// JavaScript Document
// Standard functions to be called after page load
<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

var maxWidth  = 98;
var maxHeight = 128;

function scaleImage(im) {

  if (typeof im.naturalHeight == 'undefined') im.naturalHeight = im.height;
  if (typeof im.naturalWidth == 'undefined') im.naturalWidth = im.width;
  
  if (im.naturalHeight > maxHeight) {

    im.height = maxHeight;
    im.style.maxHeight = im.naturalHeight + 'px';
    im.className = 'resized';
   // im.title = 'Klik voor originele grootte';
   // im.onclick = unscaleImage;

  }

}

function unscaleImage() {

  if (this.height == maxHeight) {
	if (this.naturalHeight < 468){
		this.height = this.naturalHeight;
		this.style.borderWidth = '0px';
		this.title = 'Klik om te verkleinen';
	}
	else{
		newWindow=window.open(this.src,'newWin','width='+this.naturalWidth+',height='+this.naturalHeight+',toolbar=no');
		newWindow.document.write('<html><head><title>'+this.alt+'(Large Image)<\/title><style>body{margin:0;}<\/style><\/head><body><img src="'+this.src+'" alt="'+this.alt+'"><\/body><\/html>');
		newWindow.focus();		
	}

  } else {
	
    this.height = maxHeight;
    this.style.borderWidth = '2px';
    this.title = 'Klik voor de orginele grootte';

  }
}

function mp(url){
	window.location.href= '#';
	window.location.href= url;
}

function outLinks(myURL){
	linkTarget="_blank";
	for (var i=0; i<=(document.links.length-1); i++){
		isExternal=((document.links[i].href.indexOf("http://")!=-1)&&(document.links[i].href.indexOf(myURL)==-1))
		if(isExternal){
			document.links[i].target = linkTarget;
		}
	}
}


function domResize() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');	
	for (i=0;i<imgarr.length;i++){
				
		if (imgarr[i].className.indexOf('domresize')!=-1){
			imgarr[i].onload=function(){
				scaleImage(this);
			}
			scaleImage(imgarr[i]);
		}
	}
}





function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

//Delete_Cookie("cao_1",'/','')
//Delete_Cookie("cao_2",'/','')
//Delete_Cookie("cao_3",'/','')


// this function gets the cookie, if it exists
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function CloseEnquete(){
	Set_Cookie("display_enquete3", "false", "14", "/", "", "" ) 
	if (document.getElementById('enquete')){
		document.getElementById('enquete').style.display = 'none';									 
	}
}

function CompleteEnquete(){
	Set_Cookie("display_enquete3", "false", "365", "/", "", "" ) 
}

function displayEnquete(){
	if (document.getElementById('enquete')){	
		if (!Get_Cookie("display_enquete3") ||!Get_Cookie("display_enquete3") == 'false' ){
			document.getElementById('enquete').style.display = 'block';									 
		}
		else{
			//Set_Cookie("display_enquete", "true", "14", "/", "", "" ) 		
			//document.getElementById('enquete').style.display = 'block';	
		}
	}
}
Delete_Cookie("display_enquete",'/','')
displayEnquete()

domResize();

outLinks(document.domain);


// -->