//***************************************************************************
// Assign a variable, "who," based on browser type to allow for on-the-fly code generation
// ===========================
// Filename: whoAmI.js
// Copyright (c) 2001 by Blair Reyburn (blairr@ashlandagency.com)
// http://www.ashlandagency.com
//
//
// This program is free software. You can redistribute it and/or modify 
// it under the terms of the GNU General Public License as published by 
// the Free Software Foundation; either version 2 of the License. 
// 
//******************************
// http://www.ashlandagency.com
//
// Build Revision v0.4
// Date: 06/05/2001

var browserName = navigator.appName;
var browserVersion = navigator.appVersion;
var browserAgent = navigator.userAgent.toLowerCase();
var isWin = ( (browserAgent.indexOf("win")!=-1) || (browserAgent.indexOf("16bit")!=-1) );
var isMac = (browserAgent.indexOf("mac")!=-1);
var who = "pc";

// rules if the browser is Windows
if ((browserAgent.indexOf("win")!=-1) || (browserAgent.indexOf("16bit")!=-1)) {
	if (browserName == "Netscape") {
		// checks to see if the browser is a Gecko-based NS i.e. NS6 and up
		if (browserAgent.indexOf('gecko') != -1) {
			who = "winGecko";
		} // end Gecko check
		else {
		// if not a Gecko-based NS, degrade to NS4.x and previous
			who = "winNetscape";
		} // end non-Gecko check
	} // end Netscape Win check
	else {
		who = "pc";
	}
} // end isWin check

// rules if the browser is Mac
if (browserAgent.indexOf("mac")!=-1) {
	if (browserName == "Netscape") {
		// checks to see if the browser is a Gecko-based NS i.e. NS6 and up
		if (browserAgent.indexOf('gecko') != -1) {
			who = "macGecko";
		} // end Gecko check
		else {
		// if not a Gecko-based NS, degrade to NS4.x and previous
			who = "macNetscape";
		} // end non-Gecko check
	} // end Netscape mac check 
	// if not a netscape browser, dub IE
	else {
		who = "macIE";
	} // end browser check for mac
} // end Mac check