// JavaScript Document

/*******************************************************************
          Written by  :  Kyle Bottorff
		  				 Owner, Lead Design
					     www.erisluminal.com
									
		  Date        :  04.03.2009
					 
		  Description :  Capture's the user's browser version, and 
		  				 runs a check to ensure compatibility.  If
						 then user is using an older, unsupported
						 browser, the script will alert the user 
						 with embedded text on the page with 
						 upgrade options.
						 
		  Notice	  :  Use of this script is permitted only with
						 written consent of ErisLuminal.
*******************************************************************/



/*******************************************************************
                     Variables declared
*******************************************************************/

var internetExplorer = "Microsoft Internet Explorer";
var unsupportedIE = "MSIE";
var userBrowser = navigator;
var userAgentInfo;
var userAgentVer;
var msieLoc;
var warningMsg = '<p class="center"><div id="browserwarning"><strong>You are using an unsupported browser.\
</strong><br />Please upgrade to the latest version of <a href="http:/' + '/microsoft.com/ie/">Microsoft \
Internet Explorer</a>, or download an alternative such as <a href="http:/' + '/www.mozilla.com/firefox/">\
Mozilla Firefox</a> or <a href="http:/' + '/www.google.com/chrome/">Google Chrome</a>.</div></p>';

/*******************************************************************
                         Main Script
*******************************************************************/

if (userBrowser.appName == internetExplorer)
{
	userAgentInfo = userBrowser.userAgent;
	userAgentInfo = userAgentInfo.toUpperCase();
	msieLoc = userAgentInfo.indexOf("MSIE");
	msieLoc += 5;
	userAgentVer = userAgentInfo.substr(msieLoc,3);
	
	if (userAgentVer < 7.0)
	{
		document.write(warningMsg);
	}
}
