/** © menosdiez.com
 **/

function Abre(page) {
OpenWin = this.open(page, "Ventana", "toolbar=no,menubar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=400px,height=300px");
}

function Activacapa(nombrecapa) {
	if (document.getElementById(nombrecapa).style.display == "none") {
      document.getElementById(nombrecapa).style.display = "";
      document.getElementById(nombrecapa+'txt').innerHTML="Ocultar";
     } else {
       document.getElementById(nombrecapa).style.display = "none";
       document.getElementById(nombrecapa+'txt').innerHTML="Mostrar";
       }
}

function Enviar() {
	setTimeout(	document.formulario.submit(),2000);
}


// MENU DESPLEGABLE

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menuprincipal");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

function vaciacampo(control){
	if(!control.texto_predeterminado){
		control.texto_predeterminado=control.value;
	}
	
	if(control.value==control.texto_predeterminado){
		control.value='';
	}
}

/*
 * Restaurar el contenido de un control de formulario, pero sólo si no se ha modificado
 * Nota: el control debe tener parámetro value
 */


function campooriginal(control){
	if(control.texto_predeterminado){
	}
	
	if(control.texto_predeterminado && control.value==''){
		control.value=control.texto_predeterminado;
	}
}

function ErrorCargarImagen(imagen) {
		
		var fichero=imagen.src+'#';
			//imagen.src='../../imagftp/imagnodisponible.jpg';
			//setTimeout(imagen.src=../../imagftp/imagnodisponible.jpg,500);
			
		imagen.onerror='null';
		imagen.src='../imag_general/1pxtr.gif'
		setTimeout(imagen.src=fichero,500);
		
}
