var tempX = 0;
var tempY = 0;
var scrollActivate = true;
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)

function updateMenuPosition(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft
		tempY = event.clientY + document.body.scrollTop
	} else {
		// grab the x-y pos.s if browser is NS
		tempX = e.pageX
		tempY = e.pageY
	}
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	if(scrollActivate){
		var menu = document.getElementById('scrollMenu');
		//menu.style.top= tempY-menu.clientHeight/2;
		// menu.style.top= tempY;
		var posY = (tempY-menu.clientHeight/2);
		menu.style.paddingTop = posY+"px";
	}
}
function activateScroll(){
	scrollActivate = true;
}
function desactivateScroll(){
	scrollActivate = false;
}
function initScroll(){
	var menu = document.getElementById('scrollMenu');
//	var main = document.getElementById('main');
	menu.setAttribute('style', "position:absolute; display:block; z-index: 3;; width:190px;");
	
	/*main.onmouseover = desactivateScroll;
	main.onmouseout = activateScroll;*/
	menu.onmouseover = desactivateScroll;
	menu.onmouseout = activateScroll;
	
	document.onmousemove = updateMenuPosition;
}
window.onload = initScroll;
