//Manual Scroller- © Dynamic Drive 2001
//For full source code, visit http://www.dynamicdrive.com

//specify speed2 of scroll (greater=faster)
var speed2 = 3;

var iens62 = (document.all || document.getElementById);
var ns42 = document.layers;

var crossobj2 = null;
var contentheight2 = 0;
var contentwidth2 = 0;
var largura_maxima2 = 0;
var altura_maxima2 = 0;

function scroll_init2(poObjeto2, pcCamada2, pnWidth2, pnHeight2) {
	largura_maxima2 = pnWidth2;
	altura_maxima2 = pnHeight2;
	document.write('<ilayer name="nscontainer2" width="' + pnWidth2 + '" height="' + pnHeight2 + '" clip2="0, 0, ' + pnWidth2 + ', ' + pnHeight2 + '">');
	document.write('<layer name="nscontent2" width="' + pnWidth2 + '" height="' + pnHeight2 + '" visibility="hidden">');
	if (iens62) {
		document.write('<div id="container2" style="position:relative;width:' + pnWidth2 + 'px;height:' + pnHeight2 + 'px;overflow:hidden;">');
		document.write('<div id="content2" style="position:absolute;left:0px;top:0px">');
	}
	//document.write(pcTexto);
	document.write(document.getElementById(pcCamada2).innerHTML);
	if (iens62) {
		document.write('</div></div>');
		crossobj2 = document.getElementById? document.getElementById(poObjeto2) : document.all.content2;
		contentheight2 = crossobj2.offsetHeight;
		contentwidth2 = crossobj2.offsetWidth;
	} else if (ns42){
		crossobj2 = document.nscontainer2.document.nscontent2;
		contentheight2 = crossobj2.clip2.height;
		contentwidth2 = crossobj2.clip2.width;
	}
	document.write('</layer>');
	document.write('</ilayer>');
	
	window.onload=getcontent_height2;
}

function movedown2(){
if (window.moveupvar) clearTimeout(moveupvar)
if (iens62&&parseInt(crossobj2.style.top)>=(contentheight2*(-1)+altura_maxima2))
	crossobj2.style.top=parseInt(crossobj2.style.top)-speed2+"px";
else if (ns42&&crossobj2.top>=(contentheight2*(-1)+altura_maxima2))
	crossobj2.top-=speed2;
movedownvar=setTimeout("movedown2()",20);
}

function moveup2(){
if (window.movedownvar) clearTimeout(movedownvar)
if (iens62&&parseInt(crossobj2.style.top)<=0)
	crossobj2.style.top=parseInt(crossobj2.style.top)+speed2+"px";
else if (ns42&&crossobj2.top<=0)
	crossobj2.top+=speed2;
moveupvar=setTimeout("moveup2()",20);
}

function moveleft2(){
if (window.moverightvar) clearTimeout(moverightvar);
if (iens62&&parseInt(crossobj2.style.left)<=0)
	crossobj2.style.left=parseInt(crossobj2.style.left)+speed2+"px";
else if (ns42&&crossobj2.left<=0)
	crossobj2.left+=speed2;
moveleftvar=setTimeout("moveleft2()",10);
}

function moveright2(){
if (window.moveleftvar) clearTimeout(moveleftvar);
if (iens62&&parseInt(crossobj2.style.left)>=(contentwidth2*(-1)+largura_maxima2))
	crossobj2.style.left=parseInt(crossobj2.style.left)-speed2+"px";
else if (ns42&&crossobj2.left>=(contentwidth2*(-1)+largura_maxima2))
	crossobj2.left-=speed2;
moveleftvar=setTimeout("moveright2()",10);
}

function stopscroll2(){
	if (window.moveupvar) clearTimeout(moveupvar);
	if (window.movedownvar) clearTimeout(movedownvar);
	if (window.moverightvar) clearTimeout(moverightvar);
	if (window.moveleftvar) clearTimeout(moveleftvar);
}

function movetop2(){
stopscroll2()
if (iens62)
	crossobj2.style.top=0+"px";
else if (ns42)
	crossobj2.top=0;
}

function getcontent_height2() {
	if (iens62) {
		contentheight2 = crossobj2.offsetHeight;
		contentwidth2 = crossobj2.offsetWidth;
	} else if (ns42) {
		document.nscontainer2.document.nscontent2.visibility = "show";
	}
}