
isMac = (navigator.appVersion.indexOf('Mac') != -1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all) && (isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all) && (navigator.appVersion.indexOf('MSIE 4.') != -1)) ? true : false;
IE5 = ((document.all) && (navigator.appVersion.indexOf('MSIE 5.') != -1)) ? true : false;
IE6 = ((document.all) && (navigator.appVersion.indexOf('MSIE 6.') != -1)) ? true : false;
IE7 = ((document.all) && (navigator.appVersion.indexOf('MSIE 7.') != -1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape') != -1) ? true : false;

IE5plus = IE5 || IE6 || IE7;
IEMajor = 0;

if (IE4plus) {
  var start = navigator.appVersion.indexOf('MSIE');
  var end = navigator.appVersion.indexOf('.', start);
  IEMajor = parseInt(navigator.appVersion.substring(start + 5, end));
  IE5plus = (IEMajor >= 5) ? true : false;
}


var img;
var img_mo;
var img_cl;
img = new Array();
img_mo = new Array();
img_cl = new Array();


if (location.href.indexOf('/print=true') == -1 && location.href.indexOf('/singleframe=true') == -1 && top.location.href.indexOf('frameid=') != -1) {
  top.location.href = top.location.href.replace('frameid=', 'framenoid=');
}



function setCookie(name, value, expire) {
  if (expire == '') {
    document.cookie = name + "=" + escape(value);
  } else {
    var expires = new Date();
    expires.setTime(expires.getTime() + expire);

    document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expires.toGMTString())) + "; path=/";
  }
}


function getCookie(name) {
   var search = name + "=";
   var val = "";

   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 

      if (offset != -1) { // if cookie exists 
         offset += search.length;

         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 

         // set index of end of cookie value
         if (end == -1) {
            end = document.cookie.length;
         }

         val = unescape(document.cookie.substring(offset, end));
      } 
   }

   return val;
}



function initMo(uniqueid, origImgSrc, overImgSrc, clickImgSrc) {
  if (origImgSrc != '') {
    img[uniqueid] = new Image();
    img[uniqueid].src = origImgSrc;
  }
  if (overImgSrc != '') {
    img_mo[uniqueid] = new Image();
    img_mo[uniqueid].src = overImgSrc;
  }
  if (clickImgSrc != '') {
    img_cl[uniqueid] = new Image();
    img_cl[uniqueid].src = clickImgSrc;
  }
}


function mov(uniqueid) {
  if (img_mo[uniqueid]) {
    document[uniqueid].src = img_mo[uniqueid].src;
  }
}


function mou(uniqueid) {
  if(img[uniqueid]) {
    document[uniqueid].src = img[uniqueid].src;
  }
}


function md(uniqueid) {
  if (img_cl[uniqueid]) {
    document[uniqueid].src = img_cl[uniqueid].src;
  }
}


function initMouseOver(uniqueid, origImgSrc, overImgSrc, clickImgSrc) {
  img['I' + uniqueid + origImgSrc] = new Image();
  img['I' + uniqueid + origImgSrc].src = origImgSrc;
  img_mo['I' + uniqueid + origImgSrc] = new Image();
  img_mo['I' + uniqueid + origImgSrc].src = overImgSrc;
  img_cl['I' + uniqueid + origImgSrc] = new Image();
  img_cl['I' + uniqueid + origImgSrc].src = clickImgSrc;
}

function MouseOver(imgName) {
  document[imgName].src = img_mo[imgName].src;
}

function MouseOut(imgName) {
  document[imgName].src = img[imgName].src;
}

function MouseDown(imgName) {
  document[imgName].src = img_cl[imgName].src;
}


function showWindow(uniqueid,id,qs,width,height) {
  var windowObj;
  windowObj = eval('top.Info' + uniqueid);

  if (windowObj !=null && (windowObj + "" != "undefined") && !windowObj.closed) {
    windowObj.focus();
  } else {
    windowObj = null;
    windowObj = top.open('/zwijsen/show/id=' + id + qs,'Info'+uniqueid,'toolbar=no,width=' + width + ',height=' + height + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
    top.name = 'wm';

    if (windowObj != null) {
      windowObj.focus();
    }     
  }
  reload = false;
}

function writeFlash(s,w,h,b,v) {
  var flashContent = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="'+w+'" HEIGHT="'+h+'" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
  + '<PARAM NAME="MOVIE" VALUE="'+s+'">'
  + '<PARAM NAME="PLAY" VALUE="true">'
  + '<PARAM NAME="LOOP" VALUE="true">'
  + '<PARAM NAME="QUALITY" VALUE="high">'
  + '<PARAM NAME="MENU" VALUE="false">'
  + '<PARAM NAME=bgcolor VALUE='+b+'>'
  + '<PARAM NAME="wmode" VALUE="transparent" />'
  + '<EMBED SRC="'+s+'" WIDTH="'+w+'" HEIGHT="'+h+'" PLAY="true" LOOP="true" wmode="transparent" QUALITY="high" MENU="false" BGCOLOR="'+b+'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>'
  + '</OBJECT>';

  document.write(flashContent);
}
// Elfproef: controle voor bankrekeningnummer en sofinummer
function check_elfproef(getal) {
  checksum = 0;

  // only accept numbers
  if (isNaN(getal)) {
    return false; 
  } 
  else { 
    // accept giro number (7 or less digits)
    if (getal.length <= 7) {
      return true;
    }
    else {
      // banknumber should be 9 digits exactly
      if (getal.length != 9) {
        return false;
      }
      else {
        // calculate 'eleven test' (elfproef)
        for (i=0; i<9; i++) { 
          checksum += (getal.charAt(i) * (9-i));
        } 
        if (checksum % 11 != 0) { 
          return false; 
        }
      }
    }
  } 
  return true;
} 

function check_email(email_address) {
  var email_filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  return (email_filter.test(email_address))
}

function documentWrite(text) {
  document.write(text);
}
