/*
  Since about june 2006, IE requires embedded objects to be activated by a
  mouseclick, before any user-interaction is allowed. This is due to the fact
  that Microsoft lost in court regarding the Eolas patent.

  Use the functions below to fix the issue. The trick is to "create" the objects
  using Javascript in a *separate* file.

  Source: http://msdn.microsoft.com/workshop/author/dhtml/overview/activating_activex.asp 

  TODO: move this to merlin/admin/scripts
  TODO: maybe remove the objectID parameter
  TODO: add function createApplet()
  TODO: also do flash-plugin detection and handle alternative content
*/

function createFlash(objectID, url, width, height, params)
{
  document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'");
  if (objectID != null) document.write(" id='"+objectID+"'");
  document.write(" width='"+width+"' height='"+height+"'>");
  document.write("<param name='movie' value='"+url+"'>");
  document.write("<param name='wmode' value='transparent'>");
  for (var key in params)
  {
    document.write("<param name='"+key+"' value='"+params[key]+"'>");
  }
  document.write("<embed src='"+url+"' width='"+width+"' height='"+height+"' wmode='transparent' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
  document.write("</object>");
}
