/**
 * @file
 * Custom javascript utilities.
 * 
 * @author Shannon M. Rause <shannon.rause@creativeflavor.com>
 * @version $Revision: 1.2 $
 * @version $Name: BOEFOUNDATION_2010-05-11_4 $
 * @version $Id: main.js,v 1.2 2009/05/19 18:02:50 smr Exp $
 *
 * These files are copyrighted to Creative Flavor Inc. and are
 * subject to the terms of the applicable Service Agreement.
 * If no service agreement is available you must contact us at
 * legal@creativeflavor.com or 303-379-9450.
 * 
 * These files may be watermarked to ensure traceability.
 */

function mt_create_flash(id,
                        classid,
                        src,
                        name,
                        width,
                        height,
                        params,
                        version,
                        extra)
{
   var elem = $(id);
   alert(elem);
   
   if (elem)
   {
      var s = '<object classid="' + classid + '" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + '" width="' + width + '" height="' + height + '" id="' + name + '" name="' + name + '" ' + extra + '>';
      s += '<param name="movie" value="' + src + '" />';

      for (var i in params)
      {
         if (i == '$family')
         {
            break;
         } // if

         s += '<param name="' + i + '" value="' + params[i] + '" />';
      } // for

      s += '<embed src="' + src + '" width="' + width + '" height="' + height + '" id="' + name + '" name="' + name + '" swliveconnect="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ';

      for (var i in params)
      {
         if (i == '$family')
         {
            break;
         } // if

         s += i + '="' + params[i] + '" ';
      } // for

      s += extra + ' /></object>';
      alert(s);
      elem.innerHTML = s;
   } // if
} // create_flash

