
function FlashOBJ( movie, width, height, background ) {
    // This class written by the casm.org web dev team.
    /*
    IsSSL = boolean; default 0
    width = int
    height = int
    id = string; default ''
    align = string; default 'middle'
    allowScriptAccess = string; default 'always'
    movie = string
    quality = high
    bgcolor = string; default ''
    wmode = string; default null
    */
    this.movie= movie;
    this.width= width;
    this.height= height;
    this.background= background;
    // DEFAULTS
    this.isSSL= 0;
    this.id= "";
    this.align= "";
    this.allowScriptAccess= "always";
    this.quality= "high";
    this.fixMovie= function (m) {
        c=0;
        while( m.indexOf("&amp;") >= 0 && c++<500) {
            m= m.replace("&amp;", "&");
        }
        return m;
    }
    
    this.movie= this.fixMovie(this.movie);
    
    this.display= function () {
        document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' );
        if( ! this.isSSL ) {
        // If SSL, don't show http plugin link because it prompts 'load non-secure items?' dialogue box
            document.write( 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=7,0,0,0" ' );
        }
        document.write( 'width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">' );
        document.write( '<param name="allowScriptAccess" value="' + this.allowScriptAccess + '" />' );
        document.write( '<param name="movie" value="' + this.movie  + '" />' );
        document.write( '<param name="quality" value="' + this.quality + '" />' );
        if( this.background.toLowerCase() == 'transparent' ) {
            document.write( '<param name="wmode" value="transparent" />' );
        } else {
            document.write( '<param name="bgcolor" value="' + this.background + '" />' );
        }
        document.write( '<embed src="' + this.movie + '" quality="' + this.quality + '" width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '" allowScriptAccess="' + this.allowScriptAccess + '" type="application/x-shockwave-flash" ' );
        if( this.background.toLowerCase() == 'transparent' ) {
            document.write( 'wmode="transparent" ' );
        } else {
            document.write( 'bgcolor="' + this.background + '" ' );
        }
        if( ! this.isSSL ) {
            document.write( 'pluginspage="http://www.macromedia.com/go/getflashplayer" ' );
        }
        document.write( '></embed>' );
        document.write( '</object>' );
    }
}
