/* FlashJavascrip v0.5
 Copyright 2008 Markus Bordihn (http://markusbordihn.de), Inc. All rights reserved.
 Optimiert von Dietmar Meier vielen Dank, Dietmar ;)
*/

function CreateFlash (sFlashFile, nWidth, nHeight, sFlashvars, sFlashID) {
  var 
   i,
   aParams = [],
   FlashID = (sFlashID || 'flash_'+Math.round(Math.random()*100)),
   oEffAttr = { quality: "autohigh", wmode: "opaque", play: "true", loop: "true", scale: "noscale", menu: "false", allowscriptaccess: "always", flashvars: sFlashvars,};
  if ((typeof sFlashFile !== 'string') || isNaN(nWidth) || isNaN(nHeight)) {
    document.write('<p style="color:red;background-color:white">Fehler in der Definition</p>');}
  else {
    for (i in oEffAttr) aParams[aParams.length] = '<param name="' + i + '" value="' + oEffAttr[i] + '">';
    document.write('<object type="application/x-shockwave-flash" id="'+ FlashID +'" name="'+ FlashID +'" data="' + sFlashFile + '" width="' +nWidth + '" height="' + nHeight + '">'
    + '<param name="movie" value="' + sFlashFile + '">'
    + aParams.join("")
    + '</object>\n');}
}

