sfHover = function() {
	if (!document.getElementById("hoofdmenu")) {return false;}
	var sfEls = document.getElementById("hoofdmenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function addToKruimelpad(txt,url)
	{
	mya=document.createElement("A");
	mya.setAttribute("href",url);
	mya.setAttribute("class",'last');
	myTxt=document.createTextNode(txt);
	mya.appendChild(myTxt);
	if (document.getElementById("kruimelpad")) {document.getElementById("kruimelpad").appendChild(mya);}
	}
		
function tellafriend()
	{
	document.location="/tell-a-friend?l="+String(window.location);
	}
	
function setTextSize(txtsz)
	{
	var today = new Date();
	var expire = new Date();
	expire.setTime(today.getTime() + 3600000*24*90);
	document.cookie = "txtsize="+escape(txtsz) + ";expires="+expire.toGMTString()+";path=/";
	document.getElementById("typo").href="/typo.php?"+expire.toString();
	}

//zoeken
function search()
	{
	s=document.getElementById("searchbox");
	if (s)
		{
		if (s.value=="") {alert("Geef a.u.b. een zoekterm op");}
		else
			{
			f=document.getElementById("searchform");
			f.submit();
			}
		}
	
	}

//popups

PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;


var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage (imageURL, caption) {

if (caption=="NL") {caption="Uitvergroting";}
if (caption=="EN") {caption="Large image";}


  var windowTop = 100;                // Top position of popup
  var windowLeft = 100                // Left position of popup
  var defaultWidth = 730;             // Default width (for browsers that cannot resize)
  var defaultHeight = 532;            // Default height (for browsers that cannot resize)
  var onLoseFocusExit = true;         // Set if window to exit when it loses focus
  var undefined;

  // Set up the window open options
  var Options = "width=" + defaultWidth + ",height=" + defaultHeight + ",top=" + windowTop + ",left=" + windowLeft + ",resizable"
  
  // Now write the HTML markup to the new window, ensuring that we insert the 
  // parameter URL of the image and the parameter description of the image in 
  // the right place.
  var myScript = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" +
    "<html>\n" + 
    "<head>\n" + 
    "<title>" + caption + "\</title>\n" +
    "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n" +
    "<meta http-equiv=\"Content-Language\" content=\"en-gb\">\n" +
    "<script language=\"JavaScript\" type=\"text/javascript\">\n" +
    "function resizewindow () {\n" +
    "  var width = document.myimage.width;\n" + 
    "  var height = document.myimage.height;\n";
  
  // Netscape  
  if (navigator.appName.indexOf("Netscape") != -1) {  
    myScript = myScript +  "  window.innerHeight = height;\n  window.innerWidth = width;\n"
  }
   
  // Opera 
  else if (navigator.appName.indexOf("Opera") != -1) {
    myScript = myScript +  "  window.resizeTo (width+12, height+31);\n"
  }
  
  // Microsoft 
  else if (navigator.appName.indexOf("Microsoft") != -1) { 
    myScript = myScript + "  window.resizeTo (width+12, height+31);\n" 
  }
  
  // Assume a frig factor for any other browsers
  else {
    myScript = myScript + "  window.resizeTo (width+14, height+34);\n"
  }
      
  myScript = myScript + "}\n" + "window.onload = resizewindow;\n" +
    "</script>\n</head>\n" + "<body ";
    
  // If the window is required to close when it loses focus.
  if (onLoseFocusExit) {myScript = myScript + "onblur=\"self.close()\" ";}
    
  myScript = myScript + "style=\"margin: 0px; padding: 0px;\">\n" +
    "<a href='javascript:window.close();'><img src=\"" + imageURL + "\" alt=\"" + caption + "\" title=\"" + caption + "\" name=\"myimage\" border='0'></a>\n" + 
    "</body>\n" +  "</html>\n";
        
  // Diagnostic - uncomment the next line if you wish to see the script generated.   
  //alert (myScript);
  
  // Create the popup window
  var imageWindow = window.open ("","imageWin",Options);
  imageWindow.document.write (myScript)
  imageWindow.document.close ();
  if (window.focus) imageWindow.focus();
  return false;
}

//Form checks
function MM_validateFormEN() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormNL.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);hr=args[i+1];o=val;

   // if (String(val.type)=="undefined") {val=getElementsByTagName(val);}
    if (val) { nm=val.name;T=val.type;

    if(val.length>0 && val[0].type=="radio") {T="radio";}

if ((val=val.value)!="" && T!="checkbox" && T!="radio") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+URLDecode(hr)+' must contain a valid e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+URLDecode(hr)+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+URLDecode(hr)+'must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') 
	{
	
	if (T=="checkbox" && o.checked==false) {errors += '- '+URLDecode(hr)+' is required\n'; }
	if (T=="radio" && getCheckedValue(o)==false) {errors += '- '+URLDecode(hr)+' is required\n'; }
	if (T!="checkbox" && T!="radio")
		{errors += '- '+URLDecode(hr)+' is required\n'; }
	}
}
  } if (errors) alert('The following information is incorrect:\n'+errors);

  document.MM_returnValue = (errors == '');
}

function MM_validateFormNL() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormNL.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);hr=args[i+1];o=val;

   // if (String(val.type)=="undefined") {val=getElementsByTagName(val);}
    if (val) { nm=val.name;T=val.type;

    if(val.length>0 && val[0].type=="radio") {T="radio";}

if ((val=val.value)!="" && T!="checkbox" && T!="radio") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+URLDecode(hr)+' moet een geldig e-mail adres bevatten.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+URLDecode(hr)+' moet een nummer bevatten.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+URLDecode(hr)+' moet een nummer tussen '+min+' en '+max+' bevatten.\n';
    } } } else if (test.charAt(0) == 'R') 
	{
	
	if (T=="checkbox" && o.checked==false) {errors += '- '+URLDecode(hr)+' is verplicht\n'; }
	if (T=="radio" && getCheckedValue(o)==false) {errors += '- '+URLDecode(hr)+' is verplicht!\n'; }
	if (T!="checkbox" && T!="radio")
		{errors += '- '+URLDecode(hr)+' ontbreekt\n'; }
	}
}
  } if (errors) alert('De volgende informatie is incorrect:\n'+errors);

  document.MM_returnValue = (errors == '');
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return false;
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return false;
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return false;
}
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_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 URLDecode(psEncodeString)
	{
	// Create a regular expression to search all +s in the string
	var lsRegExp = /\+/g;
	// Return the decoded string
	return unescape(String(psEncodeString).replace(lsRegExp, " "));
	}

/**
 *  author:		Timothy Groves - http://www.brandspankingnew.net
 *	version:	1.3 - 2006-11-02
 *				1.2 - 2006-11-01
 *				1.1 - 2006-09-29
 *				1.0 - 2006-09-25
 *
 *	requires:	nothing
 *
 */

var useBSNns;

if (useBSNns)
{
	if (typeof(bsn) == "undefined")
		bsn = {}
	var _bsn = bsn;
}
else
{
	var _bsn = this;
}





_bsn.Crossfader = function (divs, fadetime, delay )
{	
	this.nAct = -1;
	this.aDivs = divs;
	
	for (var i=0;i<divs.length;i++)
	{
		document.getElementById(divs[i]).style.opacity = 0;
		document.getElementById(divs[i]).style.position = "absolute";
		document.getElementById(divs[i]).style.filter = "alpha(opacity=0)";
		document.getElementById(divs[i]).style.visibility = "hidden";
	}
	
	this.nDur = fadetime;
	this.nDelay = delay;
		
	this._newfade();
}


_bsn.Crossfader.prototype._newfade = function()
{
	if (this.nID1)
		clearInterval(this.nID1);
	
	this.nOldAct = this.nAct;
	this.nAct++;
	if (!this.aDivs[this.nAct])	this.nAct = 0;
	
	if (this.nAct == this.nOldAct)
		return false;
	
	document.getElementById( this.aDivs[this.nAct] ).style.visibility = "visible";
	
	this.nInt = 50;
	this.nTime = 0;
	
	var p=this;
	this.nID2 = setInterval(function() { p._fade() }, this.nInt);
}


_bsn.Crossfader.prototype._fade = function()
{
	this.nTime += this.nInt;
	
	var ieop = Math.round( this._easeInOut(this.nTime, 0, 1, this.nDur) * 100 );
	var op = ieop / 100;
	document.getElementById( this.aDivs[this.nAct] ).style.opacity = op;
	document.getElementById( this.aDivs[this.nAct] ).style.filter = "alpha(opacity="+ieop+")";
	
	if (this.nOldAct > -1)
	{
		document.getElementById( this.aDivs[this.nOldAct] ).style.opacity = 1 - op;
		document.getElementById( this.aDivs[this.nOldAct] ).style.filter = "alpha(opacity="+(100 - ieop)+")";
	}
	
	if (this.nTime == this.nDur)
	{
		clearInterval( this.nID2 );
		
		if (this.nOldAct > -1)
			document.getElementById( this.aDivs[this.nOldAct] ).style.visibility = "hidden";	
		
		var p=this;
		this.nID1 = setInterval(function() { p._newfade() }, this.nDelay);
	}
}



_bsn.Crossfader.prototype._easeInOut = function(t,b,c,d)
{
	return c/2 * (1 - Math.cos(Math.PI*t/d)) + b;
}


shuffle = function(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};
   
  
function zzgCrossFader()
	{
	var cf = new Crossfader( shuffle(new Array('cf01','cf02','cf03','cf04','cf05','cf06','cf07','cf08','cf09','cf10')), 1500, 5000 );
	}

