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');
}









jQuery(document).ready(function(){	
    if (canal == "guiadefundos"){
        //jQuery('<img src="http://portalexame.abril.com.br/v2010/img/rankingfundos_modal.png" style="position:absolute;z-index:1000;margin-top:-160px" />').prependTo('#rf_topo');
        jQuery('<div id="menu_interna"><span class="areas"><a href="http://portalexame.abril.com.br/mercados/arquivos-ranking-de-fundos/como-usar.shtml">Como Usar</a> <a href="http://portalexame.abril.com.br/mercados/arquivos-ranking-de-fundos/criterios.shtml">Crit&eacute;rios</a> <a href="http://portalexame.abril.com.br/mercados/arquivos-ranking-de-fundos/ranking-EXAME-de-fundos-2009.pdf">Ranking EXAME de Fundos 2009 (PDF)</a> <a href="http://portalexame.abril.com.br/mercados/arquivos-ranking-de-fundos/ranking-EXAME-de-fundos-2010.pdf">Ranking EXAME de Fundos 2010 (PDF)</a> </span></div>').insertBefore('#publi_top');	
	
	    	
        
      
      //jQuery('.chapeu_interna').html('<h2 class="chapeu1"><a href="http://portalexame.abril.com.br/mercados/">Mercados</a></h2><h2 class="chapeu2"> / Ranking EXAME de Fundos</h2><span style="position:absolute;margin:2px 0 0 20px;font-size:11px"><img src="http://portalexame.abril.com.br/v2010/img/powered_fgv.gif" alt="" style="vertical-align:middle"  /></span>');
		//jQuery('.chapeu_interna').css('visibility','visible');
                                 
//jQuery('#centro').prependTo('<div class="anula"></div><div id="super2"><table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"><tr><td valign="middle" align="center"><script type="text/javascript">OAS_AD("Top2");</script></td></tr></table></div><div class="anula"></div>');


tooltip = function(){	
		xOffset = 10;
		yOffset = 20;
	  jQuery(".box_menu_margem div:last-child").hover(function(e){											  							  
		jQuery("body").append("<p id='tooltip'>Re&uacute;ne os fundos que t&ecirc;m menos de cinco representantes<br /> no mercado, como os que aplicam em a&ccedil;&otilde;es de energia<br /> el&eacute;trica, e os multimercados com estrat&eacute;gias espec&iacute;ficas.</p>");
		jQuery(".box_menu_margem")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			//.fadeIn("fast");		
    },
    
	function(){
		//this.title = this.t;		
		jQuery("#tooltip").remove();
    });	
    
	jQuery(".box_menu_margem div:last-child").mousemove(function(e){
		jQuery("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	}
  
  );			
};


	tooltip();

        
    }       
});





