function Flash( ) { this.BrowserInfo( ); } Flash.prototype.BrowserInfo = function( ) { var userAgent = navigator.userAgent.toLowerCase( ); this.browserIE = ( userAgent.indexOf( 'msie' ) != -1 ); } Flash.prototype.CheckVersionFlash = function( needVersion ) { if ( navigator.plugins[ 'Shockwave Flash' ] ) { matchStr = new RegExp ( '^[A-Za-z ]*(.*) .*$' ); this.flashVerion = parseInt( navigator.plugins[ 'Shockwave Flash' ].description.replace( matchStr, '$1' ) ); if ( needVersion <= this.flashVerion ) { return true; } else { return false; } //return needVersion <= this.flashVerion; } else if ( this.browserIE ) { for( var i = needVersion; i < needVersion + 10; i++ ) { try { flashPlayer = new ActiveXObject( 'ShockwaveFlash.ShockwaveFlash.' + i ); this.flashVerion = i; return true; } catch( e ) { continue; } } return false; } else { this.flashVerion = 0; return false; } } Flash.prototype.Insert = function( ) { if ( this.CheckVersionFlash( this.needFlashVerion ) ) { document.write( this.GenerateHtmlFlash( ) ); } else { document.write( this.GenerateHtmlImage( ) ); } } Flash.prototype.GenerateHtmlFlash = function( ) { var flashCode = '\n'; flashCode += '\t\n'; flashCode += '\t\n'; flashCode += '\t\n'; if ( this.base ) { flashCode += '\t\n'; } if ( this.background ) { flashCode += '\t\n'; } if ( this.transparent ) { flashCode += '\t\n'; } if ( this.flashvars ) { flashCode += '\t\n'; } flashCode += '\t'; return imageCode; }