//benodigde functie voor foto overzichts bouwsteen
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
var popupscherm=0;

function popup_afbeelding(filename, fileid, width, height, scrollbars, resizable, menubar, toolbar, status, location) {
	if (popupscherm && ! popupscherm.closed)	popupscherm.close();
	if (!filename || filename=="")				filename="http://www.grundel.nl";
	if (!fileid || fileid=="")					fileid="Grundel";
	if (!width || width=="")					width="50";
	if (!height || height=="")					height="50";
	if (!scrollbars || scrollbars=="")			scrollbars="no";
	if (!resizable || resizable=="")			resizable="no";
	if (!menubar || menubar=="")				menubar="no";
	if (!toolbar || toolbar=="")				toolbar="no";
	if (!status || status=="")					status="no";
	if (!location || location=="")				location="no";
	popupscherm=0;
	var args = "height=" + height + ", width=" + width + ", scrollbars=" + scrollbars + ", resizable=" + resizable +  ", menubar=" + menubar + ", toolbar=" +toolbar + ", status=" + status + " ,location=" + location;
	popupscherm = open(filename, fileid, args);
	if (!InternetExplorer) 						popupscherm.focus();
}

//hoogte browser
	var isNav4, isNav6
	var isBrand = navigator.appName
	var navVer = parseInt(navigator.appVersion)
	
	var isNav4 = (isBrand == "Netscape" && navVer < 5) ? true : false
	var isNav6 = (isBrand == "Netscape" && navVer >= 5) ? true : false

function getInsideWindowHeight() {
	if (isNav4 || isNav6)
		return window.innerHeight
 	else 
	    return document.body.clientHeight
}

//this function will get the current/computed style in IE and Moz/FF
function getStyle(obj,Attribute) {
	if (obj) {
		if (obj.currentStyle)
			var value = eval('obj.currentStyle.'+Attribute)
		else
			var value = eval('document.defaultView.getComputedStyle(obj, null).'+Attribute)
		return parseInt(value);
	}
}

function setHeights() {
	schermhoogte 		= getInsideWindowHeight();
	var mainsite		= document.getElementById('mainsite');
	var maintable		= document.getElementById('maintable');
	var footer			= document.getElementById('footer');
	var blazer			= document.getElementById('blazer');
	var iframe			= document.getElementById('bwstIframe');
	var margintop		= parseInt(getStyle(maintable,'top'));
	var marginbottom	= parseInt(getStyle(footer,'height'));
	var blazerheight	= parseInt(getStyle(blazer,'height'));
	var height			= maintable.offsetHeight;
	
	if (footer) {
		if ((height + margintop + marginbottom) > schermhoogte) {
			mainsite.style.height = height + margintop + marginbottom + 10;
			maintable.style.height = height - margintop - marginbottom;
			footer.style.top = height + margintop + 10;
			blazer.style.top = height + margintop + 9 - blazerheight + marginbottom;
		} else {
			maintable.style.height = schermhoogte - margintop - marginbottom;
			mainsite.style.height = schermhoogte;
			footer.style.top = schermhoogte - marginbottom;
			blazer.style.top = schermhoogte - blazerheight -1;
		}
		footer.style.display = 'block';
		blazer.style.display = 'block';
		if (iframe)
			iframe.style.width = parseInt(getStyle(maintable,'width'));
	}
}