/* Конструктор класса FlashObject*/ function Flash( ) { /* this.idHTML; // id - блока подложки; this.srcFlash; // абсолютный путь; this.width; // ширина флэша; this.height; // высота флэша; this.background; // цвет фона флэша; this.transparent; // прозрачность флэша; this.flashvars; // flashvars флэша; this.needFlashVerion; // необходимая флэша; this.Insert(); // вставка флэша; */ 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' ] ) { /* определяем есть ли у браузера plugin флэшплеера */ matchStr = new RegExp ( '^[A-Za-z ]*(.*) .*$' ); this.flashVerion = parseInt( navigator.plugins[ 'Shockwave Flash' ].description.replace( matchStr, '$1' ) ); return ( needVersion <= this.flashVerion ); } else if ( this.browserIE ) { /* иначе будет создаваться ActiveX объект (IE) */ 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.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