// JavaScript Document
var xmlHttp // xmlHttp variable



function GetXmlHttpObject(){ // This function we will use to call our xmlhttpobject.

var objXMLHttp=null // Sets objXMLHttp to null as default.

if (window.XMLHttpRequest){ // If we are using Netscape or any other browser than IE lets use xmlhttp.

objXMLHttp=new XMLHttpRequest() // Creates a xmlhttp request.

}else if (window.ActiveXObject){ // ElseIf we are using IE lets use Active X.

objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") // Creates a new Active X Object.

} // End ElseIf.

return objXMLHttp // Returns the xhttp object.

} // Close Function



function show_state(countryid)

{ // This function we will use to check to see if a username is taken or not.


	xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.

	if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.

	alert ("Browser does not support HTTP Request") // Alert Them!

	return // Returns.

	} // End If.

	

	var url="list_state.php?country="+countryid ;// Url that we will use to check the username.

	xmlHttp.open("GET",url,true) // Opens the URL using GET

	xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.

	if(xmlHttp.readyState==1)
	{
		document.getElementById('stateidabh').innerHTML = "<img src=\"images/3-0.gif\" border=0>";
	}

	if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.

	document.getElementById('stateidabh').innerHTML = xmlHttp.responseText;

	} // End If.

	}; // Close Function

	xmlHttp.send(null); // Sends NULL instead of sending data.



} // Close Function.
function set_city_blank()
{
 var str="<select name=\"province\" id='stateSelect' onchange='show_city(this.value)' class=\"newselect\" style=\"width:98%\"><option value=\"\">-----ALL-----</option></select>";
 	document.getElementById('cityidabh').innerHTML = str;
}
function show_city(provinceid)

{ // This function we will use to check to see if a username is taken or not.


	xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.

	if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.

	alert ("Browser does not support HTTP Request") // Alert Them!

	return // Returns.

	} // End If.

	

	var url="list_city.php?province="+provinceid ;// Url that we will use to check the username.

	xmlHttp.open("GET",url,true) // Opens the URL using GET

	xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.
	if(xmlHttp.readyState==1)
	{
		document.getElementById('cityidabh').innerHTML = "<img src=\"images/3-0.gif\" border=0>";
	}
	if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.

	document.getElementById('cityidabh').innerHTML = xmlHttp.responseText;

	} // End If.

	}; // Close Function

	xmlHttp.send(null); // Sends NULL instead of sending data.



} // Close Function.





function show_category2(category)

{ // This function we will use to check to see if a username is taken or not.


	xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.

	if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.

	alert ("Browser does not support HTTP Request") // Alert Them!

	return // Returns.

	} // End If.

	

	var url="list_category2.php?category="+category ;// Url that we will use to check the username.

	xmlHttp.open("GET",url,true) // Opens the URL using GET

	xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.

	if(xmlHttp.readyState==1)
	{
		document.getElementById('category2id').innerHTML = "<img src=\"images/3-0.gif\" border=0>";
	}

	if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.

	document.getElementById('category2id').innerHTML = xmlHttp.responseText;

	} // End If.

	}; // Close Function

	xmlHttp.send(null); // Sends NULL instead of sending data.



} // Close Function.


function show_category3(category2)

{ // This function we will use to check to see if a username is taken or not.


	xmlHttp=GetXmlHttpObject() // Creates a new Xmlhttp object.

	if (xmlHttp==null){ // If it cannot create a new Xmlhttp object.

	alert ("Browser does not support HTTP Request") // Alert Them!

	return // Returns.

	} // End If.

	

	var url="list_category3.php?category2="+category2 ;// Url that we will use to check the username.

	xmlHttp.open("GET",url,true) // Opens the URL using GET

	xmlHttp.onreadystatechange = function () { // This is the most important piece of the puzzle, if onreadystatechange is equal to 4 than that means the request is done.

	if(xmlHttp.readyState==1)
	{
		document.getElementById('category3id').innerHTML = "<img src=\"images/3-0.gif\" border=0>";
	}

	if (xmlHttp.readyState == 4) { // If the onreadystatechange is equal to 4 lets show the response text.

	document.getElementById('category3id').innerHTML = xmlHttp.responseText;

	} // End If.

	}; // Close Function

	xmlHttp.send(null); // Sends NULL instead of sending data.



} // Close Function.
function set_category3_blank()
{
 var str="<select name=\"category3\" id='category3'  style=\"width:98%\" class=\"newselect\"><option value=\"\">-----ALL-----</option></select>";
 	document.getElementById('category3id').innerHTML = str;
}