
/*************
|       TITLE: Pulse.Player.Flash Package
|     VERSION: 5.0 (alpha)
|    PERFORCE: $Id: //depot/main/src/Pulse.Player.JS/javascript/Pulse.Player.Flash.js#14 $
|              $Change: 19552 $
|        TYPE: Media Support Module
|      AUTHOR: Chris van Rensburg
|   COPYRIGHT: (c)2004 Pulse Entertainment Inc. <http://www.pulse3d.com>
| DESCRIPTION: Implements support for Flash movie Veepers
|    REQUIRES: Pulse.Player
*************/

(function(){var _a=Pulse.Player,_b=_a.prototype,_c=navigator,_d=document,_e='undefined',_f=false,_g=true,_h=null;function _i(_j){return(typeof _d.getElementById!=_e)?_d.getElementById(_j):_h}function _k(_l,_m){if(typeof _l.insertAdjacentHTML!='undefined'){_l.insertAdjacentHTML('BeforeEnd',_m);}else{var _n=_d.createElement('DIV');_n.innerHTML=_m;_o=_n.childNodes;for(var _p=0;_p<_o.length;_p++){_l.appendChild(_o[_p]);}}}_b.flashAudioEventEmulation=function(_q){function _r(_s,_t){var _u=_i(_s);if(_u!=_h)_u.style.left=_u.style.top=(_t?'0':'-1000')+'px';}var _v=this,
_w=_v.Flash._x[_q],_y=_w._z,_A=_i(_y);if(_w._B){var _C=_w._D;_w._D=_A.IsPlaying();if(_w._D!=_C){_r(_v.objectName+'IdleMovieDiv',!_w._D);_r(_y+'Div',_w._D);_v.fireEvent(_w._D?'Audio Started':'Audio Stopped');}}else if(_A!=_h&&typeof _A.PercentLoaded!=_e&&_A.PercentLoaded()==100){_w._B=_g;if(_w._E)_v.playAudioFlash(_q);}};_b.doPlayAudioFlash=function(_F){var _v=this,_q=_v.get('audioUrl');if(_v.playerSupportsScripting()){if(typeof _v.Flash._x[_q]==_e){if(_F){var _y=_v.objectName+'Audio'+_v.Flash._G++ +'Player',_w=_v.Flash._x[_q]={_z:_y,_D:_f,_B:_f,_E:_g},_H=_v.doGetPlayerHtmlFlash({playerId:_y,src:_q,play:_f,loop:_f});_k(_i(_v.objectName+'AudioMoviesDiv'),'<div id="'+_y+'Div" style="position:absolute; left:-1000px; top:-1000px;"></div>');_i(_y+'Div').innerHTML=_H;_w._I=setInterval(_v.objectName+'.flashAudioEventEmulation (\''+_q+'\')',100);}}else{var _w=_v.Flash._x[_q],_A=_i(_w._z);if(_w._B){if(_F){_A.Rewind();_A.Play();}else{_A.StopPlay();}_v.flashAudioEventEmulation(_q);}else{_w._E=_F;}}}else{
if(_v.Flash._J||_F)_i(_v.objectName+'IdleMovieDiv').innerHTML=_v.doGetPlayerHtmlFlash({src:_F?_q:_v.get('src'),play:_g,loop:!_F});_v.Flash._J=_F;}};_b.doGetPlayerHtmlFlash=function(_K){function _L(_M,_N){return(typeof _K!=_e&&typeof _K[_M]!=_e)?_K[_M]:_N;}function _O(_M){return((_M=='bgColor')?'#':'')+_L(_M,_v.get(_M));}function _P(_M){return' '+_M+'="'+_O(_M)+'"';}function _Q(_M,_R){return _S((typeof _R!=_e)?_R:_M,_O(_M));}var _v=this,_m='',_S=_a.getParamStr,_z=_L('playerId',_v.playerId),_T=_L('play',_g),_U=_L('loop',_g),_V=' ID="'+_z+'"'+_P('width')+_P('height');if(WINIE){_m='<OBJECT'+' CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+' CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'+_V+' STYLE="visibility:visible"'+'>'+_Q('src','movie')+_Q('quality')+_Q('bgColor')+_S('play',_T)+_S('loop',_U)+_S('scale','exactfit')+_S('menu',_f)+'</OBJECT>';}else{_m='<EMBED'+_V+' NAME="'+_z+'"'+' TYPE="application/x-shockwave-flash"'+
' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"'+' MAYSCRIPT'+_P('src')+_P('quality')+_P('bgColor')+' play='+_T+' loop='+_U+' scale=exactfit'+' menu=false'+'></EMBED>';}return _m;};_a.extensionsToMedia.swf='Flash';_b.initializeFlash=function(){var _v=this;_v.Flash._x={};_v.Flash._G=0;_v.Flash._J=_f;};_b.getPlayerImageFlash=function(){return{src:'get-flash-player.gif',width:78,height:33}};_b.clickToInstallFlash=function(){};_b.isReadyToEnableFlash=function(){return _g};_b.isAdequateFlash=function(){return this.isBrowserSupportedFlash()&&_W};_b.isBrowserSupportedFlash=function(){return!(GECKO&&MAC||MACIE)};_b.playerSupportsEventsFlash=function(){return _f};_b.playerSupportsScriptingFlash=function(){return!MAC};_b.playerSupportsPauseFlash=function(){return _f};_b.getPlayerHtmlFlash=function(_K){var _X='position:absolute; left:0px; top:0px;',_m=this.doGetPlayerHtmlFlash(_K);_m='<div id="'+this.objectName+'IdleMovieDiv" style="'+_X+'">'+_m+'</div>'+
'<div id="'+this.objectName+'AudioMoviesDiv" style="'+_X+'"></div>';return _m;};_b.playAudioFlash=function(){this.doPlayAudioFlash(_g)};_b.stopAudioFlash=function(){this.doPlayAudioFlash(_f)};_a.registerProperties({quality:'quality'});_a.set({quality:'high'});var _Y=6,_W=_f,_Z='application/x-shockwave-flash';if(_c.mimeTypes&&_c.mimeTypes[_Z]&&_c.mimeTypes[_Z].enabledPlugin){var _0=_c.plugins['Shockwave Flash'].description.match(new RegExp('\\b([\\d\\.]+)\\b')),_1=_0?(_0[1]-0):0;_W=_1>=_Y;}else if(WINIE){try{new ActiveXObject('ShockwaveFlash.ShockwaveFlash.'+_Y);_W=_g;}catch(_2){}}})();
