var velo_scroll = 50; // velocidade da rolagem
var pixel_scroll = 5; // quantidade de saltos entre os pixels
var window_height = 400; 
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 getObjHeight(obj) {
var theObj = eval("document." + coll + obj);
if (isNav) {
return theObj.clip.height;
} else {
return theObj.clientHeight;
}
}

function getObject(obj) {
if (typeof obj == "string") {
theObj = eval("document." + coll + obj + styleObj);
} else {
theObj = obj;
}
return theObj;
}

function getInsideWindowHeight() {
if (isNav) {
return window.innerHeight;
} else {
return document.body.clientHeight;
}
}

function getObjectTop(obj) {
var theObj = getObject(obj);
if (isNav) {
return theObj.top;
} else {
return theObj.pixelTop;
}
}

function shiftBy(obj, x, y) {
var theObj = getObject(obj);
if (isNav) {
theObj.top = theObj.top + x;
theObj.left = theObj.left + y;
} else {
theObj.pixelTop = theObj.pixelTop + x;
theObj.pixelLeft = theObj.pixelLeft + y;
}
}

var tim = 0;
var noScroll = true;

function mTop(obj) {
obj = "menu"
if(!noScroll && getObjectTop(obj) < window_height) {
shiftBy(obj, pixel_scroll, 0);
tim = setTimeout("mTop()", velo_scroll);
}
}

function mBottom(obj) {
obj = "menu" 
if(!noScroll && getObjectTop(obj) > -(getObjHeight(obj) - (getInsideWindowHeight())) - window_height) {
shiftBy(obj, -pixel_scroll, 0);
tim = setTimeout("mBottom()", velo_scroll);
}
}

function noMove() {
clearTimeout(tim);
noScroll = true;
} 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
