// JavaScript Document
/**
Cross browser scripts for detecting the current browser being used by the client.
This script taken from  Source code from the Web Wizard Series book on Javascript by Stephen Estrella
**/
/* Callout: theApp will contain the browser name */
var theApp = navigator.appName.toLowerCase();

/* Callout: UA for user agent will contain more detailed browser info. For example, UA for Internet Explorer on Mac would be 'mozilla/4.0 (compatible; msie 5.0; mac_powerpc)' */
var UA = navigator.userAgent.toLowerCase();

/* variables for the two major browsers in existence today. */
var isIE = (UA.indexOf('msie') >= 0) ? true : false;
var isNS = (UA.indexOf('mozilla') >= 0) ? true : false;

// 'compatible' text string exists only in non-Netscape browsers
if (UA.indexOf('compatible')>0){
	isNS = false;
}

// platform
var thePlatform = navigator.platform.toLowerCase();
var isMAC = (UA.indexOf('mac') >= 0) ? true : false;
var isWIN = (UA.indexOf('win') >= 0) ? true : false;

/* Most UNIX users use X-Windows so this detects UNIX most of the time.*/
var isUNIX = (UA.indexOf('x11') >= 0) ? true : false;

// browser version
var version = navigator.appVersion;
var isMajor = parseInt( version );
// Internet Explorer version 5 on the Mac reports itself as version 4
if(isIE && isMAC) {
	if(UA.indexOf("msie 5")) {
		isMajor = 5;
		var stringLoc = UA.indexOf("msie 5");
		version = UA.substring(stringLoc + 5, stringLoc + 8);
	}
}

// Netscape 6 reports itself as version 5
if(isNS && isMajor>4) {
	if(UA.indexOf("netscape6")) {
		isMajor = 6;
		var stringLoc = UA.indexOf("netscape6");
		version = UA.substring(stringLoc + 10, stringLoc + 14);
	}
}
var isMinor = parseFloat( version );

var obsolete = (document.getElementById) ? false : true;
/* End of browser detection code */