/******************************************
* Scrollable Content IE/FF
* Developed by Rob Wells 2008-07-07
* Only works with IE6+, FF1.7+
******************************************/

var ScrollerContent;
var ScrollerContentHeight;
var ScrollerMoveUpVar;
var ScrollerMoveDownVar;

var ScrollerSpeed = 2;
var ScrollerUpImg = '/images/ScrollerUp.gif';
var ScrollerDownImg = '/images/ScrollerDown.gif';

function ScrollerDown() {
	if (parseInt(ScrollerContent.style.top) >= (ScrollerContentHeight*(-1))+210) {
		ScrollerContent.style.top =  parseInt(ScrollerContent.style.top) - ScrollerSpeed + "px";
	}
	ScrollerMoveDownVar = setTimeout("ScrollerDown()",20)
}

function ScrollerUp() {
	if (parseInt(ScrollerContent.style.top) <= 0) {
		ScrollerContent.style.top = parseInt(ScrollerContent.style.top) + ScrollerSpeed + "px";
	}
	ScrollerMoveUpVar = setTimeout("ScrollerUp()",20);

}

function ScrollerDisplay(strDivID,intTop,intLeft) {

	if (!intTop || intTop.isNaN) {
		intTop = "0px";
	} else {
		intTop = intTop + "px";
	}

	if (!intLeft || intLeft.isNaN) {
		intLeft = "0px";
	} else {
		intLeft = intLeft + "px";
	}

	ScrollerParent = document.getElementById(strDivID)

	strScrollerHTML = ScrollerParent.innerHTML;
	
	strScrollerHTML = '';
	strScrollerHTML += '<div id="ScrollerContainer' + strDivID + '">';
	strScrollerHTML += '	<div id="ScrollerContent' + strDivID + '" style="position:absolute; width: 100%; height: auto; top: 0px; left: 0px;">';
	strScrollerHTML += ScrollerParent.innerHTML;
	strScrollerHTML += '	</div>';
	strScrollerHTML += '</div>';
	
	ScrollerParent.innerHTML = strScrollerHTML;

	ScrollerContent = document.getElementById ? document.getElementById('ScrollerContent' + strDivID) : document.all.content;
	ScrollerContentHeight = ScrollerContent.offsetHeight;
	
	if (ScrollerParent.offsetHeight < ScrollerContentHeight) { // Only show the scroll arrows if the scroll area is bigger than the content
		document.writeln('<div id="ScrollerArrows' + strDivID + '" class="scroller" style="position: absolute; top: ' + intTop + '; left: ' + intLeft + ';">');
		document.writeln('	<div class="up" onMouseover="ScrollerUp()" onMouseout="clearTimeout(ScrollerMoveUpVar)"></div>');
		document.writeln('	<div class="down" onMouseover="ScrollerDown()" onMouseout="clearTimeout(ScrollerMoveDownVar)"></div>');
		document.writeln('</div>');
	}
}
