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