var browsername;
var output;
var browserOk = true;
var browserTooLow = false;
var browserStatus = "";
var firefoxLowVersion = 2;
var ieLowVersion      = 6;
var safariLowVersion  = 3;

var minWidth = 800;
var minHeight = 600;

var flashMajorVersion = 9;
var flashMinorVersion = 0;
var flashRevision     = 124;
var browserLowVersion = 0;


/* Determine the browser */
if (browser.isChrome) {
	browsername = "Google Chrome";
}
else if (browser.isOpera) {
	browsername = "Opera";
}
else if (browser.isGecko == true && browser.isNS != true) {
	browsername = "Firefox";
	if (browser.versionMajor < firefoxLowVersion) {
		browserLowVersion = firefoxLowVersion
		browserTooLow = true;
		browserOk = false;
	}
}

else if (browser.isIE) {
	browsername = "Internet Explorer";
	if(browser.isIE6up == false) {
		browserOk = false;
		browserTooLow = true;
		browserLowVersion = ieLowVersion;
	}
}

else if (browser.isSafari) {
	browsername = "Safari";
	if (browser.isWin == true) {
		browserStatus = "<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />This site is not designed to run on Safari for Windows.  Please follow <a href='/pages/firefoxtut.html'>these instructions</a> to install Mozilla Firefox, or alternatively you can download <a href='http://www.google.com/chrome'>Google Chrome</a> instead.</div>";
		browserOk = false;
	}
	else if (browser.versionMajor < safariLowVersion) {
		browserOk = false;
		browserTooLow = true;
	}
		
}

else
{
	browsername = 'an unknown browser';
	browserOk = false;
	browserStatus = "<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />This site is not designed to run with the browser you have installed.  Please follow <a href='/pages/firefoxtut.html'>these instructions</a> to install the latest version of Mozilla Firefox, or alternatively you can download <a href='http://www.google.com/chrome'>Google Chrome</a> instead.</div>";
	browser.versionMajor = '';
}



document.writeln("<div class='info'><img style='margin-right:5px' src='/assets/siteimages/info.png' border='0' alt='info' />You are using "+browsername+" version "+browser.versionMajor+".</div>");

if (browserOk)
	browserStatus = "<div class='ok'><img src='/assets/siteimages/tick-glow.png' border='0' alt='Ok' />The version of "+browsername+" you are using should be fine for using this site.</div>";
else if (browserTooLow)
	browserStatus = "<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />The version of "+browsername+" you are using is too old for using with this site.  Please upgrade it to at least version "+browserLowVersion+"</div>";

document.writeln(browserStatus);

/* Determine the Flash Player version */
if (FlashDetect.installed) {
	document.writeln("<div class='info'><img style='margin-right:5px' src='/assets/siteimages/info.png' border='0' alt='info' />You have Flash Player version "+FlashDetect.major+"."+FlashDetect.minor+"."+FlashDetect.revision+" installed.</div>");	

	if ((FlashDetect.major < flashMajorVersion) ||
		(FlashDetect.major == flashMajorVersion && FlashDetect.minor < flashMinorVersion) ||
		(FlashDetect.major == flashMajorVersion && FlashDetect.minor == flashMinorVersion && FlashDetect.revision < flashRevision)) {
		document.writeln("<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />The version of Flash Player you are using is too old for using with this site.  Please upgrade it to at least version "+flashMajorVersion+"."+flashMinorVersion+"."+flashRevision+".  Follow <a href='/pages/flashtut.html'>these instructions</a> to install the latest version of Flash Player.</div>");	
		browserOk = false;
	}
	else
		document.writeln("<div class='ok'><img src='/assets/siteimages/tick-glow.png' border='0' alt='Ok' />The version of Flash Player you are using should be fine for using with this site.  </div>");	
}
else
	document.writeln("<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />You do not have the Flash Player installed in your web browser.  You need to install the player to use this site.  Follow <a href='/pages/flashtut.html'>these instructions</a> to install the latest version of Flash Player.</div>");

if (screen.width < minWidth || screen.height < minHeight)
	document.writeln("<div class='error'><img src='/assets/siteimages/cross-glow.png' border='0' alt='ERROR' />Your screen resolution is too low.  Please adjust it to at least "+minWidth+"x"+minHeight+" in order to use this site.</div>");
else
	document.writeln("<div class='ok'><img src='/assets/siteimages/tick-glow.png' border='0' alt='Ok' />Your screen resolution is "+screen.width+"x"+screen.height+", which should be fine to view this site.</div>");

	


