function centraliza(largura,altura){
	window.moveTo((window.screen.width-largura)/2,(window.screen.height-altura)/2);
}
function abreJanela(arquivo,nome,barra,largura,altura) {
	window.open(arquivo,nome,"resizable=no,toolbar=no,status=no,menubar=no,scrollbars="+barra+",width="+largura+",height="+altura);
}
function redimenciona(){
	var i=0;
	function resize() {
		if (navigator.appName == 'Netscape') i=40;
		if (document.images[0]) window.resizeTo(document.images[0].width +50, document.images[0].height+80-i);
		if (window.moveTo((window.screen.width-document.images[0].width)/2,(window.screen.height-document.images[0].height)/2));
	}
}
function montaSWF(arquivo,largura,altura,action){
	
	var now = new Date();	
	var dia = now.getDay();
	var mes = now.getMonth();
	var ano = now.getFullYear();
	var hora = now.getHours();
	var mintuto = now.getMinutes();
	var segundo = now.getSeconds();
	var data = ano+""+mes+""+dia+""+hora;	
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + largura + '" height="' + altura + '">');
	document.write('<param name="movie" value="swf/'+ arquivo +'.swf?ieSux='+ data +'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="FlashVars" value="'+ action +'&clearCache='+ data +'" />');
	document.write('<embed FlashVars="'+ action +'&clearCache='+ data +'" wmode="transparent" menu="false" src="swf/'+ arquivo +'.swf?ieSux='+ data +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + largura + '" height="' + altura + '"></embed>');
	document.write('</object>');
	
}

function JanelaRedefine()
{
    var Janela = document.getElementById('redefinir');
    
    if(Janela.style.display == "none")
        Janela.style.display='';
    else
        Janela.style.display='none';
}

function OpenCusto()
{
    var Open = document.getElementById(arguments[0]);
    
    if(Open.style.display == "none")
        Open.style.display = "";
    else
        Open.style.display = "none";
}

	
	function ShowHideRedefine()
	{
	    var Embed = document.getElementById(arguments[0]);
	    var Disabe1 = document.getElementById(arguments[1]);
	    var Disabe2 = document.getElementById(arguments[2]);
	    
	    Embed.style.display = '';
	    Disabe1.style.display = 'none';
	    Disabe2.style.display = 'none';
	}
	
	function More()
	{
	    var Dv = document.getElementById(arguments[1]);
	    
	    
	    if(Dv.style.display == 'none')
	    {
	        arguments[0].innerHTML = "[-] Esconder";
	        Dv.style.display = '';
	    }
	    else
	    {
	        arguments[0].innerHTML = "[+] Mais..";
	        Dv.style.display = 'none';
	    }
	}
	
	function pg() {

	    var imTipo = document.getElementById("ImTipo");
        var im = document.getElementById("imgBusca");
        var patch = "img/global/layout/tilt/busca_";
        
        var Pf = document.getElementById("bxPf");
        var Inpf = document.getElementById("inpf");
        var HlpPf = document.getElementById("HlpPf");

        var Pj = document.getElementById("bxPj");
        var Inpj = document.getElementById("inpj");
        var HlpPj = document.getElementById("HlpPj");

        var Prof = document.getElementById("bxProf");
        var Inprof = document.getElementById("inprof");
        var HlpPrf = document.getElementById("HlpPrf");

        try {
            var bannerPf = document.getElementById("BannerPf");
            var bannerPj = document.getElementById("BannerPj");
            var bannerPr = document.getElementById("BannerPr");
        }
        catch (x) { }

        Pf.style.display = "none";
        Inpf.src = "img/global/layout/bt/pf.jpg";
        HlpPf.style.display = "none";

        Pj.style.display = "none";
        Inpj.src = "img/global/layout/bt/pj.jpg";
        HlpPj.style.display = "none";

        Prof.style.display = "none";
        Inprof.src = "img/global/layout/bt/profissao.jpg";
        HlpPrf.style.display = "none";

        try {
            bannerPf.style.display = "none";
            bannerPj.style.display = "none";
            bannerPr.style.display = "none";
        } catch (xx) { }
                
        switch(arguments[0])
        {
            case "pj":
                im.src = patch + "pj.jpg";
                Pj.style.display = "";
                Inpj.src = "img/global/layout/bt/pj-up.jpg";
                HlpPj.style.display = "";
                imTipo.src = "img/global/layout/tilt/escolha_tipoPJ.jpg";

                try {
                    bannerPj.style.display = "";
                } catch (x) { }

                break;
            case "prof":
                im.src = patch + "prof.jpg";
                Prof.style.display = "";
                Inprof.src = "img/global/layout/bt/profissao-up.jpg";
                HlpPrf.style.display = "";

                try {
                    bannerPr.style.display = "";
                } catch (x) { }

                try {
                    if (document.getElementById('prf1').checked)
                        CloseDvw(2);
                } catch (e) { }

                imTipo.src = "img/global/layout/tilt/escolha_tipo.jpg";
                break;
            default:
                im.src = patch + "pf.jpg";
                Pf.style.display = "";
                Inpf.src = "img/global/layout/bt/pf-up.jpg";
                HlpPf.style.display = "";

                try {
                    bannerPf.style.display = "";
                } catch (x) { }

                try {
                    if (document.getElementById('rdpf1').checked)
                        CloseDvw(1);
                } catch (e) { }

                imTipo.src = "img/global/layout/tilt/escolha_tipo.jpg";
                break;
        }
    }
    
    function Goto()
    {
        arguments[0].style.cursor = 'pointer';
        arguments[0].onclick = new Function("Fadex();window.location='default.aspx?action=busca&tipo=pl&" + arguments[1] + "'");
    }
    
    function CloseDvw()
    {
        try {
            document.getElementById('faixa-etaria-prof').style.display = 'none';
        } catch (ex) { }

        try {
            document.getElementById('faixa-etaria-pj').style.display = 'none';
        }
        catch (exx) { }

        try {
            document.getElementById('faixa-etaria').style.display = 'none';
        }
        catch (exxx) { }
        
        if(arguments[0] != null)
        {
            switch(arguments[0])
            {
               case 1: document.getElementById('faixa-etaria').style.display=''; break;
               case 2: document.getElementById('faixa-etaria-prof').style.display=''; break;
            }
        }
        
    }
