// JavaScript Document

var xmlHttp

function getMeProvinces(id)
{ 
	//alert(id);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="pro_shop/getProvincesfromDB.php"
	url=url+"?param="+id
	url=url+"&sid="+Math.random()
	xmlHttp.open("GET",url,true)
	xmlHttp.onreadystatechange=stateChanged
	
	xmlHttp.send(null)
}

function getMeBillingProvinces(id)
{ 
	//alert(id);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="pro_shop/getBillingProvincesfromDB.php"
	url=url+"?param="+id
	url=url+"&sid="+Math.random()
	xmlHttp.open("GET",url,true)
	xmlHttp.onreadystatechange=stateChanged2
	
	xmlHttp.send(null)
}


function getMeDeliveryProvinces(id,id2)
{ 
	//alert(id2);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="pro_shop/getDeliveryProvincesfromDB.php"
	url=url+"?param="+id+"&param2="+id2
	url=url+"&sid="+Math.random()
	xmlHttp.open("GET",url,true)
	xmlHttp.onreadystatechange=stateChanged1
	
	xmlHttp.send(null)
}


function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("cmbCustState").style.display="none";
document.getElementById("divForProvinces1").innerHTML=xmlHttp.responseText 

} 
} 

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
	document.getElementById("state").style.display="none";
	document.getElementById("spanForBillingProvinces").innerHTML=xmlHttp.responseText 
} 
} 


function stateChanged1() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("bstate").style.display="none";
			document.getElementById("spanForDeliveryProvinces").innerHTML=xmlHttp.responseText 
		} 
} 

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

