//code for scrollers
var scrollerIds = "";
var scrollersInitialized = false;
var scrollerDistance = 4;

function createScroller(elId) {
	if(document.all) {
		var el = document.getElementById(elId);
		var ul = el.firstChild;
		
		//set the new styles on the scroller div
		//el.style.position = "relative";
		//el.style.overflow = "hidden";
		//el.style.height = "80px";
		
		//set the new styles on the ul
		//ul.style.position = "relative";
		ul.style.top = "0px";
		
		//set the new styles on each li
		for(i=0; i<ul.childNodes.length; i++) {
			//get each list item
			var li = ul.childNodes[i];
			
			//add a huge margin to the bottom of each li
			li.style.marginBottom = (95 - li.scrollHeight) + "px";
		}
		
		//start the ul scrolling
		scrollerIds += elId + ";";
		
		if(!scrollersInitialized) {
			scrollersInitialized = true;
			setTimeout("scrollScrollers()", 5000);
		}
	}
}

function scrollScrollers() {
	var scrollerIdArray = scrollerIds.split(";");
	scrollerDistance++;
	
	for(i=0; i<scrollerIdArray.length; i++) {
		var elId = scrollerIdArray[i];
		
		if(elId) {
			var el = document.getElementById(elId);
			
			//get the ul
			var ul = el.firstChild;
			
			//get the top position
			var top = parseInt(ul.style.top) -scrollerDistance;
			
			//reset the scroller when it reaches the bottom
			if(top < -(ul.scrollHeight)) {
				top = 95;
				scrollerDistance = 4;
			}
			
			ul.style.top = top;
		}
	}
	
	if(scrollerDistance == 14) {
		setTimeout("scrollScrollers()", 5000);
		scrollerDistance = 4;
	}
	else setTimeout("scrollScrollers()", 20);
}
