//ADDLOADEVENT

	function addLoadEvent(func) {
	  var oldonload = window.onload;
	  if (typeof window.onload != 'function') {
	    window.onload = func;
	  } else {
	    window.onload = function() {
	      if (oldonload) {
	        oldonload();
	      }
	      func();
	    }
	  }
	}

//END ADDLOADEVENT


//UPDATE PANEL

function init()
{
	if (window.XMLHttpRequest) {

		if(window.ActiveXObject) 
		{
			return new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			return new XMLHttpRequest();
		}
	}
	else if (window.ActiveXObject)
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function updatePanel(queryString, Panel)
{
		//Panel.innerHTML = '<div style="text-align: center;"><!--<br /><img src="/media/arrows/33-1.gif" /><br /><br />-->Loading data...<br /><br /></div>';

//		var callFunction = "updatePanelTimer('" + queryString + "', 'document.getElementById(\"" + Panel.id + "\")')"
//		setTimeout(""+callFunction+"", 100);

		var xmlHttp=new init();
		xmlHttp.open("GET", queryString, true);
		xmlHttp.onreadystatechange=function()
		{
			if (xmlHttp.readyState==4)
			{
				var resptxt = xmlHttp.responseText;
				Panel.innerHTML = resptxt;
			}
		}
		xmlHttp.setRequestHeader('Content-Type', 'text/xml');
		xmlHttp.setRequestHeader('CharSet', 'iso-8859-1');
		xmlHttp.send(null);

}

function updateSelectPanel(queryString, Panel)
{
		Panel.disabled=true;
		var loadingOption = document.createElement('option');

		var xmlHttp=new init();
		xmlHttp.open("GET", queryString, true);
		xmlHttp.onreadystatechange=function()
		{
			if (xmlHttp.readyState==4)
			{
				var resptxt = xmlHttp.responseText;

				if(resptxt.split("###").length!=1){

				var resultString = resptxt.split("###")[1];
				var keywordsList = Panel;
				var oldSelected = new Array();

				for (var i = 0; i < keywordsList.options.length; i++)
				{
					if (keywordsList.options[i].selected) oldSelected.push(keywordsList.options[i].value);
				}
				var elOptions = resultString.split("||");
				Panel.length=0;

				for(var elOption=0; elOption < elOptions.length-1; elOption++)
				{
					var newOption = document.createElement('option');
					newOption.value=elOptions[elOption].split("|")[0];
					newOption.text=elOptions[elOption].split("|")[1];

					for(sel=0; sel < oldSelected.length; sel++)
					{
						if(parseInt(oldSelected[sel])==parseInt(newOption.value))
						{
							newOption.selected=true;
						}
					}
					Panel.options.add(newOption, elOption);
				}
				Panel.disabled=false;

				keywordslistChange(Panel);

				} 
				else 
				{
					Panel.length=0;
					Panel.disabled=true;
				}
			}
		}
		xmlHttp.setRequestHeader('Content-Type','text/xml') 
		xmlHttp.send(null);

}

function updatePanelTimer(queryString, Panel)
{

		Panel = eval(Panel);

		var xmlHttp=new init();

		xmlHttp.open("GET", queryString, true);
		xmlHttp.onreadystatechange=function()
		{
			if (xmlHttp.readyState==4)
			{
				var resptxt = xmlHttp.responseText;
				Panel.innerHTML = resptxt;
			}
		}
		xmlHttp.setRequestHeader('Content-Type','text/xml') 
		xmlHttp.send(null);

}


// END UPDATE PANEL




// MAGNIFY


var currentImage = "";
var oldScrollTop;

window.onresize = (function()
{

try
{
	eval(currentImage);
} catch(ex) {}

});

function windowHeight() {

try
{
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return myHeight;

} catch(ex) {}

}

function windowWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
 return myWidth;
}


addLoadEvent(function() 
{

try
{

var contentCol = document.getElementById("Content_Inner");
var contentImages = contentCol.getElementsByTagName("IMG");

for(var x=0; x < contentImages.length; x++)
{
	
var doMagnify = 1;
var imageURL = contentImages[x].src;
imageURL = imageURL.toLowerCase();

	if(imageURL.indexOf("/media/icons")!=-1)
	{
		doMagnify=0;
	}
	if(imageURL.indexOf("/media/layout")!=-1)
	{
		doMagnify=0;
	}
	if(imageURL.indexOf("/media/banners")!=-1)
	{
		doMagnify=0;
	}
	if(imageURL.indexOf("/content")!=-1)
	{
		doMagnify=1;
	}


	if(doMagnify==1)
	{


	var parentItem = contentImages[x];
	var ImageInLink = 0;

	while(parentItem.tagName.toLowerCase()!="body" && ImageInLink!=1)
	{
		parentItem=parentItem.parentNode;

		if(parentItem.tagName=="A")
		{
			ImageInLink=1;			
		}

	}

	if(ImageInLink==0)
	{
		if((contentImages[x].onclick==null) && (contentImages[x].src.indexOf("hid=img")!=-1))
		{
			contentImages[x].style.cursor='pointer';	

			var isIE="false";

			try
			{
			var imgAlign = contentImages[x].align;
			contentImages[x].align='';

			var newOuterHTML = '';
			newOuterHTML = "<div id='VergrootImgRight'></div>";
			newOuterHTML += contentImages[x].outerHTML;


			contentImages[x].outerHTML = "" + newOuterHTML.toString() + "";

			} catch(ex) 
			{ isIE="false"; }
			try
			{

			var zoomImg = document.createElement("SPAN");
			zoomImg.style.cursor="pointer";
			zoomImg.style.position="absolute";
			zoomImg.style.marginLeft="-22px";
			zoomImg.style.marginTop="6px";
			zoomImg.style.width="20px";
			zoomImg.style.height="20px";
			zoomImg.style.background="url(/Layout/images/VergrootButton.gif) no-repeat";
			zoomImg.innerHTML="&nbsp;";

			var imgParent = contentImages[x].parentNode;
			imgParent.insertBefore(zoomImg, contentImages[x].nextSibling);

			zoomImg.onclick=(function()
			{
				//click image
				this.previousSibling.onclick();
			});

			} catch(exp)
			{ isIE="true" }

			contentImages[x].onclick=(function()
			{
				popupImage(this.src, this.alt);
				currentImage = "popupImage('" + this.src + "', '" + this.alt + "');"
				return false;
			});

		}
	}

	if(ImageInLink==1)
	{
		if((contentImages[x].onclick==null) && (contentImages[x].src.indexOf("hid=img")!=-1))
		{
			contentImages[x].style.cursor='pointer';	

			var isIE="false";

			try
			{
			var imgAlign = contentImages[x].align;
			contentImages[x].align='';

			var newOuterHTML = '';
			newOuterHTML += contentImages[x].outerHTML;


			contentImages[x].outerHTML = "" + newOuterHTML.toString() + "";

			} catch(ex) 
			{ isIE="false"; }
			try
			{

			var zoomImg = document.createElement("SPAN");
			zoomImg.style.cursor="pointer";
			zoomImg.style.position="absolute";
			zoomImg.style.marginLeft="-26px";
			zoomImg.style.marginTop="6px";
			zoomImg.style.width="20px";
			zoomImg.style.height="20px";
			zoomImg.style.background="url(/Layout/images/VergrootButton.gif) no-repeat";
			zoomImg.innerHTML="&nbsp;";

			var imgParent = contentImages[x].parentNode;
			imgParent.insertBefore(zoomImg, contentImages[x].nextSibling);

			zoomImg.onclick=(function()
			{
				//click image
				this.previousSibling.onclick();
			});

			} catch(exp)
			{ isIE="true" }

			contentImages[x].onclick=(function()
			{
				popupImage(this.src, this.alt);
				currentImage = "popupImage('" + this.src + "', '" + this.alt + "');"
				return false;
			});

		}
	}

	}
}

} catch(ex) {}

});

function popupImage(imgURL, imgTEXT)
{

try
{


oldScrollTop = document.documentElement.scrollTop;
var popupFrame = document.getElementById("imgMagnify");

document.body.style.overflow="hidden";
document.documentElement.style.overflow="hidden";

document.documentElement.scrollTop=oldScrollTop;

if(imgURL.indexOf("?")==-1)
{
	imgURL += '?imgtype=large';
}

if(imgURL.indexOf(";mxh=")!=-1)
{
	imgURL = imgURL.replace(";mxh=",";oldmxh=");
}

if(imgURL.indexOf(";mxw=")!=-1)
{
	imgURL = imgURL.replace(";mxw=",";w=;q=100;rm=18;mxw=" + (parseInt(windowWidth())-150) + ";mxh=" + (parseInt(windowHeight())-200) + ";oldmxw=")
}
if(imgURL.indexOf(";w=")!=-1)
{
	imgURL = imgURL.replace(";w=",";w=;q=100;rm=18;mxw=" + (parseInt(windowWidth())-150) + ";mxh=" + (parseInt(windowHeight())-200) + ";oldw=")
}
if(imgURL.indexOf("hid=img;")==-1)
{
	imgURL += '&hid=img;w=;mxw=' + (parseInt(windowWidth())-150) + ';mxh=' + (parseInt(windowHeight())-200) + ';q=100;rm=18';
}
if(imgURL.indexOf(";h=")!=-1)
{
	imgURL = imgURL.replace(";h=",";oldh=")
}
if(imgURL.indexOf(";mxw=")==-1)
{
	imgURL = imgURL.replace("hid=img;","hid=img;w=;h=;q=100;rm=18;mxw=" + (parseInt(windowWidth())-150) + ";mxh=" + (parseInt(windowHeight())-200) + ";oldval=")
}

popupFrame.unselectable

popupFrame.style.display='block';
popupFrame.style.position='absolute';
popupFrame.style.left=document.documentElement.scrollLeft+'px';
try{
popupFrame.style.top=window.scrollY+'px';
} catch(e)
{
popupFrame.style.top=document.documentElement.scrollTop+'px';
}

popupFrame.style.width=parseInt(windowWidth())+'px';
popupFrame.style.height=parseInt(windowHeight()) +'px';
popupFrame.style.textAlign="center";
popupFrame.style.zIndex='999999';
popupFrame.innerHTML="<div style='width: 100%; height: " + parseInt(windowHeight()) + "px; left: 0px; top: 0px; background-color: #000; position: fixed; filter: Alpha(opacity=75););-moz-opacity:.75;opacity:.75;'></div>"
popupFrame.innerHTML+="<table style='width: 100%; height: " + parseInt(windowHeight()) + "px; left: 0px; top: 0px; position: absolute; cursor: pointer;' height='100%' width='100%'><tr><td width='100%' align='center'><div id='altTekst'>" + imgTEXT + "</div><img style='border: 3px solid white;margin-left:auto;margin-right:auto;' src='"+ imgURL +"'><br /><br /><div id='alttekst'>Klik ergens binnen dit scherm om te sluiten</div></div></td></tr></table>"

	popupFrame.onclick=(function()
	{
		this.style.display='none';
		document.body.style.overflow="";
		document.documentElement.style.overflow="";
		currentImage = "";
		document.documentElement.scrollTop=oldScrollTop;
	});

} catch(ex) {}

}

// END MAGNIFY

// FANCHOR


function fAnchor() 
{

try{

      var s=event.srcElement;

      if(s.tagName!='A' && s.parentNode.tagName=='A')
      {
      s = s.parentNode;
      }

      try
      {

      if(s.tagName.match(/a/i) && !s.href.indexOf(document.location+'#')) 
      {
            document.getElementById((s.href.substr(s.href.indexOf('#')+1))).scrollIntoView(true);
            return false;
      }

      } catch(e)
      {  }

} catch(ex) {}

}

// END FANCHOR