
var _viewportwidth;
var _viewportheight;
var _content_shield = null;

function getPageSize() {
	if (typeof window.innerWidth != 'undefined') // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	{
	  _viewportwidth = window.innerWidth,
	  _viewportheight = window.innerHeight
	} else if (typeof document.documentElement != 'undefined' 
		 && typeof document.documentElement.clientWidth !='undefined' 
		 && document.documentElement.clientWidth != 0) // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	 {
		   _viewportwidth = document.documentElement.clientWidth,
		   _viewportheight = document.documentElement.clientHeight
	 } else 	 // older versions of IE
	 {
		   _viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
		   _viewportheight = document.getElementsByTagName('body')[0].clientHeight
	 }
}

function showhideLayer(layer_ref,state) {
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById && !document.all) {
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = state;
	}
	if(state=='visible') {
		if (_content_shield == null) {
			_content_shield = document.createElement("div");
			_content_shield.style.height = _viewportheight;
			document.body.appendChild(_content_shield);
			_content_shield.className = "content_faded";
		}
	} else {
		if (_content_shield != null) {
			document.body.removeChild(_content_shield);
			_content_shield = null;
		}
	}
}
