﻿
function setHgt() {
var url=window.location.href;
var pagina=(url.substring(url.lastIndexOf('/')+1,url.length));
var pagina2=(pagina.substring(0,15));

	OBJ1=document.getElementById('contentlinks');
	OBJ2=document.getElementById('contentlinksonder');
	OBJ3=document.getElementById('contentmidden'); 
	OBJ4=document.getElementById('contentrechts');
	OBJ5=document.getElementById('achtergrond');
	H=Math.max(OBJ1.offsetHeight,OBJ2.offsetHeight,OBJ3.offsetHeight,OBJ4.offsetHeight,OBJ5.offsetHeight);
	if(pagina2=='plattegrond.php') {
		OBJ1.style.height=250+H+'px';
		OBJ2.style.height=250+38+H+'px';
		OBJ3.style.height=250+38+H+'px';
		OBJ4.style.height=250+38+120+H+'px';
		OBJ5.style.height=250+120+38+H+'px';
	} else {
		OBJ1.style.height=H+'px';
		OBJ2.style.height=38+H+'px';
		OBJ3.style.height=38+H+'px';
		OBJ4.style.height=38+120+H+'px';
		OBJ5.style.height=120+38+H+'px';
	}
}
window.onload=setHgt;

function MM_findObj(n, d) { //v3.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
var layer1,i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
;
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function ShowHint() {
var obj;
obj = document.getElementById("balloon");
obj.style.visibility = "visible";
}

function popwindow(xsize,ysize,url,align) {
	var wWidth, wHeight, wLeft, wTop;
	wWidth = xsize;
	if(ysize>0) {
		wHeight = ysize;
	} else {
		wHeight = wWidth*.75;
	}
	if(align=='center') {
		wLeft = (screen.width-wWidth)/2;
		wTop = (screen.height-wHeight)/2;
		var Scherm = window.open(url, '_blank', 'scrollbars=yes,width='+wWidth+',height='+wHeight+',left='+wLeft+',top='+wTop);
	} else {
		var Scherm = window.open(url, '_blank', 'scrollbars=yes,width='+wWidth+',height='+wHeight);
	}
	Scherm.focus();
}

function popwindownoscroll(xsize,ysize,url,align) {
	var wWidth, wHeight, wLeft, wTop;
	wWidth = xsize;
	if(ysize>0) {
		wHeight = ysize;
	} else {
		wHeight = wWidth*.75;
	}
	if(align=='center') {
		wLeft = (screen.width-wWidth)/2;
		wTop = (screen.height-wHeight)/2;
		var Scherm = window.open(url, '_blank', 'scrollbars=no,width='+wWidth+',height='+wHeight+',left='+wLeft+',top='+wTop);
	} else {
		var Scherm = window.open(url, '_blank', 'scrollbars=no,width='+wWidth+',height='+wHeight);
	}
	Scherm.focus();
}

var popup;
function enlarge(file){
	popup = window.open("about:blank", "display", "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,height=150,width=200");
	popup.document.write("<html>\n");
	popup.document.write("<head>\n");
	popup.document.write("<title>Foto Weergave</title>\n");
	popup.document.write("<style>\n");
	popup.document.write("body{ margin: 0px; padding: 0px; }\n");
	popup.document.write("</style>\n");
	popup.document.write("<script>\n");
	popup.document.write("function resizewindow(image){window.moveTo(0, 0);window.resizeTo(image.clientWidth, image.clientHeight);imgratio = image.clientWidth/image.clientHeight;winratio = document.body.clientWidth/document.body.clientHeight;if(imgratio > winratio){if(document.body.clientWidth < image.clientWidth){image.width = document.body.clientWidth;window.resizeTo(image.clientWidth, image.clientHeight);}}else{if(document.body.clientHeight < image.clientHeight){image.height = document.body.clientHeight;window.resizeTo(image.clientWidth, image.clientHeight);}}center();}\n");
	popup.document.write("function center(){var w, h;if(typeof window.outerWidth != 'undefined'){w = window.outerWidth; h = window.outerHeight;}else if(typeof document.body != 'undefined' && typeof document.body.clientWidth != 'undefined'){  w = document.body.clientWidth;  h = document.body.clientHeight;  } else {  return;  }  window.moveTo(screen.width/2 - w/2, screen.height/2 - h/2);}\n");
	popup.document.write("</script>\n");
	popup.document.write("</head>\n");
	popup.document.write("<body>\n");
	popup.document.write("<img src='" + file + "' alt='' title='' onload='resizewindow(this);'>\n");
	popup.document.write("</body>\n");
	popup.document.write("</html>\n");
	window.onfocus = function(){if(popup){popup.close();popup=0;}};
}

function confirmLink(rowid, theLink, msg) {
	OBJ1=document.getElementById(rowid);
	OBJ1.className='row_delete_confirm';
	var is_confirmed = confirm(msg);
	if (is_confirmed) {
		theLink.href += '&confirmed=1';
	} else {
		OBJ1.className='row1';
	}
	return is_confirmed;
}

function confirmDelete(theLink, msg) {
	var is_confirmed = confirm(msg);
	if (is_confirmed) {
		theLink.href += '&confirmed=1';
	}
	return is_confirmed;
}

function confirmClick(theLink, msg) {
	var is_confirmed = confirm(msg);
	if (is_confirmed) {
		theLink.href += '&confirmed=1';
	}
	return is_confirmed;
}

function confirmClickPopUp(theLink, msg, wWidth, wHeight, align) {
	var is_confirmed = confirm(msg);
	if (is_confirmed) {
		theLink.href += '&confirmed=1';
		popwindowXY(wWidth,wHeight,theLink.href,align);
	}
	return false;	
}

function ToggleClass(id,rowclass) {
	OBJ1=document.getElementById(id);
	if(OBJ1.className=='row_delete_confirm') {
	} else {
		if(OBJ1.className=='row_delete') {
			OBJ1.className=rowclass;
		} else {
			OBJ1.className='row_delete';
		}
	}
}
