
	// SCROLL van info menu

var minTop = 0; //px   Minimale top van het menu in de pagina
var borderh = -100; //px   Hoogte boven het menu tijdens scrollen
var floatSpeed = 0.2; // Snelheid waarmee het menu beweegd. Kleiner dan 1 !
var idMenu = "rightfloat"; // Id van de div waarin het menu staat
var floatIntervalTime = 15; 
var checkScrollTime = 100;
var floatMenuTimer = null;


function initial(){
	if( pageHeight() >= 755){	
 		setTimeout("checkScroll()",20);
	}
}

function pageHeight() 
{return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} 

function checkScroll() {
	
  var scrollY = getWindowScroll();
	if(floatMenuTimer)
	  clearInterval(floatMenuTimer)
  if(scrollY > minTop - borderh){
	  floatMenuTimer = setInterval("floatMenuTo("+(scrollY + borderh)+")", floatIntervalTime);
	}else{
	  floatMenuTimer = setInterval("floatMenuTo("+minTop+")", floatIntervalTime);
	}
  setTimeout("checkScroll()",checkScrollTime);
}

function getWindowScroll() {
  var scrollY = 0
  if( typeof( window.pageYOffset ) == 'number' ) {  //Netscape compliant
    scrollY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {  //DOM compliant
    scrollY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {//IE6 standards compliant mode
    scrollY = document.documentElement.scrollTop;
  }
  return scrollY;
}

function floatMenuTo(newPos){

	if(document.getElementById(idMenu) !== null ) {
	  var oldPos = parseInt(document.getElementById(idMenu).style.top);
		if(floatSpeed>1)
		  floatSpeed = 1
		if(newPos > oldPos)
		  document.getElementById(idMenu).style.top = parseInt((newPos - oldPos)*floatSpeed + oldPos) + "px";
		else
		  document.getElementById(idMenu).style.top = parseInt(oldPos - (oldPos - newPos)*floatSpeed) + "px";
		
		if( Math.abs(newPos-oldPos) < 1)
		  clearInterval(floatMenuTimer)
	}
}
