// Turner XMP, Release Build, © 2007 Turner Broadcasting System, Inc. A Time Warner Company.  Version: 0.1.633.2120
// xmp_views, xmp_views_0_1_633_2120.js
xmp.i_ABSOLUTE_POSITION="absolute";xmp.i_RELATIVE_POSITION="relative";xmp.OVERLAY="Overlay";xmp.i_OVERLAY_ELEMENT="div";xmp.i_OVERLAY_WIDTH_PARAMETER="{{width}}";xmp.i_OVERLAY_HEIGHT_PARAMETER="{{height}}";xmp.Overlay=function(aa,ba,ca,da,ea){try{this.p_viewport=ba;this.p_rawName="";this.p_group="";if(ca===null||ca.length===0){throw new xmp.OverlayError("Validating group.","Invalid overlay group.  Missing group.",this);}
if(ca.indexOf(" ")!==-1){throw new xmp.OverlayError("Validating group.","Invalid overlay group.  Group cannot contain spaces.",this);}
this.p_group=ca;if(da===null||da.length===0){throw new xmp.OverlayError("Validating name.","Invalid overlay name.  Missing name.",this);}
if(da.indexOf(" ")!==-1){throw new xmp.OverlayError("Validating name.","Invalid overlay name.  Name cannot contain spaces.",this);}
this.p_rawName=da;this.p_name=aa+this.p_group+this.p_rawName+xmp.OVERLAY;this.p_style="";this.p_html="";this.i_setVisible(false);this.p_zIndex=-1;this.p_position=xmp.i_ABSOLUTE_POSITION;this.p_rectangle={left:0,top:0,width:0,height:0};this.p_type=((ea)?ea:xmp.OVERLAY);}
catch(e){this.i_handleError("Constructing overlay.",e);}};xmp.Overlay.prototype.i_open=function(fa){try{if(fa.i_getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidOverlayViewportError("Opening overlay.","Invalid overlay viewport \""+fa.i_getType()+"\".  Supported viewports:  DHTML",this);}
this.p_viewport=fa;this.refresh();}
catch(e){this.i_handleError("Opening overlay.",e);}};xmp.Overlay.prototype.i_close=function(){try{this.p_viewport=null;this.i_setVisible(false);this.i_destroyNative();}
catch(e){this.i_handleError("Closing overlay.",e);}};xmp.Overlay.prototype.setHTML=function(ga){try{this.p_html=ga;if(true===this.i_viewportExists()){this.i_getNative().innerHTML=this.p_getRenderableHTML();}}
catch(e){this.i_handleError("Setting overlay HTML.",e);}};xmp.Overlay.prototype.setStyle=function(ha){try{this.p_style=ha;if(true===this.i_viewportExists()&&true===this.i_isVisible()){this.i_applyCustomStyle(this.i_getNative());}}
catch(e){this.i_handleError("Setting overlay style.",e);}};xmp.Overlay.prototype.show=function(ia){try{this.i_setVisible(true);if(false===this.i_viewportExists()){return;}
this.i_setZOrder();this.i_applyVisibility();}
catch(e){this.i_handleError("Showing overlay.",e);}};xmp.Overlay.prototype.hide=function(){try{if(false===this.i_viewportExists()||false===this.i_isVisible()){return;}
this.i_setVisible(false);this.i_applyVisibility();}
catch(e){this.i_handleError("Hiding overlay.",e);}};xmp.Overlay.prototype.refresh=function(){try{if(false===this.i_viewportExists()){return;}
this.i_destroyNative();if(true===this.i_isVisible()){this.show();}}
catch(e){this.i_handleError("Refreshing overlay.",e);}};xmp.Overlay.prototype.moveTo=function(ja,ka,la,ma){try{this.p_rectangle={left:xmp.getPixelUnits(ja),top:xmp.getPixelUnits(ka),width:xmp.getPixelUnits(la),height:xmp.getPixelUnits(ma)};if(true===this.i_viewportExists()&&true===this.i_isVisible()){this.p_validatePlacement();var na=this.i_getNative();var oa=((this.p_style.length>0)?this.p_style+"; ":"")+"z-Index: "+this.p_zIndex+"; position: "+this.p_position+"; display: "+this.p_display+"; marginLeft: "+"0px"+"; marginTop: "+"0px"+"; left: "+this.p_rectangle.left+"; top: "+this.p_rectangle.top+"; width: "+this.p_rectangle.width+"; height: "+this.p_rectangle.height;na.style.cssText=oa;}}
catch(e){this.i_handleError("Moving overlay.",e);}};xmp.Overlay.prototype.i_getNative=function(){var pa=document.getElementById(this.p_name);if(pa===null){pa=document.createElement(xmp.i_OVERLAY_ELEMENT);pa.setAttribute(xmp.ID_ATTRIBUTE,this.p_name);pa.setAttribute(xmp.NAME_ATTRIBUTE,this.p_name);pa.style.display=this.p_display;this.p_position=xmp.i_ABSOLUTE_POSITION;pa.style.position=this.p_position;pa.style.marginLeft="0px";pa.style.marginTop="0px";this.p_validatePlacement();pa.style.left=this.p_rectangle.left;pa.style.top=this.p_rectangle.top;pa.style.width=this.p_rectangle.width;pa.style.height=this.p_rectangle.height;pa.innerHTML=this.p_getRenderableHTML();this.i_applyCustomStyle(pa);this.p_viewport.i_getNative().style.position=xmp.i_RELATIVE_POSITION;xmp.insertDomChildBefore(this.p_viewport.i_getNative(),pa);}
return pa;};xmp.Overlay.prototype.i_getType=function(){return this.p_type;};xmp.Overlay.prototype.i_getName=function(){return this.p_rawName;};xmp.Overlay.prototype.i_getGroup=function(){return this.p_group;};xmp.Overlay.prototype.i_getViewport=function(){return this.p_viewport;};xmp.Overlay.prototype.i_setViewport=function(qa){this.p_viewport=qa;};xmp.Overlay.prototype.i_isVisible=function(){return(this.p_display===xmp.DISPLAY_BLOCK);};xmp.Overlay.prototype.i_viewportExists=function(){return(this.p_viewport!==null);};xmp.Overlay.prototype.i_handleError=function(ra,e){var sa=e;if(false===(sa instanceof xmp.OverlayError)&&false===(sa instanceof xmp.InvalidOverlayViewportError)&&false===(sa instanceof xmp.OverlayPlacementError)){sa=new xmp.OverlayError(((e.context)?e.context:ra),((e.rawMessage)?e.rawMessage:e.message),this);sa.setInnerError(e);}
throw sa;};xmp.Overlay.prototype.i_destroyNative=function(){var ta=document.getElementById(this.p_name);if(ta!==null){var ua=xmp.getDomParent(ta);ua.removeChild(ta);}};xmp.Overlay.prototype.i_onViewportChange=function(va,wa,xa,ya){};xmp.Overlay.prototype.p_getRenderableHTML=function(){var za=this.p_html;var Aa=[{name:xmp.i_OVERLAY_WIDTH_PARAMETER,value:this.p_rectangle.width},{name:xmp.i_OVERLAY_HEIGHT_PARAMETER,value:this.p_rectangle.height}];var Ba=Aa.length;for(var i=0;i<Ba;i++){za=za.replace(Aa[i].name,Aa[i].value);}
return za;};xmp.Overlay.prototype.i_getId=function(){return this.p_name;};xmp.Overlay.prototype.i_applyCustomStyle=function(Ca){var Da=((this.p_style.length>0)?this.p_style+"; ":"")+"z-Index: "+Ca.style.zIndex+"; position: "+Ca.style.position+"; display: "+Ca.style.display+"; marginLeft: "+Ca.style.left+"; marginTop: "+Ca.style.top+"; left: "+Ca.style.left+"; top: "+Ca.style.top+"; width: "+Ca.style.width+"; height: "+Ca.style.height;Ca.style.cssText=Da;};xmp.Overlay.prototype.i_setZOrder=function(){var Ea=this.p_viewport.i_getNativePlayer().i_getNative();if(!Ea){throw new xmp.OverlayError("Setting Z-order.","A native player does not exist for the viewport.",this);}
if(!Ea.style.zIndex||Ea.style.zIndex<=0){Ea.style.zIndex=1;}
var Fa=this.i_getNative();this.p_zIndex=parseInt(Fa.style.zIndex,10)+1;Fa.style.zIndex=this.p_zIndex;};xmp.Overlay.prototype.i_setVisible=function(Ga){this.p_display=((true===Ga)?xmp.DISPLAY_BLOCK:xmp.DISPLAY_NONE);};xmp.Overlay.prototype.i_applyVisibility=function(){this.i_getNative().style.display=this.p_display;};xmp.Overlay.prototype.p_validatePlacement=function(){var Ha=this.i_getViewport().i_getNative();var Ia=parseInt(Ha.style.width,10);var Ja=parseInt(Ha.style.height,10);var Ka={left:parseInt(this.p_rectangle.left,10),top:parseInt(this.p_rectangle.top,10),width:parseInt(this.p_rectangle.width,10),height:parseInt(this.p_rectangle.height,10)};if((Ka.left<0)||(Ka.left>Ia)){throw new xmp.OverlayPlacementError("Validating placement.","Invalid left \""+this.p_rectangle.left+"\".",this);}
if((Ka.top<0)||(Ka.top>Ja)){throw new xmp.OverlayPlacementError("Validating placement.","Invalid top \""+this.p_rectangle.top+"\".",this);}
if((Ka.width<0)){throw new xmp.OverlayPlacementError("Validating placement.","Invalid width \""+this.p_rectangle.width+"\".",this);}
if((Ka.height<0)){throw new xmp.OverlayPlacementError("Validating placement.","Invalid height \""+this.p_rectangle.height+"\".",this);}};xmp.Overlay.prototype.i_setRectangle=function(La){this.p_rectangle=La;};xmp.OverlayError=function(Ma,Na,Oa){var Pa=[{label:"Overlay Group",text:((Oa)?Oa.i_getGroup():"")},{label:"Overlay Type",text:((Oa)?Oa.i_getType():"")},{label:"Overlay Name",text:((Oa)?Oa.i_getName():"")},{label:"Overlay Id",text:((Oa)?Oa.i_getId():"")}];xmp.OverlayError.ctor.call(this,"OverlayError",Ma,Na,Pa);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.OverlayError);xmp.i_NATIVE_VIEWPORT_Z_INDEX=1;xmp.Viewport=function(Qa,Ra,Sa,Ta,Ua){this.p_owner=Qa;this.p_type=Ra;this.p_mimeType=Sa;this.p_contextName=Ta;this.p_name=Ta+this.p_type.substr(this.p_type.indexOf(".")+1);this.p_overlays=Ua;this.p_opened=false;this.p_style="";this.p_nativeViewport=null;this.p_nativePlayer=null;};xmp.Viewport.prototype.i_init=function(Va,Wa,Xa){try{this.p_createContext=Va;xmp.ViewportRegistry.i_addViewport(this);this.p_nativeViewport=this.p_owner.i_onCreateViewport(this.p_type,this.p_name,Wa,Xa);}
catch(e){this.i_setError("Creating viewport.",e);}};xmp.Viewport.prototype.i_open=function(Ya){this.p_createContext=Ya;};xmp.Viewport.prototype.i_close=function(){try{xmp.ViewportRegistry.i_removeViewport(this);for(var i=0;i<this.p_overlays.length;i++){this.p_overlays[i].i_close();}
this.p_opened=false;this.p_owner.i_onDestroyViewport(this.p_type,this.p_name);}
catch(e){this.i_setError("Closing viewport.",e);}};xmp.Viewport.prototype.i_isOpen=function(){return this.p_opened;};xmp.Viewport.prototype.i_reset=function(Za){this.p_createContext=Za;};xmp.Viewport.prototype.getSize=function(){try{return{width:this.p_nativeViewport.style.width,height:this.p_nativeViewport.style.height};}
catch(e){this.i_setError("Retrieving viewport size.",e);}
return{width:0,height:0};};xmp.Viewport.prototype.setSize=function($a,ab,bb){try{var cb=((this.p_nativeViewport.style.marginLeft.length>0)?this.p_nativeViewport.style.marginLeft:"0px");var db=((this.p_nativeViewport.style.marginTop.length>0)?this.p_nativeViewport.style.marginTop:"0px");this.moveTo(cb,db,$a,ab,bb);}
catch(e){this.i_setError("Setting viewport size.",e);}};xmp.Viewport.prototype.moveTo=function(eb,fb,gb,hb,ib){try{if(this.p_nativePlayer){this.p_nativePlayer.i_moveTo(eb,fb,gb,hb);}
var jb=((this.p_style.length>0)?this.p_style+"; ":"")+((this.p_nativeViewport.style.zIndex)?"z-Index: "+this.p_nativeViewport.style.zIndex+";":"")+((this.p_nativeViewport.style.position)?"position: "+this.p_nativeViewport.style.position+";":"")+"margin-left: "+xmp.getPixelUnits(eb)+"; margin-top: "+xmp.getPixelUnits(fb)+"; width: "+xmp.getPixelUnits(gb)+"; height: "+xmp.getPixelUnits(hb);this.p_nativeViewport.style.cssText=jb;if(true===ib){for(var i=0;i<this.p_overlays.length;i++){this.p_overlays[i].i_onViewportChange(eb,fb,gb,hb);}}}
catch(e){this.i_setError("Moving viewport.",e);}};xmp.Viewport.prototype.setStyle=function(kb){try{this.p_style=kb;var lb=((this.p_nativeViewport.style.left.length>0)?this.p_nativeViewport.style.left:"0");var mb=((this.p_nativeViewport.style.top.length>0)?this.p_nativeViewport.style.top:"0");var nb=((this.p_style.length>0)?this.p_style+"; ":"")+((this.p_nativeViewport.style.position)?"position: "+this.p_nativeViewport.style.position+";":"")+"left: "+lb+"; top: "+mb+"; width: "+this.p_nativeViewport.style.width+"; height: "+this.p_nativeViewport.style.height;this.p_nativeViewport.style.cssText=nb;}
catch(e){this.i_setError("Setting viewport style.",e);}};xmp.Viewport.prototype.i_getNative=function(){return this.p_nativeViewport;};xmp.Viewport.prototype.i_getContextName=function(){return this.p_contextName;};xmp.Viewport.prototype.i_getName=function(){return this.p_name;};xmp.Viewport.prototype.i_getType=function(){return this.p_type;};xmp.Viewport.prototype.i_getMimeType=function(){return this.p_mimeType;};xmp.Viewport.prototype.i_getNativeData=function(){return this.native_data;};xmp.Viewport.prototype.i_setError=function(ob,e){var pb=e;if(false===(pb instanceof xmp.ViewportError)){pb=new xmp.ViewportError(((e.context)?e.context:ob),((e.rawMessage)?e.rawMessage:e.message),this);pb.setInnerError(e);}
this.p_createTimer({id:"i_setError",interval:xmp.i_DEFAULT_TIMER_INTERVAL,handler:this.p_onSetError,context:pb}).start();};xmp.Viewport.prototype.i_setOpened=function(){this.p_opened=true;this.p_createTimer({id:"setOpened",interval:xmp.i_DEFAULT_TIMER_INTERVAL,handler:this.p_onSetOpened,context:null}).start();};xmp.Viewport.prototype.i_setCreated=function(){this.p_createTimer({id:"setCreated",interval:xmp.i_DEFAULT_TIMER_INTERVAL,handler:this.p_onSetCreated,context:null}).start();};xmp.Viewport.prototype.p_createTimer=function(qb){var rb=new xmp.util.Callback(qb.id,qb.handler,this);rb.setMetadata(xmp.i_CONTEXT,qb.context);return new xmp.util.Timer(qb.id,qb.interval,-1,rb);};xmp.Viewport.prototype.i_setNativePlayer=function(sb){this.p_nativePlayer=sb;for(var i=0;i<this.p_overlays.length;i++){this.p_overlays[i].i_open(this);}};xmp.Viewport.prototype.i_getNativePlayer=function(){return this.p_nativePlayer;};xmp.Viewport.prototype.i_getOwner=function(){return this.p_owner;};xmp.Viewport.prototype.p_onSetError=function(tb,ub){var vb=null;try{ub.stop();vb=tb.getMetadata(xmp.i_CONTEXT,{});this.p_owner.i_onViewportError(vb);}
catch(e){var wb=((vb)?vb:e);xmp.handleFatalError(wb);}};xmp.Viewport.prototype.p_onSetOpened=function(xb,yb){try{yb.stop();this.p_owner.i_onViewportOpened(this,this.p_createContext);}
catch(e){this.i_setError("Forwarding opened notification to owner.",e);}};xmp.Viewport.prototype.p_onSetCreated=function(zb,Ab){try{Ab.stop();this.p_owner.i_onViewportCreated(this,this.p_createContext);}
catch(e){this.i_setError("Forwarding created notification to owner.",e);}};xmp.Viewport.prototype.i_getCallbackMethod=function(Bb){return"xmp.ViewportRegistry.getViewport( '"+this.i_getName()+"' )."+Bb;};xmp.DHTML_VIEWPORT="xmp.DHTMLViewport";xmp.DHTMLViewport=function(Cb,Db,Eb,Fb){xmp.DHTMLViewport.ctor.call(this,Cb,xmp.DHTML_VIEWPORT,Db,Eb,Fb);};xmp.DERIVE_CLASS(xmp.Viewport,xmp.DHTMLViewport);xmp.DHTMLViewport.prototype.i_open=function(Gb,Hb){xmp.DHTMLViewport.base.i_open.call(this,Gb,Hb);this.i_setOpened();};xmp.DHTMLViewport.prototype.i_init=function(Ib,Jb,Kb){xmp.DHTMLViewport.base.i_init.call(this,Ib,Jb,Kb);this.i_setCreated();};xmp.FLASH_VIEWPORT="xmp.FlashViewport";xmp.i_FLASH_VIEWPORT_OPENED_METHOD="onOpened";xmp.i_FLASH_VIEWPORT_CREATED_METHOD="onCreated";xmp.i_FLASH_VIEWPORT_ERROR_METHOD="onViewportError";xmp.i_FLASH_VIEWPORT_PLAYER="viewportPlayer";xmp.i_FLASH_NATIVE_VIEWPORT_TYPE="Flash";xmp.FlashViewport=function(Lb,Mb,Nb,Ob){xmp.FlashViewport.ctor.call(this,Lb,xmp.FLASH_VIEWPORT,Mb,Nb,Ob);};xmp.DERIVE_CLASS(xmp.Viewport,xmp.FlashViewport);xmp.FlashViewport.prototype.i_init=function(Pb,Qb,Rb){var Sb=[{name:xmp.i_ALLOW_SCRIPT_ACCESS,value:xmp.i_ALWAYS_ACCESS},{name:xmp.i_QUALITY,value:xmp.i_QUALITY_HIGH},{name:xmp.i_ALLOW_FULLSCREEN_ACCESS,value:xmp.TRUE}];var Tb=[{name:xmp.i_FLASH_INITIALIZATION_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_VIEWPORT_CREATED_METHOD)},{name:xmp.i_FLASH_ERROR_CALLBACK,value:this.i_getCallbackMethod(xmp.i_FLASH_VIEWPORT_ERROR_METHOD)},{name:xmp.i_FLASH_VIEWPORT_PLAYER,value:xmp.makeSWFPath(xmp.i_FLASH_PLAYER_SWF_BASE_NAME,true)}];xmp.FlashViewport.base.i_init.call(this,Pb,Sb,Tb);};xmp.FlashViewport.prototype.i_open=function(Ub,Vb){xmp.FlashViewport.base.i_open.call(this,Ub,Vb);var Wb=this.i_getNative();Wb.style.zIndex=xmp.i_NATIVE_VIEWPORT_Z_INDEX;Wb.SetVariable(xmp.i_FLASH_INITIALIZATION_CALLBACK,this.i_getCallbackMethod(xmp.i_FLASH_VIEWPORT_OPENED_METHOD));Wb.fvpOpen(xmp.i_FLASH_NATIVE_VIEWPORT_TYPE);};xmp.FlashViewport.prototype.i_reset=function(Xb,Yb){};xmp.FlashViewport.prototype.i_onTimelineChange=function(Zb,$b,ac){this.i_getNative().fvpPlayerTimelineChange($b,ac);};xmp.FlashViewport.prototype.onStateChange=function(bc,cc,dc){this.i_getNative().fvpPlayerStateChange(cc,dc);};xmp.FlashViewport.prototype.onTrigger=function(ec,fc,gc){this.i_getNative().fvpPlayerTrigger(fc,gc);};xmp.FlashViewport.prototype.onError=function(hc,e){this.i_getNative().fvpPlayerError(e);};xmp.FlashViewport.prototype.onOpened=function(){try{this.i_getOwner().addEventListener(this);this.i_setOpened();}
catch(e){this.i_setError("Handling open.",e);}};xmp.FlashViewport.prototype.onCreated=function(){try{this.i_setCreated();}
catch(e){this.i_setError("Handling create.",e);}};xmp.FlashViewport.prototype.onViewportError=function(ic,jc){try{var kc=[{label:"Flash Error Type",text:ic}];this.i_setError(null,new xmp.ViewportError("Handling error.",jc,this,kc));}
catch(e){this.i_setError("Handling error.",e);}};xmp.InvalidOverlayViewportError=function(lc,mc,nc){var oc=[{label:"Overlay Group",text:((nc)?nc.i_getGroup():"")},{label:"Overlay Type",text:((nc)?nc.i_getType():"")},{label:"Overlay Name",text:((nc)?nc.i_getName():"")},{label:"Overlay Id",text:((nc)?nc.i_getId():"")}];xmp.InvalidOverlayViewportError.ctor.call(this,"InvalidOverlayViewportError",lc,mc,oc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.InvalidOverlayViewportError);xmp.MEDIA_OVERLAY="MediaOverlay";xmp.i_MEDIA_OVERLAY_PLAYER="MediaPlayer";xmp.MediaOverlay=function(pc,qc,rc,sc){xmp.MediaOverlay.ctor.call(this,pc,qc,rc,sc,xmp.MEDIA_OVERLAY);this.p_player=null;this.p_listener=null;this.p_node=null;};xmp.DERIVE_CLASS(xmp.Overlay,xmp.MediaOverlay);xmp.MediaOverlay.prototype.show=function(tc){try{this.i_setVisible(true);if(false===this.i_viewportExists()){return;}
this.i_setZOrder();this.moveTo(this.rectangle.left,this.rectangle.top,this.rectangle.width,this.rectangle.height);this.i_applyVisibility();this.p_openMedia();}
catch(e){this.i_handleError("Showing media overlay.",e);}};xmp.MediaOverlay.prototype.hide=function(){try{if(false===this.i_viewportExists()||false===this.i_isVisible()){return;}
this.i_setVisible(false);this.i_applyVisibility();this.p_destoryMediaPlayer();}
catch(e){this.i_handleError("Hiding media overlay.",e);}};xmp.MediaOverlay.prototype.setHTML=function(uc){throw new xmp.util.internals.UnsupportedOperationError("The \"setHTML\" operation is not supported.");};xmp.MediaOverlay.prototype.i_onViewportChange=function(vc,wc,xc,yc){};xmp.MediaOverlay.prototype.play=function(){this.getMediaPlayer().play();};xmp.MediaOverlay.prototype.pause=function(){this.getMediaPlayer().pause();};xmp.MediaOverlay.prototype.stop=function(){this.getMediaPlayer().stop();};xmp.MediaOverlay.prototype.rewind=function(){this.getMediaPlayer().rewind();};xmp.MediaOverlay.prototype.fastForward=function(){this.getMediaPlayer().fastForward();};xmp.MediaOverlay.prototype.seek=function(zc){this.getMediaPlayer().seek(zc);};xmp.MediaOverlay.prototype.isAvailable=function(Ac){return this.getMediaPlayer().isAvailable(Ac);};xmp.MediaOverlay.prototype.getPosition=function(){return this.getMediaPlayer().getPosition();};xmp.MediaOverlay.prototype.getDuration=function(){return this.getMediaPlayer().getDuration();};xmp.MediaOverlay.prototype.setVolume=function(Bc){this.getMediaPlayer().setVolume(Bc);};xmp.MediaOverlay.prototype.getVolume=function(){return this.getMediaPlayer().getVolume();};xmp.MediaOverlay.prototype.setMute=function(Cc){this.getMediaPlayer().setMute(Cc);};xmp.MediaOverlay.prototype.getMute=function(){return this.getMediaPlayer().getMute();};xmp.MediaOverlay.prototype.setFullscreen=function(Dc){this.getMediaPlayer().setFullscreen(Dc);};xmp.MediaOverlay.prototype.getFullscreen=function(){return this.getMediaPlayer().getFullscreen();};xmp.MediaOverlay.prototype.getBufferingProgress=function(){return this.getMediaPlayer().getBufferingProgress();};xmp.MediaOverlay.prototype.setMedia=function(Ec){this.p_node=Ec;if(false===this.i_viewportExists()||false===this.i_isVisible()){return;}
this.p_openMedia();};xmp.MediaOverlay.prototype.close=function(){this.getMediaPlayer().close();};xmp.MediaOverlay.prototype.getMediaPlayer=function(){if(!this.p_player){this.p_player=xmp.MediaPlayerFactory.createPlayer(this.getId()+xmp.i_MEDIA_OVERLAY_PLAYER,this);this.p_player.init();}
return this.p_player;};xmp.MediaOverlay.prototype.p_destoryMediaPlayer=function(){if(this.p_player){this.p_player.fini();this.p_player=null;}};xmp.MediaOverlay.prototype.onInitialized=function(){this.p_player.setVolume(100);this.p_player.setMute(false);var Fc=xmp.PlayerPolicy.i_getMimeTypes();var Gc=Fc.length;for(var i=0;i<Gc;i++){this.p_player.setViewportConfig(Fc[i],xmp.DHTML_VIEWPORT);}};xmp.MediaOverlay.prototype.i_onTimelineChange=function(Hc,Ic,Jc){this.p_getListener().onOverlayTimelineChange(Hc,Ic,Jc);};xmp.MediaOverlay.prototype.onStateChange=function(Kc,Lc,Mc){this.p_getListener().onOverlayStateChange(Kc,Lc,Mc);};xmp.MediaOverlay.prototype.onTrigger=function(Nc,Oc,Pc){this.p_getListener().onOverlayTrigger(Nc,Oc,Pc);};xmp.MediaOverlay.prototype.onError=function(Qc,e){this.p_getListener().onOverlayError(Qc,e);};xmp.MediaOverlay.prototype.i_onCreateViewport=function(Rc,Sc,Tc,Uc){return this.getNative();};xmp.MediaOverlay.prototype.i_onDestroyViewport=function(Vc,Wc){};xmp.MediaOverlay.prototype.onPlugInError=function(e){this.p_getListener().onOverlayPlugInError(e);};xmp.MediaOverlay.prototype.onUnsupportedPlatformError=function(e){this.p_getListener().onOverlayUnsupportedPlatformError(e);};xmp.MediaOverlay.prototype.p_openMedia=function(){if(!this.p_node){return;}
this.getMediaPlayer().open(this.p_node);};xmp.MediaOverlay.prototype.setListener=function(Xc){if(!Xc){throw new xmp.OverlayError("Retrieving media overlay listener.","Invalid media overlay listener.",this);}
this.p_listener=Xc;};xmp.MediaOverlay.prototype.p_getListener=function(){if(!this.p_listener){throw new xmp.OverlayError("Retrieving media overlay listener.","Missing media overlay listener.",this);}
return this.p_listener;};xmp.OverlayFactory=function(){return{createOverlay:function(Yc,Zc,$c,ad,bd){if(ad===xmp.OVERLAY){return new xmp.Overlay(Yc,Zc,$c,bd);}
else if(ad===xmp.SLATE_OVERLAY){return new xmp.SlateOverlay(Yc,Zc,$c,bd);}
else if(ad===xmp.MEDIA_OVERLAY){return new xmp.MediaOverlay(Yc,Zc,$c,bd);}
throw new xmp.OverlayError("Creating overlay.","Unable to create \""+ad+"\" overlay.",null);}};}();xmp.OverlayPlacementError=function(cd,dd,ed){var fd=[{label:"Overlay Group",text:((ed)?ed.i_getGroup():"")},{label:"Overlay Type",text:((ed)?ed.i_getType():"")},{label:"Overlay Name",text:((ed)?ed.i_getName():"")},{label:"Overlay Id",text:((ed)?ed.i_getId():"")}];xmp.OverlayPlacementError.ctor.call(this,"OverlayPlacementError",cd,dd,fd);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.OverlayPlacementError);xmp.SLATE_OVERLAY="SlateOverlay";xmp.SlateOverlay=function(gd,hd,jd,kd){xmp.SlateOverlay.ctor.call(this,gd,hd,jd,kd,xmp.SLATE_OVERLAY);this.p_nonVisibleViewportRect={left:"0px",top:"0px",width:"1px",height:"1px"};this.p_origViewportRect=null;};xmp.DERIVE_CLASS(xmp.Overlay,xmp.SlateOverlay);xmp.SlateOverlay.prototype.show=function(ld){try{this.i_setVisible(true);if(false===this.i_viewportExists()){return;}
if(!this.p_origViewportRect){var md=this.i_getViewport().getSize();this.p_setPlacement(md.width,md.height);}
this.i_getViewport().moveTo(this.p_nonVisibleViewportRect.left,this.p_nonVisibleViewportRect.top,this.p_nonVisibleViewportRect.width,this.p_nonVisibleViewportRect.height,false);this.i_applyVisibility();}
catch(e){this.i_handleError("Showing slate overlay.",e);}};xmp.SlateOverlay.prototype.hide=function(){try{if(false===this.i_viewportExists()||false===this.i_isVisible()){return;}
if(this.p_origViewportRect){this.i_getViewport().moveTo(this.p_origViewportRect.left,this.p_origViewportRect.top,this.p_origViewportRect.width,this.p_origViewportRect.height,false);}
this.i_setVisible(false);this.i_applyVisibility();}
catch(e){this.i_handleError("Hiding slate overlay.",e);}};xmp.SlateOverlay.prototype.moveTo=function(nd,od,pd,qd){throw new xmp.util.internals.UnsupportedOperationError("The \"moveTo\" operation is not supported.");};xmp.SlateOverlay.prototype.i_onViewportChange=function(rd,sd,td,ud){this.p_setPlacement(td,ud);this.refresh();};xmp.SlateOverlay.prototype.p_setPlacement=function(vd,wd){this.p_origViewportRect={left:"0px",top:"0px",width:vd,height:wd};this.i_setRectangle({left:0,top:0,width:vd,height:wd});};xmp.ALL_OVERLAYS="AllOverlays";xmp.i_OVERLAY_GROUP_SHOW="GroupShow";xmp.i_OVERLAY_GROUP_HIDE="GroupHide";xmp.i_OVERLAY_GROUP_REFRESH="GroupRefresh";xmp.ViewManager=function(xd){this.p_activeViewport=null;this.p_viewportsConfig={};this.p_overlays=[];this.p_context=xd;};xmp.ViewManager.prototype.i_setViewportConfig=function(yd,zd){if(false===xmp.ViewportFactory.i_canCreate(zd)){throw new xmp.ViewportError("Setting viewport configuration.","Invalid media player viewport type \""+zd+"\".",null);}
this.p_viewportsConfig[yd]=zd;};xmp.ViewManager.prototype.i_getViewportConfig=function(Ad){var Bd=this.p_viewportsConfig[Ad];if(Bd===null){throw new xmp.InvalidMimeTypeError("Retrieving viewport configuration.","Unable to find media player viewport configuration for MIME type \""+Ad+"\".");}
return Bd;};xmp.ViewManager.prototype.i_getActiveViewport=function(){return this.p_activeViewport;};xmp.ViewManager.prototype.i_openViewport=function(Cd,Dd,Ed,Fd){var Gd=this.i_getViewportConfig(Ed);var Hd=this.p_activeViewport;if(this.p_activeViewport===null||(this.p_activeViewport.i_getType()!==Gd)){return this.i_createViewport(Cd,Dd,Ed,Fd);}
else if(this.p_activeViewport.i_getMimeType()!==Ed){this.p_activeViewport.i_reset(Fd);}
if(false===Hd.i_isOpen()){try{Hd.i_open(Fd);return true;}
catch(e){Hd.i_close();throw e;}}
return false;};xmp.ViewManager.prototype.i_createViewport=function(Id,Jd,Kd,Ld){var Md=this.i_getViewportConfig(Kd);if(!Md){throw new xmp.ViewportError("Creating viewport.","Unable to find viewport configuration for MIME type \""+Kd+"\" .",null);}
if(this.p_activeViewport===null||(this.p_activeViewport.i_getType()!==Md)){var Nd=xmp.ViewportFactory.i_createViewport(Id,Jd,Md,Kd,Ld,this.p_overlays);try{if(this.p_activeViewport!==null){this.p_activeViewport.i_close();this.p_activeViewport=null;}}
catch(e){throw e;}
finally{this.p_activeViewport=Nd;}
return true;}
return false;};xmp.ViewManager.prototype.createOverlay=function(Od,Pd,Qd){if(this.getOverlay(Qd)!==null){throw new xmp.OverlayError("Creating overlay.","An overlay already exists with the name \""+Qd+"\".",null);}
var Rd=xmp.OverlayFactory.createOverlay(this.p_context,this.p_activeViewport,Od,Pd,Qd);this.p_overlays.push(Rd);return Rd;};xmp.ViewManager.prototype.getOverlay=function(Sd){for(var i=0;i<this.p_overlays.length;i++){if(this.p_overlays[i].i_getName()===Sd){return this.p_overlays[i];}}
return null;};xmp.ViewManager.prototype.showOverlays=function(Td){this.doOverlayGroupAction(Td,xmp.i_OVERLAY_GROUP_SHOW);};xmp.ViewManager.prototype.hideOverlays=function(Ud){this.doOverlayGroupAction(Ud,xmp.i_OVERLAY_GROUP_HIDE);};xmp.ViewManager.prototype.refreshOverlays=function(Vd){this.doOverlayGroupAction(Vd,xmp.i_OVERLAY_GROUP_REFRESH);};xmp.ViewManager.prototype.doOverlayGroupAction=function(Wd,Xd){for(var i=0;i<this.p_overlays.length;i++){if(this.p_overlays[i].i_getGroup()===Wd||Wd===xmp.ALL_OVERLAYS){var Yd=this.p_overlays[i];Yd.i_setViewport(this.p_activeViewport);if(Xd===xmp.i_OVERLAY_GROUP_SHOW){Yd.show();}
else if(Xd===xmp.i_OVERLAY_GROUP_HIDE){Yd.hide();}
else if(Xd===xmp.i_OVERLAY_GROUP_REFRESH){Yd.refresh();}}}};xmp.ViewManager.prototype.i_close=function(){if(this.p_activeViewport!==null){this.p_activeViewport.i_close();this.p_activeViewport=null;}};xmp.ViewportError=function(Zd,$d,ae,be){var ce=[];if(ae){ce.push({label:"Viewport Type",text:ae.i_getType()});ce.push({label:"Viewport Name",text:ae.i_getName()});}
if(be){ce=ce.concat(be);}
xmp.ViewportError.ctor.call(this,"ViewportError",Zd,$d,ce);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ViewportError);xmp.ViewportFactory=function(){return{i_createViewport:function(de,ee,fe,ge,he,ie){var je=xmp.getNamespacedMethod(fe);if(!je){throw new xmp.ViewportError("Creating viewport.","Unable to create \""+fe+"\" viewport.",null);}
var ke=new je(de,ge,ee,ie);ke.i_init(he,null,null);return ke;},i_canCreate:function(le){try{return(true===xmp.isDefined(xmp.getNamespacedMethod(le)));}
catch(e){}
return false;}};}();xmp.ViewportProxy=function(me){this.viewManager=me;};xmp.ViewportProxy.prototype.viewManager=null;xmp.ViewportProxy.prototype.getType=function(){return((this.viewManager.i_getActiveViewport()!==null)?this.viewManager.i_getActiveViewport().i_getType():"None");};xmp.ViewportProxy.prototype.getSize=function(){return((this.viewManager.i_getActiveViewport()!==null)?this.viewManager.i_getActiveViewport().getSize():null);};xmp.ViewportProxy.prototype.setSize=function(ne,oe){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE,xmp.i_STRING_TYPE],"ViewportProxy.setSize");this.viewManager.i_getActiveViewport().setSize(ne,oe,true);};xmp.ViewportProxy.prototype.moveTo=function(pe,qe,re,se){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE,xmp.i_STRING_TYPE,xmp.i_STRING_TYPE,xmp.i_STRING_TYPE],"ViewportProxy.moveTo");this.viewManager.i_getActiveViewport().moveTo(pe,qe,re,se,true);};xmp.ViewportProxy.prototype.setStyle=function(te){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE],"ViewportProxy.setStyle");this.viewManager.i_getActiveViewport().setStyle(te);};xmp.ViewportProxy.prototype.createOverlay=function(ue,ve,we){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE,xmp.i_STRING_TYPE,xmp.i_STRING_TYPE],"ViewportProxy.createOverlay");return this.viewManager.createOverlay(ue,ve,we);};xmp.ViewportProxy.prototype.getOverlay=function(xe){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE],"ViewportProxy.getOverlay");return this.viewManager.getOverlay(xe);};xmp.ViewportProxy.prototype.showOverlays=function(ye){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE],"ViewportProxy.showOverlays");this.viewManager.showOverlays(ye);};xmp.ViewportProxy.prototype.hideOverlays=function(ze){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE],"ViewportProxy.hideOverlays");this.viewManager.hideOverlays(ze);};xmp.ViewportProxy.prototype.refreshOverlays=function(Ae){xmp.validateArguments(arguments,[xmp.i_STRING_TYPE],"ViewportProxy.refreshOverlays");this.viewManager.refreshOverlays(Ae);};xmp.ViewportRegistry=function(){var Be={};return{i_addViewport:function(Ce){var De=Ce.i_getName();if(Be[De]!==null&&true===xmp.isDefined(Be[De])){throw new xmp.ViewportError("Adding viewport to registry.","A media player viewport already exists with the name \""+De+"\".",Ce);}
Be[De]=Ce;},getViewport:function(Ee){return Be[Ee];},i_removeViewport:function(Fe){if(Fe===null||false===xmp.isDefined(Fe)){throw new xmp.ViewportError("Removing viewport from registry.","Cannot remove NULL viewport from viewport registry.",Fe);}
Be[Fe.i_getName()]=null;}};}();
