/* Browser Detect JavaScript
 * Reuben Hawkins
 * Jan 13, 2005
 * This script detects web browser and platform type.
 */

/* This function is called by Front/index.html as this is the first page
 * a viewer should see when entering the site.  This function checks
 * the browser version.  If it is a KNOWN unsupported browser then
 * the unsupported broswer message is printed at the top of the
 * document by PrintUnsupportedBrowserMessage() function. */

function browser_check(){
	var agent = navigator.userAgent.toLowerCase();
	var Unsupported;
	var Supported

	/* The browsers that are KNOWN not to work are all
	   searched for, checked then the results are OR'ed
	   together for a composite final result of weither
	   the browser is a known not working one. */

	Unsupported = 	(agent.indexOf("msie 5") != -1) ||
			(agent.indexOf("msie 4") != -1) ||
			(agent.indexOf("mozilla/4") != -1) ||
			(agent.indexOf("mozilla/3") != -1);

	/* Sometime a browser will be detected as unsupported even
	   when it is supported.  Check to see if it is a KNOWN
	   supported browser. */

	Supported =	(agent.indexOf("msie 6") != -1) ||
			(agent.indexOf("mozilla/5") != -1);

	/* We must MAKE SURE that supported == false AND Unsupported == true.
	   Combinations such as Supported == true and Unsupported == true are
	   possible. */

	if(Supported == false && Unsupported == true)
		PrintUnsupportedBrowserMessage();
}

function PrintUnsupportedBrowserMessage(){
	var appName = navigator.appName;
	var appVersion = navigator.appVersion;

	
}


/* Call this function to print what browser is being used.  This function is also
 * called from Front/index.html in the footer of the doc. */

function browser_detect(){
	document.write('<font color="#aa0077">');
	document.write(navigator.userAgent.toLowerCase());
	document.write('</font>');
}
