
jsversion = "6.3";

function Dims () {
  if (window.innerWidth)
    theWidth=window.innerWidth;
  else if (document.documentElement && document.documentElement.clientWidth)
    theWidth=document.documentElement.clientWidth;
  else if (document.body)
    theWidth=document.body.clientWidth;

  if (window.innerHeight)
    theHeight=window.innerHeight;
  else if (document.documentElement && document.documentElement.clientHeight)
    theHeight=document.documentElement.clientHeight;
  else if (document.body)
    theHeight=document.body.clientHeight;
}

function show(m,x) {
  document.write('<h2>'+m+'</h2>');
  for (var i in x) {
    document.write('x[\''+i+'\'] is ' + x[i] + '<br>')
  }
}

function show1(m,x,n1,n2) {
  msg = m + '[' + n1 + ',' + n2 + ']';
  n = 0;
  for (var i in x) {
    n++;
    if (n == n1) { msg = msg + "\n"; }
    if (n >= n1 && n <= n2) { msg = msg + n +': x[\''+i+'\'] is ' + x[i] + "\n"; } else { msg = msg + '.' }
  }
  return msg;
}

function rescale() {
  if (self.innerHeight) { // all except Explorer
    setTimeout('window.location.reload()',1000);
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    window.location.reload();
  } else if (document.body) { // other Explorers
    window.location.reload();
  }
}

function anewwin(src,name,attributes){
 var x = window.open(src,name,attributes);
 x.focus();
}

function toggleVisibility(obj) {
  obj.style.display = "";
  if (obj.style.visibility == "hidden" ) {
    obj.style.visibility = "visible";
  } else {
    obj.style.visibility = "hidden";
  }
}

function toggleDisplay(obj) {
  obj.style.visibility = "visible";
  if (obj.style.display == "none" ) {
    obj.style.display = "";
  } else {
    obj.style.display = "none";
  }
}

function SetFormBron(formulier,vanuit,titel) {
  formid = formulier.substr(1);
  form = document.getElementById(formid);
  form.fr1.value = vanuit;
  form.fr2.value = titel;
  
  //toggleDisplay(form.fr1);
  //toggleDisplay(form.fr2);
  
  //obj = form.fr2;
  //msg = show1('\nFORM: [', obj, 61, 75) + ']';
  //window.alert('Formulier: '+formulier+ ' - ' + formid + ' vanuit: ' + vanuit + msg);
}

function newwin(src){
 anewwin(src,'','width=500,height=400,scrollbars=yes,resizable=yes,location=yes,menubar=yes,directories=yes,status=yes,toolbar=yes');
}

function getCookie(cookieName){
 var cookieBeg, cookieEnd;
 var cookieJar = document.cookie;
 cookieBeg = 0+cookieJar.indexOf(cookieName,0);
 if(cookieBeg < 0)return null;
 else cookieBeg +=  cookieName.length + 1;
 cookieEnd = 0+cookieJar.indexOf(";",cookieBeg);
 if(cookieEnd < 0)cookieEnd = cookieJar.length;
 return unescape(cookieJar.substring(cookieBeg,cookieEnd));
}

var previous=false;
function toggleVisibility (id) {
 current = document.getElementById(id);
 if (previous) if (previous != current) previous.style.display = "none";
 previous = current;
 if (current.style.display == "block")
  current.style.display = "none";
 else
  current.style.display = "block";
}

function storubr(id){
  //parent.parms.document.data.rubr.value = id;
}
function stoh0(id)  {
  //parent.parms.document.data.h0.value = id;
}
function stoh1(id)  {
  //parent.parms.document.data.h1.value = id;
}

function rech0 ()   {
  //return parent.parms.document.data.h0.value;
}
function rech1 ()   {
  //return parent.parms.document.data.h1.value;
}

function geth0 ()   {
  //var id=parent.parms.document.data.h0.value;if(id)toggleh0(id);
}
function geth1 ()   {
  //var id=parent.parms.document.data.h1.value;if(id)toggleh1(id);
}

var prevh0=false;
var prevk0=false;
function toggleh0 (id) {
 current = document.getElementById("P"+id);
 if (prevh0) if (prevh0 != current) prevh0.style.display = "none";
 prevh0 = current;
 key = document.getElementById("xP"+id);
 if (current.style.display == "block") {
  current.style.display = "none";
  key.innerHTML = "[+]";
  if (prevk0) if (key != prevk0) prevk0.innerHTML = "[-]";
 } else {
  current.style.display = "block";
  key.innerHTML = "[-]";
  if (prevk0) if (key != prevk0) prevk0.innerHTML = "[+]";
 }
 prevk0 = key;
}

var prevh1=false;
var prevk1=false;
function toggleh1 (id) {
 current = document.getElementById("D"+id);
 if (prevh1) if (prevh1 != current) prevh1.style.display = "none";
 prevh1 = current;
 key = document.getElementById("R"+id);
 if (current.style.display == "block") {
  current.style.display = "none";
  key.innerHTML = "[+]";
  if (prevk1) if (key != prevk1) prevk1.innerHTML = "[-]";
 } else {
  current.style.display = "block";
  key.innerHTML = "[-]";
  if (prevk1) if (key != prevk1) prevk1.innerHTML = "[+]";
 }
 prevk1 = key;
}

function Toggle(item) {
   obj=document.getElementById(item);
   visible=(obj.style.display!="none")
   key=document.getElementById("x" + item);
   if (visible) {
     obj.style.display="none";
     key.innerHTML="[+]";
   } else {
      obj.style.display="block";
      key.innerHTML="[-]";
   }
}

function Terug(rubr) {
  document.location=rubr+'.php';
}

src='http://javascript.about.com/library/blqs.htm';
var qsParm = new Array();
function qs() {
 var query = window.location.search.substring(1);
 var parms = query.split('&');
 for (var i=0; i<parms.length; i++) {
  var pos = parms[i].indexOf('=');
  if (pos > 0) {
   var key = parms[i].substring(0,pos);
   var val = parms[i].substring(pos+1);
   qsParm[key] = val;
  }
 }
}

function Wijs() {
 qs();
 h0=qsParm['h0'];
 h1=qsParm['h1'];
 if (h0) if (h0!='') toggleh0(h0);
 if (h1) if (h1!='') {
  toggleh1(h1);
  document.location.hash="N"+h1;
 }
}

/////////////////////////
function GeefTijd () {
  var now         = new Date();
  var hour        = now.getHours();
  var minute      = now.getMinutes();
  var second      = now.getSeconds();
  var monthnumber = now.getMonth()+1;
  var monthday    = now.getDate();
  var year        = now.getYear()+1900;
  if ( monthnumber < 10 ) { monthnumber = '0'+monthnumber; }
  if ( monthday < 10 ) { monthday = '0'+monthday; }
  if (hour   < 10) { hour   = "0" + hour;   }
  if (minute < 10) { minute = "0" + minute; }
  if (second < 10) { second = "0" + second; }
	return monthday+'-'+monthnumber+'-'+year+'&nbsp;'+hour+':'+minute+':'+second;
}

var mins;
var secs;

function Timer (refresh) {
  document.write ('<form name="cd">');
  document.write (GeefTijd(),'&nbsp;&nbsp;');
  document.write ('<input id="txt" readonly="true" type="text" value="00:00" size=4 border="0" name="disp">');
  document.write ('</form>');
  secs = refresh % 60;
  mins = Math.floor(refresh / 60);
  //mins = m; secs = s+1;
  redo ();
}

function dis(mins,secs) {
  var disp;
  if ( mins <= 9 ) { disp = " 0"; } else { disp = " "; }
  disp += mins + ":";
  if ( secs <= 9 ) { disp += "0" + secs; } else { disp += secs; }
  return (disp);
}

function redo() {
  secs--;
  if ( secs == -1 ) { secs = 59; mins--; }
  document.cd.disp.value = dis(mins,secs); // setup additional displays here.
  if ( (mins == 0) && (secs == 0) ) {
    //window.alert("Time is up. Press OK to continue.");
    //window.location = "yourpage.htm"
  } else {
    cd = setTimeout ("redo()", 1000);
  }
}

function detectPopupBlocker() {
  var test = window.open(null,"","width=100,height=100");
  try {
    test.close();
    alert("Pop-ups not blocked.");
  } catch (e) {
    alert("Pop-ups blocked.");
  }
}

// Created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
    if (oldonload) {
      oldonload();
    }
    func();
  }
}
}

// addLoadEvent(detectPopupBlocker);

