var xmlHttp

function switch_buscador(str)
{
	//document.getElementById("form_search").innerHTML="<img src='img/ajax-loader.gif' border='0'>"
	if (str==1)
	{
	document.getElementById("boton1").className="activo";
	document.getElementById("boton2").className="";
	//document.getElementById("boton3").className="";
	}
	if (str==2)
	{
	document.getElementById("boton1").className="";
	document.getElementById("boton2").className="activo";
	//document.getElementById("boton3").className="";
	}
	//if (str==3)
	//{
	//document.getElementById("boton1").className="";
	//document.getElementById("boton2").className="";
	//document.getElementById("boton3").className="activo";
	//}
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Tu explorador no soporta HTTP Request")
		return
	}
	var url="/viajes/buscador.php"
	url=url+"?&tipo="+str
	//Si es el buscador de paquetes
	if (str==1)
	{
		xmlHttp.onreadystatechange=stateChanged2
	}
	//Si es el buscador de aereos
	if (str==2)
	{
		xmlHttp.onreadystatechange=stateChanged3
	}
	//Si es el buscador de hoteles
	//if (str==3)
	//{
	//	xmlHttp.onreadystatechange=stateChanged
	//}
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

//function stateChanged() 
//{ 
//	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
//	{ 
//		document.getElementById("form_search").innerHTML=xmlHttp.responseText;
//	} 
//}
function stateChanged2() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("form_search").innerHTML=xmlHttp.responseText;
		cargar_pais(document.getElementById("prt").value);
	} 
}
function stateChanged3() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById("form_search").innerHTML=xmlHttp.responseText;
		var obj = actb(document.getElementById('ae_ori_des_t'),destinos_nombre);
		var obj = actb(document.getElementById('ae_des_des_t'),destinos_nombre);
	} 
}
function GetXmlHttpObject()
{	
	var xmlHttp=null;
	try
	{
 		// Firefox, Opera 8.0+, Safari, IE7
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		 //Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}