
var xmlHttp


function exe_ajax(url, strHint)
{ 		
	var valor;
	valor=0;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
		alert ("Your browser does not support AJAX!");
		return;
	  } 

    xmlHttp.onreadystatechange=function()
	 {valor=1;  
	    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		   {	
			   if (xmlHttp.responseText!=1)
    		   	  document.getElementById(strHint).innerHTML=xmlHttp.responseText;
			   if (xmlHttp.responseText==1)	
				  location.href='done.php'; 				
		   }
     };

	url=url+"&sid="+Math.random();
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	return valor;
}

function exe_ajax1(url, strHint)
{ 		
	var valor;
	valor=0;
	xmlHttp1=GetXmlHttpObject();
	if (xmlHttp1==null)
	  {
		alert ("Your browser does not support AJAX!");
		return;
	  } 

    xmlHttp1.onreadystatechange=function()
	 {valor=1;  
	    if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
		   {	
			   if (xmlHttp1.responseText!=1)
    		   	  document.getElementById(strHint).innerHTML=xmlHttp1.responseText;
			   if (xmlHttp1.responseText==1)	
				  location.href='done.php'; 				
		   }
     };

	url=url+"&sid="+Math.random();
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
	
	return valor;
}
function showCitySelect(country,city)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getcities.php";
	url=url+"?q="+country+"&r="+city;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
/*
function stateChanged(kk) 
{ 
	if (xmlHttp.readyState==4)	
	{ 	
		if (xmlHttp.responseText!=1)
			document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		if (xmlHttp.responseText==1)	
			location.href='done.php';
	}
}

*/
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;
}
