// JavaScript Document
	
	function sm_jump(objSelect){
		if (objSelect.selectedIndex<=0) return false;
		var objOpt = objSelect.options[objSelect.selectedIndex];
		window.location.href=objOpt.value;
	}

	function deleteList(cod)
	{
		if(confirm('Your are going to delete permanetly this List!\n Are you sure?'))
		{
			window.location.href = '../../actions/deleta_lista.php?cod='+cod;
		}
	}
	
	function getCategories(divAlvo, objSelId)
	{
		var xmlHttp;
		
		var targetDiv = $(divAlvo);
		targetDiv.innerHTML='Loading...';
		
		/*
		//	GETTING SELECTED OPTIONS
		*/
		
		var selObj = document.getElementById(objSelId);
		var pos = selObj.selectedIndex;
		var optValue = selObj.options[pos].value;
		// alert(optValue);
		
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
			catch (e)
			{
				// Internet Explorer
				try
				{
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
			catch (e)
			{
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
	
		xmlHttp.onreadystatechange=function()
		{
			
			if(xmlHttp.readyState!=4)
			{
				targetDiv.innerHTML='Loading...';
			}
			if(xmlHttp.readyState==4)
			{
				targetDiv.innerHTML='';
				//if(xmlHttp.status == 200)
				//{
					targetDiv.innerHTML = xmlHttp.responseText;
				//}
			}
		}
		xmlHttp.open("GET",'/tentopten/include/getCategories.php?group=' + optValue,true);
		xmlHttp.send(null);
	}
	
	function orderItems(url, divAlvo, objSelId)
	{
		var xmlHttp;
		
		var targetDiv = $(divAlvo);
		targetDiv.empty();
		targetDiv.innerHTML = '<div class="loading"></div>';
		
		/*
		//	GETTING SELECTED OPTIONS
		*/
		
		var selObj = document.getElementById(objSelId);
		var pos = selObj.selectedIndex;
		var optValue = selObj.options[pos].value;
		// alert(optValue);
		
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
			catch (e)
			{
				// Internet Explorer
				try
				{
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
			catch (e)
			{
				try
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
	
		xmlHttp.onreadystatechange=function()
		{
			
			if(xmlHttp.readyState!=4)
			{
				targetDiv.innerHTML = '<div class="loading"></div>';
			}
			
			if(xmlHttp.readyState==4)
			{
				targetDiv.innerHTML = '';
				if(xmlHttp.status == 200)
				{
					targetDiv.innerHTML = xmlHttp.responseText;
				}
			}
		}
		xmlHttp.open("GET",url + '&orderby=' + optValue,true);
		xmlHttp.send(null);
	}

	
	// JavaScript Document
	function selectCategorias(id,objSelId){
		var xmlHttp;
			
			var targetDiv = $(id);
			targetDiv.empty();
			targetDiv.innerHTML = "Loading...";
			
			/*
			//	GETTING SELECTED OPTIONS
			*/
			
			var selObj = document.getElementById(objSelId);
			var pos = selObj.selectedIndex;
			var optValue = selObj.options[pos].value;
			
			try
			{
				// Firefox, Opera 8.0+, Safari
				xmlHttp=new XMLHttpRequest();
			}
				catch (e)
				{
					// Internet Explorer
					try
					{
						xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
					}
				catch (e)
				{
					try
					{
						xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e)
					{
						alert("Your browser does not support AJAX!");
						return false;
					}
				}
			}
		
			xmlHttp.onreadystatechange=function()
			{
				
				if(xmlHttp.readyState!=4)
				{
					targetDiv.innerHTML = "Loading...";
				}
				if(xmlHttp.readyState==4)
				{
					//targetDiv.empty();
					//if(xmlHttp.status == 200)
					//{
						targetDiv.innerHTML = xmlHttp.responseText;
					//}
				}
			}
			xmlHttp.open("GET",'../getCategories.php&cod=' + optValue,true);
			xmlHttp.send(null);
	}
