<!--
function Examinar(sid, GEBIcid, GEBIid, NombreForm){
	var cid=0;
	var id=0;
	var sector="";
	var subsec="";
	var sFormulario=document.forms[NombreForm];
	for (i=0; i<= sFormulario.length-1; i++){
		if (sFormulario.elements(i).type =="radio" && sFormulario.elements(i).checked == true){
			if (sFormulario.elements(i).id == GEBIcid ){
				cid = sFormulario.elements(i).value;
				sector=sFormulario.elements(i).validationmsg;
			}
			if (sFormulario.elements(i).id == GEBIid ){
				id = sFormulario.elements(i).value;
				subsec= sFormulario.elements(i).validationmsg;
			}
		}  
	}
	location.href = "fuac.asp?sid="+sid+"&cid="+cid+"&id="+id+"&sector="+sector+"&subsec="+subsec;
}

function SoloNum(){
	if (event.keyCode!=13&&(event.keyCode<48||event.keyCode>57))
		event.keyCode=0;
}
//Minimo de caracteres a buscar en la busqueda avanzada
function LimiteBusqueda(){
	if (document.getElementById("txtBusca1").value.length<4){
		alert("La busqueda debe de ser de más de 4 caracteres");
		return false;
	}
	return true;
}
//Minimo de caracteres a buscar en el menu superior
function LimiteBusqueda2(){
	if (document.getElementById("txtBusca2").value.length<4){
		alert("La busqueda debe de ser de más de 4 caracteres");
		return false;
	}
	return true;
}

function upload(elemento) {
	window.open("upload.asp?dir=upload/consultas&campo="+elemento+"&formulario=frmConsulta","upload","left=300,top=250,fullscreen=no,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width=420,height=220");
}
		
function Buscar(){
	var sid = document.getElementById("sid").value;
	var bus = document.getElementById("bus").value;
	location.href = "fuac.asp?sid="+ sid +"&bus="+ bus;
}

function Menu(IdMenu,Imagen){
	document.getElementById(IdMenu).src="graficos/"+Imagen;
}

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 Mostrar(IdMenu){
	switch (IdMenu){
		case "Nombre":
			if (document.getElementById("TEXTO").innerHTML==""){
				document.getElementById("TEXTO").innerHTML="Ver mis datos";
			}else{
				document.getElementById("TEXTO").innerHTML="";
			}
			break;
		case "Usuario":
			if (document.getElementById("TEXTO").innerHTML==""){
				document.getElementById(IdMenu).src="graficos/img43_2on.gif";
				document.getElementById("TEXTO").innerHTML="Cerrar sesión";
			}else{
				document.getElementById(IdMenu).src="graficos/img43_2.gif";
				document.getElementById("TEXTO").innerHTML="";
			}
			break;
		case "Mapa":
			if (document.getElementById("TEXTO").innerHTML==""){
				document.getElementById(IdMenu).src="graficos/img03on.gif";
				document.getElementById("TEXTO").innerHTML="Mapa";
			}else{
				document.getElementById(IdMenu).src="graficos/img03.gif";
				document.getElementById("TEXTO").innerHTML="";
			}
			break;
		case "Contacto":
			if (document.getElementById("TEXTO").innerHTML==""){
				document.getElementById(IdMenu).src="graficos/img04on.gif";
				document.getElementById("TEXTO").innerHTML="Contacto";
			}else{
				document.getElementById(IdMenu).src="graficos/img04.gif";
				document.getElementById("TEXTO").innerHTML="";
			}
			break;
	}
}

function openIt(x) {
	var items = 5;
	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 F_imprimir(TITULO, TEXTO){
	var sTitulo=document.getElementById(TITULO).innerHTML;
	var sTexto =document.getElementById(TEXTO).innerHTML;
	var win = window.open();
	self.focus();
	win.document.open();
	var neweb= "<table cellpadding='0' cellspacing='0' border='0' width='100%' align='center'>";
	//neweb+="<tr><td><img src='graficos/img01.gif' width=444 height=57></td></tr>";
	//neweb+="<tr><td align='center' bgcolor='#F5F5F5'><font size='+2'>"+sTitulo+"</font></td></tr>";
	//neweb+="<tr><td height='2'></td></tr>";
	neweb+="<tr><td height='15'></td></tr>";
	neweb+="<tr><td height='100%'>"+sTexto+"</td></tr>";
	neweb+="<tr><td height='15'></td></tr>";
	//neweb+="<tr><td height='2' bgcolor='#666666'></td></tr>";
	neweb+="<tr><td bgcolor='#F5F5F5'><b>www.fundacion.udc.es</b></td></tr>";
	neweb+="</table>";
	win.document.write(neweb);
	win.document.close();
	//win.print();
	//win.close();
}

function CambiaComilla(){
	if (event.keyCode==39){	event.keyCode=180;}
}

function Passw(){
	if (document.contacto.txtPass1.value!=document.contacto.txtPass2.value){
		alert("Los password introducidos no son iguales");
		document.contacto.txtPass2.focus();
	}
}

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 Zoom(foto) {
	//creamos el objeto image
	var win= null;
	var imaxe = new Image;
	imaxe.src = foto;
	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{
		setTimeout("Zoom('"+foto+"')", 500)
	}
}

//-->