function writeFlash2()
{
// Modified version of wrtieFlash from Flash.js.
// Added 01/06/2007 DLP.


  var index = sGetAppIndex()
  if (sWindowTitle=="") 
  {
    sWindowTitle=as_AppName[index];
  }
  
  if (document.title) document.title=sWindowTitle;

  var sFilename = as_FlashFile[index];
  
  sFilename = trim(sFilename.substr(sFilename.lastIndexOf("/")+1, sFilename.length));
  var sParams = parseCmdLine(as_Cmds[index]);
  
  // If a launch sequence is used; see if the Security setting should be used.
  // Added 05/03/2007 DLP.
  try
  {
    if (!((as_Launch==null) || (as_Launch[index]==null) || (as_Launch[index]==''))) 
    { 
      // Get the first parameter of the launch sequence (Flash pop-up is always first).
      var sSeq = as_Launch[index].split(",");
      
      // If the security flag is set, then add the override parameter to the parameters.
      if (bFlagSet(sSeq[0], FL_RunAT))
      {
        if (sParams != '') sParams += '&'; 

        sParams += 'LicenseInfo=1';
      } 
    } 
  }
  catch(err){ }

  //window.alert("sParams = '"+sParams+"'");

  if (!sHolder)
  {
    var sHolder = 'slot';
  }
  try 
  {
    var sccFlag=checkCCFlag();
  }
  catch(err){ }
 
  //See if a module cookie has been set.
  var sModSet = unescape(GetCookieStr('LJModID='));
  if ((sModSet!="") || true)
  {
    var sNewString = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' 
                   + ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'
                   + ' id="oFlash" width="100%" height="100%" align="middle">'
                   + '<param name="allowScriptAccess" value="always" />'
                   + '<param name="FlashVars" value="'+sParams+'" />'
                   + '<param name="movie" value="'+sFilename+'" />'
                   + '<param name="quality" value="high" />'
                   + '<embed src="'+sFilename+'" FlashVars="'+sParams+'" quality="high"'
                   + ' width="100%" height="100%" swLiveConnect=true id="oFlash" name="oFlash" align="middle"'
                   + ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
                   + '</object>';

    if (IsNS6orGreater())
    {
      oLayer = window.document.getElementById(sHolder);
    
      if (oLayer)
      {
        sNewString = '<embed src="'+sFilename +'" FlashVars="'+sParams+'" quality="high"'
                 + ' width="100%" height="100%" swLiveConnect=true id="oFlash" name="oFlash" align="middle"'
                 + ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
    
        oLayer.innerHTML=sNewString;
        document.oFlash.play();
      }
    } 
    else if (document.all)
    {
      document.all(sHolder).innerHTML=sNewString;
    }
    else
    {
      window.document.getElementById(sHolder).innerHTML=sNewString;
      if ((document.oFlash) && (document.oFlash.play))
      {
        document.oFlash.play();
      }
    }
  }
  else
  {
    window.document.getElementById(sHolder).innerHTML=sFlshTxt_ErrorAccessingSim;
  }
}

function AddFlashLink2(index, sCaption)
// Modified version of AddFlashLink from launch.js.
// Added 01/06/2007 DLP.
{
  document.write('<a href="javascript:var newWin=window.open(\''+GetMediaDir()+'..\/theme\/system\/html\/flashwin2.htm?index='+index+'\',\'_new\',\'location=no,resizable=yes,width=792,height=550\');var x=newWin.focus();">'+sCaption+'</a>');
}

