<!--
// Flash Detection Script

var MM_FlashCanPlay = false;
var MM_contentVersion = 4;

// Use VBScript to detect flash is available for IE on Windows
if((navigator.appVersion.indexOf("MSIE") != -1) && (navigator.appVersion.toLowerCase().indexOf("win") != -1)) {
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  // document.write('MM_FlashCanPlay = (IsObject(Nothing                                        )) \n');
  document.write('MM_FlashCanPlay = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
  document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

// Detect that the Netscape PlugIn exists.
function detectFlash() {	
	if (navigator.plugins) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.substring(16));
			MM_FlashCanPlay = flashVersion >= 4;
		}
	}	
}

detectFlash();


function writeMap(id, width, height, flashMovie, imageMap, useMapId) {
    var mapSetting=get_cookie("janesMapSetting");
    if (mapSetting=="ImageMap") { MM_FlashCanPlay = false; }
    if ( MM_FlashCanPlay ) {
        document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
        document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
        document.write(' ID="'+id+'" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN="">');
        document.write(' <PARAM NAME=movie VALUE="'+flashMovie+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=WMode VALUE=Transparent> <PARAM NAME=SCALE VALUE=exactfit>');
        document.write(' <EMBED src="'+flashMovie+'" quality=high bgcolor=#FFFFFF  ');
        document.write(' swLiveConnect=FALSE WIDTH="'+width+'" HEIGHT="'+height+'" NAME="allcontenents" ALIGN="" WMode=Transparent scale="exactfit"');
        document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"');
        document.write(' </EMBED>');
        document.write(' </OBJECT><BR>');
        document.write('<a href="JavaScript:setToImageMap()" class="small_link">View the image version of this Flash map.</a>');
    } else{
        document.write('<IMG SRC="'+imageMap +'" WIDTH="'+width+'" HEIGHT="'+height+'" usemap="'+useMapId+'" BORDER=0>');
        document.write('<NOEMBED><IMG SRC="'+imageMap+'" WIDTH="'+width+'" HEIGHT="'+height+'" usemap="'+useMapId+'" BORDER=0></NOEMBED><BR>');
    }
   } //end function writeMap

function writeChart(flashChart, imageChart) {
    if ( MM_FlashCanPlay ) {
	   document.write(flashChart);
   } else{
	  document.write(imageChart);
    }
} //end function writeChart


function setToImageMap() {
  document.cookie="janesMapSetting=ImageMap";
  window.location=location.href;
}

function testCookieValue() {
  var mapSetting=get_cookie("janesMapSetting") 
  alert(mapSetting);
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}


//-->
