/****************************************************** 
 *  DIV Scroller
 *-----------------------------------------------------
 * Written by: Web International
 * Date: Aug 14, 2007
 *
 ******************************************************/

var timerId;
var scrollSpeed = 50;
var scrollAmnt = 10;
var divId = 'ep2-display-box';

function scrollStart(dir) {
	if (timerId) clearInterval(timerId);
	
	if (dir == 'down') {
		timerId = setInterval(scrollDown, scrollSpeed);
	} else if (dir == 'up') {
		timerId = setInterval(scrollUp, scrollSpeed);
	} else {
		alert ('Invalid scroll direction was given.');
	}
}

function scrollStop() {
	if (timerId) {
		 clearInterval(timerId);
		 timerId = 0;
	}
}

function scrollDown() {
	var theDiv = document.getElementById(divId);
	theHeight = theDiv.scrollHeight;
	theDiv.scrollTop = theDiv.scrollTop + scrollAmnt;
}

function scrollUp() {
	var theDiv = document.getElementById(divId);
	theHeight = theDiv.scrollHeight;
	if (theDiv.scrollTop > 0) {
		theDiv.scrollTop = theDiv.scrollTop - scrollAmnt;
	}
}

arrow_up = new Image();
      arrow_up.src = 'up.gif';
      arrow_up_r = new Image();
      arrow_up_r.src = 'up_r.gif';

      arrow_down = new Image();
      arrow_down.src = 'down.gif';
      arrow_down_r = new Image();
      arrow_down_r.src = 'downn_r.gif';

//Rollover Image Swap for the Arrows
    function onArrow(arrowId, direction) {
      if (direction == 'down') {
        arrowId.src = arrow_down_r.src;
      } else {
        arrowId.src = arrow_up_r.src;
      }
    }
    
    function outArrow(arrowId, direction) {
      if (direction == 'down') {
        arrowId.src = arrow_down.src;
      } else {
        arrowId.src = arrow_up.src;
      }
    }


