function GetXmlHttpObject()
{
	var xmlHttp;
	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();

function check_user(obj)
{
	var username = obj.user_id.value;
	var url	=	site_ws_path+"/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 cat_drop_down(catID,scatId)
{
	
	var url	=	site_ws_path+"/ajax_respons.php?catId="+catID+"&sbcatId="+scatId+"&ran="+Math.random();
	//alert(url);
	xmlHttp2	=	GetXmlHttpObject();	
	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)	
	xmlHttp2.onreadystatechange = function()
	{		
			if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
			{		
			  var txt	 = xmlHttp2.responseText;
			   //alert("111"+txt);
					 if(txt!="")
					 {					
					  //alert("cat_tree1");
					document.getElementById("cat_tree1").innerHTML=txt;							
					 }	
			  }
	
	}
}

function cat_drop_down2(subcatID,scatId)
{
	var url	=	site_ws_path+"/ajax_respons.php?subcatId="+subcatID+"&sbcatId="+scatId+"&ran="+Math.random();	
	//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("cat_tree2").innerHTML=txt2;							
					 }	
			  }
	
	}
}

function get_city_by_state(stateID,scatId)
{
	
	var url	=	site_ws_path+"/ajax_respons.php?statId="+stateID+"&sbcatId="+scatId+"&ran="+Math.random();;
	//alert(url);
	xmlHttp3	=	GetXmlHttpObject();
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
	xmlHttp3.onreadystatechange = function()
	{		
			if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
			{		
			  var txt	 = xmlHttp3.responseText;
			  //alert(txt);
					 if(txt!="")
					 {
					document.getElementById("city_link").innerHTML=xmlHttp3.responseText							
					 }	
			  }
	
	}
}

function get_topbanner(stateID,scatId)
{
	
	var url	=	site_ws_path+"/ajax_respons.php?statId="+stateID+"&sbcatId="+scatId+"&ran="+Math.random();;
	//alert(url);
	xmlHttp3	=	GetXmlHttpObject();
	xmlHttp3.open("GET",url,true)
	xmlHttp3.send(null)
	xmlHttp3.onreadystatechange = function()
	{		
			if (xmlHttp3.readyState==4 || xmlHttp3.readyState=="complete")
			{		
			  var txt	 = xmlHttp3.responseText;
			  //alert(txt);
					 if(txt!="")
					 {
					document.getElementById("city_link").innerHTML=xmlHttp3.responseText							
					 }	
			  }
	
	}
}

function changed_currency(curid,ref)
{
	
	var url	=	site_ws_path+"/multiple-currency.php?currId="+curid;
	//alert(url);
	xmlHttp4	=	GetXmlHttpObject();
	xmlHttp4.open("GET",url,true)
	xmlHttp4.send(null)
	xmlHttp4.onreadystatechange = function()
	{		
			if (xmlHttp4.readyState==4 || xmlHttp4.readyState=="complete")
			{		
			  var txt	 = xmlHttp4.responseText;
			  //alert(txt);
					 if(txt!="")
					 {
						 window.location=ref;
						 
					   //document.getElementById("city_link").innerHTML=xmlHttp3.responseText							
					 }	
			  }
	
	}
}

