// In this section we set up the content to be placed dynamically on the page.
// Customize movie tags and alternate html content below.
//testing
//mnum=Math.ceil(Math.random()*3);
movieTag="media/cgb_home.swf";
movieHeight="109";
movieWidth="777";

		
if (location.search.indexOf("bypass=true") !=-1) {
	// this will show the falsh regardless
	useRedirect=false;
	hasRightVersion=true;
}	else if (location.search.indexOf("noflash=true") !=-1) {
	//this will NOT display the flash regardless
	useRedirect=false;
	hasRightVersion=false;
}

if (!useRedirect) {    // if dynamic embedding is turned on
  if(hasRightVersion) {  // if we've detected an acceptable version
    var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'WIDTH="'+movieWidth+'" HEIGHT="'+movieHeight+'" '
    + 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">'
    + '<PARAM NAME="MOVIE" VALUE="'+movieTag+'">'
    + '<PARAM NAME="PLAY" VALUE="true">'
    + '<PARAM NAME="LOOP" VALUE="false">'
    + '<PARAM NAME="QUALITY" VALUE="high">'
    + '<PARAM NAME="MENU" VALUE="false">'
    + '<EMBED SRC="'+movieTag+'"'
    + 'WIDTH="'+movieWidth+'" HEIGHT="'+movieHeight+'" '
    + 'PLAY="true"'
    + 'LOOP="false"'
    + 'QUALITY="high"'
    + 'MENU="false"'
    + 'TYPE="application/x-shockwave-flash"'
    + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
    + '</EMBED>'
    + '</OBJECT>';

    document.write(oeTags);   // embed the flash movie
				
  } else {  // flash is too old or we can't detect the plugin
    // NOTE: height, width are required!
    var alternateContent = '<a href="http://www.macromedia.com/go/getflashplayer" target="_blank" ><<img src="img/hm_noflash.jpg" alt="Welcome to CGB - Get the flash player for more features" width="777" height="109" /></a>';
		
			//	alert("Flash plugin description: " + flashDescription);		
  document.write(alternateContent); 
	  // insert non-flash content
  }
}


