<!-- Begin General
// Copyright (c) 2001 Maurice Hazenbroek. All Rights Reserved.
// Tested with IE 5.00.2920.0000
// browser version checks
// |--------------------------------|
// | isIE4 | isW3C | isIE4 && isW3C |
// |--------------------------------|
// | false | false | older browser  |
// | true  | false | IE4 only       |
// | true  | true  | IE5+           |
// | false | true  | NN6+           |
// |--------------------------------|
var txtBrowser = navigator.userAgent
var intIEVersion = parseFloat(txtBrowser.substring(txtBrowser.indexOf('MSIE')+5, txtBrowser.indexOf(';', txtBrowser.indexOf('MSIE'))))
var isIE4 = (navigator.appName.indexOf('Microsoft') > -1 && parseInt(intIEVersion) >= 4)
var isW3C = (document.documentElement) ? true : false
var isNN4 = (document.layers) ? true : false
var isOpera = (navigator.userAgent.indexOf('Opera') > -1)

newline = "\n";
nbsp = "\u00a0";

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };

// document.all simulator for NN6
if (isW3C && !isIE4) {
  Node.prototype.__defineGetter__("all", function() {
    if (document.getElementsByTagName("*").length) {
      switch (this.nodeType) {
        case 9: 
		  return document.getElementsByTagName("*")
          break
        case 1:
		  return this.getElementsByTagName("*")
		  break
		}
      }
      return ""
	}
  )
  Node.prototype.__defineSetter__("all", function() {});
}
// innerText simulator for NN6
if (isW3C && !isIE4 && HTMLElement) {
  HTMLElement.prototype.__defineSetter__("innerText", function (txt) {
    var rng = document.createRange()
    rng.selectNodeContents(this)
    rng.deleteContents()
	var newText = document.createTextNode(txt)
	this.appendChild(newText)
	return txt
    }
  )
  HTMLElement.prototype.__defineGetter__("innerText", function () {
    var rng = document.createRange()
	rng.selectNode(this)
	return rng.toString()
    }
  )
}
// outerHTML simulator for NN6
if (isW3C && !isIE4 && HTMLElement) {
  HTMLElement.prototype.__defineSetter__("outerHTML", function (html) {
    var rng = document.createRange()
    rng.selectNode(this)
    var newHTML = rng.createContextualFragment(html)
    this.parentNode.replaceChild(newHTML,this)
    return html
    }
  )
  HTMLElement.prototype.__defineGetter__("outerHTML", function() {return ''})
}
// fix NN4 bug which destroys layout and eventhandlers after resize
function MM_reloadPage(blnInit) {  
  if (blnInit) {
    if (isNN4) {
      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)

// avoid submit by disabling Enter key; usage: <BODY onKeyPress="return disableEnter(event)">
function disableEnter(nsEvent) { 
  return ((isIE4) ? event.keyCode : nsEvent.which) != 13
}
// disable backspace; usage: <BODY onKeyDown="return disableBackspace(event)">
function disableBackspace(nsEvent) { 
  return ((isIE4) ? event.keyCode : nsEvent.which) != 8
}

if (isIE4 || isW3C) {
  //document.onmouseup=disableRightClick
  //document.oncontextmenu=disableRightClick
} else {
  //document.captureEvents(Event.MOUSEDOWN)
  //document.onmousedown=disableRightClick
}
function disableRightClick(nsEvent) {
  if (isIE4) {
    return false
  } else {
    if (nsEvent.which == 2 || nsEvent.which == 3) {
      return false
    }
  }
}
//disable all anchors
function disableAnchors() {
	for (var i=0; i<document.anchors.length; i++) {				
		var obj = document.anchors[i]			
		obj.href = "javascript: void(0);";
		obj.target = "";
	}
}


//get position recursively
function getPosition(objReference) {
  var arrPosition = new Array()
  arrPosition.left = 0
  arrPosition.right = objReference.offsetWidth
  arrPosition.top = 0
  arrPosition.bottom = objReference.offsetHeight
  do {
    arrPosition.left += objReference.offsetLeft
    arrPosition.top += objReference.offsetTop
  	objReference = objReference.offsetParent
  } while (objReference.tagName != 'BODY')
  arrPosition.right += arrPosition.left
  arrPosition.bottom += arrPosition.top
  return arrPosition
}

// script om de hoogte en breedte van het contentvlak te bepalen
function setContentSize(){
	var winH = 1;
	var conW = 1;
	if (parseInt(navigator.appVersion)>3) { 
		if (navigator.appName=="Netscape") {
			winH = window.pageYOffset + window.innerHeight-184; 			
		} 
		if (navigator.appName.indexOf("Microsoft")!=-1) { 
			winH = document.body.scrollTop + (document.body.offsetHeight)-20;
			conW = (document.body.offsetWidth)-300; 
		} 
	}
	
	Footervlak = document.all["Footer"];
	Footer2vlak = document.all["Footer2"];
	Footer2vlak.style.top = Footervlak.style.top =  + winH +"px";
	Footervlak.style.width = conW + "px";
}
function openWindow(url, windowName, windowWidth, windowHeight) {
	var windowLeft = (screen.availWidth - windowWidth) / 2;
	var windowTop = (screen.availHeight - windowHeight) / 2;
	window.open(url, windowName, "toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,directories=no,location=no,width="+windowWidth+",height="+windowHeight+",left="+windowLeft+",top="+windowTop);	
}

var onLoadCalls = new Array();

function addOnLoadCall(functionRef,strDescription){
	onLoadCalls.push({func:functionRef,desc:strDescription});
	return onLoadCalls.length;
}
function triggerOnLoad(){
	for (var i=0;i<onLoadCalls.length;i++){
		try{
			onLoadCalls[i].func();
		}catch(evnt){
			alert("onLoad failed on call: " + onLoadCalls[i].desc + "\nReason: " + evnt.description)
		}
	}
	return true;
}
function copyWebPart(iFrameTag){
	var sourceDoc = iFrameTag.contentWindow.document;
	var target = document.getElementById(iFrameTag.attributes.targetid.value);
	var sourceElement = sourceDoc.getElementById("data");
	var sourceHTML = new String(sourceElement.innerHTML);
	target.innerHTML = sourceHTML;
}
// End -->
