//**browser detection **/
var appName	= navigator.appName;
var appVer	= parseInt(navigator.appVersion);
var isNS	= (appName.indexOf("Netscape") != -1);
var isIE	= (navigator.appName.indexOf("Microsoft") != -1);
var isSafari = (navigator.appVersion.indexOf("Safari") != -1);
var isType	= (isSafari) ? "Safari" : ( (isNS) ? "Netscape" : (isIE) ? "M$IE" : "Other");

function getStats() {
	strMsg = "type: " + isType;
	strMsg += "\nappName: '" + appName + "'";
	strMsg += "\nappVersion: " + appVer;
	strMsg += "\nnavigator.appName: " + navigator.appName;
	strMsg += "\nnavigator.appVersion: " + navigator.appVersion;
	strMsg += "\nwindow.outerWidth:" +  window.outerWidth;
	strMsg += "\nwindow.outerHeight: " + window.outerHeight;
	strMsg += "\nwindow.innerWidth: " + window.innerWidth;
	strMsg += "\nwindow.innerHeight: " + window.innerHeight;
	return strMsg;
}

function deBug(str) { alert(str); }

/*
	This function resizes and centers the screen for displaying
	the Discovery Channel Beyond page.  If the screen resolution 
	is 1024 X 768 or below, it resizes to the maximum height/width of
	the screen, otherwise it resizes to the given width/height and 
	then centers it on the screen	
*/
function resizeAndCenterWindow(width, height) {
	if (!isSafari) {
		if(screen.height <= 768 && screen.width <= 1024) {
			window.resizeTo(screen.width, screen.height);
			self.moveTo(0, 0);
			return;
		}
	}
	var IE = document.all;
	window.resizeTo(width, height);
	if(IE) {
		self.moveTo((self.screen.width - document.body.clientWidth) / 2, (self.screen.height - document.body.clientHeight) / 2 - 80);
	} else {
		self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2); 		
	}
}

/* This function checks that the resolution is 
	higher than 800 X 600.  If not, it shows an alert */
function checkResolution() {
	if (screen.height <= 600 && screen.width <= 800) {
		alert("To effectively use this page you must set\n your screen resolution higher than 800 X 600");
	}
}

