function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='<b>'+nm+'</b> debe ser un e-mail válido.<br />';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='<b>'+nm+'</b> debe ser un número.<br />';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.<br />';
    } } } else if (test.charAt(0) == 'R') errors += '<b>'+nm+'</b> es requerido.<br />'; }
  } if (errors) show(true, errors);
  document.MM_returnValue = (errors == '');  
}
function show(estado, mensaje){
    if (estado == true) {
        document.getElementById("msg_panel").style.display = 'block';
		document.getElementById("msg_panel").innerHTML = mensaje;
		setTimeMsg(5);
		//return false;
    } else {
        document.getElementById("msg_panel").style.display = 'none';
		//return false;
    }
}
function setTimeMsg(sec){
	id=setInterval(showControl,sec*1000);
}
function showControl(){
	document.getElementById("msg_panel");
	document.getElementById("msg_panel").style.display = "none";
	clearInterval(id);
}
function quitBlur(){
	anclas=document.getElementsByTagName("a").length;
    for (i=0;i<anclas;i++)
	    document.getElementsByTagName("a").item(i).onfocus=new Function("if(this.blur)this.blur()");
}
function makeCarrera(obj){
	sede = obj.value;
	if(sede == 'T'){
		oForm = "<select name='cboCarrera' class='textbox' style='width:160px;'>";
		oForm += "<option value='0' selected>Seleccione</option>";
		oForm += "<option value='201'>Administraci&oacute;n</option>";
		oForm += "<option value='204'>Adm. y Marketing</option>";
		oForm += "<option value='206'>Adm. y Ser. Tur&iacute;sticos</option>";
		oForm += "<option value='207'>Adm. y Neg. Internacionales</option>";
		oForm += "<option value='301'>Arquitectura</option>";
		oForm += "<option value='202'>Contabilidad</option>";
		oForm += "<option value='203'>CC.Comunicaci&oacute;n</option>";
		oForm += "<option value='501'>Derecho</option>";
		oForm += "<option value='101'>Ing. Sistemas</option>";
		oForm += "<option value='102'>Ing. Industrial</option>";		
		oForm += "<option value='401'>Psicolog&iacute;a</option>";
		oForm += "</select>";
	}else if(sede == 'C'){
		oForm = "<select name='cboCarrera' class='textbox' style='width:160px;'>";
		oForm += "<option value='0' selected>Seleccione</option>";
		oForm += "<option value='800'>Administraci&oacute;n</option>";
		oForm += "<option value='807'>Arquitectura</option>";
		oForm += "<option value='810'>Adm. y Neg. Internacionales</option>";
		oForm += "<option value='801'>CC.Comunicaci&oacute;n</option>";
		oForm += "<option value='804'>Derecho</option>";
		oForm += "<option value='803'>Ing. Sistemas</option>";
		oForm += "<option value='805'>Ing. Industrial</option>";
		oForm += "<option value='808'>Ing. Civil</option>";
		oForm += "<option value='9905'>Dpto. de Ciencias</option>";
		oForm += "<option value='9906'>Dpto. de Letras</option>";
		oForm += "</select>";
	}	
	document.getElementById("comboContainer").innerHTML= oForm;
}
document.onload = quitBlur();
