
function mudarfont(aa,bb) {
    usa1 = "mudafont" + aa;
    usa2 = bb + "em verdana,arial,sans-serif";
    document.getElementById("mudafont1").className = "";
    document.getElementById("mudafont2").className = "";
    document.getElementById("mudafont3").className = "";
    document.getElementById(usa1).className = "mudafontsel";
    document.getElementById("texto").style.font = usa2;
}

$(document).ready(function(){
	$("#indice").click(function () {
	$("#indice_geral").slideToggle("slow");
		});
	});

$(document).ready(function(){
    
    $("#indice").click(function () {
      $(".indice, .indice_up").toggle();
		});

	});

$(function(){	// shorthand for $(document).ready() BTW
        $('.lateral, #box_solucoes, #lateral-port, .box-centro03, .box-centro, .lateral-sustentabilidade, #parceria, #parceria_obrigado, #box_trentin, #box_premios, #box_portifolio, #box_depoimentos, #box_newsletter, #box_noticias, #firewall, #wbmkt2, #box_newsletter_obrigado, #contato, #contato_obrigado, #sala_imprensa, #sala_imprensa_obrigado, #oportunidades, #oportunidades_obrigado').each(function() {
			// The text of the paragraphs in the rounded divs is also the
			// jQuery code needed to create that effect. Cosmic.
             //eval($('span', this).text());
			 $(".lateral, #box_solucoes, #lateral-port, .box-centro03, .box-centro, .lateral-sustentabilidade, #parceria, #parceria_obrigado, #box_trentin, #box_premios, #box_portifolio, #box_depoimentos, #box_newsletter, #box_noticias, #firewall, #wbmkt2, #box_newsletter_obrigado, #contato, #contato_obrigado, #sala_imprensa, #sala_imprensa_obrigado, #oportunidades, #oportunidades_obrigado").corner();
        });
	});

$(document).ready(function(){
	
	//hide message_body after the first one
	$(".message_list .message_body:gt(0)").hide();
	
	//hide message li after the 5th
	$(".message_list li:gt(18)").hide();

	
	//toggle message_body
	$(".message_head").click(function(){
		$(this).next(".message_body").slideToggle(500)
		return false;
	});

	//collapse all messages
	$(".collpase_all_message").click(function(){
		$(".message_body").slideUp(500)
		return false;
	});

	//show all messages
	$(".show_all_message").click(function(){
		$(this).hide()
		$(".show_recent_only").show()
		$(".message_list li:gt(18)").slideDown()
		return false;
	});

	//show recent messages only
	$(".show_recent_only").click(function(){
		$(this).hide()
		$(".show_all_message").show()
		$(".message_list li:gt(18)").slideUp()
		return false;
	});

});

 var GB_ANIMATION = true;
      $(document).ready(function(){
        var height = 470;
        var width = 600;
      
        $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_show(t,this.href,height,width);
          //(width - 500) /2 + 'px'
          $("#GB_window").css({ height:(height - 500) /2 + 'px',
                                top:(width - 500) /2 + 'px',
                                width:'500px'
                              });
          
          return false;
        });
      });

function video_show(id){
    document.getElementById(id).style.display = 'block';
}

function troggle_manual(){
    document.getElementById('aparece-video').style.display = 'none';
}

//MASCARA PARA INPUTS DO FORMULARIO
jQuery(function($){

   //FALE CONOSCO
   $("#telefone").mask("(99) 9999-9999");
   
   //SALA DE IMPRENSA
   $('#cnpj').mask('99.999.999/9999-99');
   $('#cpf').mask('999.999.999-99');
   
   //PARCEIROS
   $("#fax").mask("(99) 9999-9999");
   
   //ANTIVIRUS
   $("#cep").mask("99999-999");
   
});


$(document).ready(function(){

	$("#lateral-solucoes a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "-75"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-85"}, "fast");
	});


});

function unblock(email){
    if(email == "adm")
        emailriddlerarray=[97,100,109,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "atendimento")
        emailriddlerarray=[97,116,101,110,100,105,109,101,110,116,111,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "financeiro")
        emailriddlerarray=[102,105,110,97,110,99,101,105,114,111,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "marketing")
        emailriddlerarray=[109,97,114,107,101,116,105,110,103,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "negocios")
        emailriddlerarray=[110,101,103,111,99,105,111,115,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "projetos")
        emailriddlerarray=[112,114,111,106,101,116,111,115,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "suporte")
        emailriddlerarray=[115,117,112,111,114,116,101,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    if(email == "worldwide")
        emailriddlerarray=[119,111,114,108,100,119,105,100,101,64,116,114,101,110,116,105,110,46,99,111,109,46,98,114]
    
    var encryptedemail='' //variable to contain encrypted email 
    for (var i=0; i<emailriddlerarray.length; i++)
     encryptedemail+=String.fromCharCode(emailriddlerarray[i])
     return encryptedemail;
}


//Função para encryptar emails do site
$(document).ready(function(){
    
    $('#adm').html('<a href="mailto:'+unblock('adm')+'">Administrativo</a>');
    $('#atendimento').html('<a href="mailto:'+unblock('atendimento')+'">Atendimento</a>');
    $('#financeiro').html('<a href="mailto:'+unblock('financeiro')+'">Financeiro</a>');
    $('#marketing').html('<a href="mailto:'+unblock('marketing')+'">Marketing</a>');
    $('#negocios').html('<a href="mailto:'+unblock('negocios')+'">Neg&oacute;cios</a>');
    $('#projetos').html('<a href="mailto:'+unblock('projetos')+'">Projetos</a>');
    $('#suporte').html('<a href="mailto:'+unblock('suporte')+'">Suporte T&eacute;cnico</a>');
    $('#worldwide').html('<a href="mailto:'+unblock('worldwide')+'">World Wide</a>');
    
    
    
});


$(document).ready(function() {	

	$('a[name=modal]').click(function(e) {
		e.preventDefault();
		
		var id = $(this).attr('href');
	
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		$('#mask').css({'width':maskWidth,'height':maskHeight});

		$('#mask').fadeIn(1000);	
		$('#mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		$(id).fadeIn(2000); 
	
	});
	
	$('.window .close').click(function (e) {
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});			
	
});


function banner()
{
	var ran = Math.random()
	var num =  2;
	if (num*ran <  1)
	{
        document.write("<object class=\"flash-banner-home\" type=\"application/x-shockwave-flash\" data=\"swf/banner3-midias.swf\">"+
                            "<param name=\"movie\" value=\"swf/banner3-midias.swf\" />"+
                            "<param name=\"quality\" value=\"high\" />"+
                            "<param name=\"wmode\" value=\"transparent\" />"+
                        "</object>");
        
		return;
	}
	
	if (num*ran <  2)
	{
		document.write("<object class=\"flash-banner-home\" type=\"application/x-shockwave-flash\" data=\"swf/banner-ecopages.swf\">"+
                            "<param name=\"movie\" value=\"swf/banner-ecopages.swf\" />"+
                            "<param name=\"quality\" value=\"high\" />"+
                            "<param name=\"wmode\" value=\"transparent\" />"+
                        "</object>");
            
		return;
	}
	
	if (num*ran <  3)
	{
		document.write("<object class=\"flash-banner-home\" type=\"application/x-shockwave-flash\" data=\"swf/banner3-midias.swf\">"+
                            "<param name=\"movie\" value=\"swf/banner3-midias.swf\" />"+
                            "<param name=\"quality\" value=\"high\" />"+
                            "<param name=\"wmode\" value=\"transparent\" />"+
                        "</object>");
            
		return;
	}

}

function fullwin(targeturl){
	window.open(targeturl,"","fullscreen,scrollbars")
}
