function print_flash_code(swf,w,h,wmode,flash_vars)
{
  if (!flash_vars) flash_vars = '';
  document.write(get_flash_code(swf,w,h,wmode,flash_vars));
  return true;
}

function get_flash_code(swf,w,h,wmode,flash_vars)
{
  var text, embed_text = '';

  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=\"" + swf + "\">\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 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)
{
  var e = _ge(container_id);
  if (e)
  {
    if (!flash_vars) flash_vars = '';
    e.innerHTML = get_flash_code(swf,w,h,wmode,flash_vars);
  }
}
