xmp.ABSOLUTE_POSITION="absolute";xmp.OVERLAY="Overlay";xmp.OVERLAY_ELEMENT="div";xmp.Overlay=function(aa,ba,ca,da,ea){try{this.viewport=ba;this.rawName="";this.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.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.rawName=da;this.name=aa+this.group+this.rawName+xmp.OVERLAY;this.style="";this.html="";this.display=xmp.DISPLAY_NONE;this.zIndex=-1;this.position=xmp.ABSOLUTE_POSITION;this.rectangle={left:0,top:0,width:0,height:0};this.type=((ea)?ea:xmp.OVERLAY);}
catch(e){this._handleError("Constructing overlay.",e);}};xmp.Overlay.prototype.open=function(fa){try{this.viewport=fa;this.refresh();}
catch(e){this._handleError("Opening overlay.",e);}};xmp.Overlay.prototype.close=function(){try{this.viewport=null;this._destoryNativeOverlay();}
catch(e){this._handleError("Closing overlay.",e);}};xmp.Overlay.prototype.setHTML=function(ga){try{this.html=ga;if(true===this.viewportExists()){this.getNativeOverlay().innerHTML=ga;}}
catch(e){this._handleError("Setting overlay HTML.",e);}};xmp.Overlay.prototype.setStyle=function(ha){try{this.style=ha;if(true===this.viewportExists()&&true===this.isVisible()){var ia=this.getNativeOverlay();var ja=((this.style.length>0)?this.style+"; ":"")+"z-Index: "+ia.style.zIndex+"; position: "+ia.style.position+"; display: "+ia.style.display+"; marginLeft: "+ia.style.left+"; marginTop: "+ia.style.top+"; width: "+ia.style.width+"; height: "+ia.style.height;ia.style.cssText=ja;}}
catch(e){this._handleError("Setting overlay style.",e);}};xmp.Overlay.prototype.show=function(ka){try{this.display=xmp.DISPLAY_BLOCK;if(false===this.viewportExists()){return;}
var la=this.viewport.getNativePlayer().getNative();if(!la){throw new xmp.OverlayError("Showing overlay.","A native player does not exist for the viewport.",this);}
if(!la.style.zIndex||la.style.zIndex<=0){la.style.zIndex=1;}
var ma=this.getNativeOverlay();this.zIndex=parseInt(la.style.zIndex,10)+1;ma.style.zIndex=this.zIndex;ma.style.display=this.display;}
catch(e){this._handleError("Showing overlay.",e);}};xmp.Overlay.prototype.hide=function(){try{if(false===this.viewportExists()||false===this.isVisible()){return;}
this.display=xmp.DISPLAY_NONE;this.getNativeOverlay().style.display=this.display;}
catch(e){this._handleError("Hiding overlay.",e);}};xmp.Overlay.prototype.refresh=function(){try{if(false===this.viewportExists()){return;}
this._destoryNativeOverlay();if(true===this.isVisible()){this.show();}
else{this.getNativeOverlay();}}
catch(e){this._handleError("Refreshing overlay.",e);}};xmp.Overlay.prototype.moveTo=function(na,oa,pa,qa){try{this.rectangle={left:na,top:oa,width:pa,height:qa};if(true===this.viewportExists()&&true===this.isVisible()){var ra=this.getNativeOverlay();var sa=((this.style.length>0)?this.style+"; ":"")+"z-Index: "+this.zIndex+"; position: "+this.position+"; display: "+this.display+"; marginLeft: "+this.rectangle.left+"; marginTop: "+this.rectangle.top+"; width: "+this.rectangle.width+"; height: "+this.rectangle.height;ra.style.cssText=sa;}}
catch(e){this._handleError("Moving overlay.",e);}};xmp.Overlay.prototype.getNativeOverlay=function(){var ta=document.getElementById(this.name);if(ta===null){ta=document.createElement(xmp.OVERLAY_ELEMENT);ta.setAttribute(xmp.ID_ATTRIBUTE,this.name);ta.setAttribute(xmp.NAME_ATTRIBUTE,this.name);ta.style.display=this.display;this.position=xmp.ABSOLUTE_POSITION;ta.style.position=this.position;ta.style.marginLeft=this.rectangle.left;ta.style.marginTop=this.rectangle.top;ta.style.width=this.rectangle.width;ta.style.height=this.rectangle.height;ta.innerHTML=this.html;if(navigator.appName.indexOf(xmp.MICROSOFT_BROWSER)!==-1){this.viewport.getNative().insertAdjacentElement("afterEnd",ta);}
else{var ua=((navigator.appName.indexOf(xmp.MICROSOFT_BROWSER)!==-1||navigator.appName.indexOf(xmp.OPERA_BROWSER)!==-1)?this.viewport.getNative().parentElement:this.viewport.getNative().parentNode);ua.insertBefore(ta,null);}}
return ta;};xmp.Overlay.prototype.getType=function(){return this.type;};xmp.Overlay.prototype.getName=function(){return this.rawName;};xmp.Overlay.prototype.getGroup=function(){return this.group;};xmp.Overlay.prototype.getViewport=function(){return this.viewport;};xmp.Overlay.prototype.setViewport=function(va){this.viewport=va;};xmp.Overlay.prototype.isVisible=function(){return(this.display===xmp.DISPLAY_BLOCK);};xmp.Overlay.prototype.viewportExists=function(){return(this.viewport!==null);};xmp.Overlay.prototype._handleError=function(wa,e){var xa=e;if(false===(xa instanceof xmp.OverlayError)){xa=new xmp.OverlayError(((e.context)?e.context:wa),((e.rawMessage)?e.rawMessage:e.message),this);xa.setInnerError(e);}
throw xa;};xmp.Overlay.prototype._destoryNativeOverlay=function(){var ya=document.getElementById(this.name);if(ya!==null){var za=((navigator.appName.indexOf(xmp.MICROSOFT_BROWSER)!==-1||navigator.appName.indexOf(xmp.OPERA_BROWSER)!==-1)?ya.parentElement:ya.parentNode);za.removeChild(ya);}};xmp.NATIVE_VIEWPORT_Z_INDEX=1;xmp.VIEWPORT_EVENT_DISPATCH_HANDLER="XmpDispatchViewportEvent";function XmpDispatchViewportEvent(){var Aa=null;try{Aa=xmp.ViewportRegistry.getViewport(arguments[1]);var Ba=arguments[2];var Ca=[];for(var i=3;i<arguments.length;i++){Ca.push(arguments[i]);}
Aa[Ba].apply(Aa,Ca);}
catch(e){if(Aa){Aa.setError("Dispatching event.",e);}
else{xmp.handleFatalError(e);}}}
xmp.Viewport=function(Da,Ea,Fa,Ga,Ha){this.listener=Da;this.type=Ea;this.mime_type=Fa;this.contextName=Ga;this.name=this.type+Ga+xmp.VIEWPORT;this.overlays=Ha;this.externalInterface=true;this.opened=false;this.style="";this.nativeViewport=null;this.nativePlayer=null;};xmp.Viewport.prototype.init=function(Ia,Ja,Ka){try{this.createContext=Ia;xmp.ViewportRegistry.addViewport(this);this.nativeViewport=this.listener.onCreateViewport(this.type,this.name,Ja,Ka);}
catch(e){this.setError("Creating viewport.",e);}};xmp.Viewport.prototype.open=function(La){this.createContext=La;};xmp.Viewport.prototype.close=function(){try{xmp.ViewportRegistry.removeViewport(this);for(var i=0;i<this.overlays.length;i++){this.overlays[i].close();}
this.opened=false;this.listener.onDestroyViewport(this.type,this.name);}
catch(e){this.setError("Closing viewport.",e);}};xmp.Viewport.prototype.isOpen=function(){return this.opened;};xmp.Viewport.prototype.reset=function(Ma){this.createContext=Ma;};xmp.Viewport.prototype.getSize=function(){try{return{width:this.nativeViewport.style.width,height:this.nativeViewport.style.height};}
catch(e){this.setError("Retrieving viewport size.",e);}
return{width:0,height:0};};xmp.Viewport.prototype.setSize=function(Na,Oa){try{var Pa=((this.nativeViewport.style.left.length>0)?this.nativeViewport.style.left:"0");var Qa=((this.nativeViewport.style.top.length>0)?this.nativeViewport.style.top:"0");this.moveTo(Pa,Qa,Na,Oa);}
catch(e){this.setError("Setting viewport size.",e);}};xmp.Viewport.prototype.moveTo=function(Ra,Sa,Ta,Ua){try{var Va=((this.style.length>0)?this.style+"; ":"")+"left: "+Ra+"; top: "+Sa+"; width: "+Ta+"; height: "+Ua;this.nativeViewport.style.cssText=Va;if(this.nativePlayer){this.nativePlayer.moveTo(Ra,Sa,Ta,Ua);}}
catch(e){this.setError("Moving viewport.",e);}};xmp.Viewport.prototype.setStyle=function(Wa){try{this.style=Wa;var Xa=((this.nativeViewport.style.left.length>0)?this.nativeViewport.style.left:"0");var Ya=((this.nativeViewport.style.top.length>0)?this.nativeViewport.style.top:"0");var Za=((this.style.length>0)?this.style+"; ":"")+"left: "+Xa+"; top: "+Ya+"; width: "+this.nativeViewport.style.width+"; height: "+this.nativeViewport.style.height;this.nativeViewport.style.cssText=Za;}
catch(e){this.setError("Setting viewport style.",e);}};xmp.Viewport.prototype.getNative=function(){return this.nativeViewport;};xmp.Viewport.prototype.getContextName=function(){return this.contextName;};xmp.Viewport.prototype.getName=function(){return this.name;};xmp.Viewport.prototype.getType=function(){return this.type;};xmp.Viewport.prototype.getExternalInterface=function(){return this.externalInterface;};xmp.Viewport.prototype.getNativeData=function(){return this.native_data;};xmp.Viewport.prototype.setNoExternalInterface=function(){this.externalInterface=false;};xmp.Viewport.prototype.setError=function($a,e){var ab=e;if(false===(ab instanceof xmp.ViewportError)){ab=new xmp.ViewportError(((e.context)?e.context:$a),((e.rawMessage)?e.rawMessage:e.message),this);ab.setInnerError(e);}
this._createTimer({id:"setError",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetError,context:ab}).start();};xmp.Viewport.prototype.setOpened=function(){this.opened=true;this._createTimer({id:"setOpened",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetOpened,context:null}).start();};xmp.Viewport.prototype.setCreated=function(){this._createTimer({id:"setCreated",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetCreated,context:null}).start();};xmp.Viewport.prototype._createTimer=function(bb){var cb=new xmp.util.Callback(bb.id,bb.handler,this);cb.setMetadata(xmp.CONTEXT,bb.context);return new xmp.util.Timer(bb.id,bb.interval,-1,cb);};xmp.Viewport.prototype.setNativePlayer=function(db){this.nativePlayer=db;for(var i=0;i<this.overlays.length;i++){this.overlays[i].open(this);}};xmp.Viewport.prototype.getNativePlayer=function(){return this.nativePlayer;};xmp.Viewport.prototype.onSetError=function(eb,fb){var gb=null;try{fb.stop();gb=eb.getMetadata(xmp.CONTEXT,{});this.listener.onViewportError(gb);}
catch(e){var hb=((gb)?gb:e);xmp.handleFatalError(hb);}};xmp.Viewport.prototype.onSetOpened=function(ib,jb){try{jb.stop();this.listener.onViewportOpened(this,this.createContext);}
catch(e){this.setError("Forwarding opened to listener.",e);}};xmp.Viewport.prototype.onSetCreated=function(kb,lb){try{lb.stop();this.listener.onViewportCreated(this,this.createContext);}
catch(e){this.setError("Forwarding created to listener.",e);}};xmp.DHTML_VIEWPORT="DHTML";xmp.DHTMLViewport=function(mb,nb,ob,pb){xmp.DHTMLViewport.ctor.call(this,mb,xmp.DHTML_VIEWPORT,nb,ob,pb);};xmp.DERIVE_CLASS(xmp.Viewport,xmp.DHTMLViewport);xmp.DHTMLViewport.prototype.open=function(qb,rb){xmp.DHTMLViewport.base.open.call(this,qb,rb);this.setOpened();};xmp.DHTMLViewport.prototype.init=function(sb,tb,ub){xmp.DHTMLViewport.base.init.call(this,sb,tb,ub);this.setCreated();};xmp.FLASH_VIEWPORT="Flash";xmp.FLASH_VIEWPORT_OPENED_METHOD="onOpened";xmp.FLASH_VIEWPORT_CREATED_METHOD="onCreated";xmp.FLASH_VIEWPORT_ERROR_METHOD="onError";xmp.FLASH_VIEWPORT_FSCOMMAND_METHOD="onFSCommand";xmp.FVP_OPEN_COMMAND="fvpOpen";xmp.FlashViewport=function(vb,wb,xb,yb){xmp.FlashViewport.ctor.call(this,vb,xmp.FLASH_VIEWPORT,wb,xb,yb);this.externalInterface=true;};xmp.DERIVE_CLASS(xmp.Viewport,xmp.FlashViewport);xmp.FlashViewport.prototype.init=function(zb,Ab,Bb){var Cb=[{name:xmp.ALLOW_SCRIPT_ACCESS,value:xmp.ALWAYS_ACCESS},{name:xmp.QUALITY,value:xmp.QUALITY_HIGH},{name:xmp.WINDOW_MODE,value:xmp.TRANSPARENT_WINDOW_MODE}];var Db=[{name:xmp.FLASH_CALLBACK_CONTEXT,value:""},{name:xmp.FLASH_CALLBACK_OBJECT,value:this.getName()},{name:xmp.FLASH_EVENT_HANDLER,value:xmp.VIEWPORT_EVENT_DISPATCH_HANDLER},{name:xmp.FLASH_INITIALIZATION_CALLBACK,value:xmp.FLASH_VIEWPORT_CREATED_METHOD},{name:xmp.FLASH_ERROR_CALLBACK,value:xmp.FLASH_VIEWPORT_ERROR_METHOD}];xmp.FlashViewport.base.init.call(this,zb,Cb,Db);};xmp.FlashViewport.prototype.open=function(Eb,Fb){xmp.FlashViewport.base.open.call(this,Eb,Fb);var Gb=this.getNative();Gb.style.zIndex=xmp.NATIVE_VIEWPORT_Z_INDEX;if(navigator.appName.indexOf(xmp.MICROSOFT_BROWSER)===-1){var Hb=document.createElement(xmp.SCRIPT_ELEMENT_TAG);var Ib=this.getName();Hb.innerHTML="function "+Ib+"_DoFSCommand(command, args) { "+this.getCallbackMethod(xmp.FLASH_VIEWPORT_FSCOMMAND_METHOD)+"(command, args); }";Gb.insertBefore(Hb,null);}
Gb.SetVariable(xmp.FLASH_CALLBACK_CONTEXT,"");Gb.SetVariable(xmp.FLASH_CALLBACK_OBJECT,this.getName());Gb.SetVariable(xmp.FLASH_EVENT_HANDLER,xmp.VIEWPORT_EVENT_DISPATCH_HANDLER);Gb.SetVariable(xmp.FLASH_INITIALIZATION_CALLBACK,xmp.FLASH_VIEWPORT_OPENED_METHOD);((true===this.externalInterface)?Gb.fvpOpen():Gb.SetVariable(xmp.FVP_OPEN_COMMAND,xmp.TRUE));};xmp.FlashViewport.prototype.reset=function(Jb,Kb){};xmp.FlashViewport.prototype.onOpened=function(){try{this.setOpened();}
catch(e){this.setError("Handling open.",e);}};xmp.FlashViewport.prototype.onCreated=function(){try{this.setCreated();}
catch(e){this.setError("Handling create.",e);}};xmp.FlashViewport.prototype.onError=function(Lb,Mb){try{var Nb=[{label:"Flash Error Type",text:Lb}];this.setError(null,new xmp.ViewportError("Handling error.",Mb,this,Nb));}
catch(e){this.setError("Handling error.",e);}};xmp.FlashViewport.prototype.onFSCommand=function(Ob,Pb){try{this.setNoExternalInterface();if(Ob===xmp.FLASH_VIEWPORT_CREATED_METHOD){this.onCreated();}
else if(Ob===xmp.FLASH_VIEWPORT_OPENED_METHOD){this.onOpened();}
else if(Ob===xmp.FLASH_VIEWPORT_ERROR_METHOD){var Qb=Pb;var Rb=Qb.substring(0,Qb.indexOf(xmp.DELIMITER));var Sb=Qb.substring(Qb.indexOf(xmp.DELIMITER)+1);this.onError(Rb,Sb);}
else{throw new xmp.ViewportError("Handling FS command.","Invalid flash viewport FS command \""+Ob+"\".",this);}}
catch(e){this.setError("Handling FS command.",e);}};xmp.OverlayError=function(Tb,Ub,Vb){var Wb=[{label:"Overlay Group",text:((Vb)?Vb.getGroup():"")},{label:"Overlay Type",text:((Vb)?Vb.getType():"")},{label:"Overlay Name",text:((Vb)?Vb.getName():"")}];xmp.OverlayError.ctor.call(this,"OverlayError",Tb,Ub,Wb);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.OverlayError);xmp.OverlayFactory=function(){return{createOverlay:function(Xb,Yb,Zb,$b,ac){if($b===xmp.OVERLAY){return new xmp.Overlay(Xb,Yb,Zb,ac);}
else if($b===xmp.SLATE_OVERLAY){return new xmp.SlateOverlay(Xb,Yb,Zb,ac);}
throw new xmp.OverlayError("Creating overlay.","Unable to create \""+$b+"\" overlay.",null);}};}();xmp.OverlayProxy=function(bc){this.object=bc;};xmp.OverlayProxy.prototype.object=null;xmp.OverlayProxy.prototype.show=function(){this.object.show();};xmp.OverlayProxy.prototype.hide=function(){this.object.hide();};xmp.OverlayProxy.prototype.refresh=function(){this.object.refresh();};xmp.OverlayProxy.prototype.setHTML=function(cc){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"OverlayProxy.setHTML");this.object.setHTML(cc);};xmp.OverlayProxy.prototype.setStyle=function(dc){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"OverlayProxy.setStyle");this.object.setStyle(dc);};xmp.OverlayProxy.prototype.moveTo=function(ec,fc,gc,hc){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"OverlayProxy.moveTo");this.object.moveTo(ec,fc,gc,hc);};xmp.SLATE_OVERLAY="SlateOverlay";xmp.SlateOverlay=function(ic,jc,kc,lc){xmp.SlateOverlay.ctor.call(this,ic,jc,kc,lc,xmp.SLATE_OVERLAY);this.nonVisibleViewportRect={left:"0px",top:"0px",width:"1px",height:"1px"};this.origViewportRect=null;};xmp.DERIVE_CLASS(xmp.Overlay,xmp.SlateOverlay);xmp.SlateOverlay.prototype.show=function(mc){try{this.display=xmp.DISPLAY_BLOCK;if(false===this.viewportExists()){return;}
if(!this.origViewportRect){var nc=this.viewport.getSize();this.origViewportRect={left:"0px",top:"0px",width:nc.width,height:nc.height};}
this.viewport.moveTo(this.nonVisibleViewportRect.left,this.nonVisibleViewportRect.top,this.nonVisibleViewportRect.width,this.nonVisibleViewportRect.height);this.getNativeOverlay().style.display=this.display;}
catch(e){this._handleError("Showing slate overlay.",e);}};xmp.SlateOverlay.prototype.hide=function(){try{if(false===this.viewportExists()||false===this.isVisible()){return;}
if(this.origViewportRect){this.viewport.moveTo(this.origViewportRect.left,this.origViewportRect.top,this.origViewportRect.width,this.origViewportRect.height);}
this.display=xmp.DISPLAY_NONE;this.getNativeOverlay().style.display=this.display;}
catch(e){this._handleError("Hiding slate overlay.",e);}};xmp.SlateOverlay.prototype.moveTo=function(oc,pc,qc,rc){throw new xmp.util.internals.UnsupportedOperationError("The \"moveTo\" operation is not supported.");};xmp.ALL_OVERLAYS="AllOverlays";xmp.OVERLAY_GROUP_SHOW="GroupShow";xmp.OVERLAY_GROUP_HIDE="GroupHide";xmp.OVERLAY_GROUP_REFRESH="GroupRefresh";xmp.ViewManager=function(sc){this.activeViewport=null;this.viewportsConfig={};this.overlays=[];this.context=sc;};xmp.ViewManager.prototype.setViewportConfig=function(tc,uc){if(false===xmp.ViewportFactory.canCreate(uc)){throw new xmp.ViewportError("Setting viewport configuration.","Invalid media player viewport type \""+uc+"\".",null);}
this.viewportsConfig[tc]=uc;};xmp.ViewManager.prototype.getViewportConfig=function(vc){var wc=this.viewportsConfig[vc];if(wc===null){throw new xmp.InvalidMimeTypeError("Retrieving viewport configuration.","Unable to find media player viewport configuration for MIME type \""+vc+"\".");}
return wc;};xmp.ViewManager.prototype.getActiveViewport=function(){return this.activeViewport;};xmp.ViewManager.prototype.openViewport=function(xc,yc,zc,Ac){var Bc=this.getViewportConfig(zc);var Cc=this.activeViewport;if(this.activeViewport===null||(this.activeViewport.getType()!==Bc)){return this.createViewport(xc,yc,zc,Ac);}
else if(this.activeViewport.mime_type!==zc){this.activeViewport.reset(Ac);}
if(false===Cc.isOpen()){try{Cc.open(Ac);return true;}
catch(e){Cc.close();throw e;}}
return false;};xmp.ViewManager.prototype.createViewport=function(Dc,Ec,Fc,Gc){var Hc=this.getViewportConfig(Fc);if(!Hc){throw new xmp.ViewportError("Creating viewport.","Unable to find viewport configuration for MIME type \""+Fc+"\" .",null);}
if(this.activeViewport===null||(this.activeViewport.type!==Hc)){var Ic=xmp.ViewportFactory.createViewport(Dc,Ec,Hc,Fc,Gc,this.overlays);try{if(this.activeViewport!==null){this.activeViewport.close();this.activeViewport=null;}}
catch(e){throw e;}
finally{this.activeViewport=Ic;}
return true;}
return false;};xmp.ViewManager.prototype.createOverlay=function(Jc,Kc,Lc){if(this.getOverlay(Lc)!==null){throw new xmp.OverlayError("Creating overlay.","An overlay already exists with the name \""+Lc+"\".",null);}
var Mc=xmp.OverlayFactory.createOverlay(this.context,this.activeViewport,Jc,Kc,Lc);this.overlays.push(Mc);return Mc;};xmp.ViewManager.prototype.getOverlay=function(Nc){for(var i=0;i<this.overlays.length;i++){if(this.overlays[i].getName()===Nc){return this.overlays[i];}}
return null;};xmp.ViewManager.prototype.showOverlays=function(Oc){this.doOverlayGroupAction(Oc,xmp.OVERLAY_GROUP_SHOW);};xmp.ViewManager.prototype.hideOverlays=function(Pc){this.doOverlayGroupAction(Pc,xmp.OVERLAY_GROUP_HIDE);};xmp.ViewManager.prototype.refreshOverlays=function(Qc){this.doOverlayGroupAction(Qc,xmp.OVERLAY_GROUP_REFRESH);};xmp.ViewManager.prototype.doOverlayGroupAction=function(Rc,Sc){for(var i=0;i<this.overlays.length;i++){if(this.overlays[i].group===Rc||Rc===xmp.ALL_OVERLAYS){var Tc=this.overlays[i];Tc.setViewport(this.activeViewport);if(Sc===xmp.OVERLAY_GROUP_SHOW){Tc.show();}
else if(Sc===xmp.OVERLAY_GROUP_HIDE){Tc.hide();}
else if(Sc===xmp.OVERLAY_GROUP_REFRESH){Tc.refresh();}}}};xmp.ViewManager.prototype.close=function(){if(this.activeViewport!==null){this.activeViewport.close();this.activeViewport=null;}};xmp.ViewportError=function(Uc,Vc,Wc,Xc){var Yc=[{label:"Viewport Type",text:((Wc)?Wc.getType():"")},{label:"Viewport Name",text:((Wc)?Wc.getName():"")}];if(Xc){var Zc=Xc.length;for(var i=0;i<Zc;i++){Yc.push(Xc[i]);}}
xmp.ViewportError.ctor.call(this,"ViewportError",Uc,Vc,Yc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ViewportError);xmp.VIEWPORT="Viewport";xmp.ViewportFactory=function(){return{createViewport:function($c,ad,bd,cd,dd,ed){var fd;if(bd===xmp.DHTML_VIEWPORT){fd=new xmp.DHTMLViewport($c,cd,ad,ed);}
else if(bd===xmp.FLASH_VIEWPORT){fd=new xmp.FlashViewport($c,cd,ad,ed);}
else{throw new xmp.ViewportError("Creating viewport.","Unable to create \""+bd+"\" viewport.",null);}
fd.init(dd,null,null);return fd;},canCreate:function(gd){return(gd===xmp.DHTML_VIEWPORT||gd===xmp.FLASH_VIEWPORT);}};}();xmp.ViewportProxy=function(hd){this.viewManager=hd;};xmp.ViewportProxy.prototype.viewManager=null;xmp.ViewportProxy.prototype.getType=function(){return((this.viewManager.getActiveViewport()!==null)?this.viewManager.getActiveViewport().getType():"None");};xmp.ViewportProxy.prototype.getSize=function(){return((this.viewManager.getActiveViewport()!==null)?this.viewManager.getActiveViewport().getSize():null);};xmp.ViewportProxy.prototype.setSize=function(jd,kd){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.setSize");this.viewManager.getActiveViewport().setSize(jd,kd);};xmp.ViewportProxy.prototype.moveTo=function(ld,md,nd,od){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.moveTo");this.viewManager.getActiveViewport().moveTo(ld,md,nd,od);};xmp.ViewportProxy.prototype.setStyle=function(pd){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.setStyle");this.viewManager.getActiveViewport().setStyle(pd);};xmp.ViewportProxy.prototype.createOverlay=function(qd,rd,sd){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.createOverlay");return new xmp.OverlayProxy(this.viewManager.createOverlay(qd,rd,sd));};xmp.ViewportProxy.prototype.getOverlay=function(td){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.getOverlay");var ud=this.viewManager.getOverlay(td);return((ud!==null)?new xmp.OverlayProxy(ud):null);};xmp.ViewportProxy.prototype.showOverlays=function(vd){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.showOverlays");this.viewManager.showOverlays(vd);};xmp.ViewportProxy.prototype.hideOverlays=function(wd){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.hideOverlays");this.viewManager.hideOverlays(wd);};xmp.ViewportProxy.prototype.refreshOverlays=function(xd){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.refreshOverlays");this.viewManager.refreshOverlays(xd);};xmp.ViewportRegistry=function(){var yd={};return{addViewport:function(zd){var Ad=zd.getName();if(yd[Ad]!==null&&true===xmp.isDefined(yd[Ad])){throw new xmp.ViewportError("Adding viewport to registry.","A media player viewport already exists with the name \""+Ad+"\".",zd);}
yd[Ad]=zd;},getViewport:function(Bd){return yd[Bd];},removeViewport:function(Cd){if(Cd===null||false===xmp.isDefined(Cd)){throw new xmp.ViewportError("Removing viewport from registry.","Cannot remove NULL viewport from viewport registry.",Cd);}
return yd[Cd.getName()]=null;}};}();