<!--
documento = document.getElementsByTagName("div");
var capaactual, timeoutinterruptor, vacios;
capaactual = null;
timeoutinterruptor = 0;

//---- VARIABLE PARA LA FUNCION QUE COMPRUEBA SI ALGUN CAMPO DEL FORM ESTA VACIO.
vacios = false;

function mostrarCapa(cual){
if(capaactual != null){
		cortarTemporizador();
		ocultarCapa();
		}
	this.cual = cual;
	capaactual = cual;
	documento[cual].style.visibility = "visible";
}

function mostrarCartel(cual){

	this.cual = cual;
	capaactual = cual;
	documento[cual].style.visibility = "visible";
}

function ocultarCapa(){
	if(capaactual != null){
		documento[capaactual].style.visibility = "hidden";
		}
}

//--------------------------------
//funcion para cambiar el color de las celdas de la lista de proyectos realizados
//--------------------------------

function ColorCelda(Celda,Pos){
	this.Celda = Celda;
	this.Pos=Pos;
	if(Pos==1){
  	Celda.style.backgroundColor="#494949";
	}else{
  Celda.style.backgroundColor="#A30C48";
	}
}

function temporizadorCapa(){
	//window.status = "temporizador";
	wait = 1000;
	if(timeoutinterruptor == 0){
			timeout = window.setTimeout("ocultarCapa()", wait);
			timeoutinterruptor = 1;
		}else{
			cortarTemporizador();
		}
}

function cortarTemporizador(){
	//window.status = "limpiar";
		window.clearTimeout(timeout);
		timeoutinterruptor = 0;
}

//-----------------------------------------
// FUNCIONES PARA LOS FORMULARIOS


function validar(campos){
this.campos = campos;

for(i=0;i<campos.length;i++){
	if(document.form1[campos[i]].value != ""){	
		vacios = false;
		}else{
		vacios = true;
		break;
		}
	}

if(vacios){
	alert("debe rellenar todos los campos");
	}else{
	document.form1.submit();
	}
}

//FUNCION PARA LIMPIAR EL FORMULARIO AL CARGAR LA PAGINA, YA QUE ACCES ALMACENA LOS "." COMO "," Y ESO DA ERROR AL TRABAJARLO CON ASP
function limpiarFormularioEntrada(){
	elementosformulario = document.form1.elements.length;
	botones = 2;
	formulario = document.form1;
	//RECORREMOS CADA CAMPO DEL FORMULARIO, COMPROBAMOS LETRA A LETRA SI HAY ALGUN CARACTER EXTRAÑO, Y SI LO HAY LO CAMBIAMOS
	for(i=0; i<elementosformulario-botones; i++){
		text = formulario.elements[i].value;
		textlong = formulario.elements[i].value.length;
		formulario.elements[i].value = "";
		for(z=0; z<textlong; z++){
			if(text.substring(z,z+1) != ","){
				formulario.elements[i].value = formulario.elements[i].value + text.substring(z,z+1);
			}else{
				formulario.elements[i].value = formulario.elements[i].value + ".";
			}
		}
	}
}
//---------------------- -  - - - - -  - - - - 

//LIMPIAMOS EL FORMULARIO DE CARACTERES NO PERMITIDOS PARA QUE NO DE ERROR AL INSERTARLOS EN LA BBDD CON ASP
function limpiarFormularioSalida(){
	elementosformulario = document.form1.elements.length;
	botones = 2;
	formulario = document.form1;
	//RECORREMOS CADA CAMPO DEL FORMULARIO, COMPROBAMOS LETRA A LETRA SI HAY ALGUN CARACTER EXTRAÑO, Y SI LO HAY LO CAMBIAMOS
	for(i=0; i<elementosformulario-botones; i++){
		text = formulario.elements[i].value;
		textlong = formulario.elements[i].value.length;
		formulario.elements[i].value = "";
		for(z=0; z<textlong; z++){
			switch(text.substring(z,z+1)){
				case ",":
					formulario.elements[i].value = formulario.elements[i].value + ".";
					break;
				case "'":
					formulario.elements[i].value = formulario.elements[i].value + "";
					break;
				case '"':
					formulario.elements[i].value = formulario.elements[i].value + "";
					break;
				default:
					formulario.elements[i].value = formulario.elements[i].value + text.substring(z,z+1);
			}
		}
	}
	formulario.submit();
}

function lanzarMensaje(cual){
this.cual = cual;
switch(cual){
	case 2:
		alert("Next, we are working in it!");
		break;
	case 3:
		alert("Après, nous travaillons dans lui");
		break;
	case 4:
		alert("Zunächst arbeiten wir in es");
		break;
	case 5:
		alert("Next, we are working in it!");
		break;
	case 6:
		alert("¡Próximamente será atendido en su propio idioma!");
		break;
	}
}

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//----------------------------------------------------------------------------
//-- FUNCION PARA MOSTRAR LA CAPA SERVICIOS DEL APARTADO FOTOS EN EL IDIOMA QUE CORRESPONDA
function obtenerIdioma(){
	//primero sacamos la url y la convertimos en string
	stringurl = window.location.toString();
	//calculamos su longitud para poder sacar el ultimo numero
	longstring = stringurl.length;
	//cortamos el ultimo carater, que nos dará un numero.
	idioma = stringurl.substring(longstring-1,longstring);
	//1=español; 2=ingles; 3=frances; 4=aleman; 5=holandes; 6=catalan.
	switch(idioma){
		case '1':
			carpeta = "es";
			arrbotones=["Habitaciones","Restaurante","Familias"];
			break;
		case '2':
			carpeta = "ing";
			arrbotones=["Rooms","Restaurant","Family"];
			break;
		case '3':
			carpeta = "fr";
			arrbotones=["Chambres","Restaurant","Familles"];
			break;
		case '4':
			carpeta = "al";
			arrbotones=["Zimmer","Restaurant","Familien"];
			break;
		case '5':
			carpeta = "hol";
			arrbotones=["Kamers","Restaurant","Gezinnen"];
			break;
		case '6':
			carpeta = "cat";
			arrbotones=["Habitacions","Restaurant","Famil.Lies"];
			break;
		default:
			alert("Error: you can´t entry here without click on fotos")
			break;
	}

document.writeln("<div id='servicios' style='position:absolute; left:354px; top:0px; width:150px; z-index:12; visibility: hidden;' onMouseOver='cortarTemporizador()' onMouseOut='temporizadorCapa()'>");
document.writeln("<table class='tmenu' width='375' border='0' cellspacing='1' cellpadding='0'>");
document.writeln("<tr>");
document.writeln("<td width='125' class='tdmenu' onMouseOver='ColorCelda(this,1)'  onMouseOut='ColorCelda(this,2)'><a class='boton' href='" + carpeta + "/habitaciones.html' target='mainFrame'>"+ arrbotones[0] +"</a></td>");
document.writeln("<td width='125' class='tdmenu' onMouseOver='ColorCelda(this,1)'  onMouseOut='ColorCelda(this,2)'><a class='boton' href='" + carpeta + "/restaurante.html' target='mainFrame'>"+ arrbotones[1] +"</a></td>");
document.writeln("<td width='125' class='tdmenu' onMouseOver='ColorCelda(this,1)'  onMouseOut='ColorCelda(this,2)'><a class='boton' href='" + carpeta + "/familias.html' target='mainFrame'>"+ arrbotones[2] +"</a></td>");
document.writeln("</tr>");
document.writeln("</table>");
document.writeln("</div>");
}

//funcion para abrir una ventana nueva;
function ventanaNueva(dir,ancho,alto){
this.dir = dir;
this.ancho = ancho;
this.alto = alto;
window.open(dir,'Plano','width=' + ancho + ',height=' + alto + ',resizable=no, scrollbars=no, toolbar=no, location=no, directories=no, menubar=no');
}
// -->
