//<scr ipt src="global.js" type="text/javascript" language="JavaScript"></scr ipt>
// scriptfunctions (c)2010 W. Kuipers www.skarweb.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;
ie8up =(parseFloat(na.split("MSIE")[1])>=8)     ?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=window.innerHeight}
if (ie8up&&!breedte){breedte=d.documentElement.clientWidth;hoogte=d.documentElement.clientHeight}

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(DIVhpos)=='number' || DIVhpos.indexOf('%')==-1){DIVhpos=eval(DIVhpos)+'px'} else { DIVhpos=eval(DIVhpos); }
 		if(typeof(DIVvpos)=='string' && DIVvpos.indexOf(':') > 0){[DIVv,DIVvpos]=DIVvpos.split(/\:/)}else{DIVv='top'}
		if(typeof(DIVvpos)=='number' || DIVvpos.indexOf('%')==-1){DIVvpos=eval(DIVvpos)+'px'} else { DIVvpos=eval(DIVvpos); }
 		if(typeof(DIVbreed)=='number' || DIVbreed.indexOf('%')==-1){DIVbreed=eval(DIVbreed)+'px'}
		if(typeof(DIVhoog) =='number' || DIVhoog.indexOf('%') ==-1){DIVhoog =eval(DIVhoog) +'px'}
		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;
	extra_cmd = extra_cmd.replace(/"/g,'\\"');
	extra_cmd = extra_cmd.replace(/'/g,'\\\'');
//	alert("resizetesterFunction('"+extra_cmd+"')");
  setTimeout("resizetesterFunction('"+extra_cmd+"')",1500);
}
function testresize(extra_cmd) {
	if ( typeof(extra_cmd) == 'undefined' ) { extra_cmd = ''; }
	extra_cmd = extra_cmd.replace(/"/g,'\\"');
 	extra_cmd = extra_cmd.replace(/'/g,'\\\'');
	if(!ie4up)   {
    setTimeout("resizetesterFunction('"+extra_cmd+"')",500);
  }	else {
//	alert("Herladen('"+extra_cmd+"')");
    window.onresize = new Function("Herladen('"+extra_cmd+"')");
  }
}

aapje='@'; // <scr ipt type="text/javascript">d.write(aapje)</scr ipt>
function skarmail(n,o,i) { // naam[domein]nl of naam ,onderwerp,inhoud  // antispammailer by www.skarweb.nl (c)2010 SkarWeb
	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;
}
/*
<scr ipt type="text/javascript" language="JavaScript"><!--
skarmailC('naam[domein]tld',[onderwerp],[inhoud],[style]);
// --></scr ipt>
*/
function skarmailC(n,o,i,style) { // naam[domein]nl of naam ,onderwerp,inhoud  // antispammailer by www.skarweb.nl (c)2010 SkarWeb
	d.write('<a href="javas'+'cript:skarmail(\''+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';DIVextra=DIVextra.replace(/absolute/g,''); }
	} else {                              DIVpos='absolute';DIVextra='' }
	str = '<div id="'+naam+'" style="position: '+DIVpos;
	if(typeof(DIVhpos) !='undefined'){str+='; '+DIVh+':'+DIVhpos;if (typeof(DIVhpos) == 'number' ){str+='px'} }
	if(typeof(DIVvpos) !='undefined'){str+='; '+DIVv+':'+DIVvpos;if (typeof(DIVvpos) == 'number' ){str+='px'} }
	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("\n"+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) {
  if (typeof(document.getElementById(laag)) != 'object'
   || document.getElementById(laag) == null ) { return; } // top.document.title = 'ID:'+laag+' NOT an Object';
	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;
  if(!(ie4up||ie5up||op5up||ie8up)) {
  	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;
	}
}

var addLoadEvent = function(extra_onload) { // don't work in IE6 :-( name = supersleight function (was removed to save bytes...)
//  document.title = extra_onload;
  if (typeof(window.onload) == 'function' ) { window.onload = function() {window.onload;eval(extra_onload)} }
  else                                      { window.onload = function() {              eval(extra_onload)} }
};
/* This function fixes PNG's for MSIE 5.5 & 6 */
//http://24ways.org/2007/supersleight-transparent-png-in-ie6
var supersleight=function(){
  var root=false;
	var applyPositioning=true;
	var shim='img/spacer.gif';
  var fnLoadPngs=function(){
    if(root){root=document.getElementById(root);}else{root=document;}
    for(var i=root.all.length-1,obj=null;(obj=root.all[i]);i--){if(obj.currentStyle.backgroundImage.match(/\.png/i)!==null){bg_fnFixPng(obj);}
    if(obj.tagName=='IMG'&&obj.src.match(/\.png$/i)!==null){el_fnFixPng(obj);}
    if(applyPositioning&&(obj.tagName=='A'||obj.tagName=='INPUT')&&obj.style.position===''){obj.style.position='relative';}}
  };
  var bg_fnFixPng=function(obj){
    var mode='scale';var bg=obj.currentStyle.backgroundImage;var src=bg.substring(5,bg.length-2);if(obj.currentStyle.backgroundRepeat=='no-repeat'){mode='crop';}
    obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";obj.style.backgroundImage='url('+shim+')';
  };
  var el_fnFixPng=function(img){
    var src=img.src;img.style.width=img.width+"px";img.style.height=img.height+"px";img.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')";img.src=shim;
  };
  return{
    init:function(){addLoadEvent('fnLoadPngs()');},
    limitTo:function(el){root=el;},
    run:function(){fnLoadPngs();}
  };
}();
// if (parseFloat(navigator.appVersion.split("MSIE")[1])<7) { // alert('crappie IE 5.x & 6.x');
//  supersleight.run(); // place this at the end of the page!!!!
//}

