// FUNÇÃO PARA CORRIGIR A BORDA EM FLASH
function corrige_borda_flash(){ 
	if (document.getElementsByTagName) { 
		// Get all the tags of type object in the page. 
		var objs = document.getElementsByTagName("object"); 
		for (i=0; i<objs.length; i++) { 
			// Get the HTML content of each object tag 
			// and replace it with itself. 
			objs[i].outerHTML = objs[i].outerHTML; 
		} 
	} 
} 
function volta_borda_flash() { 
	if (document.getElementsByTagName) { 
		//Get all the tags of type object in the page. 
		var objs = document.getElementsByTagName("object"); 
			for (i=0; i<objs.length; i++) { 
			// Clear out the HTML content of each object tag 
			// to prevent an IE memory leak issue. 
			objs[i].outerHTML = ""; 
		} 
	} 
}

//FUNÇÃO PARA VALIDAÇÃO DE SELEÇÃO DE ESTADO NA HOME
function valida_campo(x){
	if (document.form1.estados.value == "")
	{
		alert("Selecione o Estado!");
		document.form1.estados.focus();
		return false;
	}
}

//FUNÇÃO QUE ABRE A JANELA DE PRODUTOS
function acessaProd(valorID){
	if(valorID != 0){
		window.open('/controle_acesso/chama_produto.asp?prod_liberado='+valorID,'Produto','toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=780,height=500,top=50,left=150');
	}
}

//FUNÇÃO QUE ABRE A JANELA DE VISUALIZAÇÃO DO FLASH DIÁRIO
function BDF(valorID){
	if(valorID != 0){
		window.open('http://sisnet.aduaneiras.com.br/cenofisco/bdflash/arquivos/html/'+valorID+'.htm','BDFlash','toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=619,height=500,top=50,left=150');
	}
}

//FUNÇÃO QUE ABRE O MENU DROPDOWN NO IE
function menuDropDown(){
	navRoot = document.getElementsByTagName('UL');
	if (document.all&&navRoot) {
		for (i=0; i<navRoot.length; i++) {
			for (x=0; x<navRoot[i].childNodes.length; x++) {
				node = navRoot[i].childNodes[x];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
}

carregaFuncoes = function() {
	menuDropDown();
	corrige_borda_flash();
}
descarregaFuncoes = function() {
	corrige_borda_flash();
}
window.onload=carregaFuncoes;
window.onunload=descarregaFuncoes;

