// JavaScript Document - CÓDIGO PARA DESPLEGAR EL MENÚ EN IE6

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// JavaScript Document - INSTRUCCIONES FORMULARIO DE ACCESO AL CAMPUS

function Comprueba() {
	if (document.Ingreso.usuario.value == '') {
		var message = 'El Campo de Usuario no puede ser vacio';
		alert (message);
		document.Ingreso.usuario.focus();
		return (false);
		}
	else {
		var indice=document.Ingreso.categoria.selectedIndex;
		var parametro=document.Ingreso.categoria.options[indice].value;		
		if(navigator.appVersion.substring(0,1)>=4) {
			setTimeout("set()",2000);		
		}
		else {
			//window.open('<%=session("path_inicio")%>comppwd02.asp?usuario='+document.Ingreso.usuario.value+'&pwd='+document.Ingreso.pwd.value+'&categoria='+parametro,'campus','top=0.left=0,scrollbars=yes,resizable=no');		
			window.open('','campus','height=570,width=800,top=0,left=0,scrollbars=yes,resizable=no');	
			document.Ingreso.submit();
		}
	}
}
	
function set() {
	
	var miform=document.Ingreso;
	var index=miform.categoria.selectedIndex;
	var parametro1=miform.categoria.options[index].value;
	
	//ventana1=window.open('<%=session("path_inicio")%>comppwd02.asp?usuario='+document.Ingreso.usuario.value+'&pwd='+document.Ingreso.pwd.value+'&categoria='+parametro1, 'campus','top=0.left=0,scrollbars=yes,resizable=no,height=500,width=780');
	ventana1=window.open('', 'campus','top=0,left=0,scrollbars=yes,resizable=no,height=570,width=796');
    //ventana1.moveTo(0,0);
    miform.submit();	
}

// JavaScript Document - ABRIR ENLACES EN OTRA VENTANA

function openExternal(){
    if(!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName('a');
    for(var i = 0; i < anchors.length; i++)
		{
        var thisAnchor = anchors[i];
        if(thisAnchor.getAttribute('href') && thisAnchor.getAttribute('class') == 'external')
		{
            thisAnchor.target = '_blank';
        }
    }
   var className = 'new-windows-medium';
   var as = document.getElementsByTagName('a');
   for(i=0;i<as.length;i++)
   	{
      var a = as[i];
      r=new RegExp("(^| )"+className+"($| )");
      if(r.test(a.className))
	  {
         a.onclick = function()
		 {
            window.open(this.href,'_blank','width=700,height=500,scrollbars=yes');
            return false;
         }
      }
    }
	var className = 'new-windows-small';
   var as = document.getElementsByTagName('a');
   for(i=0;i<as.length;i++)
   	{
      var a = as[i];
      r=new RegExp("(^| )"+className+"($| )");
      if(r.test(a.className))
	  {
         a.onclick = function()
		 {
            window.open(this.href,'_blank','width=330,height=200,scrollbars=no');
            return false;			
         }
      }
    }
	var className = 'new-windows-large';
   var as = document.getElementsByTagName('a');
   for(i=0;i<as.length;i++)
   	{
      var a = as[i];
      r=new RegExp("(^| )"+className+"($| )");
      if(r.test(a.className))
	  {
         a.onclick = function()
		 {
            window.open(this.href,'_blank','width=1000,height=700,scrollbars=yes');
            return false;
         }
      }
    }
}

window.onload = openExternal;

<!-- SCRIPT PARA VALIDAR LOS DATOS DEL FORMULARIO DENTRO DEL POPUP -->
function Validar(form)
{
  if (form.Nombre.value == "")
  { alert("Por favor ingrese su nombre"); form.Nombre.focus(); return; }
  if (form.Apellidos.value == "")
  { alert("Por favor ingrese sus apellidos"); form.Apellidos.focus(); return; }

  if (form.Email.value == "")
  { alert("Por favor ingrese su dirección de e-mail"); form.Email.focus(); return; }
   if (form.Email.value.indexOf('@', 0) == -1 ||
      form.Email.value.indexOf('.', 0) == -1)
  { alert("Dirección de e-mail inválida"); form.Email.focus(); return; }
    if (form.Provincia.value == "")
  { alert("Por favor seleccione una provincia"); form.Provincia.focus(); return; }
  if (form.Telefono.value.length != 9)
  { alert("Por favor ingrese un número de teléfono válido."); form.Telefono.focus(); return; }
  var er_telefono = /^([0-9\s\+\-])+$/
  if( !er_telefono.test(form.Telefono.value) ) {   
        alert('Inserte un número de teléfono válido.')   
       form.Telefono.focus(); return;   
    } 
	if (!form.privacidad.checked)
  {alert("Debes aceptar la política de privacidad de Iniec");return;}   
  form.submit();
  document.getElementById('popup-info').style.visibility ='hidden';    
}