/**
 * Embed Flash functions
 * Necessary for IE6+ to activate ActiveX controls
 *
 * @version 1.0
 * @author Joris Verbogt <joris@ph8.nl>
 * @copyright &copy; 2006 Mangrove
 */

/**
 * Insert an HTML OBJECT with an embedded Flash movie. 
 * Necessary to automatically activate ActiveX in IE6+
 *
 * @param String width Width, required
 * @param String height Height, required
 * @param String url Location of the SWF, required
 * @param String noFlashImageUrl Location of the image to show if no Flash player, optional
 * @param String noFlashImageLink URL to open when clicking the no-flash image, optional
 * @param String altContent Alternative content to show, other than image, optional, default empty
 * @param String wmode Window Mode, optional, defaults to "transparent" 
 * @param String quality Quality of the movie, optional, defaults to "high"
 * @param Boolean menu Show menu, optional, defaults to "false"
 * @param String allowScriptAccess Allow script access, optional, defaults to "sameDomain"
 */
function insertFlashObject(width, height, url, noFlashImageUrl, noFlashImageLink, altContent, wmode, quality, menu, allowScriptAccess) {
    if (allowScriptAccess == null) {
        allowScriptAccess = "sameDomain";
    }
    if (menu == null) {
        menu = "false";
    }
    if (quality == null) {
        quality = "high";
    }
    if (wmode == null) {
        wmode = "transparent";
    }
    if (altContent == null) {
        altContent = "";
    }
    if (noFlashImageLink == null) {
        noFlashImageLink = "";
    }
    if (noFlashImageUrl == null) {
        noFlashImageUrl = "";
    }
    document.writeln('<object type="application/x-shockwave-flash" data="' + url + '" width="' + width + '" height="' + height + '">');
    document.writeln('<param name="allowScriptAccess" value="' + allowScriptAccess + '"  />');
    document.writeln('<param name="movie" value="' + url + '" />');
    document.writeln('<param name="quality" value="' + quality + '" />');
    document.writeln('<param name="wmode" value="' + wmode + '" />');
    document.writeln('<param name="menu" value="' + menu + '" />');
    if (noFlashImageUrl != '') {
        if (noFlashImageLink != '') {
            document.writeln('<a href="' + noFlashImageLink + '">');
        }
        document.writeln('<img src="' + noFlashImageUrl + '" alt="noflash" width="' + width + '" height="' + height + '" />');
        if (noFlashImageLink != '') {
            document.writeln('</a>');
        }
    }
    document.writeln(altContent);
    document.writeln('</object>');
}