function findPositionWithScrolling( oElement ) {
  function getNextAncestor( oElement ) {
    var actualStyle;
    if( window.getComputedStyle ) {
      actualStyle = getComputedStyle(oElement,null).position;
    } else if( oElement.currentStyle ) {
      actualStyle = oElement.currentStyle.position;
    } else {
      //fallback for browsers with low support - only reliable for inline styles
      actualStyle = oElement.style.position;
    }
    if( actualStyle == 'absolute' || actualStyle == 'fixed' ) {
      //the offsetParent of a fixed position element is null so it will stop
      return oElement.offsetParent;
    }
    return oElement.parentNode;
  }
  if( typeof( oElement.offsetParent ) != 'undefined' ) {
    var originalElement = oElement;
    for( var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent ) {
      posX += oElement.offsetLeft;
      posY += oElement.offsetTop;
    }
    if( !originalElement.parentNode || !originalElement.style || typeof( originalElement.scrollTop ) == 'undefined' ) {
      //older browsers cannot check element scrolling
      return [ posX, posY ];
    }
    oElement = getNextAncestor(originalElement);
    while( oElement && oElement != document.body && oElement != document.documentElement ) {
      posX -= oElement.scrollLeft;
      posY -= oElement.scrollTop;
      oElement = getNextAncestor(oElement);
    }
    return [ posX, posY ];
  } else {
    return [ oElement.x, oElement.y ];
  }
}		
function menuSet(menuObject,mouseType,first_item,last_item){
	if( (last_item == true) && (first_item  == true) ){
	}else if(last_item == true){
		if(mouseType=="over"){
			background_str = "url('/img/menu_eind_over.jpg')";
		}else{
			background_str = "url('/img/menu_eind.jpg')";
		}
		backgroundPos_str = "right";
	}else if(first_item == true){
		if(mouseType=="over"){
			background_str = "url('/img/menu_start_over.jpg')";
		}else{
			background_str = "url('/img/menu_start.jpg')";
		}				
		backgroundPos_str = "left";
	}else{
		if(mouseType=="over"){
			background_str = "url('/img/menu_midden_over.jpg')";
		}else{
			background_str = "url('/img/menu_midden.jpg')";
		}				
		backgroundPos_str = "left";
	}				
	menuObject.style.backgroundImage=background_str;
	menuObject.style.backgroundPosition = backgroundPos_str;		
	
	if(mouseType=="over"){
		menuObject.childNodes[2].style.display = "block";
	}else{
		menuObject.childNodes[2].style.display = "none";
	}
	submenuPos = findPositionWithScrolling(menuObject.parentNode);
	menuObject.childNodes[2].style.left = submenuPos[0]+"px";
	menuObject.childNodes[2].style.top = 34+submenuPos[1]+"px";				
}
