<!--

var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS  = navigator.appName == "Netscape";

function getRef(id) {
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

function getSty(id) {
	x = getRef(id);
	return (isNS4 ? getRef(id) : getRef(id).style);
}

var scrollerHeight = 35;
var pauseBetweenImages = 3000;
var imageIdx = 0;

function moveRightEdge()
{
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
	var divSuperBanner = getRef("SuperBanner");
	var linhaSuperBanner = getRef("LinhaSuperBanner");

	if (isNS4) {
		yMenuFrom   = divSuperBanner.top;
		yMenuTo     = windows.pageYOffset + scrollerHeight;
		
		yLinhaFrom  = linhaSuperBanner.top;
		yLinhaTo    = windows.pageYOffset + scrollerHeight;
		
	} else if (isDOM) {
		yMenuFrom   = parseInt (divSuperBanner.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + scrollerHeight;
		
		yLinhaFrom  = parseInt(linhaSuperBanner.style.top, 10);
		yLinhaTo    = (isNS ? window.pageYOffset : document.body.scrollTop) + scrollerHeight;
		
	}
	timeoutNextCheck = 500;

	if (yMenuFrom != yMenuTo) {
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4){
			divSuperBanner.top += yOffset;
			linhaSuperBanner += yOffset;
		}else if (isDOM){
			divSuperBanner.style.top = parseInt (divSuperBanner.style.top, 10) + yOffset;
			linhaSuperBanner.style.height = parseInt(linhaSuperBanner.style.height, 10) + yOffset;
		}
		timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

function Browseris () {
	var agt=navigator.userAgent.toLowerCase();
	this.osver=1.0;
	if (agt)
	{
		var stOSVer=agt.substring(agt.indexOf("windows ")+11);
		this.osver=parseFloat(stOSVer);
	}
	this.major=parseInt(navigator.appVersion);
	this.nav=((agt.indexOf('mozilla')!=-1)&&((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1)));
	this.nav6=this.nav && (this.major==5);
	this.nav6up=this.nav && (this.major >=5);
	this.nav7up=false;
	if (this.nav6up)
	{
		var navIdx=agt.indexOf("netscape/");
		if (navIdx >=0 )
			this.nav7up=parseInt(agt.substring(navIdx+9)) >=7;
	}
	this.ie=(agt.indexOf("msie")!=-1);
	this.aol=this.ie && agt.indexOf(" aol ")!=-1;
	if (this.ie)
		{
		var stIEVer=agt.substring(agt.indexOf("msie ")+5);
		this.iever=parseInt(stIEVer);
		this.verIEFull=parseFloat(stIEVer);
		}
	else
		this.iever=0;
	this.ie4up=this.ie && (this.major >=4);
	this.ie5up=this.ie && (this.iever >=5);
	this.ie55up=this.ie && (this.verIEFull >=5.5);
	this.ie6up=this.ie && (this.iever >=6);
	this.winnt=((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1));
	this.win32=((this.major >=4) && (navigator.platform=="Win32")) ||
		(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1);
	this.mac=(agt.indexOf("mac")!=-1);
	this.w3c=this.nav6up;
	this.safari=(agt.indexOf("safari")!=-1);
	this.safari125up=false;
	if (this.safari && this.major >=5)
	{
		var navIdx=agt.indexOf("safari/");
		if (navIdx >=0)
			this.safari125up=parseInt(agt.substring(navIdx+7)) >=125;
	}
}
var browseris=new Browseris();

function trocaImagem(id, state)
{
	if(state){
		document.getElementById(id).src = "/images/menu_top/"+id+"_over.gif";	
	}else{
		document.getElementById(id).src = "/images/menu_top/"+id+".gif";
	}
		
}

function adicionaBookmark()
{
    if (document.all) 
        window.external.AddFavorite('http://www.batera.com.br', 'Batera.com.br - O site no seu ritmo');
} 

function IsKeyDownSubmit(event)
{
    if (event !=null )
    {
        var charCode;
        var bKeyModifiers;
        if (browseris.ie)
        {
            charCode=event.keyCode;
            bKeyModifiers=event.altKey || event.ctrlKey;
        }
        else
        {
            charCode=event.which;
            bKeyModifiers=event.modifers & (event.ALT_MASK | event.CONTROL_MASK);
        }
        if ((charCode==13) && !bKeyModifiers)
        return true;
    }
    return false;
}

function SearchKeyDown(event, buttonId)
{
    if (IsKeyDownSubmit(event))
        document.getElementById(buttonId).click();
}

//-->