// Flash Loader
// Used to prevent highlight in Internet Explorer

function writeFlash(swffile, swfw, swfh, container, loadMethod) {

  var htmlMake;
  var thisBrowser = navigator.userAgent;
  var flashDelay  = (thisBrowser.indexOf("Safari") != -1) ? 200 : 0;

  // Safari needs a delay when using innerHTML modifications or
  // the flash wont show up until an event such as onmouseover
  // occurs on the page. This is silly.

  switch(loadMethod) {
  default:
  // The default method is by changing innerHTML on a DIV container
    htmlMake = '<object width="' + swfw + '" height="' + swfh + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">' + "\n"
  	         + '<param name="movie" value="' + swffile + '" />' + "\n"
  	         + '<param name="wmode" value="transparent" />' + "\n"
  	         + '<embed src="' + swffile + '" width="' + swfw + '" height="' + swfh + '" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>' + "\n"
             + '</object>' + "\n";

    // Load the innerHTML with or without timeout depending on flashDelay
    setTimeout( function() { document.getElementById(container).innerHTML = htmlMake; }, flashDelay);
  break;
  case "docwrite":
  document.write('<object width="' + swfw + '" height="' + swfh + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">' + "\n"
	         + '<param name="movie" value="' + swffile + '" />' + "\n"
	         + '<param name="wmode" value="transparent" />' + "\n"
	         + '<embed src="' + swffile + '" width="' + swfw + '" height="' + swfh + '" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>' + "\n"
           + '</object>' + "\n");
  break;
  } // ! switch (loadMethod)

} // ! writeFlash
