function GetXmlHttpObject()
{
	var xmlHttp=null;
	try{
		/************** Firefox, Opera 8.0+, Safari ************* */
		xmlHttp=new XMLHttpRequest();
	}catch(e){
		/* ************* Internet Explorer************* */
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
xmlHttp		=	 GetXmlHttpObject();
xmlHttp2		= GetXmlHttpObject();

function check_user(){	
	var username = document.buyerreg.user_id.value;
	var url	=	"ajax_respons.php?c="+username;	
	xmlHttp	=	GetXmlHttpObject();
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)	
	xmlHttp.onreadystatechange = function(){	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){		
	    var txt	 = xmlHttp.responseText;
		 //alert(txt);
		 if(txt!=""){
		document.getElementById("txtHint1").innerHTML=xmlHttp.responseText 
				
		    }				 
		 
		}
	}
	
}

function getmodel_sizes(modID,proid)
{
	var url	=	site_ws_path+"/ajax_respons.php?mod="+modID+"&prodId="+proid;	
	//alert(url);
	xmlHttp22	=	GetXmlHttpObject();
	xmlHttp22.open("GET",url,true)
	xmlHttp22.send(null)
	xmlHttp22.onreadystatechange = function()
	{		
			if (xmlHttp22.readyState==4 || xmlHttp22.readyState=="complete")
			{		
			  var txt2	 = xmlHttp22.responseText;
			     //alert(txt2);
					 if(txt2!="")
					 {
						// alert("cat_tree2");
					 document.getElementById("mod_size").innerHTML=txt2;							
					 }	
			  }
	
	}
}

function get_sizes_price(szid,proid)
{
	var url	=	site_ws_path+"/ajax_respons.php?szd="+szid+"&prodId="+proid;	
	//alert(url);
	xmlHttp22	=	GetXmlHttpObject();
	xmlHttp22.open("GET",url,true)
	xmlHttp22.send(null)
	xmlHttp22.onreadystatechange = function()
	{		
			if (xmlHttp22.readyState==4 || xmlHttp22.readyState=="complete")
			{		
			  var txt2	 = xmlHttp22.responseText;
			   // alert(txt2);
					 if(txt2!="")
					 {
						// alert("cat_tree2");
					 document.getElementById("change_price").innerHTML=txt2;							
					 }	
			  }
	
	}
}



function bill_set_state(steId,selid)
{
	var url	=	site_ws_path+"/ajax_respons.php?billstId="+steId+"&bsel="+selid;	
	//alert(url);	
	xmlHttp22	=	GetXmlHttpObject();
	xmlHttp22.open("GET",url,true)
	xmlHttp22.send(null)
	xmlHttp22.onreadystatechange = function()
	{		
			if (xmlHttp22.readyState==4 || xmlHttp22.readyState=="complete")
			{		
			  var txt2	 = xmlHttp22.responseText;
			     //alert(txt2);
					 if(txt2!="")
					 {
						// alert("cat_tree2");
						 bill_set_city("","");						 
					    document.getElementById("us_st").innerHTML=txt2;							
					 }	
			  }
	
	}
}

function ship_set_state(steId,selid)
{
	var url	=	site_ws_path+"/ajax_respons.php?shipstId="+steId+"&spsel="+selid;	
	//alert(url);	
	xmlHttp_ship	=	GetXmlHttpObject();
	xmlHttp_ship.open("GET",url,true)
	xmlHttp_ship.send(null)
	xmlHttp_ship.onreadystatechange = function()
	{		
			if (xmlHttp_ship.readyState==4 || xmlHttp_ship.readyState=="complete")
			{		
			  var shipinfo	 = xmlHttp_ship.responseText;
			   //alert(shipinfo);
					 if(shipinfo!="")
					 {		
					   ship_set_city("","");					
					   document.getElementById("ship_us_st").innerHTML=shipinfo;	
					  }	
			  }
	
	}
}






function bill_set_city(steId,selid)
{
	
	var url	=	site_ws_path+"/ajax_respons.php?billctId="+steId+"&bsel="+selid;	
	//alert(url);
	xmlHttp22	=	GetXmlHttpObject();
	xmlHttp22.open("GET",url,true)
	xmlHttp22.send(null)
	xmlHttp22.onreadystatechange = function()
	{		
			if (xmlHttp22.readyState==4 || xmlHttp22.readyState=="complete")
			{		
			  var txt2	 = xmlHttp22.responseText;
			    // alert(txt2);
					 if(txt2!="")
					 {
						// alert("cat_tree2");
					 
					 document.getElementById("us_ct").innerHTML=txt2;							
					 }	
			  }
	
	}
}

function ship_set_city(steId,selid)
{
	var url	=	site_ws_path+"/ajax_respons.php?shipctId="+steId+"&spsel="+selid;	
	//alert(url);
	xmlHttp_ship	=	GetXmlHttpObject();
	xmlHttp_ship.open("GET",url,true)
	xmlHttp_ship.send(null)
	xmlHttp_ship.onreadystatechange = function()
	{		
			if (xmlHttp_ship.readyState==4 || xmlHttp_ship.readyState=="complete")
			{		
			  var shipinfo	 = xmlHttp_ship.responseText;
			      //alert(shipinfo);
					 if(shipinfo!="")
					 {	
					 
					   document.getElementById("us_ct_ship").innerHTML=shipinfo;	
					  }	
			  }
	
	}
}
