<!--
					function CambiaComillaPegado(NombreForm){
					//Propósito:	Substuir la comilla simple por el acento cuando pegan en todos los campos del formulario.
					//Efectos:		Si se pega la comilla['] se reemplazará por el acento[´].
					
						var iNumCampos = document.forms[NombreForm].length-1
						for (i=0;i<=iNumCampos;i++)
						{
							sTexto=document.forms[NombreForm].elements[i].value;
							while (sTexto.search("'") != -1 || sTexto.search("\"") != -1){
								sTexto=sTexto.replace("'", "");
								//SI SE COMENTA LA SIGUIENTE LINEA PUEDE PROVOCAR SCRIPTTIMEOUT AL GUARDAR LAS PAGINAS DE EDICION DE CONTENIDOS
								//PERO AL COMENTARLA SE PODRAN GUARDAR TEXTOS CON COMILLAS PARA QUE FUNCIONEN SCRIPTS POR EJEMPLO
								sTexto=sTexto.replace("\"", "");
								}
							//alert(document.forms[formulario].elements[i].name)
							document.forms[NombreForm].elements[i].value=sTexto;
						}
					
					}
function openIt(x) {
	var items = 8;
	for (i=1; i<=items; i++) {
		document.getElementById("submenu"+i).style.visibility = "hidden";	
		document.getElementById("submenu"+i).style.display="none";
	}
	if (x>0){
		document.getElementById("submenu"+x).style.visibility = "visible";
		document.getElementById("submenu"+x).style.display="Inline";
	}
}

function AbrirVentana(pagina) {
	var w = screen.width - 10;
	var h = screen.height- 100;
	window.open(pagina,"","left=0,top=0,fullscreen=no,scrollbars=yes,toolbar=yes,location=no,directories=no,status=yes,menubar=no,resizable=yes,width="+ w +",height="+ h);
}

function Desplegar(menu){
	if(document.getElementById("M_"+menu).style.visibility=="visible"){
		document.getElementById("M_"+menu).style.visibility="hidden";
		document.getElementById("M_"+menu).style.display="none";
		document.getElementById("F_"+menu).src="graficos/flecha_down.gif";
	}else{
		document.getElementById("M_"+menu).style.display="Inline";
		document.getElementById("M_"+menu).style.visibility="visible";
		document.getElementById("F_"+menu).src="graficos/flecha_up.gif";
	}
}

function ValidoAcceso(NombreForm){
	var sFormulario=document.forms[NombreForm];
	var validado = true;
	for (i=0; i<= sFormulario.length-1; i++){
		if (sFormulario.elements(i).validationmsg){
			switch (sFormulario.elements(i).type ) {  
				case "select-multiple" :  
					if (sFormulario.elements(i).options.length =="0"){
						alert(sFormulario.elements(i).validationmsg);
						sFormulario.elements(i).focus();
						return false;
					}
					break;
				case "textarea" :  
					if (sFormulario.elements(i).value.length > sFormulario.elements(i).maxlength){validado=false;}
					if (sFormulario.elements(i).value.length == "0" ){validado=false;}
					if (validado==false){
						alert(sFormulario.elements(i).validationmsg);
						return false;
					}
					break;
				default :  
					if (sFormulario.elements(i).type !="image" && sFormulario.elements(i).type !="select-multiple" &&
					 sFormulario.elements(i).type !="textarea" && sFormulario.elements(i).type !="checkbox" && 
					 sFormulario.elements(i).type !="radio" && sFormulario.elements(i).validationmsg != "0" && 
					 sFormulario.elements(i).validationmsg != "undefined" && sFormulario.elements(i).disabled == false && 
					 (sFormulario.elements(i).value =="" || sFormulario.elements(i).value =="0" )){
						alert(sFormulario.elements(i).validationmsg);
						sFormulario.elements(i).focus();
						return false;
					}
					break;
			}  
			if (validado==false){
				alert(sFormulario.elements(i).validationmsg);
				sFormulario.elements(i).focus();
				return false;
			}
		}
	}
	return true
}

function CambiaComilla(){
	if (event.keyCode==39){	event.keyCode=180;}
}

function SoloNum(){
	if (event.keyCode!=13&&(event.keyCode<48||event.keyCode>57)){event.keyCode=0;}
}

function Buscar()
{
	if (document.getElementById("txt_buscar").value.length<3){
		alert("El parámetro de búsqueda ha de tener al menos 3 caracteres.")
		document.getElementById("txt_buscar").focus();
		return false;
	}
}

function Zoom(foto) {
	var win= null;
	var imaxe = new Image;
	imaxe.src = foto;
	//si el ancho y el alto es distinto de cero es que ya está cargada
	if (imaxe.width!=0 && imaxe.height!=0){
		var h=imaxe.height+30;
		var w=imaxe.width;
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=auto,resizable=no';
		gfoto=foto;
		win=window.open("zoom.html?"+foto,"foto",settings);
		if(parseInt(navigator.appVersion) >= 4)	{win.window.focus();}
		imaxe=null
		w=null
		h=null
		winl=null
		wint=null
	}
	else{
		//esperamos 0.5 segundos y empezamos otra vez
		setTimeout("Zoom('"+foto+"')", 500)
	}
}
function validaMail(queMail){
	if(queMail.value){
		var er_email = /^(.+\@.+\..+)$/;
			if(!er_email.test(queMail.value)) { 
	      		alert('El Campo E-MAIL no es válido.')
				queMail.select()
	      		return false 
			}
	    }
}
//-->

