function run_movie(swf,w,h,wmode,flash_vars,id)
{
  return print_flash_code(swf,w,h,wmode,flash_vars,id);
}

function print_flash_code(swf,w,h,wmode,flash_vars,id)
{
  if (!flash_vars) flash_vars = '';
  document.write(get_flash_code(swf,w,h,wmode,flash_vars,id));
  return true;
}

function get_flash_code(swf,w,h,wmode,flash_vars,id)
{
  var text, embed_text = '';

  if (!id || typeof id == 'undefined')
    var id = swf;

  text ="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + w + "\" height=\"" + h + "\" id=\"" + id + "\">\r\n";
  text+="<param name=\"allowScriptAccess\" value=\"sameDomain\">\r\n";
  text+="<param name=\"allowFullScreen\" value=\"true\">\r\n";
  text+="<param name=\"movie\" value=\"" + swf + "\">\r\n";
  text+="<param name=\"menu\" value=\"false\">\r\n";
  text+="<param name=\"quality\" value=\"high\">\r\n";
  text+="<param name=\"scale\" value=\"exactfit\">\r\n";
  text+="<param name=\"bgcolor\" value=\"#ffffff\">\r\n";

  if (typeof wmode != 'undefined' && wmode)
  {
    text += "<param name=\"wmode\" value=\"" + wmode + "\">\r\n";
    embed_text += " wmode=\"" + wmode + "\"";
  }

  if (typeof flash_vars != 'undefined' && flash_vars)
  {
    text += "<param name=\"FlashVars\" value=\"" + flash_vars + "\">\r\n";
    embed_text += " FlashVars=\"" + flash_vars + "\"";
  }

  text+="<embed id=\"" + id + "\" name=\"" + id + "\" src=\"" + swf + "\" quality=\"high\" scale=\"exactfit\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + w + "\" height=\"" + h + "\" menu=\"false\" "+embed_text+" bgcolor=\"#ffffff\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"true\">\r\n";
  text+="</object>\r\n";

  return text;
}

function insert_flash_code(container_id,swf,w,h,wmode,flash_vars,id)
{
  var e = _ge(container_id);
  if (e)
  {
    if (!flash_vars) flash_vars = '';
    e.innerHTML = get_flash_code(swf,w,h,wmode,flash_vars,id);
  }
}

function thisMovie(movieName)
{
  if (navigator.appName.indexOf("Microsoft") != -1)
  {
    return window[movieName];
  }
  else
  {
    return document[movieName];
  }
}

function thisMovie2(win, movieName)
{
  if (navigator.appName.indexOf("Microsoft") != -1)
  {
    return win[movieName];
  }
  else
  {
    return win.document[movieName];
  }
}

