function link(direcao){
	myDir = direcao=="home"?"index":direcao;
	document.location.href = myDir;
}
//método que monta o flash a ser colocado
function montaFlash(destino, flavez, width, height, trans, scale, salign){
	var myFlash = 
		'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+flavez+'" align="middle">'+
		'<param name="allowScriptAccess" value="sameDomain" />'+
		'<param name="movie" value="'+flavez+'" />'
	;
	if (trans == "yes"){
		myFlash += '<param name="wmode" value="transparent" />';
		transMoz = 'wmode="transparent" ';
	}
	else{
		transMoz = '';
	}
	if (scale == "yes"){
		myFlash += '<param name="scale" value="noscale" />';
		scaleMoz = 'scale="noscale" ';
	}
	else{
		scaleMoz = '';
	}
	if (salign != ""){
		myFlash += '<param name="salign" value="'+salign+'" />';
		salignMoz = 'salign="'+salign+'" ';
	}
	else{
		salignMoz = '';
	}
	myFlash +=
		'<param name="quality" value="high" />'+
		'<param name="bgcolor" value="#ffffff" />'+
		'<embed src="'+flavez+'" quality="high" '+scaleMoz+' bgcolor="#ffffff" '+transMoz+' width="'+width+'" height="'+height+'" name="sombra_esq" '+salignMoz+' align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+		
		'</object>'
	;
	document.getElementById(destino).innerHTML = myFlash;
}

////////////////

function procurar(end,pub){	
	if(end!=''){ 
	var newElem = document.createElement("option");

	try{
   	 xmlhttp = new XMLHttpRequest();
	}catch(ee){
    	try{
        	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   	 	}catch(e){
        	try{
            	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	}catch(E){
            	xmlhttp = false;
       		 }
  		  }
	}


xmlhttp.open("GET", "http://www.amb.com.br/mudeumdestino/loadEnd.asp?end="+end+"&pub="+pub,true);
xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4){
		//alert(xmlhttp.ResponseText);
        texto=xmlhttp.responseText;
		 texto=texto.replace(/\+/g," ");
		 texto=unescape(texto);
		//alert(texto);
		 if (window.ActiveXObject)		{
			var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
			xmlDoc.async = false;
			xmlDoc.loadXML(texto)
		}
// code for Mozilla, etc.
		else if (document.implementation && document.implementation.createDocument)	{
		//xmlDoc= document.implementation.createDocument("","",null);
		//xmlDoc.async = false;
		//xmlDoc.load(texto)
		//alert(texto);
			var oParser = new DOMParser();
			var xmlDoc = oParser.parseFromString(texto,"text/xml");
			if (xmlDoc.documentElement.tagName=="parseerror"){
			alert("Erro");
			}
		}
		//if (xmlDoc.parseError.errorCode != 0) {
   		//	var myErr = xmlDoc.parseError;
  		//	alert("You have error " + myErr.reason);
		//}
		//else{
		//alert(xmlDoc.documentElement.tagName);
			objSub = xmlDoc.getElementsByTagName("resposta");
			//alert(objSub[0].getAttribute("id"));
			//alert(objSub[0].getAttribute("text"));
				if (objSub[0].getAttribute("id")=='1'){		
				document.getElementById("reenvio").style.display='';					
				}
				else{
					//return 'false';	
				}
		//}
    }
}
xmlhttp.send(null)
}
}
//}
