/*Funcion para la secuencia de imagenes  del index*/
var t = self.setInterval("secuencia()",5000)
var cont = 0;
function secuencia(){
	if(cont==0){
		$("#hostal1").fadeOut("slow",function(){
			$("#hostal2").fadeIn("slow");
		});
		cont=1;
	}
	else if(cont==1){
		$("#hostal2").fadeOut("slow",function(){
			$("#hostal3").fadeIn("slow");
		});
		cont=2;
	}
	else if(cont==2){
		$("#hostal3").fadeOut("slow",function(){
			$("#hostal4").fadeIn("slow");
		});
		cont=3;
	}
	else if(cont==3){
		$("#hostal4").fadeOut("slow",function(){
			$("#hostal1").fadeIn("slow");
		});
		cont=0;
	}
}

/*Funcion para la secuencia de imagenes  de servicios*/
var t1 = self.setInterval("secuenciaServicios()",5000)
var cont1 = 0;
function secuenciaServicios(){
	if(cont1==0){
		$("#servicios1").fadeOut("slow",function(){
			$("#servicios2").fadeIn("slow");
		});
		cont1=1;
	}
	else if(cont1==1){
		$("#servicios2").fadeOut("slow",function(){
			$("#servicios3").fadeIn("slow");
		});
		cont1=2;
	}
	else if(cont1==2){
		$("#servicios3").fadeOut("slow",function(){
			$("#servicios4").fadeIn("slow");
		});
		cont1=3;
	}
	else if(cont1==3){
		$("#servicios4").fadeOut("slow",function(){
			$("#servicios1").fadeIn("slow");
		});
		cont1=0;
	}
}

/*Funcion para la secuencia de imagenes  de localización*/
var t2 = self.setInterval("secuenciaLocalizacion()",5000)
var cont2 = 0;
function secuenciaLocalizacion(){
	if(cont2==0){
		$("#localizacion1").fadeOut("slow",function(){
			$("#localizacion2").fadeIn("slow");
		});
		cont2=1;
	}
	else if(cont2==1){
		$("#localizacion2").fadeOut("slow",function(){
			$("#localizacion3").fadeIn("slow");
		});
		cont2=2;
	}
	else if(cont2==2){
		$("#localizacion3").fadeOut("slow",function(){
			$("#localizacion4").fadeIn("slow");
		});
		cont2=3;
	}
	else if(cont2==3){
		$("#localizacion4").fadeOut("slow",function(){
			$("#localizacion5").fadeIn("slow");
		});
		cont2=4;
	}
	else if(cont2==4){
	$("#localizacion5").fadeOut("slow",function(){
		$("#localizacion1").fadeIn("slow");
	});
	cont2=0;
	}
}

/*Funcion para la secuencia de imagenes de las habitaciones*/
var t3 = self.setInterval("secuenciaHabitaciones()",5000)
var cont3 = 0;
function secuenciaHabitaciones(){
	if(cont3==0){
		$("#hab1").fadeOut("slow",function(){
			$("#hab2").fadeIn("slow");
		});
		cont3=1;
	}
	else if(cont3==1){
		$("#hab2").fadeOut("slow",function(){
			$("#hab3").fadeIn("slow");
		});
		cont3=2;
	}
	else if(cont3==2){
		$("#hab3").fadeOut("slow",function(){
			$("#hab4").fadeIn("slow");
		});
		cont3=3;
	}
	else if(cont3==3){
		$("#hab4").fadeOut("slow",function(){
			$("#hab5").fadeIn("slow");
		});
		cont3=4;
	}
	else if(cont3==4){
	$("#hab5").fadeOut("slow",function(){
		$("#hab6").fadeIn("slow");
	});
	cont3=5;
	}
	else if(cont3==5){
	$("#hab6").fadeOut("slow",function(){
		$("#hab7").fadeIn("slow");
	});
	cont3=6;
	}
	else if(cont3==6){
	$("#hab7").fadeOut("slow",function(){
		$("#hab1").fadeIn("slow");
	});
	cont3=0;
	}
}

function comprobar() {
//Validación del nombre
	var nombre = document.getElementById("nombre1").value;
	if( nombre == null || nombre.length == 0 || /^\s+$/.test(nombre) ) 
	{
	alert("El campo Nombre es obligatorio.");
	document.getElementById("nombre1").focus();
	return false;
	}
//Validación del correo
	var correo = document.getElementById("correo").value;
	if( !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(correo)) ) 
	{
	alert("El campo Correo es obligatorio y debe contener un correo valido.");
	document.getElementById("correo").focus();
	return false;
	}
//Validación del mensaje
	var mensaje = document.getElementById("mensaje1").value;
	if( mensaje == null || mensaje.length == 0 || /^\s+$/.test(mensaje) ) 
	{
	alert("El campo Mensaje es obligatorio.");
	document.getElementById("mensaje1").focus();
	return false;
	}
//Validación de las Políticas
	var politicas = document.getElementById("politicas1");
	if(!politicas.checked){
	alert("Debe aceptar las Politicas de Privacidad");
	return false;
	}
	return true;	
}














