function checknum(val) {
 if(val.value!='') {
	if (val.value != parseInt(val.value)) {
          alert("U kunt alleen (hele) getallen invullen!");
          val.value='';
        }
 }
}


//-- BodyOnLoadFunction
function registerBodyOnloadFunction(f) {
	if (!registerBodyOnloadFunction.aFunction)
		registerBodyOnloadFunction.aFunction = [];
	registerBodyOnloadFunction.aFunction[registerBodyOnloadFunction.aFunction.length] = f;
}
function executeBodyOnloadFunctions() {
	if (registerBodyOnloadFunction.aFunction)
	{
		var i;
		for(i=0;i <  registerBodyOnloadFunction.aFunction.length;i++)
		{
			registerBodyOnloadFunction.aFunction[i]();
		}
	}
}

//-- Plannentopbar.php javascript
friends_www_accelleration = 50; // pix/sec2
friends_www_max_speed = 60; // pix/sec
friends_www_item_wait = 3; // sec
friends_www_move_wait = 0.1 // sec
friends_www_entries = null;
friends_www_nextstop = 2;
friends_www_previousstop = 1;
friends_www_starttime = null;
						

function moveFriendsWWW() {

if(document.getElementById('www_friends_scrollbox')) {

	if (friends_www_starttime == null)
	{
		friends_www_starttime = new Date().valueOf()/1000;
	}
	if (friends_www_entries == null)
	{
		friends_www_entries = [-50];
		var el;
		var i=0;
		var lastHeight = 0;
		while (el=document.getElementById('www_friends_scrollbox_child_'+i++))
		{
			friends_www_entries[friends_www_entries.length] = el.offsetTop;
			lastHeight = el.offsetHeight;
		}
		friends_www_entries[friends_www_entries.length] = friends_www_entries[friends_www_entries.length -1] + lastHeight + 50;
	}
	
	var now = new Date();
	var time = now.valueOf()/1000;
	var running_time = time - friends_www_starttime;
	var accelleration_time = friends_www_max_speed / friends_www_accelleration;
	var accelleration_distance = friends_www_max_speed *  accelleration_time /2;
	var lap_distance = friends_www_entries[friends_www_nextstop] - friends_www_entries[friends_www_previousstop];
	var lap_time = null;
	if (lap_distance > 2 * accelleration_distance) // there is some maximum speed to be reached halfwasy
	{
		lap_time = (lap_distance + 2 * accelleration_distance ) / friends_www_max_speed;
	}
	else
	{
		lap_time = Math.sqrt(lap_distance / friends_www_accelleration);
	}
	var y_position;
	var delay;
			
			
	if (running_time > lap_time)
	{
		y_position = friends_www_entries[friends_www_nextstop];
		delay = friends_www_item_wait;
		friends_www_nextstop++;
		friends_www_previousstop++;
		if (friends_www_nextstop >= friends_www_entries.length)
		{
			friends_www_nextstop = 1;
			friends_www_previousstop = 0;
			y_position = friends_www_entries[0];
			delay = 0;
		}
		friends_www_starttime = time + delay;
	}
	else
	{
		var inverse = false;
		if (running_time > lap_time /2)
		{
			inverse = true;
			running_time = lap_time - running_time;
		}
		var distance_covered = null;
		if (running_time > accelleration_time)
		{
			distance_covered = accelleration_distance+friends_www_max_speed*(running_time - accelleration_time);
		}
		else
		{
			distance_covered = friends_www_accelleration*running_time*running_time/2;
		}
		if (inverse)
		{
			distance_covered = lap_distance - distance_covered;
		}
		y_position = friends_www_entries[friends_www_previousstop] + distance_covered;
		delay = friends_www_move_wait;
	}
	document.getElementById('www_friends_scrollbox').style.top = (-y_position)+"px";
	friends_www_timeout = setTimeout(moveFriendsWWW,delay*1000);

// End if www_friends_scrollbox excists
}

}
friends_www_timeout = 0;
registerBodyOnloadFunction(function() {friends_www_timeout = setTimeout(moveFriendsWWW,friends_www_item_wait*1000);});






//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {

	//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
	//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
	showrating = false;
	showwinkelmand = false;
	iframeids = '';

	if(document.getElementById('orangeCMS_winkelmand')) {
		showwinkelmand = true; 
	}

	if(document.getElementById('orangeCMS_rating')) {
		showrating = true;
	}


	if(showrating==true && showwinkelmand==true) {
		var iframeids=["orangeCMS_rating","orangeCMS_winkelmand"];
	}

	if(showrating==true && showwinkelmand==false) {
		var iframeids=["orangeCMS_rating"];
	}
	
	if(showrating==false && showwinkelmand==true) {
		var iframeids=["orangeCMS_winkelmand"];
	}



	var dyniframe=new Array()

	for (i=0; i<iframeids.length; i++){
		if (document.getElementById)
			resizeIframe(iframeids[i])
		//reveal iframe for lower end browsers? (see var above):
		if ((document.all || document.getElementById) && iframehide=="no"){
			var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
			tempobj.style.display="block"
		}
	}
}

function resizeIframe(frameid){
	var currentfr=document.getElementById(frameid)
	if (currentfr && !window.opera){
		currentfr.style.display="block"
		if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
			currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
		else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
			currentfr.height = currentfr.Document.body.scrollHeight;

		if (currentfr.addEventListener)
			currentfr.addEventListener("load", readjustIframe, false)
		else if (currentfr.attachEvent){
			currentfr.detachEvent("onload", readjustIframe) // Bug fix line
			currentfr.attachEvent("onload", readjustIframe)
		}
	}
}


function readjustIframe(loadevt) {
	var crossevt=(window.event)? event : loadevt
	var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
	if (iframeroot)
	resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
	if (document.getElementById)
	document.getElementById(iframeid).src=url
}


if (window.addEventListener) {
	window.addEventListener("load", resizeCaller, false)
	window.addEventListener("load", executeBodyOnloadFunctions, true)
}
else if (window.attachEvent) {
	window.attachEvent("onload", resizeCaller)
	window.attachEvent("onload", executeBodyOnloadFunctions)
}
else {
	window.onload=resizeCaller();
	window.onload=executeBodyOnloadFunctions();
}








if(typeof sIFR == "function"){

	sIFR.replaceElement(named({sSelector:"#highlight h1", sFlashSrc:"f/Neuzeit.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sBgColor:"#FFFFFF", sHoverColor:"#6f5343", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"})); 
	sIFR.replaceElement(named({sSelector:".pageTitle", sFlashSrc:"f/Neuzeit.swf", sColor:"#516489", sLinkColor:"#516489", sBgColor:"#FFFFFF", sHoverColor:"#cd821c", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"})); 
	sIFR.replaceElement(named({sSelector:"#publishedcontent h1, #publishedcontent h2, #publishedcontent h3, #publishedcontent h4, #publishedcontent h5", sFlashSrc:"f/Neuzeit.swf", sColor:"#516489", sLinkColor:"#516489", sBgColor:"#FFFFFF", sHoverColor:"#cd821c", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"#rightSide h1", sFlashSrc:"f/Neuzeit.swf", sColor:"#4d4545", sLinkColor:"#4d4545", sBgColor:"#FFFFFF", sHoverColor:"#cd821c", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:"#headerLogo", sFlashSrc:"f/Neuzeit.swf", sColor:"#4d4545", sLinkColor:"#4d4545", sBgColor:"#FFFFFF", sHoverColor:"#cd821c", nPaddingTop:0, nPaddingBottom:0, sWmode:"transparent"}));
	

	/* , sFlashVars:"textalign=center&offsetTop=6" */

};


/* OrangePage Navigation */
function navigate(pageNumber,totalPages) {
	for(i=1; i<=totalPages; i=i+1) {
		if(i!=pageNumber) {
			document.getElementById('orangecmsPage'+i).style.display='none';
			document.getElementById('orangecmsNav'+i).className='navigate notactive';
		} else {
			document.getElementById('orangecmsPage'+i).style.display='block';
			document.getElementById('orangecmsNav'+i).className='navigate active';
		}
	}
}



function popupimage(lokatie,titel)
{
  HTML = "<html><title>"+ titel +"</title><style>body{margin:0px 0px 0px 0px}</style><body><img src='"+ lokatie +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+30)'></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

