// JavaScript Document

function changeImg(imgID,path) {
	var tempimg=document.getElementById(imgID);
	tempimg.src=path;
}

function popUp(URL, width, height) {
	alert (URL + " : " + width + " : " + height)
	window.open (URL,'launch',config='height='+height+',width='+width+',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=yes')

}

// generic flash checker/embedder -- usage: embdFlsh(width,height,"path to flash including swf name","path to 508 including file name")
// to NOT display alert box omit "path to 508" (in case you are displaying more than one flash movie on a page)
function embdFlsh8(flashWidth, flashHeight, flashSwf, textVersion)
{
   detectFlash(8);
   var rndUrlGen = Math.floor(Math.random() * 10000) + 1; //Generate a random number between 1 and 10000 to append onto the flash URL to combat client-side caching.
  	if (flashSwf.indexOf("?") != -1 ) //Check to see if we're pointing to XML files/appending the URL
   {
   		var fullUrl = flashSwf.split("?") //Split flashSwf at the "?" so we can get the path and swf name without xml data on the next line.
   		var flUrl = fullUrl[0];
   		var flashUrl = flUrl.substring(flUrl.lastIndexOf("/"),flUrl.length); //Gets specific name of SWF without path. We find this so we can get only the path on the next line.
   		var flashPath = flUrl.substring(0,flUrl.length - flashUrl.length); //Gets full path without SWF name to use for object base parameter.
   		flashSwf = flashSwf + '&' + rndUrlGen;
   }
   else
   {
   	var flashUrl = flashSwf.substring(flashSwf.lastIndexOf("/"),flashSwf.length); //Gets specific name of SWF without path. We find this so we can get only the path on the next line.
   	var flashPath = flashSwf.substring(0,flashSwf.length - flashUrl.length); //Gets full path without SWF name to use for object base parameter.
   	flashSwf = flashSwf + '?' + rndUrlGen;
   }
   var mPc = '';
   if((haveFlash) && (haveFlashVer))
   {
      mPc = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" align=\"middle\">";
      mPc += "<param name=\"allowScriptAccess\" value=\"always\" />";
     	mPc += "<param name=\"base\" value=\"" + flashPath + "\" />";
     	mPc += "<param name=\"movie\" value=\"" + flashSwf + "\" />";
      mPc += "<param name=\"quality\" value=\"high\" />";
      mPc += "<embed src=\"" + flashSwf + "\" quality=\"high\" wmode=\"opaque\"  width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" align=\"middle\" base=\"" + flashPath + "\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
      mPc += "</object>";
   }
   else if((!haveFlash) || (!haveFlashVer) && (textVersion))
   {
      mPc += '<div class="noFlash">';
      mPc += '<strong>WE COULD NOT DETECT THE REQUIRED FLASH PLAYER.</strong>';
      mPc += '<ul class="sml">';
      mPc += '<li>The page contains rich-media content that uses the Flash Player 8</li>';
      mPc += '<li>We recommend that you get the latest Flash Player</li>';
      mPc += '</ul>';
      mPc += '<p><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" onmouseover="ws(\'Get Latest Flash Player\');return true" onmouseout="ws(\' \');return true" target="_blank">Get Latest Flash Player</a>';
      mPc += '<br /><span class="note">Note: You will need to <a href="javascript:void(0)" onclick="history.go(0)" onmouseover="ws(\'reload this page\');return true" onmouseout="ws(\' \');return true">reload this page</a> after installing Flash Player.</span></p>';
      mPc += '<a href="/strong/index.jsp?fl=false">Browse Non-Flash Version</a>';
      mPc += '</div>';
   }
   document.write(mPc);
}


