function do_onload()
{
	
	
			if( document.getElementById('category_id').value != "" )
			{
				
				document.getElementById('category_id').onchange();
			}
	/*try
	{
		if(document.getElementById('category_id'))
		{
			alert('DFF');
			if( document.getElementById('category_id').value != "" )
			{
				
				document.getElementById('category_id').onchange();
			}
		}
	}
	catch(e)
	{
	}
	try
	{
		if(document.getElementById('state_id'))
		{
			if( document.getElementById('state_id').value != "" )
			{
				document.getElementById('state_id').onchange();
			}
		}
	}
	catch(e)
	{
	}
	
	 try
	{
		if(document.getElementById('city_id'))
		{
			if( document.getElementById('city_id').value != "" )
			{
				document.getElementById('city_id').onchange();
			}
		}
	}
	catch(e)
	{
	}
	*/
}




function showSubcategory(category_id,path)
{ 
	if ( category_id != "" )
	{
	    var xmlHttp
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		var url=path
	
		url=url+"?category_id="+category_id
	    url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange=function () {
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById("this_id_0").style.display="block";
				document.getElementById("this_id_1").innerHTML=xmlHttp.responseText
			}
		};
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	if ( category_id == "" )
	{
		document.getElementById("this_id_0").style.display="none";
	}
}




function showCity(state_id,path)
{
	if ( state_id != "" )
	{
		if ( state_id != "other_state" )
		{
			if ( document.getElementById("this_id_2").style.display == "block" && document.getElementById("this_id_5").style.display == "block" )
			{
				document.add_business.other_state.value="";
				document.getElementById("this_id_2").style.display = "none";
				document.getElementById("this_id_3").style.display = "block";
				document.add_business.other_city.value="";
				document.getElementById("this_id_5").style.display = "none";
			}
			var xmlHttp
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
			var url=path
			url=url+"?state_id="+state_id
			url=url+"&city_id="+city_id
			url=url+"&sid="+Math.random()
			xmlHttp.onreadystatechange=function () {
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{ 	
					document.getElementById("this_id_3").style.display = "block";
					document.getElementById("this_id_4").innerHTML=xmlHttp.responseText
				} 
			};
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
		}
		if ( state_id == "other_state" )
		{
			if ( document.getElementById("this_id_2").style.display == "none" && document.getElementById("this_id_5").style.display == "none" )
			{
				document.getElementById("this_id_2").style.display = "block";
				document.getElementById("this_id_3").style.display = "none";
				document.getElementById("this_id_5").style.display = "block";
			}
		}
	}
	if ( state_id == "" )
	{
		document.getElementById("this_id_2").style.display = "none";
		document.getElementById("this_id_3").style.display = "none";
		document.getElementById("this_id_5").style.display = "none";
	}
}


//
function showLocation(city_id,path)
{ 
	if ( city_id != "" )
	{
		var xmlHttp
		xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		} 
		var url=path
		url=url+"?city_id="+city_id
		url=url+"&location_id="+location_id
		
		url=url+"&sid="+Math.random()
		//alert(url);
		
		xmlHttp.onreadystatechange=function () {
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById("this_id_7").style.display="block";
				document.getElementById("this_id_8").innerHTML=xmlHttp.responseText
			}
		};
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
	if ( city_id == "" )
	{
		document.getElementById("this_id_7").style.display="none";
	}
}











function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}


