function toggleLayer(whichLayer)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}
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 MM_changeProp(objName,x,theProp,theValue) { //v3.0
	var obj = MM_findObj(objName);
	if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
	}
function Closewin(){
//alert ("blaat");
parent.close();
}			
function PrintVersion() { //v4.0
	theSelect=document.getElementById("ReturnToNormal");
	if (theSelect != undefined) {
		theSelect.style.display = "block";
	}
	theSelect=document.getElementById("TopPane");
	if (theSelect != undefined) {
		theSelect.style.display = "none";
	}
	theSelect=document.getElementById("leftcolumn");
	if (theSelect != undefined) {
		theSelect.style.display = "none";
	}
	theSelect=document.getElementById("rightcolumn");
	if (theSelect != undefined) {
		theSelect.style.display = "none";
	}
} 
function returnToNormal() { //v4.0
	theSelect=document.getElementById("ReturnToNormal");
	if (theSelect != undefined) {
		theSelect.style.display = "none";
	}
	theSelect=document.getElementById("TopPane");
	if (theSelect != undefined) {
		theSelect.style.display = "block";
	}
	theSelect=document.getElementById("leftcolumn");
	if (theSelect != undefined) {
		theSelect.style.display = "block";
	}				
	theSelect=document.getElementById("rightcolumn");
	if (theSelect != undefined) {
		theSelect.style.display = "block";
	}
} 
/* Kalender popup*/
var popUp;

function OpenCalendar(idname, postBack)
{
		//theValue=document.getElementById(idname);
		//if (theValue == undefined) {
		//}
		//alert(idname);
		//alert(theValue.Value);
		popUp = window.open('Controls/Calendar.aspx?history=false&formname=' + document.forms[0].name + '&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 'popupcal', 'width=310,height=380,left=200,top=250');
}

function BlaBla()
{
		alert('blabla');
}

function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	if (postBack)
		__doPostBack(id,'');
}

function HelpPopUp (URL)
{   
    window.open(URL, 'Helpme', 'toolbar=0,scrollbars=1,directories=0,location=0,statusbar=0,menubar=0,resizable=1,status=1,width=500,height=400,left = 200,top = 200');
}

function HowtoPopUp (URL)
{   
    window.open(URL, 'Howtooo', 'toolbar=0,scrollbars=1,directories=0,location=0,statusbar=0,menubar=0,resizable=1,status=1,width=806,height=570,left=0,top=0');
}
function HowtoMoviePopUp (URL)
{   
    window.open(URL, 'HowtoMoviePopUp', 'toolbar=0,scrollbars=0,directories=0,location=0,statusbar=0,menubar=0,resizable=0,status=0,width=790,height=550,left=100,top=100');
}
//
// Section added to resolve the Eolas Patent isue, this section will generate the tags in html that embed Flash or Shockwave;
function PGAddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function PGGenerate(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function PGEmbedFlash(){
  var ret = 
    PGGetArguments
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  PGGenerate(ret.objAttrs, ret.params, ret.embedAttrs);
}

function PGEmbedShockwave(){
  var ret = 
    PGGetArguments
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  PGGenerate(ret.objAttrs, ret.params, ret.embedAttrs);
}

function PGGetArguments(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = PGAddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

function addEventHandler(node, type, f) {
 if(node.addEventListener) {
   node.addEventListener(type, f, false);
 }else if (node.attachEvent) {
  node.attachEvent("on" + type, f);
 }else{
  node["on" + type] = f;
 }
}
// function to get elements by classname, for now this only works with elements with a single class. someday this will change but i wouldnt hold my breath till that day...
function getElementByClass(tag, name) {
 var elemements = document.getElementsByTagName(tag);
 var rightElements = [];
 var len = elemements.length;
 for(var i = 0 ; i < len ; i++ ){
  if(elemements[i].className == name) {
   rightElements[rightElements.length] = elemements[i]; 
  }
 }
 return rightElements;
}


/* font resizer
// --------------------------------------------------------------------
// Javascript Magnifier v 0.97
// Written by Dino Termini - termini@email.it - May 9, 2003
// This script is freeware (GPL) but if you use it, please let me know!
//
// Portions of code by zoomIN, zoomOUT
// Author: Nguyen Duong Minh (Obie) - obie4web@yahoo.com
// WWW: http://ObieWebsite.SourceForge.net
// License: GNU (GPL)
//
// Portions of code by Webreference Javascript Cookie Functions
// Jupirmedia Corporation
// http://www.internet.com
// --------------------------------------------------------------------
//
// Please refer to DEMO.htm file for details and usage
//
// --------------------------------------------------------------------

// Configuration parameters
// ------------------------
// Measure unit in pixel (px) or points (pt)
// measureUnit = "pt"
measureUnit = "px"

// Minimum size allowed for SIZE attribute (like in <FONT SIZE="1"> )
minSize = 1;

// Minimum size allowed for STYLE attribute (like in <FONT STYLE="font-size: 10px"> )
minStyleSize = 10;

// Maximum size allowed for SIZE attribute
maxSize = 6;

// Maximum size allowed for STYLE attribute
maxStyleSize = 30;

// Start size for tags with no SIZE attribute defined
startSize = 1;

// Start size for tags with no font-size STYLE or CLASS attribute defined
startStyleSize = 10;

// Increasing and decreasing step
stepSize = 1;

// Increasing step for STYLE definition (measure previously declared will be used)
stepStyleSize = 2;

// To set your own hotkeys, use key generator tool page included
// Keys to zooming in (with and without CAPS lock). Default: "+"
var keyin = 61;
var keyinCAPS = 43;

// Keys to zooming out (with and without CAPS lock). Default: "-"
var keyout = 45;
var keyoutCAPS = 95;

// Keys for "hard" zooming in (with and without CAPS lock). Default: 46 ">"
var keyinIe = 461111;
var keyinIeCAPS = 62;

// Keys for "hard" zooming out (with and without CAPS lock). Default: 44 "<"
var keyoutIe = 441111;
var keyoutIeCAPS = 60;

// "Hard" zoom factor
var zoomFactor = 1.1;

// Max zoom allowed
var maxZoom = 4.096;

// Min zoom allowed
var minZoom = 0.625;

// Initial decrease zoom
var startDecZoom = 0.7;

// Initial increase zoom
var startIncZoom = 1.1;

// Cookie expiry (default one year, actually 365 days)
// 365 days in a year
// 24 hours in a day
// 60 minutes in an hour
// 60 seconds in a minute
// 1000 milliseconds in a second
userExpiry = 365 * 24 * 60 * 60 * 1000;

// Enable or disable alert messages
alertEnabled = true;

// Allow input fields resize (text, buttons, and so on)
allowInputResize = false;

// End of configuration parameters. Please do not edit below this line
// --------------------------------------------------------------------------------

// Input values:
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  // Check whether cookies enabled
  document.cookie = "Enabled=true";
  var cookieValid = document.cookie;

  // if retrieving the VALUE we just set actually works
  // then we know cookies enabled
  if (cookieValid.indexOf("Enabled=true") != -1) {
    var curCookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");

    document.cookie = curCookie;
    return(true);
  }
  else {
    return(false);
  }
}

// Input value:
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// Input values:
// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// Input value:
// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function searchTags(childTree, level) {
  var retArray = new Array();
  var tmpArray = new Array();
  var j = 0;
  var childName = "";
  for (var i=0; i<childTree.length; i++) {
    childName = childTree[i].nodeName;
    if (childTree[i].hasChildNodes()) {
      if ((childTree[i].childNodes.length == 1) && (childTree[i].childNodes[0].nodeName == "#text"))
        retArray[j++] = childTree[i];
      else {
        tmpArray = searchTags(childTree[i].childNodes, level+1);
        for (var k=0;k<tmpArray.length; k++)
          retArray[j++] = tmpArray[k];
        retArray[j++] = childTree[i];
      }
    }
    else
      retArray[j++] = childTree[i];
  }
  return(retArray);
}

function changeFontSize(stepSize, stepStyleSize, useCookie) {

  if (document.body) {
    var myObj = searchTags(document.body.childNodes, 0);
    var myCookieSize = parseInt(getCookie("incrSize"));
    var myCookieStyleSize = parseInt(getCookie("incrStyleSize"));
    var myStepSize = stepSize;
    var myStepStyleSize = stepStyleSize;

    var now = new Date();

    // Fix the bug in Navigator 2.0, Macintosh
    fixDate(now);

    if (isNaN(myCookieSize)) myCookieSize = 0;
    if (isNaN(myCookieStyleSize)) myCookieStyleSize = 0;

    // For debug purpose only
    // if (!confirm("COOKIE: SIZE ["+myCookieSize+"] STYLESIZE ["+myCookieStyleSize+"]")) return(0);

    // Check valid increment/decrement sizes or useCookie parameter
    if (useCookie) {
      myStepSize = myCookieSize;
      myStepStyleSize = myCookieStyleSize;
    }

    now.setTime(now.getTime() + userExpiry);

    myObjNumChilds = myObj.length;
    for (i=0; i<myObjNumChilds; i++) {
      myObjName = myObj[i].nodeName;

      // Only some tags will be parsed
      if (myObjName != "#text" && myObjName != "HTML" &&
          myObjName != "HEAD" && myObjName != "TITLE" &&
          myObjName != "STYLE" && myObjName != "SCRIPT" &&
          myObjName != "BR" && myObjName != "TBODY" &&
          myObjName != "#comment" && myObjName != "FORM") {

        // Skip INPUT fields, if required
        if (!allowInputResize && myObjName == "INPUT") continue;

        size = parseInt(myObj[i].getAttribute("size"));

        // Internet Explorer uses a different DOM implementation
        if (myObj[i].currentStyle)
          styleSize = parseInt(myObj[i].currentStyle.fontSize);
        else 
          styleSize = parseInt(window.getComputedStyle(myObj[i], null).fontSize);

        // For debug purpose only. Note: can be very annoying
        // if (!confirm("TAG ["+myObjName+"] SIZE ["+size+"] STYLESIZE ["+styleSize+"]")) return(0);

        if (isNaN(size) || (size < minSize) || (size > maxSize))
          size = startSize;

        if (isNaN(styleSize) || (styleSize < minStyleSize) || (styleSize > maxStyleSize))
          styleSize = startStyleSize;

        if ( ((size > minSize) && (size < maxSize)) || 
             ((size == minSize) && (stepSize > 0)) || 
             ((size == maxSize) && (stepSize < 0)) || useCookie) {
          myObj[i].setAttribute("size", size+myStepSize);
        }

        if ( ((styleSize > minStyleSize) && (styleSize < maxStyleSize)) || 
             ((styleSize == minStyleSize) && (stepStyleSize > 0)) ||
             ((styleSize == maxStyleSize) && (stepStyleSize < 0)) || useCookie) {
          newStyleSize = styleSize+myStepStyleSize;
          myObj[i].style.fontSize = newStyleSize+measureUnit;
        }
      } // End if condition ("only some tags")
    } // End main for cycle

    // Set the cookies
    if (!useCookie) {
      cookieIsSet = setCookie("incrSize", myStepSize+myCookieSize, now);
      cookieIsSet = setCookie("incrStyleSize", myStepStyleSize+myCookieStyleSize, now);
      if (alertEnabled && !cookieIsSet) {
        alert("Uw browser ondersteund geen cookies.");
      }
    }

  } // End if condition ("document.body exists")
} // End function declaration



function increaseFontSize() {
  if (document.body) {
    changeFontSize(stepSize, stepStyleSize, false);
  }
  else {
    if (alertEnabled) {
      alert("Uw browser ondersteund deze functie niet.");
    }
  }
}

function decreaseFontSize() {
  if (document.body) {
    myStepSize = -stepSize;
    myStepStyleSize = -stepStyleSize;
    changeFontSize(myStepSize, myStepStyleSize, false);
  }
  else {
    if (alertEnabled) {
      alert("Uw browser ondersteund deze functie niet.");
    }
  }
}

function zoomin() {
  if (window.parent.document.body.style.zoom < maxZoom) {
    if (window.parent.document.body.style.zoom > 0) {
      window.parent.document.body.style.zoom *= zoomFactor; 
    }
    else { 
      window.parent.document.body.style.zoom = startIncZoom;
    }
  }
  else {
    if (alertEnabled) {
      alert("Maximale Zoomlevel bereikt");
    }
  }
}

function zoomout() {
  if ( (window.parent.document.body.style.zoom > minZoom) ||
       (window.parent.document.body.style.zoom == 0) ) {
    if (window.parent.document.body.style.zoom > 0) {
      window.parent.document.body.style.zoom /= zoomFactor; 
    }
    else {
      window.parent.document.body.style.zoom = startDecZoom;
    }
  }
  else {
    if (alertEnabled) {
      alert("Minimale Zoomlevel bereikt");
    }
  }
}

function checkzoom(e) {

  if (document.all) {
    myEvent = event.keyCode;
  }
  else {
    myEvent = e.which;
  }

  switch(myEvent) {
  
    case keyinIe:
    case keyinIeCAPS:
      zoomin();
      break;

    case keyoutIe:
    case keyoutIeCAPS:
      zoomout();
      break;

    case keyin:
    case keyinCAPS:
      increaseFontSize();
      break;

    case keyout:
    case keyoutCAPS:
      decreaseFontSize();
      break;

    default:
      break;
  }
}

if (document.layers) {
  document.captureEvents(Event.KEYPRESS);
}

document.onkeypress = checkzoom;
*/
