
/**
 * createFlashObject
 *
 * writes a flash object to the browser windows, bypassing the embedded content issue affecting IE
 */
function createFlashObject( url, width, height, id, align, bgcolor, flashvars )
{
    /**
     * write start of object tag
     */
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="'+align+'">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+url+'" />');
    document.write('<param name="quality" value="high" />');
    
    /**
     * write conditional parameters
     */
    if( flashvars ) {    
        document.write('<param name="flashvars" value="'+flashvars+'" />');
    }
    if( bgcolor ) {    
        document.write('<param name="bgcolor" value="'+bgcolor+'" />');
    }
    
    /**
     * write start of embed tag
     */
    document.write('<embed src="'+url+'" ' );
    
    /**
     * write conditional parameters
     */
    if( flashvars ) {    
        document.write( 'flashvars="'+flashvars+'" ');
    }    
    if( bgcolor ) {    
        document.write('bgcolor="'+bgcolor+'" ');
    }
    
    /**
     * write end embed and object tags
     */
    document.write( 'quality="high" width="'+width+'" height="'+height+'" name="'+id+'" align="'+align+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}
