//<!--

var loaded = false;
var loadProcs = new Array();

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function openWindow(_url, _name, _features) {
	top.window[_name] = window.open(_url, _name, _features);
	if (top.window[_name] != null) {
		top.window[_name].focus();
	}	
}

function argFromURL(url) {
	var args = String(url).split("#");
	if (args.length > 1) {
		return args[1];
	} 
	else {
		return ""; 
	}	
}

function changeImage(imgDocID,imgObjName) {
	document.images[imgDocID].src = eval( imgObjName + ".src")
}
	
/*
function hiMeer(obj) {
	images = obj.getElementsByTagName("img");
	images[0].src = image_folder + "pijl_over.gif";
}

function loMeer(obj) {
	images = obj.getElementsByTagName("img");
	images[0].src = image_folder + "pijl.gif";
}
*/

function showContextPopUp(srcElement, chosenid, refid, refsite, thisalias, thisid) {
	var featuresString = "left=100,top=100,height=500,width=460,scrollbars=yes,resizable=yes";
	_url = srcElement.getAttribute("href");
	openWindow(_url, "contextsearch", featuresString);
}


function showPopUp(srcElement, windowName, features) {
	var featuresString;
	
	if (features != null) {
		featuresString = features;
	}
	else {
		featuresString = "left=100,top=100,height=477,width=607,scrollbars=yes,resizable=yes";
	}
	_url = srcElement.getAttribute("href");
	openWindow(_url, "popup", featuresString);
}

function showZoomImg(fullname) {																																							 
	var featuresString = "left=100,top=100,height=500,width=500,scrollbars=yes,resizable=yes,viewbar=yes";
	var _url = site_root + "/asp/page.asp?alias=" + view_alias + "&page_alias=imageview&image=" + fullname;
	top.window["imageview"] = window.open(_url,"imageview",featuresString);
	top.window["imageview"].focus();
	}


function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight	= footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (windowHeight - footerHeight) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}

function onloadHandler() {
	loaded = true;
	for (var i = 0; i < loadProcs.length; i++) {
		eval(loadProcs[i]);
	}
}

window.onload = function() {
	onloadHandler();
}

//-->
