
//popupscript script
var wsize;
var hsize;
function select_link(linkurl, wsize, hsize, scbar, mnbar)	{
        amlPop = window.open(linkurl,"amlpop","width= "+wsize+",scrollbars="+scbar+",height= "+hsize+",menubar="+mnbar+",toolbar=no,status=yes,location=no");
window.amlPop.focus();}




// flash detect - set these 3 variables!
var flashVersionNeeded = 7;
var maxVersion = 8;
var minVersion = 5;

// *************
// you do NOT need to change anything below here!!!!!
//
// everything below this point is internal until after the body tag
// *************

// system globals
var actualVersion = 0;
var useFlash = false;

for (counter=minVersion; counter < maxVersion+1; counter++){
	eval("var flash" + counter + "Installed = false;");
}

// check the browser
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		// true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows


if(isIE && isWin){ // don't write vbscript tags on anything but ie win
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	for (counter=minVersion; counter < maxVersion+1; counter++){
		//eval("document.write('flash"+counter+"Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash."+counter+"\"))) \n');");
		document.write('flash'+counter+'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+counter+'"))) \n');
	}
	document.write('</SCR' + 'IPT\> \n');
}


// for non win/i.e. browsers
function flashDetect(){	

	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash"]){
			var flashDescription = navigator.plugins["Shockwave Flash"].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			for (counter=minVersion; counter < maxVersion+1; counter++){
				eval("flash"+counter+"Installed = flashVersion == "+counter+";");
			}
		}
	}
	
	// loop through all versions we're checking, and set actualVersion to highest detected version
	for (var i = minVersion; i <= maxVersion; i++) {	
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}

	//*********************************************** browser detect
	var flashBrowser = false;
	var brVer = navigator.appVersion.indexOf("[") != -1 ? navigator.appVersion.slice(0,navigator.appVersion.indexOf("[")-1) : navigator.appVersion.slice(0,navigator.appVersion.indexOf("(")-1);

	//alert("browser version = " + (brVer) + "\n\t" + navigator.appVersion)
	//if (isWin) {
	//	if (isIE) {
			//alert(flashVersionNeeded)
			if (brVer >= 4) {   
				flashBrowser = true;       
			} else { 
				flashBrowser = false;
			}
	
	if (actualVersion >= flashVersionNeeded && flashBrowser) {
		useFlash = true;

	} else {
		useFlash = false;

	}
	//if (actualVersion != maxVersion) alert("flashversion = " + actualVersion);
}

// run the function
flashDetect();
