// JavaScript Document
// Version check based upon the values entered above in "Globals"

var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function getAnchor() {
	var loc = document.location.href;
	var pos = loc.lastIndexOf("#");
	if (pos > 0) {
		return loc.substr(pos+1);	
	} else {
		return "";	
	}
}

function gotoAnchor(str) {
	document.location.href = "#" + str;
}

// Check to see if the version meets the requirements for playback
if (hasReqestedVersion) {  // if we've detected an acceptable version
    var oeTags = '<div id="maindiv" style="width:750px;"><object id="main" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="750" height="464">'
    + '<param name="FlashVars" value="gotopage=' + getAnchor() + '" /><param name="allowScriptAccess" value="sameDomain" />'
	+ '<param name="movie" value="index1.swf"><param name="quality" value="high">'
    + '<embed name="main" swLiveConnect="true" FlashVars="gotopage=' + getAnchor() + '" src="index1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="464">'
    + '<\/embed>'
    + '<\/object></div>';
    document.write(oeTags);   // embed the Flash Content SWF when all tests are passed
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'You need Flash fo view this site. Download <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" target="_blank">here</a>.';
    document.write(alternateContent);  // insert non-flash content
  }