//AJAX BEGIN

var ajax_url

var xmlHttp

function MakeXmlHttpObject(){
	var xmlHttp=null;
	try{
		// XmlHttpRequest para Firefox,Opera, Safari e derivados.
		xmlHttp = new XMLHttpRequest();
	}
	catch (e){
		// XmlHttpRequest para Internet Explorer.
		try{
			// Internet Explorer 6.0+
			xmlHttp = new
			ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			// Internet Explorer.
			xmlHttp = new
			ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}



function stateChanged() {
	if (xmlHttp.readyState==4){
		document.getElementById("sug").innerHTML=xmlHttp.responseText;
		document.getElementById("urlx").value=xmlHttp.responseText;
		/*ajax_url=xmlHttp.responseText;*/
		//alert (document.getElementById("urlx").value);
	}
}

function showHint(){
	xmlHttp=MakeXmlHttpObject()
	if (xmlHttp==null){
		alert ("O browser não suporta AJAX!");
		return;
	}
	var pedido="pedidos.php";
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",pedido,true);
	xmlHttp.send(null);
}
//AJAX END


