



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 getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	} else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		} else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}






var flash7Installed = false;
function hasFlash7() {
	var reqVal = (top.location.search.indexOf("flash=") != -1) ? parseInt(top.location.search.substring(top.location.search.indexOf("flash=") +6)) : 7;
	if (!flash7Installed && navigator.plugins) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.substring(16));
			flash7Installed = (flashVersion >= reqVal) ? true : false;
		}
	}
	return flash7Installed;
}








if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer") {

	/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/
	 * Windows Internet Explorer PNG Alpha-Transparency
	 * Instant-On Fix-it Script, v1.0
	 * (c) 2004 bivia
	 * created by Ben Curtis of bivia.com, July 22 2004
	 * $Id: userAgentFix.js,v 1.8 2004/10/04 06:59:03 bcurtis Exp $
	 *
	 * A free and irrevocable license to use this code is provided
	 * the following conditions are met:
	 *   1) this copyright header is intact and unchanged
	 *   2) you do not charge specifically for the application of this script
	 *   3) you consider signing up for my newsletter at
	 *      http://www.bivia.com/insite/intro.html  :)
	 *~~~~~~~*/
	
	var bv_pngFixTmr, bv_pngFixInterval;
	var bv_pngFixCnt = 0;
	function	bv_checkForPngs() { // on slow connections, the document object may take a while
		if (
				     window.document
				&&   window.document.images
				&&   window.document.images.length
			) bv_pngCheckAfterDocument();
		else bv_pngFixTmr = setTimeout("bv_checkForPngs()", 500);
	}
	function bv_pngCheckAfterDocument() {
		window.attachEvent("onload", bv_fixPngFollowUp);  // after the page loads, mop up
		bv_pngFixInterval = setInterval(bv_fixPngs, 250); // check for new pngs 4 times per second...
		bv_fixPngs();                                     // ...starting now
	}
	function bv_fixPngFollowUp() {
		clearInterval(bv_pngFixInterval); // stop checking
		bv_fixPngs();       // mop up any stragglers
		bv_pngFixCnt = 200; // tell the fixer we're done, if the clearInterval hasn't done it
	}
	function bv_fixPngs() {
		var imgsAdjusted = 0;
		for (var xx=0; xx < document.images.length; xx++) {
			var img = document.images[xx];
			if (typeof img != "object" || !img.src || img.bv_png_adjusted) continue;
			if (
					     img.src.match(/\.png$/i)               // it's a png
					&& ! img.src.match(/_(on|off|down)\.png$/i) // it's not a rollover
				) { // replace the image with the AlphaImage
				var HTML = '<img src="/img/clear.gif" height='+ img.height +' width='+ img.width +' border=0';
				HTML += (img.id) ? ' id="'+ img.id +'"' : "";
				HTML += (img.className) ? ' class="'+ img.className +'"' : "";
				HTML += ' style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+ img.src +'\', sizingMethod=\'scale\');">'
				img.outerHTML = HTML;
				imgsAdjusted++;
			}
			img.bv_png_adjusted = true;
		}
		if (imgsAdjusted) bv_pngFixCnt++;
		if (bv_pngFixCnt > 10) // give the HTML 2.5 seconds w/o a new image; if the page isn't loaded yet, we'll just wait
			clearInterval(bv_pngFixInterval);
	}



	
	
	function bv_hideFooterWhileLoading() {
		document.writeln('<style type="text/css">#footer, #menuToggle { visibility:hidden; }</style>');
		window.attachEvent("onload", bv_showFooterOnceLoaded);
	}
	function bv_showFooterOnceLoaded() { setTimeout("bv_showFooter()",1000); } // the delay allows ie7 time to do it's fix-thang
	function bv_showFooter() {
		if (El = document.getElementById("footer"))     El.style.visibility = "visible";
		if (El = document.getElementById("menuToggle")) El.style.visibility = "visible";
	}
	
	
	
// activate these functions only if the browser needs it
	var bv_IEVers = navigator.appVersion.match(/MSIE (\d+\.\d+)/);
	if (
			     navigator.platform == "Win32"       // IE on the Mac handles pngs like a champ
			&&   navigator.appName == "Microsoft Internet Explorer" 
			&&   bv_IEVers 
			&&   parseFloat(bv_IEVers[1]) <  7       // IE 7 better do this right, boy howdy
			&& ! navigator.userAgent.match(/opera/i) // Opera claims "MSIE" in its useragent, but handles pngs fine
		) {

	// fix pngs
		if (parseFloat(bv_IEVers[1]) >= 5.5) bv_checkForPngs(); // 5.0 shows the ghostly pngs, but this hack can't fix 'em

	// fix previewed, unfixed footer
		bv_hideFooterWhileLoading();
	}


// for the Flash detection
	flash7Installed = true;

}








