// Variables available to you in your HTML page and your scripts

var BROWSER_NAME;
var BROWSER_VERSION;
var PLATFORM;
var IS_IE = false;
var IS_NAV = false;
var HAS_FLASH = false;
var HAS_FLASH4 = false;
var HAS_FLASH5 = false;
var HAS_FLASH6 = false;
var HAS_METASTREAM = false;
var HAS_WINMED = false;
var HAS_REAL_5 = false;
var HAS_REAL_G2 = false;
var HAS_SHOCKWAVE = false;
var VERSION = "1";

////////////////////////////////////////////////////////////////

getBrowserInfo();

if (IS_NAV) {
 		HAS_FLASH = getFlash("Flash");
 		HAS_FLASH4 = getFlash("Flash 4");
		HAS_FLASH5 = getFlash("Flash 5");
		HAS_FLASH6 = getFlash("Flash 6");
 		HAS_METASTREAM = NavPluginSniff("MetaStream");
		HAS_WINMED = NavPluginSniff("Windows Media");
		HAS_REAL_5 = NavPluginSniff("RealPlayer");
		HAS_REAL_G2 = NavPluginSniff("RealPlayer(tm) G2");
		HAS_SHOCKWAVE = NavPluginSniff("Shockwave");
} else {
		if (IS_IE && PLATFORM != "Mac") {
    		document.write('<script language="' + 'vbscr' + 'ipt">\n\n');
			document.write('Dim Plugin_obj\n\n');
			document.write('Function ie_detect(objectName)\n');
			document.write('ie_detect = false\n\n');
			document.write('On Error Resume Next\n');
			document.write('Set Plugin_obj = CreateObject(objectName)\n');
			document.write('if IsObject(Plugin_obj) then\n');
			document.write('ie_detect = true\n');
			document.write('end if\n');
			document.write('End Function\n');
			document.write('</' + 'script' + '>');
	
			HAS_FLASH = ie_detect("ShockwaveFlash.ShockwaveFlash");
			HAS_FLASH4 = ie_detect("ShockwaveFlash.ShockwaveFlash 4");
			HAS_FLASH5 = ie_detect("ShockwaveFlash.ShockwaveFlash 5");
			HAS_FLASH6 = ie_detect("ShockwaveFlash.ShockwaveFlash 6");
			HAS_METASTREAM = ie_detect("MetaStream.MetaStream.1");
			HAS_WINMED = ie_detect("Windows Media Player");
			HAS_REAL_5  = ie_detect("RealPlayer.RealPlayer");
			HAS_REAL_G2  = ie_detect("RMOCX.RealPlayer(tm) G2");
			HAS_SHOCKWAVE = ie_detect("Macromedia.ActiveShockwave.1");
		}
	
		if (PLATFORM == "Mac" && !IS_NAV) {
 			HAS_FLASH = true;
 			HAS_FLASH4 = true;
			HAS_FLASH5 = true;
			HAS_FLASH6 = true;
			HAS_METASTREAM = true;
			HAS_WINMED = true;
			HAS_REAL_5 = true;
			HAS_REAL_G2 = true;
			HAS_SHOCKWAVE = true;
		 }
}

function getFlash(v) {
	for (var i = 0;i < navigator.plugins.length; i++) {
   		if (navigator.plugins[i].name.indexOf(v) != -1) {
				return true;
			}		
   }
	return false;
}


function getBrowserInfo() {
 BROWSER_NAME = navigator.appName;
 if (BROWSER_NAME == "Netscape") {IS_NAV = true;}
 if (BROWSER_NAME == "Microsoft Internet Explorer") {IS_IE = true;}
 
 var plat = navigator.appVersion;
 if (plat.indexOf("Win") != -1) {PLATFORM = "Win";}
 if (plat.indexOf("Mac") != -1) {PLATFORM = "Mac";}
 
 if (plat.charAt(0) == "3") {BROWSER_VERSION = 3;}
 if (plat.charAt(0) == "4") {BROWSER_VERSION = 4;}
 if (plat.charAt(0) == "5" || plat.indexOf("MSIE 5") != -1) {BROWSER_VERSION = 5;}
 if (plat.charAt(0) == "6" || plat.indexOf("MSIE 6") != -1) {BROWSER_VERSION = 6;}
}

// Function used for plugin detection in Navigator
 function NavPluginSniff(plug_in) {
   	for (var i = 0;i < navigator.plugins.length; i++) {
   		if (navigator.plugins[i].name.indexOf(plug_in) != -1) {
   			return true;
   		}		
   	}
   	return false;
}
