<!--

// set these two vars to the appropriate php pages
// we should cookie the non-flash users, but make it expire at the end of the session (so we can retest)
// does this work under ie5/flash5?


//forwardingURL = 'http://208.252.232.4/thgusa.com/index.php';
//forwardingURLFlashless = 'http://208.252.232.4/thgusa.com/index.php?flash=no';


function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.p = navigator.platform
	this.ie = (this.b=="ie" && this.v>=4 && this.p=="Win32")
	this.ns = (this.b=="ns" && this.v>=4)
	this.three = (this.v < 4)
}

is = new BrowserCheck();

if (is.three) {
	//this.location.href = 'noFlash.html';
} else {

   flash5Installed = false;
   flash6Installed = false;
	if (navigator.plugins) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"] && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion >= 6;
		}
	}

   var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
   var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

   if(isIE && isWin){
  	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  	document.write('on error resume next \n');
  	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  	document.write('</SCR' + 'IPT\> \n');
   }

	if (flash6Installed) {
		hasFlash = "plugin";
	} else {
		hasFlash = "no";
	}
}

// uncomment this in order to test the lack of plugin stuff
//hasFlash = 'no';

if (parseInt(navigator.appVersion) >= 4) {
   oldTimer = false;
   var browserVar = navigator.platform;
   var isWin = browserVar.indexOf("Win") != -1;
   var isMac = browserVar.indexOf("Mac") != -1;
   if (document.layers) {
     var n4 = true;
   } else if (document.getElementById && !(document.all)) {
     var ns = true;
   } else if (document.getElementById && document.all) {
     var ie = true;
   } else if(document.all) {
     var i4 = true;
   }
}


// begin onload stuff

height = 480;
width = 780;

if (hasFlash == 'plugin') {
	document.cookie = "Flash=Yes";
	
	//document.location = forwardingURL;

	} else {

	// pop a window to macromedia's site

	dialog = window.open('http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&P5_Language=English','MM','toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=' + width + ',height=' + height + ',scrollbars=yes');
	dialog.opener = this;
	// contine on to the thg site, sans flash
	document.cookie = "Flash=No";
	
	var fileName = location.pathname.substring(location.pathname.lastIndexOf('/')+1)
	var queryString = location.search.substring(1);
	
	if (queryString) {
		newLoc = fileName + '?' + queryString + '&flash=false';
	} else {
		newLoc = fileName + '?flash=false';
	}
		
	document.location = newLoc;

	}

// -->
