
	var xmlHttp

	function getnewId(loc,cityid,divid)
	{ 
	//alert(cityid);
		document.form1.chk_ajax.value=0;
		document.getElementById("station_alert").value =1; 
		if(cityid=='None')
		{	
			
		 alert("Please Select a Pick Up City");
		}
		else
		{	
			 // document.getElementById("station_alert").value=0;
		    var url="step1_loc_chk.php?loc_val="+loc+"&city="+cityid;	
		    if(loc!='railstation')
		   	{	
		   		document.getElementById("station_alert").value =1; 
		   		//document.getElementById("station_alert").value =1; 
		   	document.getElementById("stname").style.display ='none'; 
		   	document.getElementById("table2").innerHTML ='';
		    }
		    else
		    {
		    	
		    	 document.getElementById("station_alert").value =0; 
		    		document.getElementById("stname").style.display ='block'; 
		    }
		   
		 document.getElementById(divid).innerHTML='<img src="../images/loading.gif" border="0">';
			xmlHttp=GetXmlHttpObject(stateChanged)
			xmlHttp.open("GET", url , true)
			xmlHttp.send(null)
		}
		
	} 
	
	function getcity(cityid)
	{  
		
		myOption = -1;
		var loation="";
		for (i=document.form1.group.length-1; i > -1; i--) 
		{
		if (document.form1.group[i].checked) 
		{
		var val=document.form1.group[i].value;
		myOption = i; i = -1;
		//alert(val);
		if(val=='1')
    	{
    		loation="interairport";
    	}
    	else if(val=='2')
    	{
    		loation="domesairport";
    		
  	 	}
    	else if((val=='3'))
    	{
    		loation="railstation"
    	}
		
		}}
		//alert(loation+' sheme');
		///var url="step1_city_chk.php?loc_val="+loation+"&city="+cityid;
		///xmlHttp=GetXmlHttpObject(stateChanged)
		//xmlHttp.open("GET", url , true)
		//xmlHttp.send(null)
		document.getElementById("table2").innerHTML ='';
		return loation;
	} 
	
	function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			var result=xmlHttp.responseText;
			document.getElementById('int_1').innerHTML="";
			document.getElementById('dom_1').innerHTML="";
			document.getElementById('rail_1').innerHTML="";
			if(result=="This city does not have International Airport." || result=="This city does not have Domestic Airport." || result=="This city does not have Railway Station.")
			{
			alert(result);
		 document.form1.group[3].checked=true;
			}	
			else
			{
				document.getElementById("table").innerHTML =result;
				document.form1.chk_ajax.value=1;
			
			}
		} 
	} 
	
	function viewStat(statId)
	 {
		document.getElementById("table").innerHTML ='';
		document.getElementById("table2").innerHTML ='<b>('+statId+')</b>';
		document.form1.rs.value=statId;
		}		


	function GetXmlHttpObject(handler)
	{ 
		var objXmlHttp=null
	
		if (navigator.userAgent.indexOf("Opera")>=0)
		{
			alert("This example doesn't work in Opera") 
			return 
		}
		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
			}
	} 
