  var cId = 0;
  var aV = 0;
  var swVersion;
  var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
  var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

  if (isIE && isWin)
  {
    document.write('<scr' + 'ipt language="VBScript"\> \n');
    document.write('Function VBGetSwfVer(i) \n');
    document.write('on error resume next \n');
    document.write('Dim swControl, swVersion \n');
    document.write('swVersion = 0 \n');
    document.write('set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i)) \n');
    document.write('if (IsObject(swControl)) then \n');
    document.write('swVersion = 0 \n');
    document.write('swVersion = swControl.GetVariable("$version") \n');
    document.write('end if \n');
    document.write('VBGetSwfVer = swVersion \n');
    document.write('End Function \n');
    document.write('</scr' + 'ipt\> \n');
  }
  else
  {
    var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

    function JSGetSwfVer(i)
    {
      if (navigator.plugins != null && navigator.plugins.length > 0)
      {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])         {
          var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
          var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
          descArray = flashDescription.split(" ");
          tempArrayMajor = descArray[2].split(".");
          versionMajor = tempArrayMajor[0];

          if ( descArray[3] != "")
            tempArrayMinor = descArray[3].split("r");
          else
            tempArrayMinor = descArray[4].split("r");

          versionMinor = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
          flashVer = parseFloat(versionMajor + "." + versionMinor);
        }
        else
          flashVer = -1;
      }
      else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
      else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
      else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
      else
        flashVer = -1;

      return flashVer;
    }
  }

function checkFlash(rV)
{
  var ua = navigator.userAgent.toLowerCase();
  this.webtv = (ua.indexOf("webtv") > -1);
  this.ie = (parseFloat(ua.slice(ua.indexOf("msie")+5)));
  this.nn = (parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
  var browser = navigator.appName.toLowerCase();

  this.netscape = (browser == "netscape");
  this.mac = (ua.indexOf("mac") > -1);
  this.flash = false;

  if (isIE && isWin)
  {
    aV = VBGetSwfVer(rV);

    if (aV != 0)
    {
      var cVArray = VBGetSwfVer(rV).split(" ");
      cVArray = cVArray[1].split(",");
      aV = cVArray[0];
    }
  }
  else 
    aV = JSGetSwfVer(rV);

  if (aV >= rV)
  {
    if (this.netscape && this.IEonly == 'TRUE' || this.mac && this.IEonly == 'TRUE')
      this.flash = false;
    else
      this.flash = true;
  }
}

function flashObj()
{
  cId += 1;
  this.flashFile = "/Flash/blank.swf";
  this.LiveConnect = "FALSE";
  this.IEonly = null;
  this.wmode = "opaque";
  this.redirect = null;
  this.DenyIEdl = "FALSE";
  this.NoFlashContentID = null;
  this.altImg = "/blank.gif";
  this.bgcolor = null;
  this.altTxt = null;
  this.height = "400";
  this.width = "520";
  this.salign="lt";
  this.align="left";
  this.flashVars = null;
  this.ID = "flash"+ cId;
  this.name = "flash"+ cId;
  this.webTV = "true";
  this.quality = "best";
  this.scale = "exactfit";
  this.menu = "false";
  this.deviceFont = "false";
  this.FlashVer = 5;
  this.cabVersion = "5,0,0,0";
  this.allowScriptAccess = "Always";
  this.allowNetworking = "All";
  this.useDOM = false;
  this.targetElement = null;
  this.render = writeFlashComponent;
}

function writeFlashComponent(val)
{
  var Ticket = new checkFlash(this.FlashVer);
  var sCR = "";

  if (Ticket.flash)
  {
    if (Ticket.mac || Ticket.netscape)
    {
      sCR='<embed src="'+this.flashFile+'" swliveconnect="'+this.LiveConnect+'" width="'+this.width+'" height="'+this.height+'" quality="'+this.quality+'" scale="'+this.scale+'" flashvars="'+ this.flashVars +'" wmode="'+this.wmode+'" id="'+this.ID+'" name="'+this.name+'" menu="'+this.menu+'" devicefont="'+this.deviceFont + '"';
      if (this.bgcolor)
        sCR += ' bgcolor="'+this.bgcolor + '"';

      if (this.salign)
        sCR += ' salign="'+this.salign + '"';

      if (this.allowScriptAccess)
        sCR+= ' allowscriptaccess="'+this.allowScriptAccess+'"';

      if (this.allowNetworking)
        sCR+= ' allownetworking="'+this.allowNetworking+'"';

      sCR += ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
    }
    else if (this.DenyIEdl=='TRUE')
    {
      sCR="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.FlashVer+",0,0,0\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
      sCR+="<param name=movie value=\""+this.flashFile+"\">\n";
      sCR+="<param name=quality value=\""+this.quality+"\">\n";
      sCR+="<param name=scale value=\""+this.scale+"\">\n";
      sCR+="<param name=menu value=\""+this.menu+"\">\n";
      sCR+="<param name=wmode value=\""+this.wmode+"\">\n";
      if (this.bgcolor)
        sCR+="<param name=bgcolor value=\""+this.bgcolor+"\">\n";

      if (this.flashVars)
        sCR+="<param name=FlashVars value=\""+this.flashVars+"\">\n";

      if (this.salign)
        sCR+="<param name=salign value=\""+this.salign+"\">\n";

      if (this.allowScriptAccess)
        sCR+="<param name=allowScriptAccess value=\""+this.allowScriptAccess+"\">\n";

      if (this.allowNetworking)
        sCR+="<param name=allowNetworking value=\""+this.allowNetworking+"\">\n";

      sCR+="<param name=devicefont value=\""+this.deviceFont+"\">\n";

      if (this.bgcolor)
      {
        sCR+="<embed src="+this.flashFile+" swliveconnect="+this.LiveConnect+" width="+this.width+" height="+this.height+" quality="+this.quality+" scale="+this.scale+" wmode="+this.wmode+" id="+this.ID+" name="+this.name+" menu="+this.menu+" devicefont="+this.deviceFont+" flashvars="+ this.flashVars +" bgcolor="+this.bgcolor+" type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></embed></object>";
      }
      else
      {
        sCR+="<embed src="+this.flashFile+" swliveconnect="+this.LiveConnect+" width="+this.width+" height="+this.height+" quality="+this.quality+" scale="+this.scale+" wmode="+this.wmode+" id="+this.ID+" name="+this.name+" menu="+this.menu+" devicefont="+this.deviceFont+" flashvars="+ this.flashVars +" type=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></embed></object>";
      }
    }
    else if (Ticket.ie>=4 && this.DenyIEdl=='FALSE')
    {
      sCR="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.cabVersion+"\" id=\""+this.ID+"\" width=\""+this.width+"\" height=\""+this.height+"\">\n";
      sCR+="<param name=movie value=\""+this.flashFile+"\">\n";
      sCR+="<param name=quality value=\""+this.quality+"\">\n";
      sCR+="<param name=scale value=\""+this.scale+"\">\n";
      sCR+="<param name=menu value=\""+this.menu+"\">\n";
      sCR+="<param name=wmode value=\""+this.wmode+"\">\n";
      if (this.flashVars)
        sCR+="<param name=FlashVars value=\""+this.flashVars+"\">\n";

      if (this.bgcolor)
        sCR+="<param name=bgcolor value=\""+this.bgcolor+"\">\n";

      if (this.salign)
        sCR+="<param name=salign value=\""+this.salign+"\">\n";

      if (this.allowScriptAccess)
        sCR+="<param name=allowScriptAccess value=\""+this.allowScriptAccess+"\">\n";

      if (this.allowNetworking)
        sCR+="<param name=allowNetworking value=\""+this.allowNetworking+"\">\n";

      sCR+="<param name=devicefont value=\""+this.deviceFont+"\">\n";
      sCR+="</object>\n";
    }
    else if (Ticket.webtv)
    {
      sCR="<embed src="+this.flashFile+" swliveconnect=TRUE width="+this.width+" height="+this.height+" quality="+this.quality+" scale="+this.scale+" wmode="+this.wmode+" id="+this.ID+" name="+this.name+" menu="+this.menu+" devicefont="+this.deviceFont+" flashvars="+ this.flashVars +" type=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></embed>";
    }
  }
  else
  {
    if (this.redirect)
      top.location.href = this.redirect;
    else
    {
      if (this.NoFlashContentID != null)
        document.getElementById(this.NoFlashContentID).style.display = 'block';
      else if (this.altTxt)
        sCR = this.altTxt;
      else
        sCR="<img src="+this.altImg+" width="+this.width+" height="+this.height+" />";
    }
  }

  if (val == true)
  {
    if (this.useDOM)
      document.getElementById(this.targetElement).innerHTML = sCR;
    else
      document.write(sCR);
  }
  else
    return sCR;
}
