// --------------------------------------------------------------
// 
// This creates a scoll effect
// USAGE:
// <div style='overflow: hidden;'>
// 	 <div id='scroller'><!-- PUT CONTENT HERE --><div>
// </div>
// 
// start_scroller('scroller', 100);
// 
// --------------------------------------------------------------


/* ----- MOVES THE SCROLLER BY INCREMENTS ----- */
var position=0;
var scroller;
var timer;

function move_scroller(height) {
	
	// Use a top margin to move the scroller div
	scroller.style.top=(height-position)+"px";
	
	// Check the position to ensure it repeats smoothly
	position+=2;
	if (height-position <= -scroller.offsetHeight) {position=0;}
	
	// document.getElementById("scroll_case").innerHTML=scroller.style.top;
	}


// This function pauses the scroller
function pause_scroller() {clearInterval(timer);}


// This function starts the scroller in motion
function start_scroller(scroller_id, interval) {
	// Get the information on the scroller div
	scroller = document.getElementById(scroller_id);
	// var height = scroller.offsetHeight;
	
	// Place the scroller
	var height=scroller.parentNode.offsetHeight;
	
	// Check the interval
	if (parseInt(interval) < 10) {interval=50;}
	else {interval=parseInt(interval);}
	
	timer=setInterval("move_scroller('"+height+"')", interval);
	
	// Mouseover effects
	scroller.onmouseover=function() {pause_scroller();};
	scroller.onmouseout=function() {timer=setInterval("move_scroller('"+height+"')", interval);}
	}
