var velo_scroll = 20; // velocidade do Srcroll
var pixel_scroll = 10; // pixels que vai mudar
var window_width_right = 2560; // 230
var window_width_left = 0;
var isNav;
var isIE;
var coll = "";
var styleObj = "";

if (parseInt(navigator.appVersion) >= 4)
{
	if (navigator.appName == "Netscape") {
	 isNav = true;
	} else {
	 isIE = true;
	 coll = "all.";
	 styleObj = ".style";
	}
}

function getObjWidth(obj)
{
	var theObj = eval("document." + coll + obj);
	if (isNav) {
	 return theObj.clip.width;
	} else {
	 return theObj.clientWidth;
	}
}

function getObject(obj)
{
	if (typeof obj == "string") {
	 theObj = eval("document." + coll + obj + styleObj);
	} else {
	 theObj = obj;
	}
	return theObj;
}

function getInsideWindowWidth()
{
	if (isNav) {
	 return window.innerWidth;
	} else {
	 return document.body.clientWidth;
	}
}

function getObjectLeft(obj)
{
	var theObj = getObject(obj);
	if (isNav) {
		 return theObj.left;
	} else {
		 return theObj.pixelLeft;
	}
}

function shiftBy(obj, x, y)
{
	var theObj = getObject(obj);
	if (isNav) {
		 theObj.left = theObj.left + x;
		 theObj.top = theObj.top + y;
	} else {
		 theObj.pixelLeft = theObj.pixelLeft + x;
		 theObj.pixelTop = theObj.pixelTop + y;
	}
}

var tim = 0;
var noScroll = true;

function mLeft(obj)
{
	obj = "menu"
	if(!noScroll && getObjectLeft(obj) < window_width_left) {
		shiftBy(obj, pixel_scroll, 0);
		tim = setTimeout("mLeft()", velo_scroll);
	}
}

function mRight(obj)
{
	// getObjWidth(obj)
	obj = "menu" 
	if(!noScroll && getObjectLeft(obj) > - ( 530 - getInsideWindowWidth() ) - window_width_right) {
	 shiftBy(obj, -pixel_scroll, 0);
	 tim = setTimeout("mRight()", velo_scroll);
	}
}

function noMove()
{
	clearTimeout(tim);
	noScroll = true;
}

// style="filter:alpha(opacity=70);-moz-opacity:0.7" onMouseover="high(this)" onMouseout="low(this)" 
function high(which2){
	theobject=which2
	highlighting=setInterval("highlightit(theobject)",1)
}

function low(which2)
{
	clearInterval(highlighting)
	if (which2.style.MozOpacity)
	 which2.style.MozOpacity=0.7
	else if (which2.filters)
	 which2.filters.alpha.opacity=70
}

function highlightit(cur2)
{
	if (cur2.style.MozOpacity<1)
	 cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)+0.1
	else if (cur2.filters&&cur2.filters.alpha.opacity<100)
	 cur2.filters.alpha.opacity+=70
	else if (window.highlighting)
	 clearInterval(highlighting)
}
