// Variaveis globais

empresa_up = new Image();
empresa_up.src = "imagens/empr_up.gif";
empresa_dn = new Image();
empresa_dn.src = "imagens/empr_dn.gif";

produtos_up = new Image();
produtos_up.src = "imagens/prod_up.gif";
produtos_dn = new Image();
produtos_dn.src = "imagens/prod_dn.gif";

comercial_up = new Image();
comercial_up.src = "imagens/comer_up.gif";
comercial_dn = new Image();
comercial_dn.src = "imagens/comer_dn.gif";

suporte_up = new Image();
suporte_up.src = "imagens/sup_up.gif";
suporte_dn = new Image();
suporte_dn.src = "imagens/sup_dn.gif";

esitef_up = new Image();
esitef_up.src = "imagens/esitef_up.gif";
esitef_dn = new Image();
esitef_dn.src = "imagens/esitef_dn.gif";



// Checagem de browsers

function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
    this.win   = (agent.indexOf("win")!=-1);
    this.mac   = (agent.indexOf("mac")!=-1);
    this.unix  = (agent.indexOf("x11")!=-1);
}

var is = new Is();

function onerror() {
    document.location.href = "javascript:";
}

// Switcher de Objetos, para ambos os browsers.

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
} else if(is.ie4) {
    doc = "document.all";
    sty = ".style";
    htm = ""
}

// Carregamento previo de imagens

var count = 0;

var banner;

function preLoad(bVisitou) {
	if ( bVisitou == 0 ) {
		/* Vai abrir nova janela */
      self.name = "principal"
		banner = window.open ("banner.php","banner", "height=450,width=500,scrollbars=no");
      banner.moveTo(200,200);
	}
}

function posLoad () {
   if (banner != null)
	   banner.close();
}

// Funcao de atualizacao de contador
function updateCounter() {
    var counter = eval(doc + '["counterLyr"]' + htm);
	dData = new Date();
	instHours = dData.getHours();
    var msg = '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD ALIGN="CENTER"><font class="texto">';
	if (instHours >= 0 && instHours <= 12)
		msg += 'Bom dia! ';
	else if (instHours > 12 && instHours <= 18)
			msg += 'Boa tarde! ';
		 else
			msg += 'Boa noite! ';
	msg += '</font></TD></TR>'
   	msg += '<tr><td ALIGN="CENTER" VALIGN="MIDDLE"><img src="images/white.gif" height="10"></td></tr>';
	msg += '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE">Estamos contando:</TD></TR>'
	msg += '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE"><IMG SRC="http://counter.digits.com/wc/-d/4/kuayet" ALIGN=middle WIDTH=60 HEIGHT=20 BORDER=0 HSPACE=4 VSPACE=2> pessoas</TD></TR>'
	msg += '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE">visitaram a p&aacute;gina.</TD></TR>';
   	msg += '<tr><td ALIGN="CENTER" VALIGN="MIDDLE"><img src="images/white.gif" height="10"></td></tr>';
	msg += '<TR><TD ALIGN="CENTER" VALIGN="MIDDLE"><FONT size="-2">Atualizada em 25/04/2000</font></TR></TD>';
	msg += '</TABLE>';
    if(is.ns4) {
    	counter.write(msg);
        counter.close();
    } else if(is.ie4) {
        counter.innerHTML = msg;
    }
}

// Selecionador de menu
function buttonOver(selection) {
   	document[selection].src = eval (selection + "_dn.src");
}

function buttonOut(selection) {
   	document[selection].src = eval (selection + "_up.src");
}

