// Função Popup: <a href="arquivo.ext" onclick="popup(this.href,'360','535','1'); return false;"></a>
function popup(url,w,h,s) {
	var oW=window.open(url,'popup','width='+w+',height='+h+',directories=0,location=0,menubar=0,resizable=0,scrollbars='+s+',status=0,toolbar=0,marginleft=0,margintop=0,left='+(((screen.availWidth-w)/2)+-10)+',top='+(((screen.height-h)/2)+-10));
}
function combo(el, val){document.getElementById(el).value = val;}

function abreFechaBusca(elemento) {
    if ($("filtros").style.display == "none") {
        $("filtros").show();
        $("btn_abre_fecha").addClassName("btns_chec_busca_aberto");
        $("btn_abre_fecha").title="Fechar";
        $("btn_abre_fecha").alt="Fechar";
    } else {
        $("filtros").hide();
        $("btn_abre_fecha").removeClassName("btns_chec_busca_aberto");
        $("btn_abre_fecha").title="Abrir";
        $("btn_abre_fecha").alt="Abrir";
    }
}

function abreFechaPolitica() {
    if ($("politica").style.display=="none") {
        $("tampa").style.height=$("content").offsetHeight+"px";
        $("tampa").style.width=$("content").offsetWidth+"px";
        $("tampa").show();
        $("politica").show();
    } else {
        $("tampa").hide();
        $("politica").hide();
    }
}

function abreFechaTampa() {
	if ($("tampa").style.display=="none") {
		$("tampa").style.height=$("fundo").offsetHeight+"px";
		$("tampa").style.width=$("fundo").offsetWidth+"px";
		$("tampa").show();
	} 
	else
	{
		$("tampa").hide();   
	}
}

function modalHome() {
	if ($("tampa").style.display=="none") {
		
		if(typeof document.body.style.maxHeight === "undefined"){
		$("tampa").style.height=$("form1").offsetHeight+"px";
		}
		else{
		$("tampa").style.height=$("form1").offsetHeight+100+"px";
		}
		$("tampa").style.width=$("form1").offsetWidth+"px";
		$("tampa").show();
		$("modalHomeCadastro").show();
	} 
	else
	{
		$("tampa").hide();   
		$("modalHomeCadastro").hide();
	}
}

function modalHomePromocao() {
	if ($("tampa").style.display=="none") {
		
		if(typeof document.body.style.maxHeight === "undefined"){
		$("tampa").style.height=$("form1").offsetHeight+"px";
		}
		else{
		$("tampa").style.height=$("form1").offsetHeight+100+"px";
		}
		$("tampa").style.width=$("form1").offsetWidth+"px";
		$("tampa").show();
		$("modalHomePromocao").show();
	} 
	else
	{
		$("tampa").hide();   
		$("modalHomePromocao").hide();
	}
}

