var do_not_hilite = location.search.substring(1,location.search.length);
var imgDocID;
var imgObjName;
var imgText;
var titel_naam;
var d=document;

function preloader() {if(d.images){
	if(!d.loaderarray) { d.loaderarray=new Array(); }
	var i,j=d.loaderarray.length,a=preloader.arguments;
	for(i=1; i<a.length; i++) { if (a[i].indexOf("#")!=0) { d.loaderarray[j]=new Image;
	d.loaderarray[j++].src= a[0]+a[i]; } }
}}

function preload(intro) {
	preloader('nav/','nav_on.jpg','nav_off.jpg');
	preloader('img/','spacer.gif');
}

function hiLite(imgDocID, imgObjName, imgText) {
  if (do_not_hilite == imgDocID ) { return }
	window.status='';
	if ( typeof(imgText) == 'undefined' ) { imgText = '' }
	if ( imgObjName >= 1) { window.status = imgText + ' .....'; }
	else                  { window.status = ''; }
//wacht_laag            = eval(doc + '"wachten"' + sty);
	document.images[imgDocID].src = "nav/"+imgDocID+"_"+imgObjName+".gif";
}

function XXXX_Current(imgDocID) {
  if (do_not_hilite.length != 0) {
    var remember = do_not_hilite; do_not_hilite = '';
    hiLite(imgDocID,'2');
    do_not_hilite = imgDocID;
  }
}

function Clicked(imgDocID, imgObjName) {
  Current(imgDocID);
  do_not_hilite = imgDocID;
  for (var i = 0; i < totaalnav; i++) { hiLite(i+1,1) }
}

function fix_height(stretch_div,footer_div,min_height,prev_inner_height) {
  if (d.getElementById) {
    if (d.getElementById(stretch_div)) {
      inner_height  = d.body.clientHeight;
      if (typeof(min_height) == 'undefined' ) { min_height = 1; }
//      fixed_it = false;
      if (typeof(prev_inner_height) == 'undefined' || prev_inner_height != inner_height ) {
//        fixed_it = true;
        // start with the minimum height (in case of smaller -> larger -> smaller)
        d.getElementById(stretch_div).style.height = min_height+'px';
        // start with the largest one..      
        new_height = inner_height;
        if (d.body.parentNode.scrollHeight > new_height ) { new_height = d.body.parentNode.scrollHeight; }
        if (d.body.scrollHeight            > new_height ) { new_height = d.body.scrollHeight; }
        // substract the headers = top-pos of the stretch_div
        new_height-= d.getElementById(stretch_div).offsetTop;
        // substract the footers = height  of the footer_div
        if (d.getElementById(footer_div)) {
          new_height-= d.getElementById(footer_div).offsetHeight;
        }
        // is there a minimum height set & needed?
        if (new_height < min_height ) {
          new_height = min_height; // this can usualy be done by setting a CSS min-height;
        } 
        // set the height of the stretch_div
        d.getElementById(stretch_div).style.height = new_height+'px';
      }
//      document.title= window_height+' '+inner_height+' '+new_height+' '+min_height+' '+fixed_it+' '+d.getElementById(stretch_div).style.minHeight;
     	setTimeout('fix_height(\''+stretch_div+'\',\''+footer_div+'\','+min_height+','+inner_height+');',250);
    } else {
      alert('Can\'t find the div to stretch ('+stretch_div+')');
    }
  }
}
