/*---------------------------------------------------------------------
	NSS Scrollable Content Area JS

	REQUIREMENTS:
		Utilizes functions found in /assets/js/functions.js
	
	USAGE:
		Make sure function InitContentScroll() is called in the window.onload event (found in /assets/js/init.js).
		
-----------------------------------------------------------------------*/

/*-------------------------------
	general setup
---------------------------------*/
var iScrollTopInit = 0;
var iScrollHeight = 0; 
var iScrollCurrent = 0; 
var iScrollDistance = 1; 
var iScrollTime = 150;
var ourInterval;


function rolloverDown() {
	//ourInterval = setInterval("moveDown()", iScrollTime);
}
function rolloverUp() {
	//ourInterval = setInterval("moveUp()", iScrollTime);
}
function moveDown() {
	var oContentBlock = document.getElementById("ContentBlock");
	if (iScrollCurrent + iScrollDistance >= 0) {
		iScrollCurrent += iScrollDistance;
		oContentBlock.scrollTop = iScrollCurrent;
	}
}
function moveUp() {
	var oContentBlock = document.getElementById("ContentBlock");
	if (iScrollCurrent - iScrollDistance >= 0) {
		iScrollCurrent -= iScrollDistance;
		oContentBlock.scrollTop = iScrollCurrent;
	}
}

/*-------------------------------
	InitContentScroll() - called from init.js
---------------------------------*/
InitContentScroll = function() {
	if (!document.getElementById) return;
	
	var oContentBlock = document.getElementById("ContentBlock");
	var oScrollUp = document.getElementById("ScrollUp");
	var oScrollDown = document.getElementById("ScrollDown");
	var iScrollHeight = oContentBlock.scrollHeight; 

	oScrollUp.onmouseover=function() {
		rolloverUp();
	}
	oScrollUp.onmouseout=function() {
		clearInterval();
	}
	oScrollDown.onmouseover=function() {
		rolloverDown();
	}
	oScrollDown.onmouseout=function() {
		clearInterval();
	}
}

/*---------------------------------------------------------------------
	end NSS Scrollable Content Area JS
-----------------------------------------------------------------------*/