
function pega(){tc=document.getElementById("formulario_webnotas").tipocurso.value;enviaForm('formulario_webnotas','/webnotas/menu_direito_ajax'+tc+'.asp','miolo');}
function antesconsiste(){tc=document.getElementById("formulario_webnotas").tipocurso.value}
try{xmlhttp=new XMLHttpRequest();}catch(ee){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}}
fila=[];ifila=0;function carrega(url,destino){fila[fila.length]=[url,destino];if((ifila+1)==fila.length)ajaxRun();}
function ajaxRun(){url=fila[ifila][0];destino=fila[ifila][1];xmlhttp.open("GET",url,true);xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");xmlhttp.setRequestHeader("Cache-Control","no-store, no-cache, must-revalidate");xmlhttp.setRequestHeader("Cache-Control","post-check=0, pre-check=0");xmlhttp.setRequestHeader("Pragma","no-cache");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){texto=unescape(xmlhttp.responseText.replace(/\+/g," "));document.getElementById(destino).innerHTML=texto;ifila++;if(ifila<fila.length)setTimeout("ajaxRun()",20);}}
xmlhttp.send(url);}
function enviaForm(frmNome,url,destino){f=document.getElementById(frmNome);var query=url;for(i=0;i<f.elements.length;i++){query+=i==0?'?':'&';query+=f.elements[i].name+'='+f.elements[i].value;}
carrega(query,destino);}
VerifiqueTAB=true;function Mostra(quem,tammax){if((quem.value.length==tammax)&&(VerifiqueTAB)){var i=0,j=0,indice=-1;for(i=0;i<document.forms.length;i++){for(j=0;j<document.forms[i].elements.length;j++){if(document.forms[i].elements[j].name==quem.name){indice=i;break;}}
if(indice!=-1)break;}
for(i=0;i<=document.forms[indice].elements.length;i++){if(document.forms[indice].elements[i].name==quem.name){while((document.forms[indice].elements[(i+1)].type=="hidden")&&(i<document.forms[indice].elements.length)){i++;}
document.forms[indice].elements[(i+1)].focus();VerifiqueTAB=false;break;}}}}
function PararTAB(quem){VerifiqueTAB=false;}
function ChecarTAB(){VerifiqueTAB=true;}
function num(qua)
{for(I=0;I<=(qua.length);I++)
{if(qua.charCodeAt(I)<48||qua.charCodeAt(I)>57)
{return(false);}}}
function Consiste()
{vnumero=document.getElementById("formulario_webnotas").numero.value
tc=document.getElementById("formulario_webnotas").tipocurso.value
if(tc==1){vdia=document.getElementById("formulario_webnotas").dia.value
vmes=document.getElementById("formulario_webnotas").mes.value
vano=document.getElementById("formulario_webnotas").ano.value}
else
{senha=document.getElementById("formulario_webnotas").senha.value}
if(vnumero.length<5)
{alert("Preencha o campo Matrícula !!\n\n Mínimo de 05 dígitos");document.getElementById("formulario_webnotas").numero.focus();return(false);}
if(num(vnumero)==false){alert("Digite apenas números na matrícula!");document.getElementById("formulario_webnotas").numero.focus();return(false);}
if(tc==1){if(vdia.length<2){alert("Preencha o campo Dia !!\n\n Mínimo de 02 dígitos \n\n Ex: 03");document.getElementById("formulario_webnotas").dia.focus();return(false);}
if(num(vdia)==false){alert("Digite apenas números no dia!");document.getElementById("formulario_webnotas").dia.focus();return(false);}
if(vmes.length<2){alert("Preencha o campo mês !!\n\n Mínimo de 02 dígitos \n\n Ex: 09");document.getElementById("formulario_webnotas").mes.focus();return(false);}
if(num(vmes)==false){alert("Digite apenas números no mês!");document.getElementById("formulario_webnotas").mes.focus();return(false);}
if(vano.length<2){alert("Preencha o campo ano !!\n\n Mínimo de 02 dígitos \n\n Ex: 06");document.getElementById("formulario_webnotas").ano.focus();return(false);}
if(num(vano)==false){alert("Digite apenas números no ano!");document.getElementById("formulario_webnotas").ano.focus();return(false);}}else{if((senha)==false){alert("Digite sua senha!");document.getElementById("formulario_webnotas").senha.focus();return(false);}}


//if(tc==1){document.getElementById("formulario_webnotas").action="http://www.unisanta.br/portalalunos/catraca_pagina.asp";}
if(tc==1){document.getElementById("formulario_webnotas").action="http://www.unisanta.br/portalalunos/catraca.asp";}
else{document.getElementById("formulario_webnotas").action="http://www.unisanta.br/alunospos/catraca.asp";}}