//////////////////////////////////////////////////////
// Javascript for popup
// Version 2.0
// 10-27-08
// Stephen Audy
//////////////////////////////////////////////////////
function $() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}

function toggleWindowShade(displayMode) { // block or none
	if (!$('windowshade') ||$('windowshade').style.display == displayMode)
		return;
	if (displayMode == 'block') {
		var biggestHeight = document.body.scrollHeight;
		if (getWinHeight() > biggestHeight)
			biggestHeight = getWinHeight();

		$('windowshade').style.width=document.body.scrollWidth+'px';
		$('windowshade').style.height=biggestHeight+'px';
	}
	$('windowshade').style.display = displayMode;
}

function getWinHeight()
{
    if (window.innerHeight) return window.innerHeight;
  	else if (document.documentElement && document.documentElement.clientHeight) 
  		return document.documentElement.clientHeight;
  	else if (document.body && document.body.clientHeight) 
  		return document.body.clientHeight;
  	else if (document.body && document.body.parentNode && document.body.parentNode.clientHeight) 
  		return document.body.parentNode.clientHeight;
}