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+".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 afbeelding(plaatje,pic_breedte,pic_hoogte,extra_cmd,tekst) {
	var d=document;
	var link   = '';
	var submap = '';
	var uitlijnen = '' ;
	if (extra_cmd == 'niks'
	 || extra_cmd == '0'              ) { link = extra_cmd }
	else if (extra_cmd.indexOf('/')>=0) { submap = extra_cmd }
	else if (extra_cmd.length > 0     ) { var uitlijnen = 'align='+extra_cmd }
	else                                { var uitlijnen = 'align=right' }
	if ( uitlijnen == 'align=right' && (breedte-pic_breedte) < 530 ) { uitlijnen = 'align=center'	}
	d.write('<table '+uitlijnen+' border=0 CELLSPACING=0 CELLPADDING=0><tr>');
	if ( uitlijnen.indexOf('right') > 0 ) {
		d.write('<td nowrap rowspan=2>&nbsp;</td>');
	}
	d.write('<td valign=top>');
	if ( link == '0' ) {
		d.write('<a href="javas'+'cript:createWindow(\'plaatje.html?'+link+plaatje+'\',\'meta_detail\',\'width=285,height=415,status\')">')
		d.write('<img SRC="'+submap+'pic/'+plaatje+'" border=1 height='+pic_hoogte+' width='+pic_breedte+' alt="Klik om de foto te vergroten">');
		d.write('</a>');
	} else {
		d.write('<img SRC="'+submap+'img/'+plaatje+'" border=1 height='+pic_hoogte+' width='+pic_breedte+'>');
	}
	if ( uitlijnen.indexOf('left') > 0
	 ||  uitlijnen.length == 0 ) {
		d.write('</td>');
	}
	if ( tekst.length > 0 ) {
		d.write('</tr><tr><td><span class=tekstfoto>'+tekst+'</span></td>');
	}
	d.write('</tr></table>');
}

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;
			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 pixels you desired
				new_height -= substract;
				// 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
				d.getElementById(stretch_div).style.height = (new_height)+'px';
			}
/*      document.title=
			+inner_height+' '
			+new_height+' '
			+fixed_it+' '
*/
			setTimeout('fix_height(\''+stretch_div+'\','+substract+','+min_height+','+inner_height+');',250);
		} else {
			alert('Can\'t find the div to stretch ('+stretch_div+')');
		}
	}
}
