
ie =  document.all ? true : false;

// script que condiciona o Browser do menu de SERVIÇOS PARA VOCÊ
if (document.all || document.layers) {
	IE4 = (document.all);
	NS4 = (document.layers);
	NS6 = false;
} else if (document.getElementById) {
	IE4 = false;
	NS4 = false;
	NS6 = (document.getElementById);
}
if ( navigator.userAgent.indexOf("Mozilla") != -1 ) {
	mozilla = true;
}

    ver4 = (NS4 || IE4);
	 IE5 = (IE4 && navigator.appVersion.indexOf("5.")!=-1);
   isMac = (navigator.appVersion.indexOf("Mac") != -1);
  isMenu = (NS4 || (IE4 && !isMac) || (IE5 && isMac));
function popUp(){return};
function popDown(){return};
if (!ver4) event=null;
if(top.frames.length!=0){top.location=location;}
function pop(link){
window.open(link, "Janela", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=796,height=450,left=1,top=60", true); 
}

var IE4 = document.all; NS4 = document.layers; NS6 = document.getElementById;

function getStyle(id){return NS4? document[id] : NS6 ? document.getElementById(id).style : document.all[id].style;}
function HideLayer(nLayer) { 
	for (var i = 0; i < Layers.length; i++ ) { 
		if (Layers[i] == nLayer) { 
			HideLayerN(Layers[i]);
		}
	}
}
function ShowLayer(nLayer, topo, esq) { 
	for (var i = 0; i < Layers.length; i++ ) { 
		if (Layers[i] == nLayer) {
			if(topo) ShowLayerN(Layers[i], topo, esq);
			else ShowLayerN(Layers[i]);

		}
	}
}

function HideLayerN(layer) {
	getStyle(layer).visibility = NS4? "hide" : "hidden";
	Estado[layer] = "off";
}
function ShowLayerN(layer, topo, esq) {	
	if(ns && ns > 0) clearTimeout(ns);
 	getStyle(layer).visibility = NS4? "show" : "visible";
	Estado[layer] = "on";
 	if(topo)getStyle(layer).top = parseInt(topo); 
 	if(esq)getStyle(layer).left = parseInt(esq); 
	ns = setTimeout("CloseAll()",5000);
}
var Layers = null;
Layers = [];
var Estado = null;
Estado = [];
var timerMep = [];
var ns;
function setLayers() {
	for (var i = 0; i < arguments.length; i++) {
		Layers[i] = arguments[i];
		Estado[Layers[i]] = "off";
	}
}

function CloseLayers(nLayer) {
	for (var j = 0; j < Layers.length; j++ ) {
		if (Layers[j] == nLayer) {
			ShowLayerN(Layers[j]);
		}
		else if (Layers[j] != nLayer && Estado[Layers[j]] == "on") {
			HideLayerN(Layers[j]);
		}
	}
}
function CloseAll() {
	for (var j = 0; j < Layers.length; j++) {if(Estado[Layers[j]] == "on")HideLayer(Layers[j]);}
}

function PutColor(cel){
	if(NS4) return; //document[cel].bgColor = "#ffcc00"; 
	if(IE4){
		document.all[cel].bgColor = "#ffcc00";
	}
	if(NS6){ 
		document.getElementById(cel).bgColor = "#ffcc00";
	}
}
function TakeColor(cel){
	if(NS4) return; //document[cel].bgColor = "";  
	if(IE4) {
		document.all[cel].bgColor = "";
	} 
	if(NS6){ 
		document.getElementById(cel).bgColor = "";
	}
}
function limpaTimeout(nLayer) {
		
	if(timerMep[nLayer] && timerMep[nLayer] > 0){
		clearTimeout(timerMep[nLayer]);
		window.itemOn = null;
      }
	if(NS4){
	 window.itemOn = nLayer;
	 timerMep[nLayer] = setTimeout("esconde()", 3000) ;
	}
}
function iniciaTimeout(nLayer) {
	window.itemOn = nLayer;
	timerMep[nLayer] = (!NS4)? setTimeout("esconde()", 600): setTimeout("esconde()", 3000);
	if(NS4) limpaTimeout(window.itemOn);
}
function esconde(){
HideLayer(window.itemOn);
}
