var pass = new Passaporte('35','83');
function logoutExame() {
       pass.logout();
       eraseCookie("ExamePersonalizacaoFontSize");
       if (document.loginForm.URL_RETORNO.value != "") {
           window.location = document.loginForm.URL_RETORNO.value; 
       } else {
           location.reload();
       }
}

function enviar() {
    if ( document.getElementById( "loginHlpAutenticacaoToLogin" ).value == "" ) { alert("Campo e-mail deve ser preenchido."); return false; }
    else if ( document.getElementById( "loginHlpAutenticacaoToSenha" ).value == "" ) { alert("Campo senha deve ser preenchido."); return false; }
    else { document.loginForm.submit(); }
}

function submitLogin( e ) {
    try {
        var key = ( window.event ) ? window.event.keyCode : e.which;

        if ( key == 13 ) {
            enviar();
        }
    } catch( e ) {}
}


function menu(x){
for(n=1;n<10;n++){
document.getElementById("m"+n).style.backgroundColor="#ffffff";
document.getElementById("n"+n).style.color="#000000";
document.getElementById("s"+n).style.display="none";
}
document.getElementById("m"+x).style.backgroundColor="#d9171f";
document.getElementById("n"+x).style.color="#ffffff";
document.getElementById("s"+x).style.display="block";
}


function m_login(x){
if(x==0){
//document.getElementById("elogin").style.visibility="hidden";
//document.getElementById("pstLogin").style.visibility="visible";
//document.getElementById("pstLogin").style.position="absolute";
//document.getElementById("mlogin").style.visibility="hidden";
document.getElementById("elogin").style.visibility="hidden";
document.getElementById("pstLogin").style.visibility="visible";
document.getElementById("pstLogin").style.position="absolute";
document.getElementById("mlogin").style.display="none";
}
if(x==1){
document.getElementById("mlogin").style.display="block";
document.getElementById("pstLogin").style.visibility="hidden";
document.getElementById("elogin").style.visibility="hidden";
}

}

function abre_menu(){
if( userCookie != null ) 
{
m_login('0');
}
}

function t_abas(x,y,z){
for(n=1;n<=z;n++){
document.getElementById(y+n).style.visibility="hidden";
if(x !=n){document.getElementById(y+n+"a").src="/v2009/css/img/lidas_"+n+"f.jpg";}
}
document.getElementById(y+x+"a").src="/v2009/css/img/lidas_"+x+"a.jpg";
document.getElementById(y+x).style.visibility="visible";
}

function abre_popup(x,y,z,k){
window_randow=window.open(x,'janela','width='+y+',height='+z+',scrollbars='+k+'\'');
//window_randow.resizeTo(y,z); 
//window_randow.focus();
}

    function addHomeSite(oForm, tipoHome) {
        if (document.all) {
            oForm.style.behavior = "url(#default#homepage)";
            oForm.setHomePage( "http://portalexame.abril.com.br/" + tipoHome );
            return false;
        } else {
            window.open('/institucional/html0118697.html','setHomePage','width=565, height=415');
        }
    }


function imprimir_mm(){
window.open('/v2009/areascomuns/imprimir_mm.html', 'imprimir', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=700, height=600');
}
