////////////////////////////////////////////////////////////////////////////////
// BEGIN
//

	var curPos = 0;
	var myScroll;
	
	function doScroll2( direction )
	{
		handle( direction );
		myScroll = setTimeout( "doScroll2( "+ direction +" )", 100 );
		//alert( direction );
	}
	function endScroll2()
	{
		clearTimeout( myScroll );	
	}
	
	function handle( delta )
	{
		var contentElem = document.getElementById( "content" );
		var multiplier = 5;
		curPos += (delta*multiplier);
		if (delta < 0)
		{
			// Scroll Down Event
			//contentElem.style.top = curPos + "px";
		}
		else
		{
			// Scroll Up Event
			
		}
		
		// Content Height
		//var outputJS = document.getElementById( "output" );
			//outputJS.innerHTML = "curPOS: "+ curPos +" ContentHeight: "+ ((contentElem.clientHeight-415)*(-1));
		
		if( curPos < 10 && curPos >= ((contentElem.clientHeight-415)*(-1)) )
			contentElem.style.top = curPos + "px";
		
		if( ((contentElem.clientHeight-415)*(-1)) > curPos )
		curPos = ((contentElem.clientHeight-415)*(-1));
		
		if( curPos > 10 )
		curPos = 10;
	}
	
	function wheel( event )
	{
		var delta = 0;
		if( !event ) /* For IE. */
			event = window.event;
		if( event.wheelDelta )
		{ /* IE/Opera. */
			delta = event.wheelDelta/120;
			/** In Opera 9, delta differs in sign as compared to IE.
			 */
			if (window.opera)
				delta = -delta;
		}
		else if( event.detail )
		{
			/** Mozilla case. */
			/** In Mozilla, sign of delta is different than in IE.
			    * Also, delta is multiple of 3.
			*/
				delta = -event.detail/3;
		}
			/** If delta is nonzero, handle it.
			 * Basically, delta is now positive if wheel was scrolled up,
			 * and negative, if wheel was scrolled down.
			 */
			if( delta )
				handle( delta );
			/** Prevent default actions caused by mouse wheel.
			 * That might be ugly, but we handle scrolls somehow
			 * anyway, so don't bother here..
			 */
			if (event.preventDefault)
				event.preventDefault();
		event.returnValue = false;
	}
	
	if( window.addEventListener )
		/** DOMMouseScroll is for mozilla. */
		window.addEventListener('DOMMouseScroll', wheel, false);
	/** IE/Opera. */
	window.onmousewheel = document.onmousewheel = wheel;

//
// END
////////////////////////////////////////////////////////////////////////////////
