function getFlash (swfPath, width, height, flashVars, bgColor, isAutoPlay, objectId) {
  GetFlash (swfPath, width, height, flashVars, bgColor, isAutoPlay, objectId);
  }

function GetFlash (swfPath, width, height, flashVars, bgColor, isAutoPlay, objectId) {
  document.write("<object ID='" + objectId + "' Style='Width: " + width + "; Height: " + height + "' ClassID='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' CodeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'>");
  document.write("  <param Name='FlashVars' Value='" + flashVars +"' />");
  document.write("  <param Name='AllowScriptAccess' Value='always' />");
  document.write("  <param Name='Movie' Value='" + swfPath + "' />");
  document.write("  <param Name='BGColor' Value='" + bgColor + "' />");
  document.write("  <param Name='Play' Value='" + ((isAutoPlay == null)? 'true' : isAutoPlay) + "' />");
  document.write("  <param Name='Quality' Value='High' />");
  document.write("  <embed Name='" + objectId + "' Src='" + swfPath + "' Quality='High' Play='" + ((isAutoPlay == null)? 'true' : isAutoPlay) + "' BGColor='" + bgColor + "' Style='Width: " + width + "; Height: " + height + "' FlashVars='" + flashVars + "' SWLiveConnect='True' Type='application/x-shockwave-flash' PluginsPage='http://www.macromedia.com/go/getflashplayer' />");
  document.write("</object>");
  }

function isMovieLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
    }
  else {
    return false;
    }
  }

function thisMovie(movieName) {
  if (window.document[movieName]) {
    return window.document[movieName];
    }
  if (navigator.appName.indexOf("Microsoft Internet")==-1) {
    if (document.embeds && document.embeds[movieName]) {
      return document.embeds[movieName];
      }
    else {
      return document.getElementById(movieName);
      }
    }
  }


function playMovie(movieName) {
  if (isMovieLoaded(thisMovie(movieName))) {
    thisMovie(movieName).Play();
    }
  else {
    alert('The movie ' + movieName + ' was not found.  It may still be loading.');
    }
  }

