function openPopup(locatie, width, height)
 { if (width!=null) {
       w=width;
        } else {
       var w = window.screen.availWidth /1.5;
       }
   if (height!=null) {
       h=height;
       } else {
   var h = window.screen.availHeight /1.5;
       }
   var l = (window.screen.availWidth /2) - (w/2); 
   var t = (window.screen.availHeight /2 ) -(h/2); 
   var xps =  window.open(locatie,"_blank",config='toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+w+',height='+h+',left='+l+',top='+t, replace=false);
  }
function setBorder(){
imgs=document.getElementsByTagName("img");
	for(i=0; i<imgs.length; i++){
		if(imgs[i].getAttribute("align")=="bordered"){
			imgs[i].style.border='1px #000 solid';
		}
		else if(imgs[i].getAttribute("align")=="borderedleft"){
			imgs[i].style.border='1px #000 solid';
			imgs[i].align='left';
		}
		else if(imgs[i].getAttribute("align")=="borderedright"){
			imgs[i].style.border='1px #000 solid';
			imgs[i].align='right';
		}
	}
}
function sendLinks(){
	hrefs=document.getElementsByTagName("a");
	for(i=0; i<hrefs.length; i++){
		uri=hrefs[i].getAttribute("href");
		if(uri.indexOf("http://") >-1 && uri.indexOf("hier")==-1){
			hrefs[i].target="_blank";
		}
	}
}
function updImgs(){
	allimgs=document.getElementsByTagName("img");
	for(i=0; i<allimgs.length; i++){
		if(allimgs[i].src.indexOf("hier_nieuw")>-1){
			newsrc=allimgs[i].src.replace("hier_nieuw/","");
			allimgs[i].src=newsrc;
		}
	}
	allhrefs=document.getElementsByTagName("a");
	for(i=0; i<allhrefs.length; i++){
		if(allhrefs[i].href.indexOf("http://www.versie1.com/hier_nieuw")>-1){
			newhref=allhrefs[i].href.replace("http://www.versie1.com/hier_nieuw/","");
			allhrefs[i].href=newhref;
		}
	}
}
window.onload=function(){
	setBorder();
	sendLinks();
	//updImgs();
}
function showLayer(id){
	if(currentdiv){
		document.getElementById("detail_" + currentdiv).style.display="none";
	}
	else{
		cdiv=document.getElementById("coalitiedivs").getElementsByTagName("div");
		cdiv[0].style.display="none";
	}	
	currentdiv=id;
	document.getElementById("detail_" + id).style.display="";
}
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
function showTipLayer(id){
	var dedivs = document.getElementById('coalitiedivs').getElementsByTagName('div');
	var alles = "";
	for(i=0; i < dedivs.length; i++){
		
		if(dedivs[i].id.indexOf("detail")>-1){
			//alles = alles + dedivs[i].id + '\n' ;
			dedivs[i].style.display='none';
		}
	}
	var opendiv = "detail_" + id
	//alert(opendiv);
	document.getElementById(opendiv).style.display="";
	
}