/* Конструктор класса FlashObject*/
function Flash( ) {
this.BrowserInfo( );
}
oyy_context_id = '2889';
//
/* Метод определения типа Браузера */
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;
}
}
/* Метод вставки в страницу HTML нужного кода */
Flash.prototype.Insert = function( ) {
if ( this.CheckVersionFlash( this.needFlashVerion ) ) {
document.write( this.GenerateHtmlFlash( ) );
}
else {
document.write( this.GenerateHtmlImage( ) );
}
}
/* Метод для генерирования флэш - кода */
Flash.prototype.GenerateHtmlFlash = function( ) {
var flashCode = '';
return flashCode;
}
/* Метод для генерирования image - кода */
Flash.prototype.GenerateHtmlImage = function( ) {
var imageCode = '
';
return imageCode;
}