
function InsertHtml(sDivID, sHTML)
//       ~~~~~~~~~~
{
  var oDiv = document.getElementById(sDivID);
  oDiv.outerHTML = sHTML;    
}
//-------------------------------------------------

function InsertFlash(sDivID, sParams, sSrc, sFlashVars)
//       ~~~~~~~~~~~
{
  var oDictionary = new ActiveXObject("Scripting.Dictionary");
  oDictionary.add ("sWidth", "100%");
  oDictionary.add ("sHeight", "100%");
  oDictionary.add ("sBgColor", "");
  oDictionary.add ("sAlign", "");
  oDictionary.add ("sID", "");
  oDictionary.add ("sWmode", "");  
  oDictionary.add ("sSalign", "");  
  oDictionary.add ("sFlashVars", ""); 

  arrParams = sParams.split('&');  
    
  for (var i=0; i<arrParams.length; i++)
  {     
    oDictionary.Item(arrParams[i].split("=")[0]) = arrParams[i].split("=")[1];                
  }  
  
  if(sFlashVars != undefined)
    oDictionary.Item('sFlashVars') = sFlashVars;
  
  var oDiv = document.getElementById(sDivID);
  var sFlash = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' + 
                ' WIDTH=' + oDictionary.Item('sWidth') + ' HEIGHT=' + oDictionary.Item('sHeight') + ' id=' + oDictionary.Item('sID') + ' ALIGN=' + oDictionary.Item('sAlign') + ' VIEWASTEXT>' + 
                ' <PARAM NAME="movie" VALUE=' + sSrc + '>' + 
                ' <PARAM NAME="quality" VALUE="high">' + 
                ' <PARAM NAME="FlashVars" VALUE=' + oDictionary.Item("sFlashVars") + '>' +
                ' <PARAM NAME="bgcolor" VALUE=' + oDictionary.Item('sBgColor') + '>' + 
                ' <PARAM NAME="menu" VALUE="false">' + 
                ' <PARAM NAME="wmode" VALUE=' + oDictionary.Item('sWmode') + '>' + 
                ' <PARAM NAME="salign" VALUE=' + oDictionary.Item('sSalign') + '>' + 
                ' <EMBED src=' + sSrc + ' quality="high" bgcolor=' + oDictionary.Item('sBgColor') + ' WIDTH=' + oDictionary.Item('sWidth') + ' HEIGHT=' + oDictionary.Item('sHeight') + 
                ' NAME=' + oDictionary.Item('sID') + ' ALIGN=' + oDictionary.Item('sAlign') + ' salign=' + oDictionary.Item('sSalign') + ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>' + 
                ' </OBJECT>';

  InsertHtml (sDivID, sFlash);    
}
//-------------------------------------------------

