function TimeScroll( div ) {
	var divBlock = document.getElementById( div );
	var listBlock = document.getElementById( div + "-list" );
	var arrowUp = document.getElementById( div + "-up" );
	var arrowDown = document.getElementById( div + "-down" );
	var numTimes = 0;
	var position = 0;	
	
	this.init = function() {
		start();
	}
	
	function start() {
		// add events for up/down buttons
		if( arrowUp ) {
			arrowUp.addEventListener( "click", up, true );
		}
		
		if( arrowDown ) {
			arrowDown.addEventListener( "click", down, true );
		}
		
		// find current start time
		var times = listBlock.getElementsByTagName( "a" );
		for( var i = 0; i < times.length; i++ ) {
			if( times[i].className == "on" ) {
				position = i;
			}
		}
		
		display();
		
	}
	
	function display() {
		// display proper number of groups
		if( listBlock ) {
			var times = listBlock.getElementsByTagName( "a" );
			numTimes = times.length;
			
			var timesPerPage = 4;
			
			if( numTimes > timesPerPage ) {				
				var start = position;
				for( var i = 0; i < numTimes; i++ ) {
					var display = "none";
					if( i >= start && i < ( start + timesPerPage ) ) {
						display = "block";
					}
					
					times[i].style.display = display;
				}
			}
			
			// reset arrow display
			var upDisplay = "arrowUp";
			if( (position + timesPerPage) >= numTimes ) {
				upDisplay = "arrowUpOff";
			}
			
			var downDisplay = "arrowDown";
			if( position == 0 ) {
				downDisplay = "arrowDownOff";
			}
			
			arrowUp.className = upDisplay;
			arrowDown.className = downDisplay;
		}
	}
	
	function up( e ) {
		if( arrowUp.className != "arrowUpOff" ) {
			position++;
			display();
		}
		
		if( e ) { e.preventDefault(); }
	}
	
	function down( e ) {
		if( arrowDown.className != "arrowDownOff" ) {
			position--;
			display();
		}
		
		if( e ) { e.preventDefault(); }
	}
}