<!--
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="#929191";
	}else{
  Celda.style.backgroundColor="#ffffff";
	}
}

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(cual,campos){
this.cual = cual
this.campos = campos;
if(cual == 1){
	for(i=0;i<campos.length;i++){
		if(document.form1[campos[i]].value != ""){	
			vacios = false;
			}else{
				vacios = true;
				break;
				}	
		}
	}else{
	for(i=0;i<campos.length;i++){
		if(document.form2[campos[i]].value != ""){	
			vacios = false;
			}else{
				vacios = true;
				break;
				}	
		}	
	}

if(vacios){
	alert("¡debe rellenar todos los campos!");
	}else{
	switch(cual){
		case 1:
			document.form1.submit();
			break;
		case 2:
			document.form2.submit();
			break;
		}
	}
}

//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;
	}
}

function alertas(texto){
this.texto = texto;
alert(texto);
}

function mandarformulario(cual){
this.cual = cual;
switch(cual){
	case 1:
	document.ordenar.submit();
	break;
	}
}
// -->
