function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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];}
}

function InArray(arr, key) {
 	for ( var i=0; i < arr.length; i++ ) {
 		if ( arr[i] == key ) {
 			return true;
    }
 	}
 	return false;
}

function selectImage() {
  <!--
  //This is the script to take querystrings from the URL and convert them into
  //a Javascript array. "?search=whatever" becomes querystring["search"] 
  
  //this loads the portion of the url containing the querystring, and also
  //decodes any special character codes  
  var que = unescape(location.search);
  
  //remove the ? from the beginning of the string
  var que = que.substring(1, que.length);
  
  //detects multiple values and splits them into an array que[0], que[1] etc...
  var que = que.split("&");
  
  // creates the querystring array
  var queryString = new Array();
  
  //(for some strange reason the "for/next" loop wasn't working)
  var loop = 0;
  
  //This loop takes each value in the que array then seperates the "names" 
  //from the "values" by splitting it into "inter" arrays. the name becomes
  // "inter3" and the value becomes "inter2". querystring then loads the "inter2" 
  //value into a slot called "inter3"
  while ( loop < que.length ) {
   var inter = que[loop].split( "=" );
   var inter2 = inter[1];
   var inter3 = inter[0]
   que[loop] = inter2;
   queryString[inter3] = inter2
   loop = loop + 1;
  };
  //(C) Samuel Loy
  
  var imageUrl = '';
  var imagePath = 'fileadmin/templates/logica/main/images/content/';
  
  var pageIds = new Array();
  pageIds[1] = new Array( 30, 30 );
  pageIds[2] = new Array( 80, 80 );
  pageIds[3] = new Array( 81, 81, 82, 83 );
  pageIds[4] = new Array( 84, 84 );
  pageIds[5] = new Array( 86, 86, 88, 89 );
  pageIds[6] = new Array( 90, 90, 91 );
   
  if ( InArray( pageIds[1], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_over_ons.jpg)';
  }
  else if ( InArray( pageIds[2], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_uw_verblijf.jpg)';
  }
  else if ( InArray( pageIds[3], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_tarieven.jpg)';
  }
  else if ( InArray( pageIds[4], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_reserveren.jpg)';
  }
  else if ( InArray( pageIds[5], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_contact.jpg)';
  }
  else if ( InArray( pageIds[6], queryString["id"] ) ) {
    imageUrl = 'url(' + imagePath + 'content_header_photo_route.jpg)';
  }
  else {
    imageUrl = 'url(' + imagePath + 'content_header_photo_over_ons.jpg)';
  }
  
  if ( document.getElementById("content_header") ) {
    document.getElementById("content_header").style.backgroundImage = imageUrl;
  }
  // --!>
}