// Turner XMP, Release Build,  2007 Turner Broadcasting System, Inc. A Time Warner Company.  Version: 0.1.633.2120
// xmp_playerapi_native, xmp_playerapi_native_0_1_633_2120.js
xmp.i_DHTML_PLAYER="DHTML";xmp.DHTML_MIME_TYPE="application/x-dhtml";xmp.i_DHTML_OBJECT_TRANSPORT="dhtmlObject";xmp.DHTMLPlayer=function(aa,ba){this.p_object=null;this.p_node=null;this.p_url="";xmp.DHTMLPlayer.ctor.call(this,xmp.i_DHTML_PLAYER,aa,ba);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.DHTMLPlayer);xmp.DHTMLPlayer.prototype.i_open=function(ca){this.p_node=ca;this.p_url=ca.getURI();var da=new xmp.util.Callback(this.i_getName(),this.p_onDHTMLObjectLoad,this);var ea=xmp.i_DHTML_OBJECT_TRANSPORT;var fa=ca.getMetadata('altRootUrlType','');if(fa.length>0){ea=fa;}
var ga=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(ea);ga.setIds([this.p_url],da);ga.load();};xmp.DHTMLPlayer.prototype.i_close=function(){if(this.p_object){this.p_object.close();this.p_object=null;}
xmp.DHTMLPlayer.base.i_close.call(this);};xmp.DHTMLPlayer.prototype.i_play=function(){this.p_object.play();xmp.DHTMLPlayer.base.i_play.call(this);this.i_setState(xmp.PLAY);};xmp.DHTMLPlayer.prototype.i_pause=function(){this.p_object.pause();xmp.DHTMLPlayer.base.i_pause.call(this);this.i_setState(xmp.PAUSE);};xmp.DHTMLPlayer.prototype.i_stop=function(){this.p_object.stop();xmp.DHTMLPlayer.base.i_stop.call(this);this.i_setState(xmp.STOP);};xmp.DHTMLPlayer.prototype.i_rewind=function(){this.p_object.rewind();xmp.DHTMLPlayer.base.i_rewind.call(this);this.i_setState(xmp.REWIND);};xmp.DHTMLPlayer.prototype.i_fastForward=function(){this.p_object.fastForward();xmp.DHTMLPlayer.base.i_fastForward.call(this);this.i_setState(xmp.FAST_FORWARD);};xmp.DHTMLPlayer.prototype.i_seek=function(ha){this.p_object.seek(ha);xmp.DHTMLPlayer.base.i_seek.call(this,ha);this.i_setState(xmp.SEEKABLE);};xmp.DHTMLPlayer.prototype.i_ended=function(){xmp.DHTMLPlayer.base.i_ended.call(this);this.p_object.ended();};xmp.DHTMLPlayer.prototype.i_isAvailable=function(ia){if(!this.p_object){return false;}
return this.p_object.isAvailable(ia);};xmp.DHTMLPlayer.prototype.i_getPosition=function(){return this.p_object.getPosition();};xmp.DHTMLPlayer.prototype.i_getDuration=function(){return this.p_object.getDuration();};xmp.DHTMLPlayer.prototype.i_moveTo=function(ja,ka,la,ma){xmp.DHTMLPlayer.base.i_moveTo.call(this,ja,ka,la,ma);this.p_object.moveTo(ja,ka,la,ma);};xmp.DHTMLPlayer.prototype.i_create=function(na){na.id=xmp.i_DHTML_PLAYER+na.group;xmp.DHTMLPlayer.base.i_create.call(this,na);if(na.viewport.i_getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+na.viewport.i_getType()+"\".  Supported viewports:  DHTML.",this);}
this.i_setVolume(na.volume);this.i_setMute(na.mute);var oa=na.viewport.i_getNative();oa.innerHTML="<div id='"+na.id+"' style='background-color: #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"; width: "+oa.style.width+"; height: "+oa.style.height+"' />";this.i_setCreated();};xmp.DHTMLPlayer.prototype.p_onDHTMLObjectLoad=function(pa,qa){try{if(true===qa.isError()){return;}
this.p_object=qa.getDataObject();this.p_validateObject();this.p_object.open(this.i_getGroup(),this,this.i_getNative(),this.p_node);this.p_node=null;}
catch(e){this.i_setError("Loading DHTML object via Ajax request.",e);}};xmp.DHTMLPlayer.prototype.p_validateObject=function(){if(!this.p_object){throw new xmp.DHTMLObjectError("Validating DHTML object.","NULL DHTML object.");}
var ra=[{name:xmp.OPEN_OPERATION,implementation:this.p_object.open,args:4},{name:xmp.CLOSE_OPERATION,implementation:this.p_object.close,args:0},{name:xmp.i_PLAY_OPERATION,implementation:this.p_object.play,args:0},{name:xmp.i_PAUSE_OPERATION,implementation:this.p_object.pause,args:0},{name:xmp.i_STOP_OPERATION,implementation:this.p_object.stop,args:0},{name:xmp.i_REWIND_OPERATION,implementation:this.p_object.rewind,args:0},{name:xmp.i_FAST_FORWARD_OPERATION,implementation:this.p_object.fastForward,args:0},{name:xmp.i_SEEK_OPERATION,implementation:this.p_object.seek,args:1},{name:xmp.ENDED_OPERATION,implementation:this.p_object.ended,args:0},{name:xmp.i_IS_AVAILABLE_OPERATION,implementation:this.p_object.isAvailable,args:1},{name:xmp.i_GET_POSITION_OPERATION,implementation:this.p_object.getPosition,args:0},{name:xmp.i_GET_DURATION_OPERATION,implementation:this.p_object.getDuration,args:0},{name:xmp.i_MOVETO_OPERATION,implementation:this.p_object.moveTo,args:4}];var sa=ra.length;for(var i=0;i<sa;i++){if(!ra[i].implementation){throw new xmp.DHTMLObjectError("Validating DHTML object.","Missing required DHTML object method \""+ra[i].name.toLowerCase()+"\" implementation.");}
if(ra[i].implementation.length!==ra[i].args){throw new xmp.DHTMLObjectError("Validating DHTML object.","The required DHTML object method \""+ra[i].name.toLowerCase()+"\" requires \""+ra[i].args+"\" arguments.  \n\n"+ra[i].implementation.length+" arguments were found.");}}};xmp.DHTMLPlayer.prototype.onStateChange=function(ta,ua){try{xmp.validateArguments(arguments,[xmp.i_STRING_TYPE,xmp.i_STRING_TYPE],"DHTMLPlayer.onStateChange");this.i_setState(ta,ua);}
catch(e){this.i_setError("Handling state change.",e);}};xmp.DHTMLPlayer.prototype.onError=function(va,e){try{xmp.validateArguments(arguments,[xmp.i_STRING_TYPE,xmp.i_OBJECT_TYPE],"DHTMLPlayer.onError");this.i_setError(va,e);}
catch(ex){this.i_setError("Handling error.",ex);}};xmp.i_FLASH="Flash";xmp.FLASH_MIME_TYPE="video/x-flv";xmp.i_FLASH_PLUGIN_MIME_TYPE="application/x-shockwave-flash";xmp.i_FLASH_PLUGIN_NAME="Shockwave Flash";xmp.i_FLASH_ACTIVEX_BASE_PROGID="ShockwaveFlash.ShockwaveFlash.";xmp.i_FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID="ShockwaveFlash.ShockwaveFlash";xmp.i_FLASH_VERSION=8;xmp.i_FLASH_VERSION_VARIABLE="$version";xmp.i_ALLOW_SCRIPT_ACCESS="allowScriptAccess";xmp.i_ALLOW_TRANSPARENCY="wmode";xmp.i_ALLOW_FULLSCREEN_ACCESS="allowFullScreen";xmp.i_ALWAYS_ACCESS="always";xmp.i_QUALITY="quality";xmp.i_QUALITY_HIGH="high";xmp.i_WINDOW_MODE="wmode";xmp.i_TRANSPARENT_WINDOW_MODE="transparent";xmp.i_FLASH_PLAYER_STATE_CHANGE_METHOD="onStateChange";xmp.i_FLASH_PLAYER_ERROR_METHOD="onError";xmp.i_FLASH_PLAYER_INITIALIZATION_METHOD="onInit";xmp.i_FLASH_PLAYER_INVOKE_METHOD="onInvoke";xmp.i_FLASH_PLAYER_TRIGGER_METHOD="onTrigger";xmp.i_SCRIPT_ELEMENT_TAG="script";xmp.i_FLASH_ERROR_CALLBACK="errorCallback";xmp.i_FLASH_INITIALIZATION_CALLBACK="initializationCallback";xmp.i_FLASH_STATE_CHANGE_CALLBACK="stateChangeCallback";xmp.i_FLASH_INVOKE_CALLBACK="invokeCallback";xmp.i_FLASH_TRIGGER_CALLBACK="triggerCallback";xmp.i_FLASH_CONNECTION_ERROR="ConnectionError";xmp.i_FLASH_PLAYER_SWF_BASE_NAME="FlashMediaPlayer";xmp.i_FLASH_BUFFER_TIME_CONFIG="Buffer Time";xmp.i_FLASH_BUFFER_TIME="bufferTime";xmp.i_FLASH_STREAMING_VIDEO_ADAPTER_CONFIG="Streaming Video Adapter";xmp.i_FLASH_STREAMING_VIDEO_ADAPTER="streamingVideoAdapter";xmp.i_FLASH_FULLSCREEN_ENABLED="fullscreenEnabled";xmp.FlashPlayer=function(wa,xa){xmp.FlashPlayer.ctor.call(this,xmp.i_FLASH,wa,xa);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.FlashPlayer);xmp.FlashPlayer.prototype.i_open=function(ya){this.i_getNative().fmpOpen(xmp.FLASH_MIME_TYPE,ya.getURI());};xmp.FlashPlayer.prototype.i_close=function(){this.i_getNative().fmpClose();xmp.FlashPlayer.base.i_close.call(this);};xmp.FlashPlayer.prototype.i_play=function(){this.i_getNative().fmpPlay();xmp.FlashPlayer.base.i_play.call(this);this.i_setState(xmp.PLAY);};xmp.FlashPlayer.prototype.i_pause=function(){this.i_getNative().fmpPause();xmp.FlashPlayer.base.i_pause.call(this);this.i_setState(xmp.PAUSE);};xmp.FlashPlayer.prototype.i_stop=function(){this.i_getNative().fmpStop();xmp.FlashPlayer.base.i_stop.call(this);this.i_setState(xmp.STOP);};xmp.FlashPlayer.prototype.i_seek=function(za){this.i_getNative().fmpSeek(za);xmp.FlashPlayer.base.i_seek.call(this,za);this.i_setState(xmp.SEEKABLE);};xmp.FlashPlayer.prototype.i_ended=function(){this.i_getNative().fmpEnded();xmp.FlashPlayer.base.i_ended.call(this);};xmp.FlashPlayer.prototype.i_isAvailable=function(Aa){return this.i_getNative().fmpIsAvailable(Aa);};xmp.FlashPlayer.prototype.i_getPosition=function(){return this.i_getNative().fmpGetPosition();};xmp.FlashPlayer.prototype.i_getDuration=function(){return this.i_getNative().fmpGetDuration();};xmp.FlashPlayer.prototype.i_getVolume=function(){return this.i_getNative().fmpGetVolume();};xmp.FlashPlayer.prototype.i_setVolume=function(Ba){this.i_getNative().fmpSetVolume(Ba);};xmp.FlashPlayer.prototype.i_getMute=function(){return this.i_getNative().fmpGetMute();};xmp.FlashPlayer.prototype.i_setMute=function(Ca){this.i_getNative().fmpSetMute(Ca);};xmp.FlashPlayer.prototype.i_setFullscreen=function(Da){var Ea="The \"setFullscreen\" method is not supported.  Fullscreen is only suppported by a double-click on the player.";if(false===this.i_isFullscreenEnabled()){Ea="The \"setFullscreen\" method is not supported.  Fullscreen disabled.";}
throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.",Ea,this);};xmp.FlashPlayer.prototype.i_onValidatePlugIn=function(Fa){this.i_validatePlugInVersion(xmp.i_FLASH,this.p_validatePlugInExists());};xmp.FlashPlayer.prototype.p_validatePlugInExists=function(){var Ga=this.i_getPlugInInfo(xmp.i_FLASH);if(xmp.isIEBrowser()){try{return this.p_getActiveXVersion(new ActiveXObject(xmp.i_FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID));}
catch(e){var Ha=parseInt(this.i_parseVersion(Ga.minVersion).major,10);var Ia=Ha;if(Ga.maxVersion&&Ga.maxVersion.length>0){Ia=parseInt(this.i_parseVersion(Ga.maxVersion).major,10);}
for(var i=Ia;(i>=3&&i>=Ha);i--){try{return this.p_getActiveXVersion(new ActiveXObject(xmp.i_FLASH_ACTIVEX_BASE_PROGID+i));}
catch(tempE){}}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ga);}
else{var Ja=navigator.mimeTypes[xmp.i_FLASH_PLUGIN_MIME_TYPE];if(!Ja){throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ga);}
if(!Ja.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",Ga,xmp.i_FLASH_PLUGIN_MIME_TYPE);}
var Ka=Ja.enabledPlugin.name;if(Ka.indexOf(xmp.i_FLASH_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",Ga,xmp.i_FLASH_PLUGIN_MIME_TYPE);}
var La=Ja.enabledPlugin.description;var Ma=this.i_getVersionFromString(xmp.i_MOZILLA_VERSION_DETECTION_JSON,La);return Ma;}
return"";};xmp.FlashPlayer.prototype.i_create=function(Na){if(true===this.i_attach(Na)){return;}
Na.id=xmp.i_FLASH+Na.group;xmp.FlashPlayer.base.i_create.call(this,Na);var Oa=Na.viewport.i_getNative();var Pa=new SWFObject(xmp.makeSWFPath(xmp.i_FLASH_PLAYER_SWF_BASE_NAME,true),Na.id,Oa.style.width,Oa.style.height,xmp.i_FLASH_VERSION,xmp.i_BLACK_BACKGROUND_COLOR);Pa.addParam(xmp.i_ALLOW_SCRIPT_ACCESS,xmp.i_ALWAYS_ACCESS);Pa.addParam(xmp.i_ALLOW_TRANSPARENCY,"transparent");Pa.addParam(xmp.i_QUALITY,xmp.i_QUALITY_HIGH);Pa.addParam(xmp.i_ALLOW_FULLSCREEN_ACCESS,xmp.TRUE);Pa.addVariable(xmp.i_FLASH_BUFFER_TIME,this.i_getConfigProperty(xmp.i_FLASH_BUFFER_TIME_CONFIG));Pa.addVariable(xmp.i_FLASH_STREAMING_VIDEO_ADAPTER,this.i_getConfigProperty(xmp.i_FLASH_STREAMING_VIDEO_ADAPTER_CONFIG));Pa.addVariable(xmp.i_FLASH_FULLSCREEN_ENABLED,((true===this.i_isFullscreenEnabled())?xmp.TRUE:xmp.FALSE));Pa.addVariable(xmp.i_FLASH_INITIALIZATION_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_INITIALIZATION_METHOD));Pa.addVariable(xmp.i_FLASH_STATE_CHANGE_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_STATE_CHANGE_METHOD));Pa.addVariable(xmp.i_FLASH_TRIGGER_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_TRIGGER_METHOD));Pa.addVariable(xmp.i_FLASH_INVOKE_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_INVOKE_METHOD));Pa.addVariable(xmp.i_FLASH_ERROR_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_ERROR_METHOD));Pa.addVariable(xmp.i_VOLUME,Na.volume);Pa.addVariable(xmp.i_MUTE,((true===Na.mute)?xmp.TRUE:xmp.FALSE));Pa.write(Oa.id);};xmp.FlashPlayer.prototype.i_attach=function(Qa){Qa.id=Qa.viewport.i_getName();xmp.FlashPlayer.base.i_attach.call(this,Qa);if(Qa.viewport.i_getType()!==xmp.DHTML_VIEWPORT&&Qa.viewport.i_getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Initializing native player.","Invalid native player viewport \""+Qa.viewport.i_getType()+"\".  Supported viewports:  DHTML, Flash",this);}
if(Qa.viewport.i_getType()!==xmp.FLASH_VIEWPORT){return false;}
var Ra=[{name:xmp.i_FLASH_BUFFER_TIME,value:this.i_getConfigProperty(xmp.i_FLASH_BUFFER_TIME_CONFIG)},{name:xmp.i_FLASH_STREAMING_VIDEO_ADAPTER,value:this.i_getConfigProperty(xmp.i_FLASH_STREAMING_VIDEO_ADAPTER_CONFIG)},{name:xmp.i_FLASH_FULLSCREEN_ENABLED,value:((true===this.i_isFullscreenEnabled())?xmp.TRUE:xmp.FALSE)},{name:xmp.i_FLASH_STATE_CHANGE_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_STATE_CHANGE_METHOD)},{name:xmp.i_FLASH_TRIGGER_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_TRIGGER_METHOD)},{name:xmp.i_FLASH_INVOKE_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_INVOKE_METHOD)},{name:xmp.i_FLASH_ERROR_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_PLAYER_ERROR_METHOD)},{name:xmp.i_VOLUME,value:Qa.volume},{name:xmp.i_MUTE,value:((true===Qa.mute)?xmp.TRUE:xmp.FALSE)}];var Sa=Ra.length;for(var i=0;i<Sa;i++){var Ta=Ra[i];this.i_getNative().SetVariable(Ta.name,Ta.value);}
this.i_setCreated();return true;};xmp.FlashPlayer.prototype.p_translateState=function(Ua){return Ua;};xmp.FlashPlayer.prototype.p_getActiveXVersion=function(Va){var Wa=Va.GetVariable(xmp.i_FLASH_VERSION_VARIABLE);return this.i_getVersionFromString(xmp.i_ACTIVEX_VERSION_DETECTION_JSON,Wa);};xmp.FlashPlayer.prototype.onInit=function(){try{this.i_getNative().style.zIndex=xmp.i_NATIVE_PLAYER_Z_INDEX;this.i_setCreated();}
catch(e){this.i_setError("Initializing.",e);}};xmp.FlashPlayer.prototype.onStateChange=function(Xa,Ya){try{var Za=this.p_translateState(Xa);if(Za.length>0){this.i_setState(Za,Ya);}}
catch(e){this.i_setError("Handling state change.",e);}};xmp.FlashPlayer.prototype.onTrigger=function($a,ab){try{this.i_setTrigger($a,ab);}
catch(e){this.i_setError("Handling trigger.",e);}};xmp.FlashPlayer.prototype.onInvoke=function(bb,cb){try{this.i_invoke(bb,cb);}
catch(e){this.i_setError("Invoking method.",e);}};xmp.FlashPlayer.prototype.onError=function(db,eb,fb){try{var gb=[{label:"Flash Error Type",text:db}];if(fb){gb.push({label:"Flash Error Code",text:fb});}
var hb=((db===xmp.i_FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",eb,this,gb):new xmp.NativePlayerError("Handling error.",eb,this,gb));this.i_setError(null,hb);}
catch(e){this.i_setError("Handling error.",e);}};xmp.i_IMAGE_PLAYER="Image";xmp.IMAGE_MIME_TYPE="application/x-image";xmp.i_IMAGE_TAG="IMG";xmp.i_IMAGE_STATE_CHANGE_METHOD="onStateChange";xmp.i_IMAGE_ERROR_METHOD="onError";xmp.i_IMAGE_INITIALIZATION_METHOD="onInit";xmp.ImagePlayer=function(ib,jb){xmp.ImagePlayer.ctor.call(this,xmp.i_IMAGE_PLAYER,ib,jb);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.ImagePlayer);xmp.ImagePlayer.prototype.i_open=function(kb){this.p_url=kb.getURI();this.p_timeLimit=kb.getTimeLimitInSeconds();this.p_position=0;if(true===this.p_isDHTML()){this.i_setState(xmp.CONNECTING);this.i_getNative().src=this.p_url;}
else{this.i_getNative().fmpOpen(xmp.IMAGE_MIME_TYPE,this.p_url);}};xmp.ImagePlayer.prototype.i_close=function(){if(false===this.p_isDHTML()){this.i_getNative().fmpClose();}
xmp.ImagePlayer.base.i_close.call(this);};xmp.ImagePlayer.prototype.i_play=function(){if(-1!==this.p_timeLimit){this.i_startMonitor();}
this.i_setState(xmp.PLAY);};xmp.ImagePlayer.prototype.i_stop=function(){this.i_setState(xmp.STOP);};xmp.ImagePlayer.prototype.i_ended=function(){if(false===this.p_isDHTML()){this.i_getNative().fmpEnded();}
xmp.ImagePlayer.base.i_ended.call(this);this.i_close();};xmp.ImagePlayer.prototype.i_isAvailable=function(lb){return(lb===xmp.ENDED);};xmp.ImagePlayer.prototype.i_getPosition=function(){return this.p_position;};xmp.ImagePlayer.prototype.i_getDuration=function(){return((-1===this.p_timeLimit)?0:this.p_timeLimit);};xmp.ImagePlayer.prototype.i_create=function(mb){if(true===this.i_attach(mb)){return;}
mb.id=xmp.i_IMAGE_PLAYER+mb.group;xmp.ImagePlayer.base.i_create.call(this,mb);this.i_setVolume(mb.volume);this.i_setMute(mb.mute);var nb=mb.viewport.i_getNative();nb.innerHTML="<img style='background-color:  #000000' id='"+mb.id+"' width='"+(nb.style.width)+"' height='"+(nb.style.height)+"' src='"+mb.node.getURI()+"' style='background-color:  #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"' onError='"+this.p_createCallbackMethod(xmp.i_IMAGE_ERROR_METHOD)+"()' onLoad='"+this.p_createCallbackMethod(xmp.i_IMAGE_STATE_CHANGE_METHOD)+"(xmp.OPEN, null)' />";this.i_setCreated();};xmp.ImagePlayer.prototype.i_onMonitorTimelineChange=function(ob,pb){this.p_position++;};xmp.ImagePlayer.prototype.i_attach=function(qb){qb.id=qb.viewport.i_getName();this.i_setVolume(qb.volume);this.i_setMute(qb.mute);xmp.ImagePlayer.base.i_attach.call(this,qb);if(qb.viewport.i_getType()!==xmp.DHTML_VIEWPORT&&qb.viewport.i_getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Initializing native player.","Invalid native player viewport \""+qb.viewport.i_getType()+"\".  Supported viewports:  DHTML,  Flash",this);}
if(qb.viewport.i_getType()!==xmp.FLASH_VIEWPORT){return false;}
this.i_getNative().SetVariable(xmp.i_FLASH_INITIALIZATION_CALLBACK,this.i_getCallbackMethod(xmp.i_IMAGE_INITIALIZATION_METHOD));this.i_getNative().SetVariable(xmp.i_FLASH_STATE_CHANGE_CALLBACK,this.i_getCallbackMethod(xmp.i_IMAGE_STATE_CHANGE_METHOD));this.i_getNative().SetVariable(xmp.i_FLASH_ERROR_CALLBACK,this.i_getCallbackMethod(xmp.i_IMAGE_ERROR_METHOD));this.i_getNative().SetVariable(xmp.i_CONTEXT,qb.group);this.i_setCreated();return true;};xmp.ImagePlayer.prototype.p_isDHTML=function(){return(this.i_getNative().tagName.toUpperCase()===xmp.i_IMAGE_TAG);};xmp.ImagePlayer.prototype.p_createCallbackMethod=function(rb){return this.i_getCallbackMethod(rb).replace(/\'/g,"\"");};xmp.ImagePlayer.prototype.p_translateState=function(sb){return sb;};xmp.ImagePlayer.prototype.onInit=function(){try{this.i_setCreated();}
catch(e){this.i_setError("Initializing.",e);}};xmp.ImagePlayer.prototype.onStateChange=function(tb,ub){try{var vb=this.p_translateState(tb);if(vb.length>0){this.i_setState(vb,ub);}}
catch(e){this.i_setError("Handling state change.",e);}};xmp.ImagePlayer.prototype.onError=function(wb,xb,yb){try{var zb=null;if(true===this.p_isDHTML()){zb=new xmp.NativePlayerConnectionError("Connecting to media.","Unable to connect to \""+this.i_getNative().src+"\"",this);}
else{var Ab=[{label:"Flash Error Type",text:wb}];if(yb){Ab.push({label:"Flash Error Code",text:yb});}
zb=((wb===xmp.i_FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",xb,this,Ab):new xmp.NativePlayerError("Handling error.",xb,this,Ab));}
this.i_setError(null,zb);}
catch(e){this.i_setError("Handling error.",e);}};xmp.i_MOCK_NATIVE="MOCK_NATIVE";xmp.MOCK_MIME_TYPE="application/xmp-mock";xmp.MockNativePlayer=function(Bb,Cb){xmp.MockNativePlayer.ctor.call(this,xmp.i_MOCK_NATIVE,Bb,Cb);this.p_position=0;this.p_duration=0;this.p_realTimePosition=0;this.p_realTimeDuration=0;this.p_playInstance=-1;this.p_monitorTimes=4.0;this.p_logger=new xmp.util.internals.CategoryLogger('MockNativePlayer');};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.MockNativePlayer);xmp.MockNativePlayer.prototype.i_open=function(Db){this.p_node=Db;this.p_logger.info("open(): "+this.p_node.getURI());this.p_position=0;this.p_duration=this.p_getDuration();this.p_realTimePosition=0;this.p_realTimeDuration=xmp.util.internals.MockTestMode.getInstance().getRealPlayTimePerNode();this.p_monitorInterval=this.p_realTimeDuration/this.p_monitorTimes;this.p_positionChangeInterval=this.p_duration/(this.p_monitorTimes*2);this.p_realTimePositionChangeInterval=this.p_realTimeDuration/(this.p_monitorTimes*2);this.p_logger.info("Duration: "+this.p_duration+" second(s)");this.p_logger.debug("Real time duration: "+this.p_realTimeDuration+" milliseconds");this.i_setState(xmp.OPEN);this.i_setState(xmp.CONNECTING);this.i_setState(xmp.CONNECTED);this.i_setState(xmp.FIRST_FRAME_RENDERED);this.i_setState(xmp.BUFFERING,{percent:0,bytesDownloaded:0,bytesTotal:0});};xmp.MockNativePlayer.prototype.i_close=function(){if(this.p_node){this.p_logger.info("close(): "+this.p_node.getURI());}
this.p_node=null;xmp.MockNativePlayer.base.i_close.call(this);};xmp.MockNativePlayer.prototype.i_fini=function(){this.i_close();};xmp.MockNativePlayer.prototype.i_onSetState=function(Eb,Fb){xmp.MockNativePlayer.base.i_onSetState.call(this,Eb,Fb);var Gb=Eb.getMetadata(xmp.i_CONTEXT,{});if(Gb.type===xmp.PLAY){this.p_simulatePlay();}};xmp.MockNativePlayer.prototype.i_play=function(){this.i_setState(xmp.PLAY);};xmp.MockNativePlayer.prototype.p_simulatePlay=function(){var Hb=this.p_node;this.p_logger.info("play(): "+Hb.getURI());this.p_logger.info("Node type: "+Hb.getNodeTypeName());this.p_playInstance++;var Ib=this.i_createTimer({object:this,id:"position change",interval:this.p_realTimePositionChangeInterval,handler:this.p_onSimulatedPositionChange,context:this.p_playInstance});Ib.start();this.i_startMonitor();};xmp.MockNativePlayer.prototype.p_onSimulatedPositionChange=function(Jb,Kb){var Lb=this.p_node;var Mb=Jb.getMetadata(xmp.i_CONTEXT,-1);if(!Lb||Mb!==this.p_playInstance){Kb.stop();}
else if(this.p_position>=this.p_duration){Kb.stop();this.i_stopMonitor();this.i_setState(xmp.ENDED);}
else{this.p_position+=this.p_positionChangeInterval;}};xmp.MockNativePlayer.prototype.p_getDuration=function(){var Nb=-1;var Ob=this.p_node;if(Ob.isContentType()||Ob.isAdType()){var Pb=Ob.getPlayableData();Nb=Pb.getTotalRunTime();}
if(Nb<=0){Nb=3;}
return Nb;};xmp.MockNativePlayer.prototype.i_pause=function(){if(this.p_node!==null){this.p_logger.info("pause(): "+this.p_node.getURI());}
xmp.MockNativePlayer.base.i_pause.call(this);this.i_setState(xmp.PAUSE);};xmp.MockNativePlayer.prototype.i_stop=function(){if(this.p_node!==null){this.p_logger.info("stop(): "+this.p_node.getURI());}
xmp.MockNativePlayer.base.i_stop.call(this);this.i_setState(xmp.STOP);};xmp.MockNativePlayer.prototype.i_rewind=function(){if(this.p_node!==null){this.p_logger.info("rewind(): "+this.p_node.getURI());}
xmp.MockNativePlayer.base.i_rewind.call(this);this.i_setState(xmp.REWIND);};xmp.MockNativePlayer.prototype.i_fastForward=function(){if(this.p_node!==null){this.p_logger.info("fastForward(): "+this.p_node.getURI());}
xmp.MockNativePlayer.base.i_fastForward.call(this);this.i_setState(xmp.FAST_FORWARD);};xmp.MockNativePlayer.prototype.i_seek=function(Qb){if(this.p_node!==null){this.p_logger.info("seek(): "+this.p_node.getURI()+" to "+Qb);}
xmp.MockNativePlayer.base.i_seek.call(this);this.setPosition(Qb);this.i_setState(xmp.SEEKABLE);};xmp.MockNativePlayer.prototype.i_ended=function(){if(this.p_node!==null){this.p_logger.info("ended(): "+this.p_node.getURI());}
xmp.MockNativePlayer.base.i_ended.call(this);};xmp.MockNativePlayer.prototype.i_isAvailable=function(Rb){return true;};xmp.MockNativePlayer.prototype.i_getPosition=function(){return this.p_position;};xmp.MockNativePlayer.prototype.i_getDuration=function(){return this.p_duration;};xmp.MockNativePlayer.prototype.i_validate=function(Sb){};xmp.MockNativePlayer.prototype.i_onValidatePlugIn=function(Tb){};xmp.MockNativePlayer.prototype.i_setCreated=function(){this.i_createTimer({object:this,id:"setCreated",interval:xmp.i_DEFAULT_TIMER_INTERVAL,handler:this.i_onSetCreated,context:null}).start();};xmp.MockNativePlayer.prototype.i_invoke=function(Ub,Vb){this.p_listener.i_onNativePlayerInvoke(Ub,Vb);};xmp.MockNativePlayer.prototype.i_create=function(Wb){this.p_data=Wb;};xmp.MockNativePlayer.prototype.i_attach=function(Xb){this.p_data=Xb;};xmp.MockNativePlayer.prototype.i_getNative=function(){return null;};xmp.MockNativePlayer.prototype.i_getMonitorInterval=function(){return this.p_monitorInterval;};xmp.i_QUICKTIME="QuickTime";xmp.QUICKTIME_MIME_TYPE="video/quicktime";xmp.i_FLIP4MAC="Flip4Mac";xmp.i_QUICKTIME_VERSION_CHECK_PROGID="QuickTimeCheckObject.QuickTimeCheck.1";xmp.i_FLIP4MAC_VERSION_DETECTION_JSON="Flip4Mac Version Detection JSON";xmp.QuickTimePlayer=function(Yb,Zb){this.p_state=new xmp.QuicktimeStateMachine(this);xmp.QuickTimePlayer.ctor.call(this,xmp.i_QUICKTIME,Yb,Zb);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.QuickTimePlayer);xmp.QuickTimePlayer.prototype.i_open=function($b){this.p_state.i_open($b);};xmp.QuickTimePlayer.prototype.i_close=function(){xmp.QuickTimePlayer.base.i_close.call(this);this.p_state.i_close();};xmp.QuickTimePlayer.prototype.i_play=function(){xmp.QuickTimePlayer.base.i_play.call(this);this.p_state.i_play();};xmp.QuickTimePlayer.prototype.i_pause=function(){xmp.QuickTimePlayer.base.i_pause.call(this);this.p_state.i_pause();};xmp.QuickTimePlayer.prototype.i_stop=function(){xmp.QuickTimePlayer.base.i_stop.call(this);this.p_state.i_stop();};xmp.QuickTimePlayer.prototype.i_rewind=function(){xmp.QuickTimePlayer.base.i_rewind.call(this);this.p_state.i_rewind();};xmp.QuickTimePlayer.prototype.i_fastForward=function(){xmp.QuickTimePlayer.base.i_fastForward.call(this);this.p_state.i_fastForward();};xmp.QuickTimePlayer.prototype.i_seek=function(ac){xmp.QuickTimePlayer.base.i_seek.call(this,ac);this.p_state.i_seek(ac);};xmp.QuickTimePlayer.prototype.i_ended=function(){xmp.QuickTimePlayer.base.i_ended.call(this);this.p_state.i_ended();};xmp.QuickTimePlayer.prototype.i_isAvailable=function(bc){return this.p_state.i_isAvailable(bc);};xmp.QuickTimePlayer.prototype.i_onValidatePlugIn=function(cc){this.p_validateQuicktime();if(cc.indexOf(xmp.WINDOWS_MEDIA_MIME_TYPE)!==-1){this.p_validateFlip4Mac();}};xmp.QuickTimePlayer.prototype.i_getPosition=function(){return this.p_state.i_getPosition();};xmp.QuickTimePlayer.prototype.i_getDuration=function(){return this.p_state.i_getDuration();};xmp.QuickTimePlayer.prototype.i_getVolume=function(){return this.p_state.i_getVolume();};xmp.QuickTimePlayer.prototype.i_setVolume=function(dc){this.p_state.i_setVolume(dc);};xmp.QuickTimePlayer.prototype.i_getMute=function(){return this.p_state.i_getMute();};xmp.QuickTimePlayer.prototype.i_setMute=function(ec){this.p_state.i_setMute(ec);};xmp.QuickTimePlayer.prototype.i_create=function(fc){fc.id=xmp.i_QUICKTIME+fc.group;xmp.QuickTimePlayer.base.i_create.call(this,fc);if(fc.viewport.i_getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+fc.viewport.i_getType()+"\".  Supported viewports:  DHTML",this);}
var gc=fc.viewport.i_getNative();if(true===xmp.isIEBrowser()){gc.innerHTML="<object id='"+fc.id+"' width='"+gc.style.width+"' height='"+gc.style.height+"' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'"+" style='background-color:  #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"' >"+"<param name='src' value='"+fc.node.getURI()+"' />"+"<param name='showlogo' value='false' />"+"<param name='bgcolor' value='#000000' />"+"<param name='autoplay' value='true' />"+"<param name='controller' value='false' />"+"<param name='enablejavascript' value='true' />"+"<param name='saveembedtags' value='true' />"+"<param name='scale' value='"+((true===fc.stretchToFit)?"TOFIT":"ASPECT")+"' />"+"<param name='loop' value='false' />"+"<param name='kioskmode' value='true' /></object>";}
else{gc.innerHTML="<embed type='video/quicktime' name='"+fc.id+"' width='"+gc.style.width+"' height='"+gc.style.height+"' src='"+fc.node.getURI()+"' showlogo='false'"+" style='background-color:  #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"' bgcolor='#000000' autoplay='true'"+" controller='false' enablejavascript='true' saveembedtags='true'"+" scale='"+((true===fc.stretchToFit)?"TOFIT":"ASPECT")+"' loop='false' kioskmode='true'></embed>";}
this.p_state.i_create(fc);this.i_setCreated();};xmp.QuickTimePlayer.prototype.p_validateQuicktime=function(){var hc=this.i_getPlugInInfo(xmp.i_QUICKTIME);var ic="0.0.0.0";if(true===xmp.isIEBrowser()){try{var jc=new ActiveXObject(xmp.i_QUICKTIME_VERSION_CHECK_PROGID);ic=this.i_getVersionFromString(xmp.i_ACTIVEX_VERSION_DETECTION_JSON,jc.QuickTimeVersion);}
catch(e){throw new xmp.PlugInNotFoundError("Validating native player plugin.",hc);}
this.i_validatePlugInVersion(xmp.i_QUICKTIME,ic);}
else{var kc=navigator.mimeTypes[xmp.QUICKTIME_MIME_TYPE];if(!kc){throw new xmp.PlugInNotFoundError("Validating native player plugin.",hc);}
if(!kc.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",hc,xmp.QUICKTIME_MIME_TYPE);}
var lc=kc.enabledPlugin.name;if(lc.indexOf(xmp.i_QUICKTIME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",hc,xmp.QUICKTIME_MIME_TYPE);}
ic=this.i_getVersionFromString(xmp.i_MOZILLA_VERSION_DETECTION_JSON,lc);this.i_validatePlugInVersion(xmp.i_QUICKTIME,ic);}};xmp.QuickTimePlayer.prototype.p_validateFlip4Mac=function(){var mc;var nc=this.i_getPlugInInfo(xmp.i_FLIP4MAC);var oc=navigator.plugins.length;for(var i=0;i<oc;i++){var pc=navigator.plugins[i];mc=pc.name;var qc=mc.length;if(mc.indexOf(xmp.i_FLIP4MAC)!==-1){var rc=this.i_getVersionFromString(xmp.i_FLIP4MAC_VERSION_DETECTION_JSON,mc);this.i_validatePlugInVersion(xmp.i_FLIP4MAC,rc);return;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",nc);};xmp.i_QUICKTIME_WAITING="Waiting";xmp.i_QUICKTIME_LOADING="Loading";xmp.i_QUICKTIME_PLAYABLE="Playable";xmp.i_QUICKTIME_COMPLETE="Complete";xmp.i_QUICKTIME_ERROR="Error";xmp.i_QUICKTIME_NORMAL_RATE=1;xmp.i_QUICKTIME_PAUSE_RATE=0;xmp.i_QUICKTIME_REWIND_RATE=-5;xmp.i_QUICKTIME_FAST_FORWARD_RATE=5;xmp.i_QUICKTIME_VOLUME_MAX=256;xmp.i_QUICKTIME_INITIAL_LIVE_DURATION=180000;xmp.i_QUICKTIME_LOAD_BUFFERING="LoadBuffering";xmp.i_QUICKTIME_WAIT_BUFFERING="WaitBuffering";xmp.i_QUICKTIME_BUFFERING_COMPLETE="BufferingComplete";xmp.i_QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG="State Change Polling Interval";xmp.i_QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG="Connection Timeout Interval";xmp.i_QUICKTIME_ERROR_CODE_DELIMITER=",";xmp.QuicktimeStateMachine=function(sc){this.p_player=sc;this.p_initTransitionTable();this.p_initStateChangeHandlers();this.p_initOperations();this.p_initErrorCodes();this.p_live=true;this.p_stateChangeMonitorTimer=null;this.p_connectionTimeoutTimer=null;this.p_bufferingComplete=false;};xmp.QuicktimeStateMachine.prototype.i_open=function(tc){if(false===this.p_checkForStaticUrl()){this.p_initState();this.p_url=tc.getURI();this.p_player.i_getNative().SetURL(this.p_url);}};xmp.QuicktimeStateMachine.prototype.i_close=function(){try{this.p_setState(xmp.i_FINI,false);this.p_opened=false;this.p_stopStateChangeMonitor();this.p_stopConnectionTimeoutMonitor();this.p_player.i_getNative().SetMute(true);this.p_player.i_getNative().Stop();}
catch(e){}};xmp.QuicktimeStateMachine.prototype.i_play=function(){this.p_player.i_getNative().Play();this.p_setState(xmp.PLAY,true);};xmp.QuicktimeStateMachine.prototype.i_pause=function(){this.p_player.i_getNative().SetRate(xmp.i_QUICKTIME_PAUSE_RATE);this.p_setState(xmp.PAUSE,true);};xmp.QuicktimeStateMachine.prototype.i_stop=function(){this.p_player.i_getNative().Stop();this.p_player.i_getNative().Rewind();this.p_setState(xmp.STOP,true);};xmp.QuicktimeStateMachine.prototype.i_rewind=function(){this.p_player.i_getNative().SetRate(xmp.i_QUICKTIME_REWIND_RATE);this.p_setState(xmp.REWIND,true);};xmp.QuicktimeStateMachine.prototype.i_fastForward=function(){this.p_player.i_getNative().SetRate(xmp.i_QUICKTIME_FAST_FORWARD_RATE);this.p_setState(xmp.FAST_FORWARD,true);};xmp.QuicktimeStateMachine.prototype.i_seek=function(uc){this.p_player.i_getNative().SetRate(xmp.i_QUICKTIME_NORMAL_RATE);this.p_player.i_getNative().SetTime(uc*this.p_player.i_getNative().GetTimeScale());this.p_setState(xmp.SEEKABLE,true);};xmp.QuicktimeStateMachine.prototype.i_ended=function(){this.p_setState(xmp.ENDED,false);};xmp.QuicktimeStateMachine.prototype.i_isAvailable=function(vc){var wc=this.p_operations[this.p_state];for(var xc=xmp.MapIterator.create(wc);xc.hasNext();xc.next()){var yc=xc.currentValue();if(yc.state===vc){if(false===this.p_live){return true;}
else{return(true===yc.live);}}}
return false;};xmp.QuicktimeStateMachine.prototype.i_getPosition=function(){try{return Math.floor(this.p_player.i_getNative().GetTime()/this.p_player.i_getNative().GetTimeScale());}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.i_getDuration=function(){try{var zc=this.p_live;var Ac=this.p_player.i_getNative().GetDuration();if(true===this.p_isInitializing()){zc=this.p_isLive(Ac);}
return((true===zc||Ac===0)?0:Math.floor(Ac/this.p_player.i_getNative().GetTimeScale()));}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.i_getVolume=function(){return Math.abs(Math.floor(((this.p_player.i_getNative().GetVolume()+1)/xmp.i_QUICKTIME_VOLUME_MAX)*100));};xmp.QuicktimeStateMachine.prototype.i_setVolume=function(Bc){this.p_player.i_getNative().SetVolume(Math.floor(((Bc.toFixed(1)+1)*0.01)*xmp.i_QUICKTIME_VOLUME_MAX));this.p_volume=Bc;this.p_muted=this.i_getMute();};xmp.QuicktimeStateMachine.prototype.i_getMute=function(){var Cc=this.p_player.i_getNative().GetMute();return(Cc===true||Cc===1);};xmp.QuicktimeStateMachine.prototype.i_setMute=function(Dc){this.p_player.i_getNative().SetMute(Dc);this.p_muted=Dc;this.p_volume=Math.floor(((this.p_player.i_getNative().GetVolume()+1)/xmp.i_QUICKTIME_VOLUME_MAX)*100);};xmp.QuicktimeStateMachine.prototype.i_create=function(Ec){this.p_stateChangePollingInterval=parseInt(this.p_player.i_getConfigProperty(xmp.i_QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG),10);if(!this.p_stateChangePollingInterval){throw new xmp.NativePlayerError("Validating state change polling interval.","Missing state change polling interval.",this.p_player,null);}
this.p_connectionTimeoutInterval=parseInt(this.p_player.i_getConfigProperty(xmp.i_QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG),10);if(!this.p_connectionTimeoutInterval){throw new xmp.NativePlayerError("Validating connection timeout interval.","Missing connection timeout interval.",this.p_player,null);}
this.p_url=Ec.node.getURI();this.p_staticUrl=this.p_url;this.p_volume=Ec.volume;this.p_muted=Ec.muted;this.p_initState();};xmp.QuicktimeStateMachine.prototype.p_onStateChange=function(Fc,Gc){try{if(this.p_state===xmp.ERRORS){return;}
if(true===this.p_canGetPluginStatus()){var Hc=this.p_getRawPluginStatus();if(!Hc){return;}
var Ic=this.p_translateState(Hc);if(Ic.length>0){if(false===this.p_stateHandlers[Ic].apply(this,[Hc,Ic])){return;}}}
if(false===this.p_isInitializing()){var Jc=this.i_getPosition();if(this.p_state!==xmp.ENDED&&Jc>0&&(Jc>=this.i_getDuration())&&false===this.p_live){this.p_setState(xmp.ENDED,true);}}}
catch(e){this.p_setError(null,e);}};xmp.QuicktimeStateMachine.prototype.p_onConnectionTimeout=function(Kc,Lc){try{this.p_stopConnectionTimeoutMonitor();if(this.p_state===xmp.ERRORS){return;}
if(false===this.p_opened&&false===this.p_validateUrl()){var e=this.p_createConnectionError(this.p_getRawPluginStatus(),"Connection timeout.","Error connecting to \""+this.p_url+"\".");throw e;}}
catch(e2){this.p_setError(null,e2);}};xmp.QuicktimeStateMachine.prototype.p_translateState=function(Mc){if(Mc.indexOf(xmp.i_QUICKTIME_ERROR)===-1&&false===this.p_validateUrl()){return"";}
for(var i=0;i<this.p_transitionTable.length;i++){var Nc=this.p_transitionTable[i];if(Mc.indexOf(Nc.nativeState)===0){if(0===Nc.currentState.length){return Nc.transitionState;}
else{for(var j=0;j<Nc.currentState.length;j++){if(this.p_state===Nc.currentState[j]){return Nc.transitionState;}}}}}
return"";};xmp.QuicktimeStateMachine.prototype.p_initOperations=function(){this.p_operations={};this.p_operations[xmp.i_INIT]=[];this.p_operations[xmp.CONNECTING]=[];this.p_operations[xmp.CONNECTED]=[];this.p_operations[xmp.OPEN]=[];this.p_operations[xmp.i_FINI]=[];this.p_operations[xmp.PLAY]=[{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:true},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.p_operations[xmp.PAUSE]=[{state:xmp.PLAY,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.p_operations[xmp.STOP]=[{state:xmp.PLAY,live:true},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false}];this.p_operations[xmp.REWIND]=[{state:xmp.PLAY,live:false},{state:xmp.STOP,live:false},{state:xmp.PAUSE,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.p_operations[xmp.FAST_FORWARD]=[{state:xmp.PLAY,live:false},{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.SEEKABLE,live:false}];this.p_operations[xmp.SEEKABLE]=[{state:xmp.SEEKABLE,live:false},{state:xmp.PAUSE,live:false},{state:xmp.STOP,live:false},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false}];this.p_operations[xmp.ENDED]=[{state:xmp.PLAY,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.p_operations[xmp.ERRORS]=[];};xmp.QuicktimeStateMachine.prototype.p_setState=function(Oc,Pc,Qc){this.p_state=Oc;if(true===Pc){var Rc=((Oc===xmp.i_QUICKTIME_LOAD_BUFFERING||Oc===xmp.i_QUICKTIME_WAIT_BUFFERING||Oc===xmp.i_QUICKTIME_BUFFERING_COMPLETE)?xmp.BUFFERING:Oc);this.p_player.i_setState(Rc,Qc);}};xmp.QuicktimeStateMachine.prototype.p_initTransitionTable=function(){this.p_transitionTable=[];this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_WAITING,currentState:[xmp.i_INIT],transitionState:xmp.CONNECTING});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_WAITING,currentState:[xmp.CONNECTING,xmp.i_QUICKTIME_WAIT_BUFFERING],transitionState:xmp.i_QUICKTIME_WAIT_BUFFERING});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_LOADING,currentState:[xmp.i_INIT,xmp.CONNECTING,xmp.i_QUICKTIME_WAIT_BUFFERING],transitionState:xmp.CONNECTED});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_LOADING,currentState:[xmp.CONNECTED,xmp.i_QUICKTIME_LOAD_BUFFERING,xmp.OPEN],transitionState:xmp.i_QUICKTIME_LOAD_BUFFERING});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_PLAYABLE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.BUFFERING],transitionState:xmp.BUFFERING});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_COMPLETE,currentState:[xmp.i_INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.i_QUICKTIME_WAIT_BUFFERING,xmp.i_QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_COMPLETE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.OPEN,xmp.BUFFERING],transitionState:xmp.i_QUICKTIME_BUFFERING_COMPLETE});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_PLAYABLE,currentState:[xmp.i_INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.i_QUICKTIME_WAIT_BUFFERING,xmp.i_QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_COMPLETE,currentState:[xmp.i_QUICKTIME_LOAD_BUFFERING],transitionState:xmp.ERRORS});this.p_transitionTable.push({nativeState:xmp.i_QUICKTIME_ERROR,currentState:[],transitionState:xmp.ERRORS});};xmp.QuicktimeStateMachine.prototype.p_initStateChangeHandlers=function(){this.p_stateHandlers={};this.p_stateHandlers[xmp.ERRORS]=this.p_onError;this.p_stateHandlers[xmp.CONNECTING]=this.p_onConnecting;this.p_stateHandlers[xmp.CONNECTED]=this.p_onConnected;this.p_stateHandlers[xmp.OPEN]=this.p_onOpen;this.p_stateHandlers[xmp.i_QUICKTIME_WAIT_BUFFERING]=this.p_onBuffering;this.p_stateHandlers[xmp.i_QUICKTIME_LOAD_BUFFERING]=this.p_onBuffering;this.p_stateHandlers[xmp.i_QUICKTIME_BUFFERING_COMPLETE]=this.p_onBuffering;this.p_stateHandlers[xmp.BUFFERING]=this.p_onBuffering;};xmp.QuicktimeStateMachine.prototype.p_onError=function(Sc,Tc){this.p_opened=false;var Uc="Unknown error.";if(true===this.p_isInitializing()){Uc="Error connecting to \""+this.p_url+"\".";}
this.p_setError(null,this.p_createConnectionError(Sc,"Connecting to media.",Uc));return false;};xmp.QuicktimeStateMachine.prototype.p_onConnected=function(Vc,Wc){this.p_player.i_startMonitor();this.p_setState(xmp.CONNECTED,true);return true;};xmp.QuicktimeStateMachine.prototype.p_onConnecting=function(Xc,Yc){this.p_player.i_startMonitor();this.p_setState(xmp.CONNECTING,true);return true;};xmp.QuicktimeStateMachine.prototype.p_onOpen=function(Zc,$c){this.p_opened=true;this.p_live=this.p_isLive(this.p_player.i_getNative().GetDuration());this.i_setVolume(this.p_volume);if(true===this.p_muted){this.i_setMute(true);}
this.p_setState(xmp.OPEN,true);this.p_player.i_setState(xmp.FIRST_FRAME_RENDERED);return true;};xmp.QuicktimeStateMachine.prototype.p_onBuffering=function(ad,bd){this.p_checkSetOpen();if(this.p_state!==xmp.i_QUICKTIME_WAIT_BUFFERING&&this.p_state!==xmp.i_QUICKTIME_LOAD_BUFFERING&&this.p_state!==xmp.i_QUICKTIME_BUFFERING_COMPLETE&&this.p_state!==xmp.BUFFERING){this.p_operations[bd]=this.p_operations[this.p_state];}
var cd=this.p_getRawBytesTotal();var dd=((bd===xmp.i_QUICKTIME_BUFFERING_COMPLETE)?cd:this.p_getRawBytesLoaded());var ed=((cd<=0)?0:Math.floor((dd/cd)*100));ed=((99===ed)?100:ed);if(false===this.p_bufferingComplete&&(false===this.p_isLive(this.p_getRawDuration())||bd===xmp.i_QUICKTIME_WAIT_BUFFERING||bd===xmp.i_QUICKTIME_LOAD_BUFFERING||bd===xmp.i_QUICKTIME_BUFFERING_COMPLETE)){this.p_setState(bd,true,{percent:ed,bytesDownloaded:dd,bytesTotal:cd});}
this.p_bufferingComplete=(100===ed);if(bd===xmp.i_QUICKTIME_LOAD_BUFFERING&&true===this.p_bufferingComplete){this.p_onOpen(ad,bd);}
return true;};xmp.QuicktimeStateMachine.prototype.p_isInitializing=function(){return(this.p_state===xmp.i_INIT||this.p_state===xmp.CONNECTING||this.p_state===xmp.CONNECTED||this.p_state===xmp.i_QUICKTIME_WAIT_BUFFERING||this.p_state===xmp.i_QUICKTIME_LOAD_BUFFERING);};xmp.QuicktimeStateMachine.prototype.isBuffering=function(){return(this.p_state===xmp.BUFFERING||this.p_state===xmp.i_QUICKTIME_WAIT_BUFFERING||this.p_state===xmp.i_QUICKTIME_LOAD_BUFFERING||this.p_state===xmp.i_QUICKTIME_BUFFERING_COMPLETE);};xmp.QuicktimeStateMachine.prototype.p_isLive=function(fd){return(xmp.i_QUICKTIME_INITIAL_LIVE_DURATION===fd||0===fd||-1===fd);};xmp.QuicktimeStateMachine.prototype.p_canGetPluginStatus=function(){return(false===this.p_bufferingComplete);};xmp.QuicktimeStateMachine.prototype.p_startStateChangeMonitor=function(){if(!this.p_stateChangeMonitorTimer){this.p_stateChangeMonitorTimer=this.p_player.i_createTimer({object:this,id:"stateChange",interval:this.p_stateChangePollingInterval,handler:this.p_onStateChange,context:null});this.p_stateChangeMonitorTimer.start();}};xmp.QuicktimeStateMachine.prototype.p_stopStateChangeMonitor=function(){if(this.p_stateChangeMonitorTimer){this.p_stateChangeMonitorTimer.stop();this.p_stateChangeMonitorTimer=null;}};xmp.QuicktimeStateMachine.prototype.p_startConnectionTimeoutMonitor=function(){if(!this.p_connectionTimeoutTimer){this.p_connectionTimeoutTimer=this.p_player.i_createTimer({object:this,id:"connectionTimeout",interval:this.p_connectionTimeoutInterval,handler:this.p_onConnectionTimeout,context:null});this.p_connectionTimeoutTimer.start();}};xmp.QuicktimeStateMachine.prototype.p_stopConnectionTimeoutMonitor=function(){if(this.p_connectionTimeoutTimer){this.p_connectionTimeoutTimer.stop();this.p_connectionTimeoutTimer=null;}};xmp.QuicktimeStateMachine.prototype.p_initErrorCodes=function(){this.p_errorCodeDesc={};this.p_errorCodeDesc[100]="(Continue)";this.p_errorCodeDesc[101]="(Switching Protocols)";this.p_errorCodeDesc[200]="(OK)";this.p_errorCodeDesc[201]="(Created)";this.p_errorCodeDesc[202]="(Accepted)";this.p_errorCodeDesc[204]="(No Content)";this.p_errorCodeDesc[205]="(Reset Content)";this.p_errorCodeDesc[206]="(Partial Content)";this.p_errorCodeDesc[300]="(Multiple Choices)";this.p_errorCodeDesc[301]="(Moved Permanently)";this.p_errorCodeDesc[302]="(Found)";this.p_errorCodeDesc[303]="(See Other)";this.p_errorCodeDesc[304]="(Not Modified)";this.p_errorCodeDesc[305]="(Use Proxy)";this.p_errorCodeDesc[306]="(No Longer Used)";this.p_errorCodeDesc[307]="(Temporary Redirect)";this.p_errorCodeDesc[400]="(Bad Request)";this.p_errorCodeDesc[401]="(Not Authorised)";this.p_errorCodeDesc[402]="(Payment Required)";this.p_errorCodeDesc[403]="(Forbidden)";this.p_errorCodeDesc[404]="(Not Found)";this.p_errorCodeDesc[405]="(Method Not Allowed)";this.p_errorCodeDesc[406]="(Not Acceptable)";this.p_errorCodeDesc[407]="(Proxy Authentication Required)";this.p_errorCodeDesc[408]="(Request Timeout)";this.p_errorCodeDesc[409]="(Conflict)";this.p_errorCodeDesc[410]="(Gone)";this.p_errorCodeDesc[411]="(Length Required)";this.p_errorCodeDesc[412]="(Precondition Failed)";this.p_errorCodeDesc[413]="(Request Entity Too Large)";this.p_errorCodeDesc[414]="(Request URI Too Long)";this.p_errorCodeDesc[415]="(Unsupported Media Type)";this.p_errorCodeDesc[416]="(Requested Range Not Satisfiable)";this.p_errorCodeDesc[417]="(Expectation Failed)";this.p_errorCodeDesc[451]="(Parameter Not Understood)";this.p_errorCodeDesc[452]="(Conference Not Found)";this.p_errorCodeDesc[453]="(Not Enough Bandwidth)";this.p_errorCodeDesc[454]="(Session Not Founds)";this.p_errorCodeDesc[455]="(Method Not Valid In This State)";this.p_errorCodeDesc[456]="(Header Field Not Valid For Resource)";this.p_errorCodeDesc[457]="(Invalid Range)";this.p_errorCodeDesc[458]="(Parameter Is Read Only)";this.p_errorCodeDesc[459]="(Aggregate Operation Not Allowed)";this.p_errorCodeDesc[460]="(Only Aggregate Operation Allowed)";this.p_errorCodeDesc[461]="(Unsupported Transport)";this.p_errorCodeDesc[462]="(Destination Unreachable)";this.p_errorCodeDesc[500]="(Internal Server Error)";this.p_errorCodeDesc[501]="(Not Implemented)";this.p_errorCodeDesc[502]="(Bad Gateway)";this.p_errorCodeDesc[503]="(Service Unavailable)";this.p_errorCodeDesc[504]="(Gateway Timeout)";this.p_errorCodeDesc[505]="(HTTP Version Not Supported)";};xmp.QuicktimeStateMachine.prototype.p_getErrorCodeDesc=function(gd){var hd=((this.p_errorCodeDesc[gd])?this.p_errorCodeDesc[gd]:"(Unknown)");return gd+" "+hd;};xmp.QuicktimeStateMachine.prototype.p_getErrorCodes=function(jd){var kd=[];var ld=jd.substring(jd.indexOf(":")+1);if(ld.indexOf(xmp.i_QUICKTIME_ERROR_CODE_DELIMITER)===-1){kd.push(this.p_getErrorCodeDesc(parseInt(ld,10)));}
else{while(ld.length>0){var md=ld.indexOf(xmp.i_QUICKTIME_ERROR_CODE_DELIMITER);if(md===-1){kd.push(this.p_getErrorCodeDesc(parseInt(ld,10)));break;}
else{kd.push(this.p_getErrorCodeDesc(parseInt(ld.substring(0,md),10)));ld=ld.substring(md+1);}}}
return kd;};xmp.QuicktimeStateMachine.prototype.p_initState=function(){this.p_opened=false;this.p_bufferingComplete=false;this.p_setState(xmp.i_INIT,false);this.p_startStateChangeMonitor();this.p_startConnectionTimeoutMonitor();};xmp.QuicktimeStateMachine.prototype.p_checkSetOpen=function(){if(false===this.p_opened&&this.i_getPosition()>0){this.p_onOpen("",xmp.OPEN);}};xmp.QuicktimeStateMachine.prototype.p_createConnectionError=function(nd,od,pd){var qd=[];if(nd&&nd.indexOf(xmp.i_QUICKTIME_ERROR)===0){qd.push({label:"QuickTime Error Codes",text:this.p_getErrorCodes(nd).join(", ")});}
return new xmp.NativePlayerConnectionError(od,pd,this.p_player,qd);};xmp.QuicktimeStateMachine.prototype.p_getRawDuration=function(){try{return this.p_player.i_getNative().GetDuration();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.p_getRawMaxTimeLoaded=function(){try{return this.p_player.i_getNative().GetMaxTimeLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.p_getRawBytesLoaded=function(){try{return this.p_player.i_getNative().GetMaxBytesLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.p_getRawBytesTotal=function(){try{return this.p_player.i_getNative().GetMovieSize();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.p_getRawPluginStatus=function(){try{return this.p_player.i_getNative().GetPluginStatus();}
catch(e){}
return null;};xmp.QuicktimeStateMachine.prototype.p_checkForStaticUrl=function(){if(this.p_staticUrl){this.p_staticUrl=null;return true;}
return false;};xmp.QuicktimeStateMachine.prototype.p_setError=function(rd,e){this.p_setState(xmp.ERRORS,false);this.p_player.i_setError(rd,e);};xmp.QuicktimeStateMachine.prototype.p_validateUrl=function(){try{var sd=this.p_player.i_getNative().GetURL();if(!sd){return false;}
return(sd.length>0&&(sd===this.p_url));}
catch(e){}
return false;};xmp.i_WINDOWS_MEDIA="WindowsMedia";xmp.WINDOWS_MEDIA_MIME_TYPE="video/x-ms-wmv";xmp.i_OPEN_STATE_CHANGE="OpenState";xmp.i_PLAY_STATE_CHANGE="PlayState";xmp.i_WINDOWS_MEDIA_ENDED=8;xmp.i_WINDOWS_MEDIA_PLAYING=3;xmp.i_WINDOWS_MEDIA_STOPPED=1;xmp.i_WINDOWS_MEDIA_CONNECTING=10;xmp.i_WINDOWS_MEDIA_LOADING=11;xmp.i_WINDOWS_MEDIA_OPEN=13;xmp.i_WINDOWS_MEDIA_ACTIVEX_PROGID="WMPlayer.OCX.7";xmp.i_WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD="onPlayStateChange";xmp.i_WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD="onOpenStateChange";xmp.i_WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD="onBuffering";xmp.i_WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD="onTrigger";xmp.i_WINDOWS_MEDIA_PLAYER_ERROR_METHOD="onError";xmp.WindowsMediaPlayer=function(td,ud){xmp.WindowsMediaPlayer.ctor.call(this,xmp.i_WINDOWS_MEDIA,td,ud);this.p_initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlayer);xmp.WindowsMediaPlayer.prototype.i_open=function(vd){this.i_getNative().URL=vd.getURI();};xmp.WindowsMediaPlayer.prototype.i_close=function(){this.i_getNative().close();xmp.WindowsMediaPlayer.base.i_close.call(this);};xmp.WindowsMediaPlayer.prototype.i_play=function(){this.i_getNative().controls.play();xmp.WindowsMediaPlayer.base.i_play.call(this);this.i_setState(xmp.PLAY);};xmp.WindowsMediaPlayer.prototype.i_pause=function(){this.i_getNative().controls.pause();xmp.WindowsMediaPlayer.base.i_pause.call(this);this.i_setState(xmp.PAUSE);};xmp.WindowsMediaPlayer.prototype.i_stop=function(){this.i_getNative().controls.stop();xmp.WindowsMediaPlayer.base.i_stop.call(this);this.i_setState(xmp.STOP);};xmp.WindowsMediaPlayer.prototype.i_rewind=function(){this.i_getNative().controls.fastReverse();xmp.WindowsMediaPlayer.base.i_rewind.call(this);this.i_setState(xmp.REWIND);};xmp.WindowsMediaPlayer.prototype.i_fastForward=function(){this.i_getNative().controls.fastForward();xmp.WindowsMediaPlayer.base.i_fastForward.call(this);this.i_setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlayer.prototype.i_seek=function(wd){this.i_getNative().controls.currentPosition=wd;xmp.WindowsMediaPlayer.base.i_seek.call(this,wd);this.i_setState(xmp.SEEKABLE);};xmp.WindowsMediaPlayer.prototype.i_isAvailable=function(xd){if(xd===xmp.FULLSCREEN){return(true===this.i_isFullscreenEnabled()&&this.i_getNative().playState===xmp.i_WINDOWS_MEDIA_PLAYING);}
return this.i_getNative().controls.isAvailable(xmp.WindowsMediaUtility.i_getCommand(xd));};xmp.WindowsMediaPlayer.prototype.i_onValidatePlugIn=function(yd){var zd=this.i_getPlugInInfo(xmp.i_WINDOWS_MEDIA);try{var Ad=new ActiveXObject(xmp.i_WINDOWS_MEDIA_ACTIVEX_PROGID);this.i_validatePlugInVersion(xmp.i_WINDOWS_MEDIA,Ad.versionInfo);return;}
catch(e){if((e instanceof xmp.InvalidPlugInVersionError)||(e instanceof xmp.UnsupportedPlugInVersionError)){throw e;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",zd);};xmp.WindowsMediaPlayer.prototype.i_getPosition=function(){return this.i_getNative().controls.currentPosition;};xmp.WindowsMediaPlayer.prototype.i_getDuration=function(){var Bd=this.i_getNative().currentMedia;if(Bd===null){return 0;}
return Bd.duration;};xmp.WindowsMediaPlayer.prototype.i_getVolume=function(){return this.i_getNative().settings.volume;};xmp.WindowsMediaPlayer.prototype.i_setVolume=function(Cd){this.i_getNative().settings.volume=Cd;};xmp.WindowsMediaPlayer.prototype.i_getMute=function(){return this.i_getNative().settings.mute;};xmp.WindowsMediaPlayer.prototype.i_setMute=function(Dd){this.i_getNative().settings.mute=Dd;};xmp.WindowsMediaPlayer.prototype.i_getFullscreen=function(){return this.i_getNative().fullScreen;};xmp.WindowsMediaPlayer.prototype.i_setFullscreen=function(Ed){if(false===this.i_isFullscreenEnabled()){throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.","Fullscreen disabled.",this);}
this.i_getNative().fullScreen=Ed;};xmp.WindowsMediaPlayer.prototype.i_create=function(Fd){Fd.id=xmp.i_WINDOWS_MEDIA+Fd.group;xmp.WindowsMediaPlayer.base.i_create.call(this,Fd);if(Fd.viewport.i_getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Fd.viewport.i_getType()+"\".  Supported viewports:  DHTML",this);}
var Gd=Fd.viewport.i_getNative();Gd.innerHTML="<object id='"+Fd.id+"' width='"+Gd.style.width+"' height='"+Gd.style.height+"' style='background-color:  #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'>"+"<param name='uiMode' value='none' />"+"<param name='stretchToFit' value='"+((true===Fd.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' />"+"<param name='enableContextMenu' value='false' />"+"<param name='windowlessVideo' value='"+((true===this.i_isFullscreenEnabled())?xmp.FALSE:xmp.TRUE)+"' />"+"<param name='volume' value='"+Fd.volume+"'/>"+"<param name='mute' value='"+((true===Fd.mute)?xmp.TRUE:xmp.FALSE)+"'/></object>"+"<script language = 'jscript' for='"+Fd.id+"' event=playstatechange(newstate)>"+this.i_getCallbackMethod(xmp.i_WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Fd.id+"' event=openstatechange(newstate)>"+this.i_getCallbackMethod(xmp.i_WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Fd.id+"' event=buffering(start)>"+this.i_getCallbackMethod(xmp.i_WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD)+"(start);</script>"+"<script language = 'jscript' for='"+Fd.id+"' event='scriptcommand(name, data)'>"+this.i_getCallbackMethod(xmp.i_WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD)+"(name, data);</script>"+"<script language = 'jscript' for='"+Fd.id+"' event=error()>"+this.i_getCallbackMethod(xmp.i_WINDOWS_MEDIA_PLAYER_ERROR_METHOD)+"();</script>";this.i_setCreated();};xmp.WindowsMediaPlayer.prototype.p_initCallbackStates=function(){this.p_callbackStates={};this.p_callbackStates[xmp.i_PLAY_STATE_CHANGE]=[{state:xmp.i_WINDOWS_MEDIA_PLAYING,player_state:xmp.PLAY},{state:xmp.i_WINDOWS_MEDIA_ENDED,player_state:xmp.ENDED}];this.p_callbackStates[xmp.i_OPEN_STATE_CHANGE]=[{state:xmp.i_WINDOWS_MEDIA_CONNECTING,player_state:xmp.CONNECTING},{state:xmp.i_WINDOWS_MEDIA_LOADING,player_state:xmp.CONNECTED},{state:xmp.i_WINDOWS_MEDIA_OPEN,player_state:xmp.OPEN}];};xmp.WindowsMediaPlayer.prototype.p_translateState=function(Hd,Id){var Jd=this.p_callbackStates[Hd];for(var i=0;i<Jd.length;i++){if(Id===Jd[i].state){return Jd[i].player_state;}}
return"";};xmp.WindowsMediaPlayer.prototype.onPlayStateChange=function(Kd){try{if(Kd===xmp.i_WINDOWS_MEDIA_STOPPED){this.i_getLogger().warn("Play state changed to \"Stopped\".");}
var Ld=this.p_translateState(xmp.i_PLAY_STATE_CHANGE,Kd);if(Ld.length>0){this.i_setState(Ld);}}
catch(e){this.i_setError("Handling play state change.",e);}};xmp.WindowsMediaPlayer.prototype.onOpenStateChange=function(Md){try{var Nd=this.p_translateState(xmp.i_OPEN_STATE_CHANGE,Md);if(Nd.length>0){this.i_setState(Nd);}}
catch(e){this.i_setError("Handling open state change.",e);}};xmp.WindowsMediaPlayer.prototype.onBuffering=function(Od){try{var Pd=((true===Od)?this.i_getNative().network.bufferingProgress:100);this.i_setState(xmp.BUFFERING,{percent:Pd,bytesDownloaded:0,bytesTotal:0});if(100===Pd){this.i_setState(xmp.FIRST_FRAME_RENDERED);}}
catch(e){this.i_setError("Handling buffering.",e);}};xmp.WindowsMediaPlayer.prototype.onTrigger=function(Qd,Rd){try{this.i_setTrigger(Qd,Rd);}
catch(e){this.i_setError("Handling trigger.",e);}};xmp.WindowsMediaPlayer.prototype.onError=function(){try{var Sd=null;var Td=this.i_getNative().Error.item(0).errorCode;var Ud=this.i_getNative().Error.item(0).errorDescription;var Vd=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.i_getErrorCodeDesc(Td)}];if(true===xmp.WindowsMediaUtility.i_isConnectionError(Td)){Sd=new xmp.NativePlayerConnectionError("Connecting to media.",Ud,this,Vd);}
else{Sd=new xmp.NativePlayerError("Handling error.",Ud,this,Vd);}
this.i_setError(null,Sd);}
catch(e){this.i_setError("Handling error.",e);}};xmp.i_WINDOWS_MEDIA_PLUGIN="WindowsMediaPlugIn";xmp.i_WINDOWS_MEDIA_PLUGIN_CONNECTING="1";xmp.i_WINDOWS_MEDIA_PLUGIN_CONNECTED="2";xmp.i_WINDOWS_MEDIA_PLUGIN_OPEN="3";xmp.i_WINDOWS_MEDIA_PLUGIN_ENDED="4";xmp.i_WINDOWS_MEDIA_PLUGIN_BUFFERING="5";xmp.i_WINDOWS_MEDIA_PLUGIN_PLAYING="6";xmp.i_WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD="onStateChange";xmp.i_WINDOW_MEDIA_PLUGIN_ERROR_METHOD="onError";xmp.i_WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD="onTrigger";xmp.i_WINDOWS_MEDIA_PLUGIN_MIME_TYPE="video/x-turner-wmv";xmp.i_TURNER_MEDIA_PLUGIN_NAME="Turner Media Plugin";xmp.i_TURNER_MEDIA_PLUGIN="TurnerMedia";xmp.WindowsMediaPlugInPlayer=function(Wd,Xd){xmp.WindowsMediaPlugInPlayer.ctor.call(this,xmp.i_WINDOWS_MEDIA_PLUGIN,Wd,Xd);this.p_initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlugInPlayer);xmp.WindowsMediaPlugInPlayer.prototype.i_open=function(Yd){this.i_setState(xmp.CONNECTING);this.i_getNative().url=Yd.getURI();};xmp.WindowsMediaPlugInPlayer.prototype.i_close=function(){this.i_getNative().close();xmp.WindowsMediaPlugInPlayer.base.i_close.call(this);};xmp.WindowsMediaPlugInPlayer.prototype.i_play=function(){this.i_getNative().play();xmp.WindowsMediaPlugInPlayer.base.i_play.call(this);this.i_setState(xmp.PLAY);};xmp.WindowsMediaPlugInPlayer.prototype.i_pause=function(){this.i_getNative().pause();xmp.WindowsMediaPlugInPlayer.base.i_pause.call(this);this.i_setState(xmp.PAUSE);};xmp.WindowsMediaPlugInPlayer.prototype.i_stop=function(){this.i_getNative().stop();xmp.WindowsMediaPlugInPlayer.base.i_stop.call(this);this.i_setState(xmp.STOP);};xmp.WindowsMediaPlugInPlayer.prototype.i_rewind=function(){this.i_getNative().rewind();xmp.WindowsMediaPlugInPlayer.base.i_rewind.call(this);this.i_setState(xmp.REWIND);};xmp.WindowsMediaPlugInPlayer.prototype.i_fastForward=function(){this.i_getNative().fastForward();xmp.WindowsMediaPlugInPlayer.base.fastForward.call(this);this.i_setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlugInPlayer.prototype.i_seek=function(Zd){this.i_getNative().seek(Zd);xmp.WindowsMediaPlugInPlayer.base.i_seek.call(this,Zd);this.i_setState(xmp.SEEKABLE);};xmp.WindowsMediaPlugInPlayer.prototype.i_isAvailable=function($d){return this.i_getNative().isAvailable(xmp.WindowsMediaUtility.i_getCommand($d));};xmp.WindowsMediaPlugInPlayer.prototype.i_onValidatePlugIn=function(ae){var be=this.i_getPlugInInfo(xmp.i_TURNER_MEDIA_PLUGIN);var ce=navigator.mimeTypes[xmp.i_WINDOWS_MEDIA_PLUGIN_MIME_TYPE];if(!ce){throw new xmp.PlugInNotFoundError("Validating native player plugin.",be);}
if(!ce.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",be,xmp.i_WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var de=ce.enabledPlugin.name;if(de.indexOf(xmp.i_TURNER_MEDIA_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",be,xmp.i_WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var ee=this.i_getVersionFromString(xmp.i_MOZILLA_VERSION_DETECTION_JSON,de);this.i_validatePlugInVersion(xmp.i_TURNER_MEDIA_PLUGIN,ee);};xmp.WindowsMediaPlugInPlayer.prototype.i_getPosition=function(){return this.i_getNative().position;};xmp.WindowsMediaPlugInPlayer.prototype.i_getDuration=function(){return this.i_getNative().duration;};xmp.WindowsMediaPlugInPlayer.prototype.i_getVolume=function(){return this.i_getNative().volume;};xmp.WindowsMediaPlugInPlayer.prototype.i_setVolume=function(fe){this.i_getNative().volume=Math.floor(fe);};xmp.WindowsMediaPlugInPlayer.prototype.i_getMute=function(){return this.i_getNative().mute;};xmp.WindowsMediaPlugInPlayer.prototype.i_setMute=function(ge){this.i_getNative().mute=ge;};xmp.WindowsMediaPlugInPlayer.prototype.i_getFullscreen=function(){return this.i_getNative().fullscreen;};xmp.WindowsMediaPlugInPlayer.prototype.i_setFullscreen=function(he){this.i_getNative().fullscreen=he;};xmp.WindowsMediaPlugInPlayer.prototype.i_create=function(ie){ie.id=xmp.i_WINDOWS_MEDIA_PLUGIN+ie.group;xmp.WindowsMediaPlugInPlayer.base.i_create.call(this,ie);if(ie.viewport.i_getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+ie.viewport.i_getType()+"\".  Supported viewports:  DHTML",this);}
var je=ie.viewport.i_getNative();je.innerHTML="<embed id='"+ie.id+"' type='"+xmp.i_WINDOWS_MEDIA_PLUGIN_MIME_TYPE+"' statechangecallback='"+this.p_createCallbackMethod(xmp.i_WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD)+"' errorcallback='"+this.p_createCallbackMethod(xmp.i_WINDOW_MEDIA_PLUGIN_ERROR_METHOD)+"' triggercallback='"+this.p_createCallbackMethod(xmp.i_WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD)+"' "+"fullscreenenabled='"+((true===this.i_isFullscreenEnabled())?xmp.TRUE:xmp.FALSE)+"' uimode='none' stretchtofit='"+((true===ie.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' windowlessvideo='true'"+"' volume='"+ie.volume+"' mute='"+((true===ie.mute)?xmp.TRUE:xmp.FALSE)+"' enablecontextmenu='false' width='"+je.style.width+"' height='"+je.style.height+"' style='background-color:  #000000; z-index: "+xmp.i_NATIVE_PLAYER_Z_INDEX+"' />";this.i_setCreated();};xmp.WindowsMediaPlugInPlayer.prototype.p_initCallbackStates=function(){this.p_callbackStates={};this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_CONNECTING]=xmp.CONNECTING;this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_CONNECTED]=xmp.CONNECTED;this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_OPEN]=xmp.OPEN;this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_ENDED]=xmp.ENDED;this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_BUFFERING]=xmp.BUFFERING;this.p_callbackStates[xmp.i_WINDOWS_MEDIA_PLUGIN_PLAYING]=xmp.PLAY;};xmp.WindowsMediaPlugInPlayer.prototype.p_translateState=function(ke){var le=this.p_callbackStates[ke];return((le)?le:"");};xmp.WindowsMediaPlugInPlayer.prototype.onStateChange=function(me,ne){try{var oe=this.p_translateState(me);if(oe.length>0){var pe=((oe===xmp.BUFFERING)?{percent:parseInt(ne,10),bytesDownloaded:0,bytesTotal:0}:null);this.i_setState(oe,pe);if(oe===xmp.BUFFERING&&100===pe.percent){this.i_setState(xmp.FIRST_FRAME_RENDERED);}}}
catch(e){this.i_setError("Handling state change.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onError=function(qe,re){try{var se=null;var te=parseInt(re,10);var ue=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.i_getErrorCodeDesc(te)}];if(true===xmp.WindowsMediaUtility.i_isConnectionError(te)){se=new xmp.NativePlayerConnectionError("Connecting to media.",qe,this,ue);}
else{se=new xmp.NativePlayerError("Handling error.",qe,this,ue);}
this.i_setError(null,se);}
catch(e){this.i_setError("Handling error.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onTrigger=function(ve,we){try{this.i_setTrigger(ve,we);}
catch(e){this.i_setError("Handling trigger.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.p_createCallbackMethod=function(xe){return xmp.escapeHtml(this.i_getCallbackMethod(xe),false,false);};xmp.i_WINDOWS_MEDIA_PLAY="play";xmp.i_WINDOWS_MEDIA_PAUSE="pause";xmp.i_WINDOWS_MEDIA_STOP="stop";xmp.i_WINDOWS_MEDIA_REWIND="fastReverse";xmp.i_WINDOWS_MEDIA_FAST_FORWARD="fastForward";xmp.i_WINDOWS_MEDIA_SEEK="currentPosition";xmp.WindowsMediaUtility=function(){return{i_getCommand:function(ye){if(!this.commands){this.commands={};this.commands[xmp.PLAY]=xmp.i_WINDOWS_MEDIA_PLAY;this.commands[xmp.PAUSE]=xmp.i_WINDOWS_MEDIA_PAUSE;this.commands[xmp.STOP]=xmp.i_WINDOWS_MEDIA_STOP;this.commands[xmp.REWIND]=xmp.i_WINDOWS_MEDIA_REWIND;this.commands[xmp.FAST_FORWARD]=xmp.i_WINDOWS_MEDIA_FAST_FORWARD;this.commands[xmp.SEEKABLE]=xmp.i_WINDOWS_MEDIA_SEEK;this.commands[xmp.FULLSCREEN]=xmp.FULLSCREEN.toLowerCase();}
return this.commands[ye];},i_getErrorCodeDesc:function(ze){this.p_initConnectionErrorCodes();return((this.connectionErrorCodes[ze])?this.connectionErrorCodes[ze]:ze);},i_isConnectionError:function(Ae){this.p_initConnectionErrorCodes();return((this.connectionErrorCodes[Ae])?true:false);},p_initConnectionErrorCodes:function(){if(!this.connectionErrorCodes){this.connectionErrorCodes={};this.connectionErrorCodes[-1072885352]="NS_E_WMP_SERVER_INACCESSIBLE (0xC00D1198)";this.connectionErrorCodes[-1072885353]="NS_E_WMP_CANNOT_FIND_FILE (0xC00D1197)";this.connectionErrorCodes[-1072885325]="NS_E_WMP_SERVER_NOT_RESPONDING (0xC00D11B3)";this.connectionErrorCodes[-1072885328]="NS_E_WMP_SERVER_UNAVAILABLE (0xC00D11B0)";this.connectionErrorCodes[-1072885322]="NS_E_WMP_NETWORK_FIREWALL (0xC00D11B6)";this.connectionErrorCodes[-1072885320]="NS_E_WMP_PROXY_CONNECT_TIMEOUT (0xC00D11B8)";this.connectionErrorCodes[-1072885312]="NS_E_WMP_NETWORK_ERROR (0xC00D11C0)";this.connectionErrorCodes[-1072885311]="NS_E_WMP_CONNECT_TIMEOUT (0xC00D11C1)";this.connectionErrorCodes[-1072885309]="NS_E_WMP_SERVER_DNS_TIMEOUT (0xC00D11C3)";this.connectionErrorCodes[-1072885308]="NS_E_WMP_PROXY_NOT_FOUND (0xC00D11C4)";}}};}();
