<!-- begin script hiding
// -------------------------------------------------------------------------------
var $dbg = 0;
var $browser = "";
var $browserType = "";
var $platformType = "";

var DP = "####";
// -------------------------------------------------------------------------------
function EmitStyles()
{
	// emits the link to the correct style sheet based on browser type
	
	var $f = "EmitStyles";
	
	document.open();
	
	if ( $dbg ) {
		document.write(DP + " " + $f + " ( phpGen='" + $phpGen + "' <BR>");
	}
	
	$browser = navigator.userAgent;		// get current browser ID string
	
	GetBrowserType();					// get type of current browser so can generate proper CSS

	GetPlatformType();					// get type platform of current browser so can generate correct CSS
	
	if ( $platformType == "Other" ) {
		// platformType is other, so change browserType to other since can't test other than on PC and Mac
		$browserType = "Other";
	}
		
	switch($browserType) {
		case "IE4.xP":								// IE 4.x+ or Opera 3.5+
			// choose proper style sheet
			switch($platformType) {
				case "Win":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/iE4xPStylesWin.css\">\n");
					break;
				case "Mac":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/iE4xPStylesMac.css\">\n");
					break;
				case "Other":
					// don't use a style sheet or CSS at all
					break;
				default:
					break;
			}
			break;
		case "NN5.xP":								// NN 5.x+
			// choose proper style sheet
			switch($platformType) {
				case "Win":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/nN5xPStylesWin.css\">\n");
					break;
				case "Mac":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/nN5xPStylesMac.css\">\n");
					break;
				case "Other":
					// don't use a style sheet or CSS at all
					break;
				default:
					break;
			}
			// choose other variables
			break;
		case "NN4.7x":								// NN 4.7x+ up to and not including NN 5.x+
			// choose proper style sheet
			switch($platformType) {
				case "Win":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/nN47xStylesWin.css\">\n");
					break;
				case "Mac":
					document.write("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"_styles/nN47xStylesMac.css\">\n");
					break;
				case "Other":
					// don't use a style sheet or CSS at all
					break;
				default:
					break;
			}
			break;
		case "Other":								// all other browsers--IE 3.x-, NN 4.7x-, Op 3.4-, etc.
			// don't use a style sheet or CSS at all
			break;
		default:
			document.write("<P>logic error in program</P>");
			break;
	}

	if ( $dbg ) {
		document.write(DP + " " + $f + " ) browser='" + $browser + "', browserType='" + $browserType + "', platformType='" + $platformType + "'<BR>");
	}
	
	document.close();
	
	return true;

}	// EmitStyles
// -------------------------------------------------------------------------------
function GetBrowserType()
{
	// gets the type of a browser as follows:
	//	IE4.xP--IE 4.x+ or 5.x+ browsers, also Opera 3.5+
	//	NN5.xP--NN 5.x+ browsers (NN 6.0 is really 5.0)
	//	NN4.7x-- NN 4.7x+ browsers up to but not including 5.x
	//	Other--any other browser including older versions of IE (before 4.x) and NN (before 4.7x)
	//	or Linux and Unix versions--even modern ones
	
	// Here are some sample $HTTP_USER_AGENT ids for some common browsers:
	//	(1) IE 5.5--Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
	//	(2) NN 6.01--Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20010131 Netscape6/6.01
	//	(3) NN 4.76--Mozilla/4.76 [en] (WinNT; U)
	//	(3) NN 4.03--Mozilla/4.03 [en] (WinNT; U ;Nav)
	//	(4) Op 5.02--Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 5.02  [en]
	//	(5) IE 5.0 Mac--Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
	//	(6) NN 4.76 Mac--Mozilla/4.76 (Macintosh; I; PPC)
	
	// browser sniffing is necessitated by the horrible CSS browser support
	
	var $f = "GetBrowserType";

	if ( $dbg ) {
		document.write(DP + " " + $f + " ( browser='" + $browser + "'<BR>");
	}
	
	if ( ($browser.match(/MSIE\s*[456789]\./i)) ||
		 ($browser.match(/opera\s*(3\.[56789]|[456789]\.)/i)) ) {
		// IE 4.x or 5.x browser or newer OR Opera 3.5 or newer
		$browserType = "IE4.xP";
	}
	else if ( ($browser.search("compatible") == -1) &&
			  ($browser.match(/Mozilla\/[56789]\.[0123456789]{0,}/i)) ) {
		// NN 5.x or newer
		$browserType = "NN5.xP";
	}
	else if ( ($browser.search("compatible") == -1) &&
			  ($browser.match(/Mozilla\/4\.[789][0123456789]{0,}/i)) ) {
		// NN 4.7x up to 4.9x
		$browserType = "NN4.7x";
	}
	else {
		$browserType = "Other";
	}
		
	if ( $dbg ) {
		document.write(DP + " " + $f + " ) browser='" + $browser + "', browserType='" + $browserType + "'<BR>");
	}

	return $browserType;

}	// GetBrowserType
//-----------------------------------------------------------------------------
function GetPlatformType()
{
	// gets the platform type of a browser as follows from $browser as follows:
	//	Win--Windows in any flavor--WinNT, Win 2000, Win 98, etc.
	//	Mac--Macintosh in any flavor--Macintosh, Mac_PowerPC, etc.
	//	Other--any other platform including Linux, Unix, etc.
	
	// Here are some sample $HTTP_USER_AGENT ids for some common browsers:
	//	(1) IE 5.5--Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
	//	(2) NN 6.01--Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20010131 Netscape6/6.01
	//	(3) NN 4.76--Mozilla/4.76 [en] (WinNT; U)
	//	(3) NN 4.03--Mozilla/4.03 [en] (WinNT; U ;Nav)
	//	(4) Op 5.02--Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 4.0) Opera 5.02  [en]
	//	(5) IE 5.0 Mac--Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
	//	(6) NN 4.7 Mac--Mozilla/4.7 (Macintosh; I; PPC)
	
	// browser sniffing is necessitated by the horrible CSS browser support
	
	var $f = "GetPlatformType";

	if ( $dbg ) {
		document.write(DP + " " + $f + " ( browser='" + $browser + "'<BR>");
	}

	if ( $browser.match(/win/i) ) {
		// platform is Windows of some kind
		$platformType = "Win";
	}
	else if ( $browser.match(/mac/i) ) {
		// platform is Macintosh of some kind
		$platformType = "Mac";
	}
	else {
		$platformType = "Other";
	}
		
	if ( $dbg ) {
		document.write(DP + " " + $f + " ) browser='" + $browser + "', platformType='" + $platformType + "'<BR>");
	}

	return $platformType;

}	// GetPlatformType
// -------------------------------------------------------------------------------
if ( ! $phpGen ) {
	// if $phpGen == false, choose style sheet with JavaScript so can locally test webpages without 
	// uploading to server
	// if PHP is generating the code, $phpGen == true, then don't do so in JavaScript
	EmitStyles();
}

// end script hiding -->
