//Manual Scroller- © Dynamic Drive 2001
//For full source code, visit http://www.dynamicdrive.com
var vert_obj;
var vert_contentheight;
var horiz_obj;
var horiz_contentwidth;
var speed;
var iens6;
var ns4;

function initscrolling(){
	//specify speed of scroll (greater=faster)
	speed = 3

	iens6 = document.all || document.getElementById;
	//ns4 = document.layers;
	if (iens6){
		vert_obj = document.getElementById? document.getElementById("vert_content") : document.all.vert_content;
		vert_contentheight = vert_obj.offsetHeight;

		//horiz_obj = document.getElementById? document.getElementById("horiz_content") : document.all.horiz_content;
		//horiz_contentwidth = horiz_obj.offsetWidth;
		
		
		//alert(vert_obj + ' / ' +vert_contentheight);
		//alert(horiz_obj + ' / ' +horiz_contentwidth);
		
	} else if (ns4){
		vert_obj = document.nsvertcontainer.document.nsvertcontent
		vert_contentheight = vert_obj.clip.height

		horiz_obj = document.nshorizcontainer.document.nshorizcontent
		horiz_contentwidth = horiz_obj.clip.width
	}
}

function movedown(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (iens6 && parseInt(vert_obj.style.top) >= (vert_contentheight * (-1) + 310))
		vert_obj.style.top = parseInt(vert_obj.style.top) - speed + "px"
	else if (ns4 && vert_obj.top >= (vert_contentheight * (-1) + 310))
		vert_obj.top -= speed
	movedownvar = setTimeout("movedown()", 20)
}

function moveup(){
	if (window.movedownvar) clearTimeout(movedownvar)
	if (iens6 && parseInt(vert_obj.style.top) <= 0)
		vert_obj.style.top = parseInt(vert_obj.style.top) + speed + "px"
	else if (ns4 && vert_obj.top <= 0)
		vert_obj.top += speed
	moveupvar=setTimeout("moveup()", 20)
}

/*
function movedown(){
	if (window.movedownvar) clearTimeout(movedownvar)
alert(parseInt(vert_obj.style.top) >= (vert_contentheight * (-1) + 310))
	if (iens6 && parseInt(vert_obj.style.top) >= (vert_contentheight * (-1) + 310))
		{
		alert("move down")
		vert_obj.style.top = parseInt(vert_obj.style.top) - speed + "px"
		}
	else if (ns4 && vert_obj.top >= (vert_contentheight * (-1) + 310))
		vert_obj.top -= speed
//	movedownvar = setTimeout("movedown()", 20)
}

function moveup(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (iens6 && parseInt(vert_obj.style.top) < 0)
		{
		alert("move up")
		vert_obj.style.top = parseInt(vert_obj.style.top) + speed + "px"
		}
	else if (ns4 && vert_obj.top <= 0)
		vert_obj.top += speed
//	moveupvar=setTimeout("moveup()", 20)
}
*/

/***
dan stanfield
scrolling to the left
***/
function moveleft(){
	if (window.moveleftvar) clearTimeout(moveleftvar)
	if (iens6 && parseInt(horiz_obj.style.left) >= (horiz_contentwidth * (-1) + 407))
		horiz_obj.style.left = parseInt(horiz_obj.style.left) - speed + "px"
	else if (ns4 && horiz_obj.left >= (horiz_contentwidth * (-1) + 400))
		horiz_obj.right -= speed
	moveleftvar=setTimeout("moveleft()", 20)
}

/***
dan stanfield
scrolling to the right
***/
function moveright(){
	if (window.moverightvar) clearTimeout(moverightvar)
	if (iens6 && parseInt(horiz_obj.style.left) < 0)
		horiz_obj.style.left = parseInt(horiz_obj.style.left) + speed + "px"
	else if (ns4 && horiz_obj.left <= 0)
		horiz_obj.left += speed
	moverightvar = setTimeout("moveright()", 20)
}

/***
dan stanfield
stops all scrolling
8/2/07 - added left & right stops
***/
function stopscroll(){
	if (window.moveupvar) clearTimeout(moveupvar)
	if (window.movedownvar) clearTimeout(movedownvar)
	if (window.moveleftvar) clearTimeout(moveleftvar)
	if (window.moverightvar) clearTimeout(moverightvar)
}


function movetop(){
	stopscroll()
	if (iens6)
		crossobj.style.top = 0 + "px"
	else if (ns4)
		crossobj.top = 0
}

function getcontent_height(){
	if (iens6)
		vert_contentheight = crossobj.offsetHeight
	else if (ns4)
		document.nscontainer.document.nscontent.visibility = "show"
}

function getcontent_width(){
	if (iens6)
		horiz_contentwidth = crossobj.offsetWidth
	else if (ns4)
		document.nscontainer.document.nscontent.visibility = "show"
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
