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(doc2 + '"wachten"' + sty);
	document.images[imgDocID].src = "nav/nav_"+imgObjName+".jpg";
}

function 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 IE6HoverFix() {
  var allTags=document.getElementsByTagName("*");
  for (i=0; i<allTags.length; i++) {
    if (allTags[i].className.indexOf('nav') == 0 && allTags[i].tagName.toUpperCase() == 'UL' ) {
//    if (allTags[i].className=="nav" && allTags[i].tagName == 'UL' ) {
      var allListItems = allTags[i].getElementsByTagName('LI');
//alert(allTags[i].className+' '+allListItems.length+' '+allTags[i].tagName);
      for (var ii=0; ii<allListItems.length; ii++) {
//d.title = ii+' '+d.title;
      	allListItems[ii].onmouseover=function() {
      		this.className+=" navon";
      	}
      	allListItems[ii].onmouseout=function() {
      		this.className=this.className.replace(new RegExp(" navon\\b"), "");
      	}
      }
    }
  }
}
if ((parseFloat(navigator.appVersion.split("MSIE")[1])<8) || 1 ) {	//alert('crappie IE 6 or 7');
	if (typeof(window.onload) == 'undefined' ) {
		window.onload = function() {              IE6HoverFix();}
	} else {
		window.onload = function() {window.onload;IE6HoverFix();}
	}
}

//testet = 0;
function fix_height(stretch_div,substract,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;
			new_height = d.body.clientHeight;
			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 pixels you desired
			new_height -= substract;

			if (typeof(prev_inner_height) == 'undefined' || prev_inner_height != new_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..
//testet++;
				// set the minimum height or at least prevent a negative height
				if (new_height < min_height ) {
					new_height = min_height;
				}
				// set the height of the stretch_div
//alert(new_height);				
				d.getElementById(stretch_div).style.height = (new_height)+'px';
			}
/*      document.title=
			+inner_height+' '
			+prev_inner_height+' '
			+(prev_inner_height-new_height)+' '
			+new_height+' '
			+fixed_it+' '
			+testet
/* */
			setTimeout('fix_height(\''+stretch_div+'\','+substract+','+min_height+','+(new_height)+');',250);
		} else {
			alert('Can\'t find the div to stretch ('+stretch_div+')');
		}
	}
}
