/****************************************************************************/

var speed = 8
var crossobj = document.getElementById("innerMain");
var contentheight = crossobj.offsetHeight
var maskOut = 460

function movedown(){
    if(parseInt(crossobj.style.top) >= (contentheight*(-1)+maskOut))
    crossobj.style.top = parseInt(crossobj.style.top)-speed+"px"
    movedownvar = setTimeout("movedown()",20)
}

function moveup(){
    if(parseInt(crossobj.style.top) <= 0)
    crossobj.style.top = parseInt(crossobj.style.top)+speed+"px"
    moveupvar = setTimeout("moveup()",20)
}

function getcontent_height(){
    contentheight = crossobj.offsetHeight
}


/****************************************************************************/
function handle(delta) {
	var s = delta + ": ";
	if (delta < 0){
		if(parseInt(crossobj.style.top) >= (contentheight*(-1)+maskOut))
                crossobj.style.top = parseInt(crossobj.style.top)+((speed*2)*delta)+"px"
        }else{
		if(parseInt(crossobj.style.top) <= 0)
                crossobj.style.top = parseInt(crossobj.style.top)+((speed*2)*delta)+"px"
        }
}

function wheel(event){
	var delta = 0;
	if (!event) event = window.event;
	if (event.wheelDelta) {
		delta = event.wheelDelta/120; 
		if (window.opera) delta = -delta;
	} else if (event.detail) {
		delta = -event.detail/3;
	}
	if (delta)
		handle(delta);
}

/* Initialization code. */
if (window.addEventListener)
	window.addEventListener('DOMMouseScroll', wheel, false);
window.onmousewheel = document.onmousewheel = wheel;
