var site_url ='http://localhost/portal/';
//var site_url ='/';
var xmlHttp;
var id;
//************* Xml object creation for ajax**********	
			function GetXmlHttpObject(handler)
{
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		}
		try
		{
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler
			return objXmlHttp
		}
		catch(e)
		{
			alert("Error. Scripting for ActiveX might be disabled")
			return
		}
	}
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
} 
				
function showDialect3(str,id2){
			idcata = id2;
			
			var url=site_url+"common/cat_list.aspx?cat=" + str;	
			
			xmlHttp=GetXmlHttpObject(stateChanged3);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChanged3(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function Cat_noMan(str,id2){
			idcata = id2;
			var url=site_url+"common/cat_list_noMan.aspx?cat=" + str;
			xmlHttp=GetXmlHttpObject(Cat_noMan_Text);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function Cat_noMan_Text(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function showDialect4(str,id2){
			idCity = id2;
			var url=site_url+"common/city_list.aspx?getState=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged4);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChanged4(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idCity).innerHTML=xmlHttp.responseText;
			}
	} 
	
	function Quick_Search(str,id2){
			idCity = id2;
			var url=site_url+"common/city_list_noMan.aspx?getState=" + str;
			xmlHttp=GetXmlHttpObject(Quick_SearchText);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function Quick_SearchText(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
			}
	} 
	

//Ajax for getting state list
function showDialect(str){
//alert(str);
	idstate = "txtResult";
	var url=site_url+"common/state_list.aspx?country=" + str;
	xmlHttp=GetXmlHttpObject(stateChanged);
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
	document.getElementById("txtResult1").innerHTML = "<input type=\"text\" class=\"textboxCls\" name=\"City\"> <span color=red class=\"Bold11Orange\">&nbsp;*</span>";	
}
//Ajax for getting city list
function showDialect1(str){
idCity = "txtResult1";
var url=site_url+"common/city_list.aspx?getState=" + str;
/*alert(url);*/
xmlHttp=GetXmlHttpObject(stateChanged1);
xmlHttp.open("GET", url , true);
xmlHttp.send(null);

}
function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
}
} 


	function showDialect2(str){
			idcata = "Cat1";
			var url=site_url+"common/cat_list.aspx?cat=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged2);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChanged2(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(idstate).innerHTML=xmlHttp.responseText ;


}
} 

function showState(str,SelectedState){
					idstate = "txtResult";
					if(isNaN(SelectedState)){
					//document.forms[0].State.value=SelectedState;
					return;
					}
					var url=site_url+"common/state_list_noMan.aspx?country=" + str+"&Selected="+SelectedState;
					xmlHttp=GetXmlHttpObject(showStateVal);
					xmlHttp.open("GET", url , true);
					xmlHttp.send(null);
//					document.getElementById("txtResult1").innerHTML = "<input type=\"text\" name=\"City\">";
					//show();

			}
		function showStateVal(){ 
					if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
								document.getElementById(idstate).innerHTML=xmlHttp.responseText ;

								
					}
			} 
		
		function showCity(str,SelectedCity){
					idCity = "txtResult1";
					if(isNaN(SelectedCity)){
					document.forms[0].City.value=SelectedCity;
					return;
					}
					var url=site_url+"common/city_list_noMan.aspx?getState="+ str+"&Selected="+SelectedCity;
					xmlHttp1=GetXmlHttpObject(showCityVal);
					xmlHttp1.open("GET", url , true);
					xmlHttp1.send(null);
			}	
		function showCityVal(){ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete"){
								document.getElementById(idCity).innerHTML=xmlHttp1.responseText ;

								
					}
			}
				
		function showState_Mandatory(str,SelectedState){
					idstate = "txtResult";
					if(isNaN(SelectedState)){
					document.forms[0].State.value=SelectedState;
					return;
					}
					var url=site_url+"common/state_list.aspx?country=" + str+"&Selected="+SelectedState;
					xmlHttps=GetXmlHttpObject(showStateVal_Mandatory);
					xmlHttps.open("GET", url , true);
					xmlHttps.send(null);
					document.getElementById("txtResult1").innerHTML = "<input type=\"text\" name=\"City\">";
			}
		function showStateVal_Mandatory(){ 
					if (xmlHttps.readyState==4 || xmlHttps.readyState=="complete"){ 
								document.getElementById(idstate).innerHTML=xmlHttps.responseText ;
								showst();
					}
			} 
		
		function showCity_Mandatory(str,SelectedCity){
					idCity = "txtResult1";
					if(isNaN(SelectedCity)){
					document.forms[0].City.value=SelectedCity;
					return;
					}
					var url=site_url+"common/city_list.aspx?getState="+ str+"&Selected="+SelectedCity;
					xmlHttp=GetXmlHttpObject(showCityVal_Mandatory);
					xmlHttp.open("GET", url , true);
					xmlHttp.send(null);
			}	
		function showCityVal_Mandatory(){ 
					if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
								document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
								//hidest();
					}
			}	
