// JavaScript Document
function mailAntiSpam()
{
var usuario = "info"
var dominio = "clubrural.com"
document.write("<a href=\"mailto:" + usuario + "@" + dominio + "\">" + usuario + "@" + dominio + "</a>")
}

//Buscador home

function checkea_destino(){
	if(document.searchAlojamientos.destino.value=="all"){
		alert("Debe seleccionar un DESTINO para realizar la busqueda");
		return false;
	}else{
		return true;
	}
}

function check_destino(){
	if(document.searchAlojamientos.txtdestino.value==""){
		alert("Debe seleccionar un DESTINO para realizar la busqueda");
		return false;
	}else{
		return true;
	}
}

function checkea_busquedas(){
	if($("destino").value=="all"){
		alert("Debe seleccionar un DESTINO para realizar la busqueda");
		return false;
	}
	
	if($("fechaentrada").value!=""){
		if($("fechasalida").value==""){
			alert("Debe seleccionar fecha de salida");
			return false;
		}else{
			if (!Comparar_Fecha($("fechaentrada").value, $("fechasalida").value)){
				alert("La fecha de salida debe ser mayor que la fecha de entrada.");
				return false;
			}	
		}
	}
}

function checkea_busquedas_total(){	
	if($("fechaentrada").value!=""){
		if($("fechasalida").value==""){
			alert("Debe seleccionar fecha de salida");
			return false;
		}else{
			if (!Comparar_Fecha($("fechaentrada").value, $("fechasalida").value)){
				alert("La fecha de salida debe ser mayor que la fecha de entrada.");
				return false;
			}	
		}
	}
}

//Buscador ofertas
function checkea_busqueda(){
	
	if(document.searchOfertas.destino.value=="0"){
		alert("Debe seleccionar un DESTINO para realizar la busqueda");
		return false;
	}
}

//buscador ultima hora
function checkea_ultimas(){
	if(document.searchOfertas.destino.value=="0" && document.searchOfertas.fiestaId.value=="0" ){
		alert("Debe seleccionar un DESTINO o una FECHA para realizar la busqueda");
		return false;
	}
}

function check_google(){
	if($("txtgoogle").value==""){
		alert("Debes escribir un termino de búsqueda");
		return false;
	}
}

//buscador fechas libres
function Comparar_Fecha(Obj1,Obj2) 
{
String1 = Obj1;
String2 = Obj2;
// Si los dias y los meses llegan con un valor menor que 10 
// Se concatena un 0 a cada valor dentro del string 
if (String1.substring(1,2)=="/") {
String1="0"+String1
}
if (String1.substring(4,5)=="/"){
String1=String1.substring(0,3)+"0"+String1.substring(3,9)
}

if (String2.substring(1,2)=="/") {
String2="0"+String2
}
if (String2.substring(4,5)=="/"){
String2=String2.substring(0,3)+"0"+String2.substring(3,9)
}

dia1=String1.substring(0,2);
mes1=String1.substring(3,5);
anyo1=String1.substring(6,10);
dia2=String2.substring(0,2);
mes2=String2.substring(3,5);
anyo2=String2.substring(6,10);


if (dia1 == "08") // parseInt("08") == 10 base octogonal
dia1 = "8";
if (dia1 == '09') // parseInt("09") == 11 base octogonal
dia1 = "9";
if (mes1 == "08") // parseInt("08") == 10 base octogonal
mes1 = "8";
if (mes1 == "09") // parseInt("09") == 11 base octogonal
mes1 = "9";
if (dia2 == "08") // parseInt("08") == 10 base octogonal
dia2 = "8";
if (dia2 == '09') // parseInt("09") == 11 base octogonal
dia2 = "9";
if (mes2 == "08") // parseInt("08") == 10 base octogonal
mes2 = "8";
if (mes2 == "09") // parseInt("09") == 11 base octogonal
mes2 = "9";

dia1=parseInt(dia1);
dia2=parseInt(dia2);
mes1=parseInt(mes1);
mes2=parseInt(mes2);
anyo1=parseInt(anyo1);
anyo2=parseInt(anyo2);

if (anyo1>anyo2)
{
return false;
}

if ((anyo1==anyo2) && (mes1>mes2))
{
return false;
}
if ((anyo1==anyo2) && (mes1==mes2) && (dia1>=dia2))
{
return false;
} 

return true;
}

function checkea_fechas_libres(){
	var f = document.searchAlojamientos2;
	
	if(f.destino.value=="all"){
		alert("Debe seleccionar un DESTINO para realizar la busqueda");
		return false;
	}

	
  if(f.fechaentrada.value == '' || f.fechaentrada.value == 'dd/mm/aaaa' || f.fechasalida.value == '' || f.fechasalida.value == 'dd/mm/aaaa'){
		alert("Debe seleccionar fecha de entrada y fecha de salida"); 
		return false;  
  }else{
	if (!Comparar_Fecha(f.fechaentrada.value, f.fechasalida.value)){
		alert("La fecha de salida debe ser mayor que la fecha de entrada.");
		return false;
	}
  }
	
}

function editarfoto(){
	document.getElementById("editarfoto").style.display='block';
}

//funciones ajax

function nuevoAjax()
{ 
 var xmlhttp=false; 
 try 
 { 
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
 }
 catch(e)
 { 
  try
  { 
   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
  } 
  catch(E) { xmlhttp=false; }
 }
 if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 
 
 return xmlhttp; 
}


function carga_localidad_buscador(){
var ajax = nuevoAjax();
var indice = document.getElementById("destino").options[document.getElementById("destino").selectedIndex].value;

strPos = "id="+indice;
ajax.open("POST", "../ajax.php?func=1",true);
ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
ajax.onreadystatechange=function() {
	if (ajax.readyState==1){
		document.getElementById("celda_localidad").innerHTML="<select disabled class='selecBuscador'><option value=''>Cargando...</option></select>";
	} 
	if (ajax.readyState==4){
			document.getElementById("celda_localidad").innerHTML=ajax.responseText;
	}
}
ajax.send(strPos);
return;	
}


function cambiafotoficha(totalfotos) {
	var ver=document.getElementById('chgFoto').name;
    if (ver < totalfotos) {
    	ver++;
	}else{
		ver=1;
	}

	document.getElementById('chgFoto').name=ver;
	document.getElementById('chgFoto').src=fotocargada[ver].src;
	setTimeout("cambiafotoficha("+totalfotos+")",2000);
}

function cambiafoto(id){
	$("fotook").src = fotosrc[id];
	$("fotook").name = id;
	$("titulook").innerHTML = $(id).title;
}


function fotosig(){
	var actual = $("fotook").name;
	actual = parseInt(actual);
	var total = fotosrc.length;
	var sig = actual+1;
	if(sig == total) sig = 0;
	$("fotook").src = fotosrc[sig];
	$("fotook").name = sig;
	$("titulook").innerHTML = $(sig.toString()).title;	
}

function fotoant(){
	var actual = $("fotook").name;
	actual = parseInt(actual);
	var total = fotosrc.length;
	var sig = actual-1;
	if(actual == 0){
		sig = total-1;	
	} 
	$("fotook").src = fotosrc[sig];
	$("fotook").name = sig;
	$("titulook").innerHTML = $(sig.toString()).title;	
}



function capasrankig(capa){
	document.getElementById("capaRanking").style.display = 'none';
	document.getElementById("funciona").style.display = 'none';
	document.getElementById("ranking07").style.display = 'none';
	document.getElementById(capa).style.display = 'block';
}

function vercalendario(capa){
	
	if(capa == "calentrada"){
		document.getElementById("calsalida").style.display = "none";	
	}
	
	if(capa == "calsalida"){
		document.getElementById("calentrada").style.display = "none";
		if(document.getElementById("fechaentrada").value == "dd/mm/aaaa" || document.getElementById("fechaentrada").value == ""){
			alert("Debe seleccionar fecha de entrada");
			return;
		}else{
			$("icalsalida").src	= "/calendariophp/calendar.php?nomcampo=fechasalida&fentrada="+$("fechaentrada").value;
		}
	}
	
	if(document.getElementById(capa).style.display == "block"){
		document.getElementById(capa).style.display = "none";
		return;
	}
	
	if(document.getElementById(capa).style.display == "none" || document.getElementById(capa).style.display == ""){
		document.getElementById(capa).style.display = "block";
		return;
	}
}

function vercapa(capa){
	if(document.getElementById(capa).style.display == "block"){
		document.getElementById(capa).style.display = "none";
		return;
	}
	
	if(document.getElementById(capa).style.display == "none" || document.getElementById(capa).style.display == ""){
		document.getElementById(capa).style.display = "block";
		return;
	}
}

function enviaruta(){
   var origen = document.getElementById("dirorigen").value;
   var destino = document.getElementById("dirdestino").value
   if(origen =="" || destino ==""){
   		alert("Debe introducir origen y destino");
   }else{
   		origen = escape(origen);
		destino = escape(destino);
		var dirmapagoogle="http://maps.google.es/maps?f=d&saddr="+origen+"&daddr="+destino;
		window.location = dirmapagoogle;	
   } 
}

function selstar(puntos,idtipo,titulo) {
	marca = puntos * 25;
	selrate = "selrate"+idtipo;
	valora = "valora"+idtipo;
	txtvalora = "txtvalora"+idtipo;
	document.getElementById(selrate).style.width = marca+"px";
	document.getElementById(valora).value = puntos;
	document.getElementById(txtvalora).innerHTML = titulo;
}

function selstar2(puntos) {
	marca = puntos * 25;
	document.getElementById("selrate").style.width = marca+"px";
	document.getElementById("valora").value = puntos;
}




function cargafechasofertas(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("destino").options[document.getElementById("destino").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=2";
	strPos = "id="+indice;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdafechas").innerHTML="<select disabled><option value=''>Cargando Fechas...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdafechas").innerHTML=ajax.responseText;
		}
	}
ajax.send(strPos);
return;	
}

function cargafechasofertas2(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("destino").options[document.getElementById("destino").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=3";
	strPos = "id="+indice;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdafechas").innerHTML="<select disabled class='inputsBuscador'><option value=''>Cargando Fechas...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdafechas").innerHTML=ajax.responseText;
		}
	}
ajax.send(strPos);
return;	
}


function cargafechasultima(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("destino").options[document.getElementById("destino").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=4";
	strPos = "id="+indice;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdafechas").innerHTML="<select disabled><option value=''>Cargando Fechas...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdafechas").innerHTML=ajax.responseText;
		}
	}
ajax.send(strPos);
return;	
}
	
function cargafechasultima2(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("destino").options[document.getElementById("destino").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=5";
	strPos = "id="+indice;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdafechas").innerHTML="<select disabled class='inputsBuscador'><option value=''>Cargando Fechas...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdafechas").innerHTML=ajax.responseText;
		}
	}
ajax.send(strPos);
return;	
}

function carga_provincias(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("PPais").options[document.getElementById("PPais").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=6";
	strPos = "id="+indice+"&prefijo="+prefijo;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdaprovincias").innerHTML="<select disabled class='inputsBuscador'><option value=''>Cargando...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdaprovincias").innerHTML=ajax.responseText;
		}
	}
	document.getElementById("celdalocalidad").innerHTML='<select id="PLocalidad" name="PLocalidad" class="inputsBuscador"><option value="0">Seleccione Localidad</option></select>';
	ajax.send(strPos);
	return;	
}

function carga_localidad(prefijo){
	var ajax = nuevoAjax();
	var indice = document.getElementById("PProvincia").options[document.getElementById("PProvincia").selectedIndex].value;
	var urlajax = prefijo+"ajax.php?func=7";
	strPos = "id="+indice;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdalocalidad").innerHTML="<select disabled class='inputsBuscador'><option value=''>Cargando...</option></select>";
		} 
		if (ajax.readyState==4){
				document.getElementById("celdalocalidad").innerHTML=ajax.responseText;
		}
	}
	ajax.send(strPos);
	return;	
}

function comprueba_usu(prefijo){
	var ajax = nuevoAjax();	
	var urlajax = prefijo+"ajax.php?func=8";
	usu = document.getElementById("PEmail").value;
	strPos = "usu="+usu;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4){
				document.getElementById("usuconfirm").innerHTML=ajax.responseText;
				
		}
	}
	ajax.send(strPos);
	return;		
}

function comprueba_usuario(){
	var ajax = nuevoAjax();	
	var urlajax = "ajax.php?func=10";
	usu = document.getElementById("usuario").value;
	strPos = "usu="+usu;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4){
				document.getElementById("usuconfirm").innerHTML=ajax.responseText;
				
		}
	}
	ajax.send(strPos);
	return;		
}

function comprueba_email(){
	var ajax = nuevoAjax();	
	var urlajax = "ajax.php?func=11";
	usu = document.getElementById("email").value;
	strPos = "usu="+usu;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4){
				document.getElementById("emailconfirm").innerHTML=ajax.responseText;
				
		}
	}
	ajax.send(strPos);
	return;		
}

function cuentacar(campo,maxcar){
	var campopintar = "campo"+campo;
	var faltan = maxcar-document.getElementById(campo).value.length;
	document.getElementById(campopintar).innerHTML = "<strong>"+faltan+"</strong>";
}

function buscaactividades(id,nombre){
	var ajax = nuevoAjax();	
	strPos = "id="+id;
	ajax.open("POST","ajax.php?func=9",true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("htmlactivo").innerHTML= "<div style='font-size:20px; margin:80px 5px 5px 3px; text-align:center'>Buscando Actividades<br /><img src='img/pic/loading.gif' /></div>";
			document.getElementById("botonbuscar").innerHTML= "<input type='image' class='inputboton' src='img/botones/buscar_off.gif' name='buscaractivo' value='Buscar' disabled='disabled' />";
		}
		
		if (ajax.readyState==4){
			document.getElementById("htmlactivo").innerHTML=ajax.responseText;
			document.getElementById("iddestino").value=id;	
			document.getElementById("nombredestino").value=nombre;
			document.getElementById("capamostrar").innerHTML=nombre;
			document.getElementById("botonbuscar").innerHTML= "<input type='image' class='inputboton' src='img/botones/buscar.gif' name='buscaractivo' value='Buscar' />";
		}	
	}
	ajax.send(strPos);
	return;		
}

function rebuscaactividades(id){
	var ajax = nuevoAjax();	
	strPos = "id="+id;
	ajax.open("POST","../ajax.php?func=9",true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("htmlactivo").innerHTML= "<div style='font-size:20px; margin:5px 0px 0px 0px; text-align:center'>Buscando Actividades<br /><img src='../img/pic/loading.gif' /></div>";
		}
		
		if (ajax.readyState==4){
			document.getElementById("htmlactivo").innerHTML=ajax.responseText;
		}	
	}
	ajax.send(strPos);
	return;		
}


function cargaprovinciafromtipo(prefijo){
	var ajax = nuevoAjax();	
	var urlajax = prefijo+"ajax.php?func=12";
	var tipo = document.getElementById("tipofoto").options[document.getElementById("tipofoto").selectedIndex].value;
	if(tipo == "pueblo" || tipo=="playa" || tipo == "estacion"){
			document.getElementById("txtprovincia").innerHTML = "Selecciona provincia:";
			document.getElementById("celdalocalidad").innerHTML = "";
			document.getElementById("txtlocalidad").innerHTML = "";
			document.getElementById("txtna").innerHTML = "";
			document.getElementById("celdana").innerHTML = "";
			
			strPos = "tipo="+tipo+"&prefijo="+prefijo;
			ajax.open("POST",urlajax,true);
			ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			ajax.onreadystatechange=function() {
				if (ajax.readyState==1){
					document.getElementById("celdaprovincia").innerHTML= "<select disabled><option value=''>Cargando...</option></select>";
				}
				
				if (ajax.readyState==4){
					document.getElementById("celdaprovincia").innerHTML=ajax.responseText;
				}	
			}
			ajax.send(strPos);
			return;	
	}else{
		document.getElementById("celdaprovincia").innerHTML = "";
		document.getElementById("celdalocalidad").innerHTML = "";
		document.getElementById("celdana").innerHTML = "";
		document.getElementById("txtprovincia").innerHTML = "";
		document.getElementById("txtlocalidad").innerHTML = "";
		document.getElementById("txtna").innerHTML = "";
	}
}

function cargalocalidadfromtipo(prefijo){
	var ajax = nuevoAjax();	
	var urlajax = prefijo+"ajax.php?func=13";
	var tipo = document.getElementById("tipofoto").options[document.getElementById("tipofoto").selectedIndex].value;
	var idprovincia = document.getElementById("provincia").options[document.getElementById("provincia").selectedIndex].value;
	document.getElementById("txtlocalidad").innerHTML = "Selecciona localidad:";	
	document.getElementById("txtna").innerHTML = "";
	document.getElementById("celdana").innerHTML = "";
	
	strPos = "tipo="+tipo+"&idprov="+idprovincia+"&prefijo="+prefijo;
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdalocalidad").innerHTML= "<select disabled><option value=''>Cargando...</option></select>";
		}
		
		if (ajax.readyState==4){
			document.getElementById("celdalocalidad").innerHTML=ajax.responseText;
		}	
		
	}
	ajax.send(strPos);
	return;	
}

function carganafromtipo(prefijo){
	var ajax = nuevoAjax();	
	var urlajax = prefijo+"ajax.php?func=14";
	var tipo = document.getElementById("tipofoto").options[document.getElementById("tipofoto").selectedIndex].value;
	var idprovincia = document.getElementById("provincia").options[document.getElementById("provincia").selectedIndex].value;
	var idlocalidad = document.getElementById("localidad").options[document.getElementById("localidad").selectedIndex].value;
	
	if(tipo == "playa"){
		document.getElementById("txtna").innerHTML = "Selecciona playa:";
	}
	
	if(tipo == "estacion"){
		document.getElementById("txtna").innerHTML = "Selecciona estacion:";
	}
	
	strPos = "tipo="+tipo+"&idprov="+idprovincia+"&idloc="+idlocalidad+"&prefijo="+prefijo;
	
	ajax.open("POST",urlajax,true);
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1){
			document.getElementById("celdana").innerHTML= "<select disabled><option value=''>Cargando...</option></select>";
		}
		
		if (ajax.readyState==4){
			document.getElementById("celdana").innerHTML=ajax.responseText;
		}	
		
	}
	ajax.send(strPos);
	return;	
}



function mostrar(txt){
	document.getElementById("capamostrar").innerHTML=txt;		
}

function validaTActivo(){
	var flag=false;
	var cb=document.getElementsByTagName('input');
	for (var i=0;i<cb.length;i++)
		if (cb[i].type=='checkbox')
			if (cb[i].checked!=0){
				flag=true;
				break;
			}
	if (!flag)
		alert('Debe elegir al menos una actividad para buscar');
	return flag;
	
}

function validafiestas(){
	
	if(document.frmfiestas.prov.value == 0){
		alert("Debes seleccionar una provincia");
		return false;
	}
	
	if(document.frmfiestas.mes.value == 0){
		alert("Debes seleccionar un mes");
		return false;
	}

}

function sleep(millisegundos){
	var inicio = new Date().getTime();
	while ((new Date().getTime() - inicio) < millisegundos){
	}
}

function slidecompartir(){
	if(document.getElementById("socialmedia").style.display=="none"){
		Effect.SlideDown('socialmedia',{duration:1.0});
		
	}else{
		Effect.SlideUp('socialmedia',{duration:1.0});
	}
}

function carrouselofertas(num){
	var posactual = document.getElementById('ofertasdestacadas').style.left;
	var mover = 0;
	var activa = "ofertas"+num;
	document.getElementById('ofertas1').className = "pagina";
	document.getElementById('ofertas2').className = "pagina";
	document.getElementById('ofertas3').className = "pagina";
	document.getElementById(activa).className = "current";
	
	if(posactual == "" || posactual == "0px"){
		if(num == 2) mover = -724;
		if(num == 3) mover = -1448;
	}
	
	if(posactual == "-724px"){
		if(num == 1) mover = 724;
		if(num == 3) mover = -724;
	}
	
	if(posactual == "-1448px"){
		if(num == 1) mover = 1448;
		if(num == 2) mover = 724;
	}
	
	new Effect.Move('ofertasdestacadas', { x: mover, y: 0, mode: 'relative' });
}

function activarcarrusel(){
	var posactual = document.getElementById('ofertasdestacadas').style.left;
	var sig;
	if(posactual == "" || posactual == "0px"){
		sig = 2;
	}
	if(posactual == "-724px"){
		sig = 3
	}
	if(posactual == "-1448px"){
		sig = 1
	}
	carrouselofertas(sig);
}

function iroferta(id){
	var oferta="oferta"+id;
	var ref = document.getElementById(oferta).href;
	window.location.href = ref;
}

function iraloj(id){
	var aloja="aloj"+id;
	var ref = $(aloja).href;
	window.location.href = ref;
}

function buscafechas(){
	if($("formfechas").style.display=="none"){
		$("buscafechas").className = "iconmenos";
		Effect.BlindDown('formfechas',{duration:1.0});	
	}else{
		$("buscafechas").className = "iconmas";
		Effect.BlindUp('formfechas',{duration:1.0});
	}
}

function buscaserv(){
	if($("servicios").style.display=="none"){
		$("buscaserv").className = "iconmenos";
		Effect.BlindDown('servicios',{duration:1.0});	
	}else{
		$("buscaserv").className = "iconmas";
		Effect.BlindUp('servicios',{duration:1.0});
	}
}

function limpiafechas(){
	$("fechaentrada").value="";
	$("fechasalida").value="";
}












