function accion(obj)
	{
		divi=obj.options[obj.selectedIndex].value;
		$('contenteventos').childElements().each(function(nodo)
			{
				if (divi=='all') 
					{ 
						$(nodo).show(); 
					} else {
						if(divi==$(nodo).id) 
							{
								$(nodo).show();
							} else {
								$(nodo).hide();
							}
					}
			});
	}

function cambiaPagina(output,idcategoria,dominio)
	{
		//alert(dominio+"ajax.php");
		new Ajax.Updater(output, dominio+"ajax.php", {
		parameters: "file=faqs&idcategoria="+idcategoria });
	}
	
function CalculaCheckout(output,startfecha,noches,dominio)
	{
		ffecha=$(startfecha).value;
		fnoches=$(noches).value;
		new Ajax.Updater(output, dominio+"ajax.php", {
		parameters: "file=calculacheckout&fechain="+ffecha+"&noches="+fnoches});
	}
	
function tab(div,totaldiv)
{
	for(i=1; i<=totaldiv; i++)
		{
			if(i==div)
				{
					$('hotelOverview'+i).style.display="block";
					$('tab'+i).className="tabOverview"+i+"Selected";
				} else {
					$('hotelOverview'+i).style.display="none";
					$('tab'+i).className="tabOverview"+i;
				}
		}
}

function comboFilter(div)
	{
		if($(div).style.display=='block') 
			{ $(div).style.display='none'; } else { $(div).style.display='block'; }
	}

function cambiaPaginaF(output,div,dominio)
	{
		//idcategoria=$(div).select.options[$(div).select.selectedIndex].value;
		idcategoria=div.options[div.selectedIndex].value;
		new Ajax.Updater(output, dominio+"ajax.php", {
		parameters: "file=faqs&idcategoria="+idcategoria });
	}

function cambiaPaginaR(output,div,dominio)
	{
		//idcategoria=$(div).value;
		idcategoria=div.options[div.selectedIndex].value;
		new Ajax.Updater(output, dominio+"ajax.php", {
		parameters: "file=resources&idcategoria="+idcategoria });
	}

function muestraDescripcion(div,totaldiv)
{
	for(i=1; i<=totaldiv; i++)
		{
			if(i==div)
				{
					$('text_'+i).style.display="block";
				} else {
					$('text_'+i).style.display="none";
				}
		}
}

function CambiaPaginaResult(div,totaldiv)
{
	for(i=1; i<=totaldiv; i++)
		{
			if(i==div)
				{
					$('searchResult'+i).style.display="block";
					$('pagination'+i).className="ActualPages";
				} else {
					$('searchResult'+i).style.display="none";
					$('pagination'+i).className="Pages";
				}
		}
}

function cambiarPagination(divApagar,divPrender)
{
	$("top"+divApagar).style.display="none";
	$("bottom"+divApagar).style.display="none";
	$("top"+divPrender).style.display="block";
	$("bottom"+divPrender).style.display="block";
}

//Funcion que valida la password
function validarPasswd (div) {
	//alert(div.pass1.value);
	//alert(div.pass2.value);
	
	var p1 = div.pass1.value;
	var p2 = div.pass2.value;
	var espacios = true;
	var cont = 0;
	
	// Este bucle recorre la cadena para comprobar
	// que no todo son espacios
	while (espacios && (cont < p1.length)) {
		if (p1.charAt(cont) != " ") {
			espacios = false;
		}
		cont++;
	}
	if (espacios) {
		//alert ("La contraseña no puede ser todo espacios en blanco");
		alert ("The password can not be all blanks");
		return false;
	}
	if (p1.length == 0 || p2.length == 0) {
		//alert("Los campos de la password no pueden quedar vacios");
		alert("The fields of the password can not be empty");
		return false;
	}
	if (p1 != p2) {
	//alert("Las passwords deben de coincidir");
	alert("The passwords must match");
	return false;
	} else {
	//alert("Todo esta correcto");
	alert("Password Change Successful");
	return true; 
	}
 }
 
 function validarBusqueda2(div) {
 $false=true;
 	if(div.locationid.value=="") {
		alert("Error: Please select your destination");
		$false=false;
	} 
	
	//if(div.destino.value=="") {
		//alert("Error: > Please select your destination from dropdown options");
		//$false=false;
	//}
	
	if(div.start_fecha.value=="") {
		alert("Error: Please select your check in date");
		$false=false;
	}
	
	if(div.rooms.value>div.adultos.value) {
		div.adultos.value=div.rooms.value;
	}
	
	if($false!=false) {
		//if($('displaybox').style.display!='none') { $('displaybox').style.display='none'; }
		clicker();
	}
		return $false;
	}

function checkaDatos(div) {
$false=true;
	if(div.theEventName.value=="") {
		alert("Error: Event name is empty!!!");
		$false=false;
	}
	
	if(div.dia.value==0) {
		alert("Error: Not day selected!!!");
		$false=false;
	}
	
	if(div.mes.value==0) {
		alert("Error: Not month selected!!!");
		$false=false;
	}
	
	if(div.anio.value==0) {
		alert("Error: Not year selected!!!");
		$false=false;
	}
	
	if(div.theNumberOfRooms.value==0) {
		alert("Error: Not numbers of rooms selected!!!");
		$false=false;
	}
	
	if(div.theNights.value==0) {
		alert("Error: Not number of nights selected!!!");
		$false=false;
	}
	
	if(div.theCountrySelector.value==0) {
		alert("Error: Not country selected!!!");
		$false=false;
	}
	
	if(div.theDestinationState.value==0) {
		alert("Error: State/Province is empty!!!");
		$false=false;
	}
	
	if(div.theDestinationCity2.value==0) {
		alert("Error: City is empty!!!");
		$false=false;
	}
	
	if(div.theEventAddress2.value==0) {
		alert("Error: Event location is empty!!!");
		$false=false;
	}
	
	if(div.theContactName.value==0) {
		alert("Error: Contact name is empty!!!");
		$false=false;
	}
	
	if(div.theContactEmail2.value==0) {
		alert("Error: Email is empty!!!");
		$false=false;
	}
return $false;	
}

function checkaDatosBooking(div) {
$false=true;

	if(div.firstName.value=="") {
		alert("Error: Please enter your name");
		$false=false;
	}
	
	if(div.lastName.value=="" && $false) {
		alert("Error: Please enter your lastname");
		$false=false;
	}
	
	if(div.email.value=="" && $false) {
		alert("Error: Please enter your email");
		$false=false;
	}

	if(div.email2.value=="" && $false) {
		alert("Error: Please enter your email again");
		$false=false;
	}

	if (div.email.value != div.email2.value) {
		alert("The emails must match");
		$false=false;
	}
	
	if(div.adrress.value==""  && $false) {
		alert("Error: Please enter your addres");
		$false=false;
	}
	
	if(div.cityname.value==""  && $false) {
		alert("Error: Please enter your city");
		$false=false;
	}
	
	if(div.postal.value=="") {
		div.postal.value=0;
	}
	
	if(div.state.value=="") {
		div.state.value=0;
	}
	
	if(div.ccnumber.value==""  && $false) {
		alert("Error: Please check/complete your credit card details");
		$false=false;
	}
	
	if(div.ccexpiremonth.value==13 || div.ccexpireyear.value==27) {
		alert("Error: Please enter your card expiry date");
		$false=false;
	}
	
	if(div.cvv.value==""  && $false) {
		alert("Error: Please enter you cvv code");
		$false=false;
	}
		if($false) {
		//if($('displaybox').style.display!='none') { $('displaybox').style.display='none'; }
		clicker();
		}
return $false;
}