window.LightboxOptions = {
    fileLoadingImage:        '/sites/lightbox/images/loading.gif',     
    fileBottomNavCloseImage: '/sites/lightbox/images/closelabel.gif',

    overlayOpacity: 0.8,   // controls transparency of shadow overlay

    animate: true,         // toggles resizing animations
    resizeSpeed: 8,        // controls the speed of the image resizing animations (1=slowest and 10=fastest)

    borderSize: 10,         //if you adjust the padding in the CSS, you will need to update this variable

	// When grouping images this is used to write: Image # of #.
	// Change it for non-english localization
	labelImage: "Foto",
	labelOf: "van"
};

function addEvent(el, evType, handle){
    if(el.addEventListener)el.addEventListener(evType, handle, false);
    else if(el.attachEvent){
        el["e" + evType + handle] = handle;
        el[evType + handle] = function(){el["e" + evType + handle](window.event)}

        el.attachEvent("on" + evType, el[evType + handle]);
    }
}

function removeEvent(el,evType,handle){
    if(el.removeEventListener)el.removeEventListener(evType, handle, false);
    else if(el.detachEvent){
        el.detachEvent("on" + evType, el[evType + handle])
        el[evType + handle] = null
        el["e" + evType + handle] = null;
    }
} 

addEvent(window, 'load', onLoad);

function onLoad() {
  if (headers.length > 1) {
    headerphoto = document.getElementById("headerphoto");
    setInterval(animateheader, 10000);
  }
}

var headerindex = 0;
var headerphoto = null;

function animateheader() {
  if (headerphoto != null) {
    headerindex++;
    if (headerindex >= headers.length) headerindex = 0;
    headerphoto.src = headers[headerindex].replace(/&amp;/g, '&');
  }
}

function fullscreenmap() {
  if (canvas) {
    var l = canvas.parentNode.getElementsByTagName("P")[0].getElementsByTagName("A")[0];
    if (canvas.parentNode.style.position != 'absolute') {
      canvas.parentNode.style.position = 'absolute';
      canvas.parentNode.style.left = '0px';
      canvas.parentNode.style.top = '19px';
      canvas.style.width = '960px';
      canvas.style.height = '600px';
      l.innerHTML = "Kleiner scherm";
    } else {
      canvas.parentNode.style.position = '';
      canvas.style.width = '';
      canvas.style.height = '';
      l.innerHTML = "Groter scherm";
    }
    google.maps.event.trigger(map, 'resize');
    //map.checkResize();
  }
}

function getPageSize(){
  var xScroll, yScroll;

  if (window.innerHeight && window.scrollMaxY) {	
    xScroll = document.body.scrollWidth;
    yScroll = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
  } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
  }

  var windowWidth, windowHeight;
  if (self.innerHeight) {	// all except Explorer
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
  }	

  // for small pages with total height less then height of the viewport
  if(yScroll < windowHeight){
    pageHeight = windowHeight;
  } else { 
    pageHeight = yScroll;
  }

  // for small pages with total width less then width of the viewport
  if(xScroll < windowWidth){	
    pageWidth = windowWidth;
  } else {
    pageWidth = xScroll;
  }
  arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
  return arrayPageSize;
}
