function selectTypes()
	{
		var type = document.getElementById("type");
		var local = document.getElementById("local");
		var web = document.getElementById("web");
		var categories = document.getElementById("categoriesArea");
		
		local.style.display = "none";
		web.style.display = "none";
		categories.style.display = "none";
			
		if(type.value == 0)
		{
			local.style.display = "";
			categories.style.display = "";
		}
		else if(type.value == 1)
		{
			web.style.display = "";	
			categories.style.display = "";
		}
	}
	
	function getXMLObject()
	{
		var xmlHttpReq = false;
		// Mozilla/Safari
		if (window.XMLHttpRequest) {
			xmlHttpReq = new XMLHttpRequest();
		}
		// IE
		else if (window.ActiveXObject) {
			try
			{
				xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)		
			{
				xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
			}
		}
		
		return xmlHttpReq;
	}
	
	function sendRequestToUpdate(url, updatedElementName)
	{
		var xmlHttpReq = getXMLObject();
		xmlHttpReq.open("GET", url, true);
		xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlHttpReq.onreadystatechange = function() 
		{
			if (xmlHttpReq.readyState == 4)
			{
				var cats = document.getElementById(updatedElementName);
				cats.innerHTML = xmlHttpReq.responseText;
				cats.style.display = "";
			}	
		}
		
		xmlHttpReq.send(null);    
	}
	function LoadMauxe(value,type)
	{
		sendRequestToUpdate("GetMauXe.php?id="+value+"&type="+type,"panel_one");
	}
	function loadAdvDetail(id)
	{
		if(id != "none")
			sendRequestToUpdate("AdvsDetail.php?ids="+id,"show_adv");
	}
	
	function loadPanel(id, iddiv, ida)
	{
		if(id != "none")
		  if (id == 1)
			sendRequestToUpdate("AddAdvs.php?ida=" + ida, iddiv);  
		  else if (id == 0) sendRequestToUpdate("SoftActive.php?ida=" + ida, iddiv);
	}
	
	function GetSearchResult(id_cate,id_mauxe,index)
	{
		sendRequestToUpdate("search_result.php?hangxe="+id_cate+"&mauxe="+id_mauxe+"&page=0", "panel_result");
	}
	
	function GetSearch(id_cate,id_mauxe,min,max,index)
	{
		sendRequestToUpdate("mainsearch_result.php?hangxe="+id_cate+"&mauxe="+id_mauxe+"&min="+min+"&max="+max+"&page="+index, "panel_result");
	}
	
	function GetPanel(id_panel,id)
	{
		if (id_panel==1)
			sendRequestToUpdate("thongso.php?id="+id, "panel");
		if (id_panel==2)
			sendRequestToUpdate("noithat.php?kieu=1&id="+id, "panel");
		if (id_panel==3)
			sendRequestToUpdate("noithat.php?kieu=2&id="+id, "panel");
	}
	function loadPanelSearch(Qr, subdomain, iddiv, ida)
	{
		sendRequestToUpdate("SoftActive.php?ida=" + ida+ "&Qr="+Qr+"&sub="+subdomain, iddiv);
	}
	function loadPanelSearchPage(Qr, Sub, Page, iddiv, ida)
	{
		sendRequestToUpdate("SoftActive.php?ida=" + ida+ "&Qr="+Qr + "&sub="+Sub+"&Page="+Page, iddiv);
	}
	
	function setSubmitVisible()
	{
		document.getElementById("submit").style.display = "";
	}
	
// JavaScript Document
