//<scr ipt src="global.js" type="text/javascript" language="JavaScript"></scr ipt>
// scriptfunctions (c)2008 E. Toering www.knoop.nl
n=navigator;na=n.appVersion;nu=n.userAgent.toLowerCase();no=n.userAgent.indexOf('Opera');d=document;
mac   =(na.indexOf("Mac")!=-1)                  ?1:0;
ns4up =(d.layers)                               ?1:0;
ns6up =(d.getElementById&&!document.all)        ?1:0;
op5up =(no>0&&!ns6up)                           ?1:0;
op7up =(op5up&&eval(nu.substring(no+6,no+7))>6) ?1:0;
ie4up =(d.all && !op5up)                        ?1:0;
ie5up =(d.all && !op5up &&  d.getElementById)   ?1:0;
ie55up=(parseFloat(na.split("MSIE")[1])>=5.5)   ?1:0;

if     (ns4up)              {doc="document[";               sty="]";      htm="].document";xpos="e.pageX";ypos="e.pageY"}
else if(ns6up||ie55up)      {doc="document.getElementById(";sty=").style";htm=")";         xpos="event.x";ypos="event.y"}
else if(ie4up||ie5up||op5up){doc="document.all[";           sty="].style";htm="].document";xpos="event.x";ypos="event.y"}
if (ie4up&&!op5up){breedte=d.body.clientWidth;hoogte=d.body.clientHeight}
else              {breedte=window.innerWidth; hoogte=innerHeight}

resizeteller=0; resizetester=0; reloading=0;
function Herladen(extra_cmd) {
//	if(!reloading) {window.location.reload();reloading=1;return }

	if (ie4up&&!op5up){breedte=d.body.clientWidth;hoogte=d.body.clientHeight}
	else              {breedte=window.innerWidth; hoogte=innerHeight}
//	posL = Math.floor((breedte-780)/2); if (posL < 0) { posL = 1 }
//	posT = Math.floor((hoogte -470)/3); if (posT < 0) { posT = 5 }

	for (var laag in div_plaatsen) {
		de_laag = eval(doc + '"'+laag+'"' + sty);
		DIVhpos = div_plaatsen[laag][0]; DIVbreed=div_plaatsen[laag][2];
		DIVvpos = div_plaatsen[laag][1]; DIVhoog =div_plaatsen[laag][3];
		if(typeof(DIVhpos)=='string' && DIVhpos.indexOf(':') > 0){[DIVh,DIVhpos]=DIVhpos.split(/\:/)}else{DIVh='left'}
		if(typeof(DIVvpos)=='string' && DIVvpos.indexOf(':') > 0){[DIVv,DIVvpos]=DIVvpos.split(/\:/)}else{DIVv='top'}
		if(typeof(DIVbreed)=='number' || DIVbreed.indexOf('%')==-1){DIVbreed=eval(DIVbreed)+'px'} DIVhpos=eval(DIVhpos);
		if(typeof(DIVhoog) =='number' || DIVhoog.indexOf('%') ==-1){DIVhoog =eval(DIVhoog) +'px'} DIVvpos=eval(DIVvpos);
		if(DIVh=='left'  ){de_laag.left  =DIVhpos;}
		if(DIVh=='right' ){de_laag.right =DIVhpos;}
		if(DIVv=='top'   ){de_laag.top   =DIVvpos;}
		if(DIVv=='bottom'){de_laag.bottom=DIVvpos;}
		de_laag.width =DIVbreed;
		de_laag.height=DIVhoog;
	}
	if ( extra_cmd.length > 0 ) { eval(extra_cmd); }
	resizeteller = 0;
}
function resizetesterFunction(extra_cmd) {
  resizetesterNIEUW = parent.innerWidth/parent.innerHeight;
  if (resizetester != resizetesterNIEUW && resizetester > 0) {resizeteller++ }
  if (resizeteller > 0 ) { Herladen("'"+extra_cmd+"'") }
//	window.status= reloadtester+'|'+reloadtesterNIEUW;
  resizetester = resizetesterNIEUW;
  setTimeout("resizetesterFunction('"+extra_cmd+"')",1500);
}
function testresize(extra_cmd) {
	if ( typeof(extra_cmd) == 'undefined' ) { extra_cmd = ''; }
	if(!ie4up)   {setTimeout("resizetesterFunction('"+extra_cmd+"')",500);}
	else         {window.onresize = new Function("Herladen('"+extra_cmd+"')");}
}

aapje='@'; // <scr ipt type="text/javascript">d.write(aapje)</scr ipt>
function knoopmail(n,o,i) { // naam[domein]nl of naam ,onderwerp,inhoud  // antispammailer by www.knoop.nl (c)2005 Knooppunt
	if(n.indexOf('[')>0){n=n.substring(0,n.indexOf('['))+aapje+n.substring(n.indexOf('[')+1,n.indexOf(']'))+'.'+n.substring(n.indexOf(']')+1,n.length);var d=''}
	else{var d=aapje+location.host.substring(location.host.substring(0,location.host.lastIndexOf('.')).lastIndexOf('.')+1,location.host.length)}
	if(!o){o='Reactie op site ('+location.host;if(n=='webmaster'){o+=location.pathname};o+=')'}if(!i){i=''}
	var m="mailto:"+n+d+"?subject="+o+"&body="+i;
	window.location.href = m;
}
function knoopmailC(n,o,i,style) { // naam[domein]nl of naam ,onderwerp,inhoud  // antispammailer by www.knoop.nl (c)2005 Knooppunt
	d.write('<a href="javas'+'cript:knoopmail(\''+n+'\'');
	if (typeof(o) != 'undefined') { d.write(',\''+o+'\'') }
	if (typeof(i) != 'undefined') { d.write(',\''+i+'\'') }
	d.write(')"');
	if ( typeof(style) != 'undefined' ) { d.write(' class="'+style+'"') }
	if(n.indexOf('[')>0){dom=n.substring(n.indexOf('[')+1,n.indexOf(']'))+'.'+n.substring(n.indexOf(']')+1,n.length);n=n.substring(0,n.indexOf('['));}
	else{var dom=location.host.substring(location.host.substring(0,location.host.lastIndexOf('.')).lastIndexOf('.')+1,location.host.length)}
	d.write('>'+n+aapje+dom+'</a>');
}

/*
<scr ipt type="text/javascript" language="JavaScript"><!--
plaats_div('naam',hpos,vpos,br,h,laag,'visible');
// --></scr ipt>
*/
var div_plaatsen = new Object;
function plaats_div(naam,DIVhpos,DIVvpos,DIVbreed,DIVhoog,DIVlaag,DIVhidvis,DIVextra) { //DIVhpos,DIVvpos tussen '..', voor herpossitionering!
	div_plaatsen[naam] = new Array(DIVhpos,DIVvpos,DIVbreed,DIVhoog);
	if(typeof(DIVhpos)=='string' && DIVhpos.indexOf(':') > 0){DIV=DIVhpos.split(':');DIVh=DIV[0];DIVhpos=DIV[1]}else{DIVh='left'}
	if(typeof(DIVvpos)=='string' && DIVvpos.indexOf(':') > 0){DIV=DIVvpos.split(':');DIVv=DIV[0];DIVvpos=DIV[1]}else{DIVv='top'}
//	alert(typeof(DIVhpos)+'\n'+DIVhpos);
	if(typeof(DIVbreed)=='number' || DIVbreed.indexOf('%')==-1){DIVbreed=eval(DIVbreed)+'px'} DIVhpos=eval(DIVhpos);
	if(typeof(DIVhoog) =='number' || DIVhoog.indexOf('%') ==-1){DIVhoog =eval(DIVhoog) +'px'} DIVvpos=eval(DIVvpos);
	if(typeof(DIVextra)!='undefined'){
		if(DIVextra.indexOf('relative')>=0){DIVpos='relative';DIVextra=DIVextra.replace(/relative/g,'')}
		else                               {DIVpos='absolute' }
	} else {                              DIVpos='absolute';DIVextra='' }
	str = '<div ID="'+naam+'" STYLE="position: '+DIVpos;
	if(typeof(DIVhpos) !='undefined'){str+='; '+DIVh+':'+DIVhpos; }
	if(typeof(DIVvpos) !='undefined'){str+='; '+DIVv+':'+DIVvpos; }
	if(typeof(DIVbreed)!='undefined'){str+='; width:'+DIVbreed;if (typeof(DIVbreed)== 'number' ){str+='px'} }
	if(typeof(DIVhoog) !='undefined'){str+='; height:'+DIVhoog;if (typeof(DIVhoog) == 'number' ){str+='px'} }
	if(typeof(DIVlaag) !='undefined'){str+='; z-index:'+DIVlaag}
	str+='; visibility:'+DIVhidvis+' '+DIVextra+'">\n';d.write(str);// alert(str)
}
//javasc ript:createWindow('popup.html','window1','width=200,height=245,status')
function createWindow(cUrl,cName,cFeatures) {
  var xWin = window.open(cUrl,cName,cFeatures);
	breedte = cFeatures.substring(cFeatures.indexOf('width=') +6,cFeatures.indexOf(',',cFeatures.indexOf('width=')));
	hoogte  = cFeatures.substring(cFeatures.indexOf('height=')+7,cFeatures.indexOf(',',cFeatures.indexOf('height=')));
  xWin.resizeTo(breedte,hoogte);
//	alert(breedte+'|'+hoogte);
	xWin.focus();
}

function setOpacity(laag,opacity) {
	de_laag = document.getElementById(laag).style;
//	imageID = eval(doc+'"album'+nr+'"'+sty);
//	document.title = "cms/images/"+eval('map'+nr)+"/"+eval('afb_array'+nr+'[map'+nr+']['+fototeller[nr]+']')+'foto_album'+nr+'_1 > '+opacity;
	opacity = (opacity == 100)?99.999:opacity; // voorkom 'flikker' in FireFox
	if ( opacity == 0 ) { de_laag.visibility = 'hidden' }
	else                { de_laag.visibility = 'visible'}
//	document.title = 'setOpacity:'+laag+' '+opacity+' '+de_laag.visibility;
	de_laag.filter = "alpha(opacity:"+opacity+")";// IE/Win
	de_laag.KHTMLOpacity = opacity/100;           // Safari<1.2, Konqueror
	de_laag.MozOpacity   = opacity/100;           // Older Mozilla and Firefox
	de_laag.opacity      = opacity/100;           // Safari 1.2, newer Firefox and Mozilla, CSS3
}
function setDIVcontent(naam,str) {
	if (ie4up) {
		document.all[naam].innerHTML = str;
	} else if (ns4up) {
		document.layers[naam].document.open();
		document.layers[naam].document.write(str);
		document.layers[naam].document.close();
	} else if (ns6up) {
		document.getElementById(naam).innerHTML = str;
	}
}
