// Netventure, http://www.netventure.pl/

/**
 * Writes whole flash object block.
 *
 * Usage: <script type="text/javascript">writeFlash('6,0,0,0','/absolutepath/to/someflash.swf', 520, 220, '');</script>
 *
 * @param version     flash version, ie. 6,0,0,0
 * @param movie       absolute path to flash file
 * @param width       width of the flash movie
 * @param height      height of the flash movie
 * @param background  background color; if empty - set to wmode transparent
 *
 * @return            whole flash object block with embed element
 */
function writeFlash(version, movie, width, height, background) {
    document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.writeln('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'"');
    document.writeln('  width="'+width+'" height="'+height+'"');
    document.writeln('>');
    document.writeln('  <param name="movie" value="'+movie+'"/>');
    document.writeln('  <param name="quality" value="high"/>');
    if (background != '') {
        document.writeln('  <param name="background" value="'+background+'"/>');
    } else {
        document.writeln('  <param name="wmode" value="transparent"/>');
    }
    document.writeln('  <embed width="'+width+'" height="'+height+'" src="'+movie+'" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"');
    if (background != '') {
        document.writeln('background="'+background+'"');
    } else {
        document.writeln('wmode="transparent"');
    }
    document.writeln('></embed>');
    document.writeln('</object>');
}

/**
 * Writes flash embed element (for Mozilla based browsers).
 *
 * Usage: <script type="text/javascript">writeFlashEmbed('6,0,0,0','/absolutepath/to/someflash.swf', 520, 220, '');</script>
 *
 * @param version     flash version, ie. 6,0,0,0
 * @param movie       absolute path to flash file
 * @param width       width of the flash movie
 * @param height      height of the flash movie
 * @param background  background color; if empty - set to wmode transparent
 *
 * @return            flash embed element
 */
function writeFlashEmbed(version, movie, width, height, background) {
    document.writeln('<embed width="'+width+'" height="'+height+'" src="'+movie+'" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"');
    if (background != '') {
        document.writeln('background="'+background+'"');
    } else {
        document.writeln('wmode="transparent"');
    }
    document.writeln('></embed>');
}

