<!--

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 desplegar2(menu){
	if(document.getElementById(menu).style.visibility=="visible"){
		document.getElementById(menu).style.visibility="hidden";
		document.getElementById(menu).style.display="none";
	}else{
		document.getElementById(menu).style.display="inline";
		document.getElementById(menu).style.visibility="visible";
	}
}
function desplegar3(menu,accion){
//menu=objeto, accion=cambiar visible si/no
	if (document.getElementById(menu)){
		if(accion==0){
			document.getElementById(menu).style.visibility="hidden";
			document.getElementById(menu).style.display="none";
		}else{
			document.getElementById(menu).style.display="inline";
			document.getElementById(menu).style.visibility="visible";
		}
	}
}
function pestana(pestana,accion,jj){
//menu=objeto, accion=cambiar visible si/no, jj=num de pestana
	if(accion==0){
		document.getElementById(pestana).style.backgroundImage="url(graficos/pest" + jj + "a.gif)";
		document.getElementById(pestana).style.borderBottom="1px solid #cccccc";
		if (document.getElementById('pestaEnlaces'+jj)){
				document.getElementById('pestaEnlaces'+jj).style.color="#000000";
				document.getElementById('pestaEnlaces'+jj).style.fontWeight="normal";
		}
	}else{
		document.getElementById(pestana).style.backgroundImage="url(graficos/pest" + jj + ".gif)";
		document.getElementById(pestana).style.borderBottom="1px solid #eeeeee";
		if (document.getElementById('pestaEnlaces'+jj)){
				document.getElementById('pestaEnlaces'+jj).style.color="#ffffff";
				document.getElementById('pestaEnlaces'+jj).style.fontWeight="bold";
		}
	}
}

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("qsc").value.length<3){
		alert("El parámetro de búsqueda ha de tener al menos 3 caracteres.")
		document.getElementById("qsc").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 votar(nombreForm) {
	var f = document.forms[nombreForm];
	var seleccion = 0;
	for (i=0;i<=f.length-1;i++) 
	{
		if (f.elements[i].checked)
		{
			seleccion = 1;
		}
	}
	if (seleccion == 0) {
		alert("Por favor, seleccione una respuesta");
		return false;
	}
}

	function validaContenido(que){
		if (que.login.value.length==0){
			 alert("Por favor, introduzca el usuario");que.login.focus();return false 
			}
		if (que.pass.value.length==0){
			 alert("Por favor, introduzca la contraseña");que.pass.focus();return false 
			 }
			
	//	que.pass.value.length==0? true : alert("Por favor, introduzca la contraseña");que.pass.focus();return false
	}
		function valida(sFormu){
			if (!ValidoAcceso(sFormu)) { 
				return false
			}else{
				var er_email = /^(.+\@.+\..+)$/;
				if(!er_email.test(document.formDatos.txtEmail.value)) { 
			      		alert('El Campo E-MAIL no es válido.')
						document.formDatos.txtEmail.focus()
			      		return false    //no submit
			    }
			     if (document.formDatos.txtPassword.value != document.formDatos.txtRepitePassword.value) {
			        alert("ERROR: El campo contraseña y su repetición deben ser idénticos..");
					document.formDatos.txtPassword.focus()
			        return false;
			     }
				 if (document.formDatos.condiciones.checked != true){
				 	var bRespuesta = confirm("No se han aceptado las condiciones de uso del RASI,\nno puede darse de alta si no las acepta.\n¿Desea aceptarlas?");
					if (bRespuesta){
						document.formDatos.condiciones.focus()
						document.formDatos.condiciones.checked = true
					}else{
				        return false;
					}
				 }
			}
		}

function Mostrar(Provincia)
{
	switch (Provincia)
		{
		case 'galicia':
			location.href="economistas.asp?fam=1&qsa=66&qsd=62"
			break;
		case 'asturias':
			location.href="economistas.asp?fam=1&qsa=66&qsd=63"
			break;
		case 'cantabria':
			location.href="economistas.asp?fam=1&qsa=66&qsd=64"
			break;
		case 'paisvasco':
			location.href="economistas.asp?fam=1&qsa=66&qsd=65"
			break;
		case 'navarra':
			location.href="economistas.asp?fam=1&qsa=66&qsd=67"
			break;
		case 'aragon':
			location.href="economistas.asp?fam=1&qsa=66&qsd=68"
			break;
		case 'cataluna':
			location.href="economistas.asp?fam=1&qsa=66&qsd=70"
			break;
		case 'madrid':
			location.href="economistas.asp?fam=1&qsa=66&qsd=74"
			break;
		case 'cyl':
			location.href="economistas.asp?fam=1&qsa=66&qsd=72"
			break;
		case 'larioja':
			location.href="economistas.asp?fam=1&qsa=66&qsd=73"
			break;
		case 'cmancha':
			location.href="economistas.asp?fam=1&qsa=66&qsd=76"
			break;
		case 'valencia':
			location.href="economistas.asp?fam=1&qsa=66&qsd=78"
			break;
		case 'andalucia':
			location.href="economistas.asp?fam=1&qsa=66&qsd=84"
			break;
		case 'murcia':
			location.href="economistas.asp?fam=1&qsa=66&qsd=86"
			break;
		case 'baleares':
			location.href="economistas.asp?fam=1&qsa=66&qsd=89"
			break;
		case 'canarias':
			location.href="economistas.asp?fam=1&qsa=66&qsd=91"
			break;
		case 'ceuta':
			location.href="economistas.asp?fam=1&qsa=66&qsd=92"
			break;
		case 'melilla':
			location.href="economistas.asp?fam=1&qsa=66&qsd=92"
			break;
		
		}
}
//-->
