
if(typeof(window)!=='undefined'){var deconcept;if(typeof deconcept==="undefined"){deconcept={};}
deconcept.hop=function(m,k){if(typeof(m.hasOwnProperty)==='undefined'){return true;}
return m.hasOwnProperty(k);};if(typeof deconcept.util==="undefined"){deconcept.util={};}
if(typeof deconcept.SWFObjectUtil==="undefined"){deconcept.SWFObjectUtil={};}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a);}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(aa){return this.attributes[aa];},addParam:function(ba,ca){this.params[ba]=ca;},getParams:function(){return this.params;},addVariable:function(da,ea){this.variables[da]=ea;},getVariable:function(fa){return this.variables[fa];},getVariables:function(){return this.variables;},getVariablePairs:function(){var ga=[];var ha;var ia=this.getVariables();for(ha in ia){if(deconcept.hop(ia,ha)){ga.push(ha+"="+ia[ha]);}}
return ga;},getSWFHTML:function(){var ja="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
ja="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";ja+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var ka=this.getParams();for(var la in ka){if(deconcept.hop(ka,la)){ja+=[la]+"=\""+ka[la]+"\" ";}}
var ma=this.getVariablePairs().join("&");if(ma.length>0){ja+="flashvars=\""+ma+"\"";}ja+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
ja="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";ja+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var na=this.getParams();for(var oa in na){if(deconcept.hop(na,oa)){ja+="<param name=\""+oa+"\" value=\""+na[oa]+"\" />";}}
var pa=this.getVariablePairs().join("&");if(pa.length>0){ja+="<param name=\"flashvars\" value=\""+pa+"\" />";}ja+="</object>";}
return ja;},write:function(qa){if(this.getAttribute("useExpressInstall")){var ra=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(ra)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof qa==="string")?document.getElementById(qa):qa;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!==""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var sa;var ta=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){ta=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{sa=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{sa=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");ta=new deconcept.PlayerVersion([6,0,21]);sa.AllowScriptAccess="always";}
catch(e2){if(ta.major===6){return ta;}}try{sa=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e3){}}if(sa!==null){ta=new deconcept.PlayerVersion(sa.GetVariable("$version").split(" ")[1].split(","));}}
return ta;};deconcept.PlayerVersion=function(ua){this.major=ua[0]!==null?parseInt(ua[0],10):0;this.minor=ua[1]!==null?parseInt(ua[1],10):0;this.rev=ua[2]!==null?parseInt(ua[2],10):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(va){var q=document.location.search||document.location.hash;if(q){var wa=q.substring(1).split("&");for(var i=0;i<wa.length;i++){if(wa[i].substring(0,wa[i].indexOf("="))===va){return wa[i].substring((wa[i].indexOf("=")+1));}}}
return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var xa=document.getElementsByTagName("OBJECT");for(var i=0;i<xa.length;i++){xa[i].style.display="none";for(var x in xa[i]){if(deconcept.hop(xa[i],x)){if(typeof xa[i][x]==="function"){xa[i][x]=function(){};}}}}};deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};if(typeof window.onunload==="function"){var ya=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();ya();};}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};if(typeof window.onbeforeunload==="function"){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){deconcept.SWFObjectUtil.prepUnload();oldBeforeUnload();};}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push===null){Array.prototype.push=function(za){this[this.length]=za;return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;}
var xmp;if(!xmp){xmp={};}else if(typeof xmp!=="object"){throw new Error("xmp already exists and is not an object");}
xmp=function(){};xmp._globalNamespace=this;xmp.getGlobalNamespace=function(){return xmp._globalNamespace;};xmp.isBrowserEnvironment=function(){return(typeof(window)!=='undefined');};xmp.createNamespace=function(ns){var Aa=ns.split(".");var Ba=xmp.getGlobalNamespace();for(var i=0;i<Aa.length;i++){if(typeof(Ba[Aa[i]])==="undefined"){Ba[Aa[i]]={};}
Ba=Ba[Aa[i]];}};xmp.extractErrorMessage=function(e){if(e instanceof Error){return('Error name: '+e.name+', Error message: '+e.message);}
else{return"UNKNOWN ERROR";}};xmp.chooseValueOrDefault=function(Ca,Da){if(!((arguments.length===2)&&(Da!==null)&&(typeof Da!=='undefined'))){throw new xmp.util.internals.InvalidArgsError("Invalid invalid 'defaultValue' (undefined or null).");}
return(typeof Ca===typeof Da)?Ca:Da;};xmp.trimString=function(Ea){return Ea.replace(/^\s*/,'').replace(/\s*$/,'');};xmp.isNonEmptyString=function(Fa){return((typeof(Fa)==='string')&&(Fa!==null)&&(Fa.length>0));};xmp.getNamespacedMethod=function(Ga){var Ha=xmp.splitMethodAndNamespace(Ga);var Ia=xmp.getObjectFromString(Ha.ns);return Ia[Ha.method];};xmp.splitMethodAndNamespace=function(Ja){var Ka=Ja.lastIndexOf('.');var La={};La.method=Ja;La.ns='';if(Ka!==-1){La.method=Ja.substring(Ka+1);La.ns=Ja.substring(0,Ka);}
return La;};xmp.getObjectFromString=function(Ma){var Na=Ma.split('.');var o=xmp.getGlobalNamespace();for(var i=0;i<Na.length;i++){o=o[Na[i]];}
return o;};xmp.isNumber=function(Oa,Pa){var Qa=0;for(var i=0;i<Oa.length;i++){var Ra=Oa.charCodeAt(i);if(Ra>=48&&Ra<=57){continue;}
if(Ra===45){if(i!==0){return false;}
continue;}
if(Ra===46){if(!Pa){return false;}
Qa++;if(Qa>1){return false;}
continue;}
return false;}
return true;};xmp.escapeHtml=function(Sa,Ta,Ua){var Va='';var Wa='@';for(var i=0;i<Sa.length;i++){var c=Sa.charAt(i);switch(c){case'&':Va+='&amp;';break;case'<':Va+='&lt;';break;case'>':Va+='&gt;';break;case'\"':Va+='&quot;';break;case'\'':if(false===Ta){Va+='&apos;';}break;case' ':if(Ua&&Wa===' '){Va+='&nbsp;';}
else{Va+=c;}
break;default:Va+=c;break;}
Wa=c;}
Va=Va.replace(/\r/g,'');if(Ua){Va=Va.replace(/\n/g,'<br>');Va=Va.replace(/\t/g,'&nbsp;&nbsp;&nbsp;&nbsp;');}
return Va;};xmp.validateArguments=function(Xa,Ya,Za){if((Xa.length>Ya.length)||Xa.length<Ya.length){throw new xmp.util.internals.InvalidArgsError("Invalid argument count \""+Xa.length+"\" for function/method \""+Za+"\".  Expected count was \""+Ya.length+"\".");}
for(var i=0;i<Xa.length;i++){if(Ya[i]===xmp.UNKNOWN_TYPE||typeof(Xa[i])===Ya[i]){continue;}
throw new xmp.util.internals.InvalidArgsError("Invalid \""+Za+"\" function/method argument \""+i+"\" data type \""+typeof(Xa[i])+"\".  Expected data type was \""+Ya[i]+"\".");}};xmp.isDefined=function($a){return(typeof($a)!==xmp.UNDEFINED_TYPE);};xmp.fatalErrorCallback=null;xmp.handleFatalError=function(e){if(xmp.fatalErrorCallback!==null){xmp.fatalErrorCallback.call(e);}
else{xmp.showFatalErrorMessage(e.message);}};xmp.showFatalErrorMessage=function(ab){xmp.showMessage(ab);};xmp.showMessage=function(bb){window.alert(bb);};xmp.escapeText=function(db){var eb=db.replace(/\"/g,"\\\"");eb=eb.replace(/\'/g,"\\\'");return eb.replace(/\n/g,"\\n");};xmp.formatTimeString=function(fb){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"formatTimeString");var gb="";if(fb<60){gb="00:";if(fb===0){gb+="00";}
else{if(fb<10){gb+="0"+fb;}
else{gb+=fb;}}}
else{var hb=Math.floor(fb/60);gb=((hb<10)?"0"+hb+":":hb+":");var ib=(fb-(hb*60));if(ib===0){gb+="00";}
else{if(ib<10){gb+="0"+ib;}
else{gb+=ib;}}}
return gb;};xmp.getSWFRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('swf')+'/';};xmp.makeSWFVersionedFileName=function(jb){return xmp.util.Version.makeFileVersionString(jb,'swf');};xmp.makeSWFPath=function(kb,lb){var mb=xmp.getSWFRoot();if(lb){mb+=xmp.makeSWFVersionedFileName(kb);}
else{mb+=(kb+'.swf');}
return mb;};xmp.getImageRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('image');};xmp.getBrowserVersion=function(){return xmp.util.internals.BrowserDetect.version;};xmp.isWindowsOS=function(){return(xmp.util.internals.BrowserDetect.OS===xmp.WINDOWS_PLATFORM);};xmp.isWindowsVistaOS=function(){return(navigator.userAgent.toLowerCase().indexOf('windows nt 6.0')!==-1);};xmp.isMacOSX=function(){return(navigator.userAgent.toLowerCase().indexOf("mac os x")>=0);};xmp.isMacOS=function(){return(xmp.util.internals.BrowserDetect.OS===xmp.MAC_PLATFORM);};xmp.isIEBrowser=function(){return(navigator.appName.indexOf(xmp.MICROSOFT_BROWSER)!==-1);};xmp.isFirefoxBrowser=function(){return(xmp.util.internals.BrowserDetect.browser===xmp.FIREFOX_BROWSER);};xmp.isSafariBrowser=function(){return(xmp.util.internals.BrowserDetect.browser===xmp.SAFARI_BROWSER);};xmp.isOperaBrowser=function(){return(navigator.appName.indexOf(xmp.OPERA_BROWSER)!==-1);};xmp.findDomElement=function(nb){var el=((xmp.isIEBrowser()||xmp.isOperaBrowser())?window[nb]:document[nb]);if(!el){el=document.getElementById(nb);}
return el;};xmp.getDomParent=function(ob){var pb=((xmp.isIEBrowser()||xmp.isOperaBrowser())?ob.parentElement:ob.parentNode);return pb;};xmp.getEventDomTarget=function(qb){var rb=(xmp.isIEBrowser()?qb.srcElement:qb.currentTarget);return rb;};xmp.findDomAncestorByTagName=function(sb,tb){while(sb!==null){if(sb.tagName.toLowerCase()===tb.toLowerCase()){return sb;}
sb=xmp.getDomParent(sb);}
return null;};xmp.insertDomChildBefore=function(ub,vb,wb){wb=(wb)?wb:null;if(xmp.isIEBrowser()&&(wb===null)){ub.insertBefore(vb);}
else{ub.insertBefore(vb,wb);}};xmp.addComboOption=function(xb,yb){if(xmp.isIEBrowser()){xb.add(yb);}
else{xb.add(yb,null);}};xmp.addDynamicStyle=function(zb,Ab){var Bb=false;try{if(typeof(document.styleSheets[0].addRule)!=='undefined'){document.styleSheets[0].addRule(zb,Ab);Bb=true;}
else if(typeof(document.styleSheets[0].insertRule)!=='undefined'){document.styleSheets[0].insertRule(zb+'  '+Ab,0);Bb=true;}}
catch(e){}
return Bb;};xmp.getPixelUnits=function(Cb){return parseInt(Cb,10)+"px";};xmp.DERIVE_CLASS=function(Db,Eb){function Inheritance(){}
Inheritance.prototype=Db.prototype;Eb.prototype=new Inheritance();Eb.prototype.constructor=Eb;Eb.ctor=Db;Eb.base=Db.prototype;};xmp.getQueryArg=function(Fb){xmp.getQueryArg._fault();var Gb=xmp.getQueryArg._map[Fb];return(Gb)?Gb:null;};xmp.getQueryArgOpt=function(Hb,Ib){var Jb=xmp.getQueryArg(Hb);return(Jb)?Jb:Ib;};xmp.getQueryArg._map=null;xmp.getQueryArg._fault=function(){if(xmp.getQueryArg._map!==null){return;}
xmp.getQueryArg._map={};var Kb=window.location.search.substring(1);var Lb=Kb.split("&");for(var i=0;i<Lb.length;i++){var Mb=Lb[i].indexOf('=');if(Mb>0){var Nb=Lb[i].substring(0,Mb);var Ob=decodeURIComponent(Lb[i].substring(Mb+1));xmp.getQueryArg._map[Nb]=Ob;}}};xmp.trueTypeOf=function(Pb){var Qb=typeof(Pb);if(Pb===null){Qb='null';}
try{switch(Qb){case'undefined':case'null':case'string':case'boolean':case'number':break;case'object':case'function':switch(Pb.constructor){case String:Qb='String';break;case Boolean:Qb='Boolean';break;case Number:Qb='Number';break;case Array:Qb='Array';break;case RegExp:Qb='RegExp';break;case Function:Qb='Function';break;default:var m=Pb.constructor.toString().match(/function\s*([^( ]+)\(/);if(m){Qb=m[1];}
break;}
break;default:break;}}
finally{Qb=Qb.substr(0,1).toUpperCase()+Qb.substr(1);return Qb;}};xmp.zeroPad=function(Rb,Sb){var Tb='';Tb+=Rb;var Ub=Tb.length;for(var i=Ub;i<Sb;i++){Tb=('0'+Tb);}
return Tb;};xmp.MapIterator=function(Vb,Wb){this._map=Vb;this._keys=(Wb)?xmp.MapIterator.extractKeysSorted(Vb):xmp.MapIterator.extractKeys(Vb);this._current=-1;this.first();};xmp.MapIterator.create=function(Xb){return new xmp.MapIterator(Xb,false);};xmp.MapIterator.createSorted=function(Yb){return new xmp.MapIterator(Yb,true);};xmp.MapIterator.extractKeys=function(Zb){var $b=[];if(!Zb){return $b;}
var ac='';var bc=(typeof(Zb.hasOwnProperty)!=='undefined');for(ac in Zb){if((!bc)||(bc&&Zb.hasOwnProperty(ac))){$b.push(ac);}}
return $b;};xmp.MapIterator.extractKeysSorted=function(cc){return xmp.MapIterator.extractKeys(cc).sort();};xmp.MapIterator.prototype.first=function(){this._current=0;};xmp.MapIterator.prototype.hasNext=function(){return(!this.isDone());};xmp.MapIterator.prototype.isDone=function(){return(this._current>=this._keys.length);};xmp.MapIterator.prototype.next=function(){this._current++;};xmp.MapIterator.prototype.currentKey=function(){this._checkDone();return this._keys[this._current];};xmp.MapIterator.prototype.currentValue=function(){return this._map[this.currentKey()];};xmp.MapIterator.prototype.updateCurrentValue=function(dc){this._map[this.currentKey()]=dc;};xmp.MapIterator.prototype._checkDone=function(){if(this.isDone()){throw new Error('MapIterator out of bounds.');}};xmp.MapIterator.prototype.getKeyArray=function(){return this._keys;};xmp.MapIterator.prototype.getValueArray=function(){var ec=[];for(var i=0;i<this._keys.length;i++){ec.push(this._map[this._keys[i]]);}
return ec;};xmp.UNKNOWN_TYPE="unknown";xmp.OBJECT_TYPE="object";xmp.STRING_TYPE="string";xmp.BOOLEAN_TYPE="boolean";xmp.NUMBER_TYPE="number";xmp.FUNCTION_TYPE="function";xmp.UNDEFINED_TYPE="undefined";xmp.TRUE="true";xmp.FALSE="false";xmp.MICROSOFT_BROWSER="Microsoft";xmp.OPERA_BROWSER="Opera";xmp.FIREFOX_BROWSER="Firefox";xmp.SAFARI_BROWSER="Safari";xmp.WINDOWS_PLATFORM="Windows";xmp.MAC_PLATFORM="Mac";xmp.UNKNOWN_ERROR="UnknownError";xmp.ROOT_URL="rootUrl";xmp.NO_DEFAULT_VALUE="";xmp.DELIMITER="|";xmp.ID_ATTRIBUTE="id";xmp.NAME_ATTRIBUTE="name";xmp.DEFAULT_TIMER_INTERVAL=100;xmp.SYNCH_UNIT="SynchUnit";xmp.CONNECTING="Connecting";xmp.CONNECTED="Connected";xmp.OPEN="Open";xmp.BUFFERING="Buffering";xmp.FIRST_FRAME_RENDERED="FirstFrameRendered";xmp.MONITOR_INTERVAL=1000;xmp.DISPLAY_NONE="none";xmp.DISPLAY_BLOCK="block";xmp.DISPLAY_INLINE="inline";xmp.CONTEXT="context";xmp.VOLUME="volume";xmp.MUTE="mute";xmp.BLACK_BACKGROUND_COLOR="#000000";xmp.NO_TIME_LIMIT=-1;xmp.IS_AVAILABLE="IsAvailable";xmp.GET_POSITION="GetPosition";xmp.GET_DURATION="GetDuration";xmp.GET_VOLUME="GetVolume";xmp.SET_VOLUME="SetVolume";xmp.GET_MUTE="GetMute";xmp.SET_MUTE="SetMute";xmp.FULLSCREEN="Fullscreen";xmp.GET_FULLSCREEN="GetFullscreen";xmp.SET_FULLSCREEN="SetFullscreen";xmp.GET_BUFFERING_PROGRESS="GetBufferingProgress";xmp.TYPE="type";xmp.ON_DEMAND_STREAMING_MODE="vod";xmp.LIVE_STREAMING_MODE="live";xmp.CONTROL_STREAMING_MODE="control";xmp.AD_STREAMING_MODE="ad";xmp.WIDTH="width";xmp.HEIGHT="height";xmp.MT_PLAYER_BOOTSTRAP="bootstrap";xmp.MT_PLAYER_PLAYLIST_ENDED="playlist_ended";xmp.createNamespace("xmp.net");xmp.net.AbstractTransport=function(fc,gc,hc,ic,jc){this._requestId=fc;this._loadId=gc;this._callback=hc;this._cfg=ic;this._contentType=jc;this._response=new xmp.net.AjaxResponse(gc);this._timer=null;this._manager=xmp.net.AjaxRequestManager.getInstance();this._response.setFullUrl(this._cfg.rootUrl+this._response.getId());};xmp.net.AbstractTransport.prototype.getRequestId=function(){return this._requestId;};xmp.net.AbstractTransport.prototype.getLoadId=function(){return this._loadId;};xmp.net.AbstractTransport.prototype.getResponse=function(){return this._response;};xmp.net.AbstractTransport.prototype.getCallback=function(){return this._callback;};xmp.net.AbstractTransport.prototype.getConfiguration=function(){return this._cfg;};xmp.net.AbstractTransport.prototype.getContentType=function(){return this._contentType;};xmp.net.AbstractTransport.prototype.setLoadedData=function(kc){throw new Error("Not supported.");};xmp.net.AbstractTransport.prototype.request=function(lc,mc){throw new Error("Must override.");};xmp.net.AbstractTransport.prototype.makeReport=function(){var nc='';nc+=('Request ID: '+this.getRequestId()+', ');nc+=('Transport Type: '+xmp.net.TransportTypes.stringify(this.getConfiguration().transportType)+', ');nc+=('Load ID: '+this.getLoadId()+', ');nc+=('Root URL: '+this.getConfiguration().rootUrl+', ');nc+=('Content Type: '+xmp.net.ContentTypes.stringify(this.getContentType()));return nc;};xmp.net.AbstractTransport.prototype._getManager=function(){return this._manager;};xmp.net.AbstractTransport.prototype._handleTimeout=function(){throw new Error("Must override.");};xmp.net.AbstractTransport.prototype._startTimer=function(){if(this._timer){this._timer.start();}};xmp.net.AbstractTransport.prototype._stopTimer=function(){if(this._timer){this._timer.stop();}};xmp.net.AbstractTransport.prototype._checkAndCreateTimer=function(){if(this._timer){this._timer.stop();}
var oc=this.getConfiguration().timeout;if(oc!==-1){if(this._timer===null){this._timer=new xmp.util.Timer(this.getRequestId(),oc,1,new xmp.util.Callback(this.getRequestId(),this._handleTimer,this));}
return true;}
return false;};xmp.net.AbstractTransport.prototype._handleTimer=function(pc,qc){this._stopTimer();this._handleTimeout();};xmp.createNamespace("xmp.net");xmp.net.AbstractTagTransport=function(rc,sc,tc,uc,vc){xmp.net.AbstractTagTransport.ctor.call(this,rc,sc,tc,uc,vc);this._timedOut=false;};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.AbstractTagTransport);xmp.net.AbstractTagTransport.prototype.setLoadedData=function(wc){this._completeResponse(wc);};xmp.net.AbstractTagTransport.prototype.request=function(xc,yc){try{this._timedOut=false;this._checkAndCreateTimer();var zc=this.getConfiguration().rootUrl+xc;if(yc!==null){throw new Error("Headers not supported");}
this._initTag(zc);this._startTimer();}
catch(e){this._finiTag();this._stopTimer();this.getResponse()._setError(e);this._getManager()._handleCompleteRequest(this);}};xmp.net.AbstractTagTransport.prototype._initTag=function(Ac){throw new Error("Must override this method!");};xmp.net.AbstractTagTransport.prototype._finiTag=function(){throw new Error("Must override this method!");};xmp.net.AbstractTagTransport.prototype._makeTagId=function(){throw new Error("Must override this method!");};xmp.net.AbstractTagTransport.prototype._getLogger=function(){throw new Error("Must override this method!");};xmp.net.AbstractTagTransport.prototype._completeResponse=function(Bc){try{this._stopTimer();if(this._timedOut){this._getLogger('Dropping data, request timed out.');return;}
if(this.getContentType()===xmp.net.ContentTypes.TEXT){if(typeof Bc!=='string'){throw new Error('Requested text but got data of type:'+(typeof Bc));}
this.getResponse()._setText(Bc);}
else if(this.getContentType()===xmp.net.ContentTypes.JSON){var Cc=null;if(typeof Bc==='string'){Cc=this._getManager()._parseJson(Bc);}
else if(typeof Bc==='object'&&Bc!==null){Cc=Bc;}
if(Cc!==null){this.getResponse()._setJsonObject(Cc);}
else{throw new Error('Requested JSON but got wrong data type:'+Bc);}}}
catch(e){this.getResponse()._setError(e);}
this._finiTag();this._getManager()._handleCompleteRequest(this);};xmp.net.AbstractTagTransport.prototype._handleTimeout=function(){this._timedOut=true;this.getResponse()._setTimedOut();this._finiTag();this._getManager()._handleCompleteRequest(this);};xmp.createNamespace("xmp.net");xmp.net.AdService=function(){this.p_AD_RESPONSE_EVENT="response";this.p_AD_ERROR_EVENT="error";this.p_initCallback={};this.p_responseCallback={};this.p_errorCallback={};this.p_requestTimeout=30000;this.p_FLASH_ADSERVICE_COMPONENT="AdServiceAdapter";this.p_FLASH_ADSERVICE_COMPONENT_NAME="xmpAdService";this.p_FLASH_ADSERVICE_COMPONENT_CONTAINER_NAME="xmpAdServiceContainer";this.p_FLASH_FABRIDGE_NAME="xmpAdServiceBridge";};xmp.net.AdService.p_singeltonInstance=null;xmp.net.AdService.i_getInstance=function(){if(xmp.net.AdService.p_singeltonInstance===null){xmp.net.AdService.p_singeltonInstance=new xmp.net.AdService();}
return xmp.net.AdService.p_singeltonInstance;};xmp.net.AdService.prototype.i_init=function(Dc,Ec){this.p_initCallback=Dc;if(Ec!==undefined){this.p_requestTimeout=Ec;}
this.p_createFlashAdService();xmp.FABridge.addInitializationCallback(this.p_FLASH_FABRIDGE_NAME,this.p_bridgeInitCallback);};xmp.net.AdService.prototype.p_createFlashAdService=function(){if(document.getElementById(this.p_FLASH_ADSERVICE_COMPONENT_CONTAINER_NAME)===null){var Fc=document.createElement("div");Fc.setAttribute(xmp.ID_ATTRIBUTE,this.p_FLASH_ADSERVICE_COMPONENT_CONTAINER_NAME);Fc.setAttribute(xmp.NAME_ATTRIBUTE,this.p_FLASH_ADSERVICE_COMPONENT_CONTAINER_NAME);xmp.insertDomChildBefore(document.body,Fc);var Gc=new SWFObject(this.p_makeSWFPath(),this.p_FLASH_ADSERVICE_COMPONENT_NAME,1,1,8,"#FFFFFF");Gc.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);Gc.addVariable('bridgeName',this.p_FLASH_FABRIDGE_NAME);Gc.write(this.p_FLASH_ADSERVICE_COMPONENT_CONTAINER_NAME);}};xmp.net.AdService.prototype.p_makeSWFPath=function(){return xmp.makeSWFPath(this.p_FLASH_ADSERVICE_COMPONENT,false);};xmp.net.AdService.prototype.i_setResponseCallback=function(Hc){this.p_responseCallback=Hc;};xmp.net.AdService.prototype.i_setErrorCallback=function(Ic){this.p_errorCallback=Ic;};xmp.net.AdService.prototype.p_bridgeInitCallback=function(){xmp.net.AdService.i_getInstance().p_setupBridge();};xmp.net.AdService.prototype.p_setupBridge=function(){this.p_flexApp=xmp.FABridge[this.p_FLASH_FABRIDGE_NAME].root();this.p_service=this.p_flexApp.createService(this.p_requestTimeout);this.p_service.addEventListener(this.p_AD_RESPONSE_EVENT,this.p_handleAdServiceResponse);this.p_service.addEventListener(this.p_AD_ERROR_EVENT,this.p_handleAdServiceError);this.p_initCallback.call();};xmp.net.AdService.prototype.p_handleAdServiceResponse=function(Jc){xmp.net.AdService.i_getInstance().p_responseCallback.call(Jc);};xmp.net.AdService.prototype.p_handleAdServiceError=function(Kc){xmp.net.AdService.i_getInstance().p_errorCallback.call(Kc);};xmp.net.AdService.prototype.i_createRequest=function(Lc,Mc,Nc,Oc,Pc){if(Mc===undefined){Mc="";}
if(Nc===undefined){Nc="";}
if(Oc===undefined){Oc=[];}
if(Pc===undefined){Pc="GET";}
var Qc=this.p_flexApp.createRequest(Lc,Mc,Nc,Oc,Pc);return Qc;};xmp.net.AdService.prototype.i_makeRequest=function(Rc){this.p_service.makeRequest(Rc);};xmp.createNamespace("xmp.net");xmp.net.AjaxRequestManager=function(){this._logger=new xmp.util.internals.CategoryLogger('AjaxRequestManager');this._loggerByTypeMap={};this._DEFAULT_TIMEOUT=30000;this._DEFAULT_TRANSPORT_TYPE=xmp.net.TransportTypes.stringify(xmp.net.TransportTypes.FLASH_XHR);this._DEFAULT_RETRIES=1;this._DEFAULT_WAIT_BETWEEN_RETRIES=0;this._DEFAULT_REQUEST_VERB='GET';this._requestIdCounter=0;this._requestMap={};};xmp.net.AjaxRequestManager.POST_FORM_TYPE='post_form';xmp.net.AjaxRequestManager._singeltonInstance=null;xmp.net.AjaxRequestManager.getInstance=function(){if(xmp.net.AjaxRequestManager._singeltonInstance===null){xmp.net.AjaxRequestManager._singeltonInstance=new xmp.net.AjaxRequestManager();}
return xmp.net.AjaxRequestManager._singeltonInstance;};xmp.net.AjaxRequestManager.prototype.init=function(Sc){xmp.net.FlashXhrTransportManager.getInstance().init(Sc);};xmp.net.AjaxRequestManager.handleLoaded=function(Tc,Uc){xmp.net.AjaxRequestManager.getInstance()._handleLoadedCore(Tc,Uc);};xmp.net.AjaxRequestManager.ping=function(Vc,Wc){var cb=new xmp.util.Callback('Ping',xmp.net.AjaxRequestManager._pingCallback,null);xmp.net.AjaxRequestManager.getInstance().request(Wc,cb,Vc,Wc,xmp.net.ContentTypes.PING,null);};xmp.net.AjaxRequestManager._pingCallback=function(Xc,Yc){};xmp.net.AjaxRequestManager.prototype.request=function(Zc,$c,ad,bd,cd,dd){var ok=xmp.isNonEmptyString(Zc)&&xmp.isNonEmptyString(ad)&&xmp.isNonEmptyString(bd);if(ok){ok=($c!==null)&&(typeof $c==='object');}
if(ok){cd=xmp.net.ContentTypes._calc(cd);ok=(cd!==xmp.net.ContentTypes.INVALID);}
if(ok){if(!dd){dd=null;}
ok=((dd===null)||(typeof dd==='object'));}
if(!ok){throw new xmp.util.internals.InvalidArgsError('Invalid arguments, please read documentation for xmp.net.AjaxRequestManager.prototype.request.');}
var ed=this._findConfiguration(ad);if(!ed){throw new Error('Could not find proper configuration for URL root type: '+ad);}
this._requestWithConfiguration(ed,Zc,$c,bd,cd,dd);};xmp.net.AjaxRequestManager.prototype._requestWithConfiguration=function(fd,gd,hd,jd,kd,ld){var md=this._createTransport(fd.transportType,gd,hd,fd,kd);this._requestMap[md.getRequestId()]=md;this._logRequestReport(md,jd,ld);md.request(jd,ld);};xmp.net.AjaxRequestManager.prototype._buildRequestReport=function(nd,od,pd){var qd='Making request = ';qd+=(nd.makeReport()+', ');qd+=('Relative URL: '+od+', ');qd+=('Request Headers: ');if(pd===null){qd+='NONE';}
else{for(var i=0;i<pd.length;i++){var rd=pd[i];qd+=(rd.name+' = '+rd.value);if(i!==(pd.length-1)){qd+=' & ';}}}
return qd;};xmp.net.AjaxRequestManager.prototype._createTransport=function(sd,td,ud,vd,wd){var xd=xmp.net.TransportTypes;var yd=xd._calc(sd);this._requestIdCounter++;var zd=this._requestIdCounter.toString();switch(yd){case xd.XHR:return new xmp.net.XhrTransport(zd,td,ud,vd,wd);case xd.IFRAME:return new xmp.net.IFrameTagTransport(zd,td,ud,vd,wd);case xd.SCRIPT:return new xmp.net.ScriptTagTransport(zd,td,ud,vd,wd);case xd.FLASH_XHR:return new xmp.net.FlashXhrTransport(zd,td,ud,vd,wd);case xd.MOCK:return new xmp.net.MockTransport(zd,td,ud,vd,wd);default:return null;}};xmp.net.AjaxRequestManager.prototype._parseJson=function(Ad){Ad=xmp.trimString(Ad);return this._parseJavaScript('('+Ad+')');};xmp.net.AjaxRequestManager.prototype._parseJavaScript=function(Bd){return eval(Bd);};xmp.net.AjaxRequestManager.prototype._handleCompleteRequest=function(Cd){var Dd=Cd.getRequestId();if(!this._requestMap[Dd]){this._logger.debug("Did not find transport: "+Dd);return;}
delete this._requestMap[Dd];try{if(Cd.getResponse().isError()){if(Cd.getResponse().isTimedOut()||(Cd.getResponse().isCriticalOrFatalError())){var Ed=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR,'ARM',this._buildReponseReport(Cd));this._logger.debug('ARM transport timeout',Ed);}
else{this._logReponseReport(Cd);}}
else{this._logReponseReport(Cd);}
Cd.getCallback().call(Cd.getResponse());}
catch(e){this._logger.trace("Error while calling request callback.",e);}};xmp.net.AjaxRequestManager.prototype._getLoggerByType=function(Fd){var Gd=this._loggerByTypeMap[Fd];if(!Gd){Gd=new xmp.util.internals.CategoryLogger('AjaxRequestManager'+'_'+Fd);this._loggerByTypeMap[Fd]=Gd;}
return Gd;};xmp.net.AjaxRequestManager.prototype._logRequestReport=function(Hd,Id,Jd){var Kd=this._getLoggerByType(Hd.getConfiguration().rootUrlType);if(Kd.isDebugEnabled()){Kd.debug(this._buildRequestReport(Hd,Id,Jd));}};xmp.net.AjaxRequestManager.prototype._logReponseReport=function(Ld){var Md=this._getLoggerByType(Ld.getConfiguration().rootUrlType);if(Md.isDebugEnabled()){Md.debug(this._buildReponseReport(Ld));}};xmp.net.AjaxRequestManager.prototype._buildReponseReport=function(Nd){var Od='Request complete (Request ID: '+Nd.getRequestId()+'), response = '+Nd.getResponse().makeReport();return Od;};xmp.net.AjaxRequestManager.prototype._handleLoadedCore=function(Pd,Qd){try{for(var Rd=xmp.MapIterator.create(this._requestMap);Rd.hasNext();Rd.next()){var Sd=Rd.currentValue();if(Sd.getLoadId()===Pd){Sd.setLoadedData(Qd);return;}}
this._logger.info("Dropping loaded data, could not find transport for: "+Pd);}
catch(e){this._logger.warn("Error while calling _handleLoadedCore.",e);}};xmp.net.AjaxRequestManager.prototype._findConfiguration=function(Td){var Ud=xmp.util.RootUrlProvider.getInstance().getRootUrl(Td);if(Ud.length===0){return null;}
var Vd=xmp.util.RootUrlProvider.getInstance().getRootUrlNode(Td);var Wd=xmp.net.TransportTypes.fromString(Vd.getString('transportType',this._DEFAULT_TRANSPORT_TYPE));if(Wd===xmp.net.TransportTypes.INVALID){return null;}
var Xd={};Xd.rootUrl=Ud;Xd.rootUrlType=Td;Xd.transportType=Wd;Xd.timeout=Vd.getInt('timeout',this._DEFAULT_TIMEOUT);Xd.retries=Vd.getInt('retries',this._DEFAULT_RETRIES);Xd.waitBetweenRetries=Vd.getInt('waitBetweenRetries',this._DEFAULT_WAIT_BETWEEN_RETRIES);Xd.requestVerb=Vd.getString('requestVerb',this._DEFAULT_REQUEST_VERB);return Xd;};xmp.createNamespace("xmp.net");xmp.net.AjaxResponse=function(id){this._id=id;this._fullUrl="";this._errorObject=null;this._jsonObject=null;this._text='';this._timedOutError=false;this._isCriticalOrFatalError=false;};xmp.net.AjaxResponse.prototype.getId=function(){return this._id;};xmp.net.AjaxResponse.prototype.getFullUrl=function(){return this._fullUrl;};xmp.net.AjaxResponse.prototype.setFullUrl=function(Yd){this._fullUrl=Yd;};xmp.net.AjaxResponse.prototype.isError=function(){return(this._errorObject!==null);};xmp.net.AjaxResponse.prototype.isTimedOut=function(){return this._timedOutError;};xmp.net.AjaxResponse.prototype.isCriticalOrFatalError=function(){return this._isCriticalOrFatalError;};xmp.net.AjaxResponse.prototype.getErrorObject=function(){return this._errorObject;};xmp.net.AjaxResponse.prototype.getJsonObject=function(){this._accessGuard();return this._jsonObject;};xmp.net.AjaxResponse.prototype.getText=function(){this._accessGuard();return this._text;};xmp.net.AjaxResponse.prototype.getErrorMessage=function(){if(this.isError()){return xmp.extractErrorMessage(this.getErrorObject());}
else{return'No Error';}};xmp.net.AjaxResponse.prototype._accessGuard=function(){if(this.isError()){var ex=new xmp.net.AjaxResponseException('Tried to access AjaxResponse while in an error state, see nested exception.');ex.message+=('\nNESTED ERROR: '+xmp.extractErrorMessage(this._errorObject));throw ex;}};xmp.net.AjaxResponse.prototype._setError=function(Zd){this._setErrorCore(Zd);};xmp.net.AjaxResponse.prototype._setTimedOut=function(){this._timedOutError=true;this._setErrorCore(new Error("AjaxResponse: Request timed out."));};xmp.net.AjaxResponse.prototype._setJsonObject=function($d){this._jsonObject=$d;};xmp.net.AjaxResponse.prototype._setText=function(ae){this._text=ae;};xmp.net.AjaxResponse.prototype._setErrorCore=function(be){this._isCriticalOrFatalError=false;if(be instanceof Error){this._errorObject=new xmp.net.AjaxResponseException('AjaxResponse, see nested exception');this._errorObject.message+=('\nNESTED ERROR: '+xmp.extractErrorMessage(be));if((be instanceof xmp.FatalException)||(be instanceof xmp.CriticalException)){this._isCriticalOrFatalError=true;}}
else{this._errorObject=new xmp.net.AjaxResponseException("AjaxResponse: UNKNOWN ERROR");}};xmp.net.AjaxResponse.prototype.makeReport=function(){var ce='';ce+=('Response ID: '+this.getFullUrl()+'\n');if(this.isError()){ce+=('Response Text: '+this._text+'\n');ce+=('Response JSON: null\n');ce+=('ERROR Message: '+this.getErrorMessage());}
else{ce+=('Response Text: '+this.getText()+'\n');ce+=('Response JSON: '+((this.getJsonObject()===null)?'null':'not null')+'\n');ce+='SUCCESS';}
return ce;};xmp.net.AjaxResponseException=function(de){this.name="AjaxResponseException";this.message=de;};xmp.DERIVE_CLASS(Error,xmp.net.AjaxResponseException);xmp.createNamespace("xmp.net");xmp.net.ContentTypes=function(){};xmp.net.ContentTypes.INVALID=-1;xmp.net.ContentTypes.TEXT=0;xmp.net.ContentTypes.JSON=1;xmp.net.ContentTypes.PING=2;xmp.net.ContentTypes._BEGIN=-1;xmp.net.ContentTypes._END=2;xmp.net.ContentTypes._calc=function(ee){var fe=xmp.net.ContentTypes;if((typeof ee!=='number')||(ee<fe._BEGIN)||(ee>fe._END)){return fe._BEGIN;}
return ee;};xmp.net.ContentTypes.stringify=function(ge){var he=xmp.net.ContentTypes;var ie=he._calc(ge);switch(ie){case he.INVALID:return'invalid';case he.TEXT:return'text';case he.JSON:return'json';case he.PING:return'ping';default:return'invalid';}};xmp.net.ContentTypes.fromString=function(je){var ke=xmp.net.ContentTypes;switch(je){case'invalid':return ke.INVALID;case'text':return ke.TEXT;case'json':return ke.JSON;case'ping':return ke.PING;default:return ke.INVALID;}};xmp.createNamespace("xmp.net");xmp.net.FlashXhrTransport=function(le,me,ne,oe,pe){xmp.net.FlashXhrTransport.ctor.call(this,le,me,ne,oe,pe);this._FLASH_XML_REQUEST_MIME_TYPE="text/html";this._handle="";this._url="";this._flashXhrManager=xmp.net.FlashXhrTransportManager.getInstance();this._isIEWin=(xmp.isIEBrowser()&&(xmp.util.internals.BrowserDetect.OS===xmp.WINDOWS_PLATFORM));this._requestHeaderArray=null;};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.FlashXhrTransport);xmp.net.FlashXhrTransport.prototype._getHandle=function(){return this._handle;};xmp.net.FlashXhrTransport.prototype._getUrl=function(){return this._url;};xmp.net.FlashXhrTransport.prototype._getRequestVerb=function(){return this.getConfiguration().requestVerb;};xmp.net.FlashXhrTransport.prototype._getRequestMimeType=function(){return this._FLASH_XML_REQUEST_MIME_TYPE;};xmp.net.FlashXhrTransport.prototype._getFlashXhrManager=function(){return this._flashXhrManager;};xmp.net.FlashXhrTransport.prototype._getRequestHeaders=function(){return this._requestHeaderArray;};xmp.net.FlashXhrTransport.prototype.request=function(qe,se){try{this._requestHeaderArray=se;this._url=this.getConfiguration().rootUrl+qe;this._handle=this._getFlashXhrManager().getXhrComponentName()+this.getRequestId();this._getFlashXhrManager().open(this);}
catch(e){this.handleError(e.name,e.message);}};xmp.net.FlashXhrTransport.prototype.doRequest=function(){this._checkAndCreateTimer();this._getFlashXhrManager().doRequest(this);this._startTimer();};xmp.net.FlashXhrTransport.prototype.handleData=function(te){this._stopTimer();this.getResponse()._setText(te);if(this.getContentType()===xmp.net.ContentTypes.JSON){var ue=this._getManager()._parseJson(te);this.getResponse()._setJsonObject(ue);}
this._getFlashXhrManager().close(this);this._getManager()._handleCompleteRequest(this);};xmp.net.FlashXhrTransport.prototype.handleError=function(ve,we){this._stopTimer();var xe="Type:  "+ve+"\nDescription:  "+we;this._getFlashXhrManager().close(this);var ye=this._extractErrorCode(we);var ze=null;if(this._isIEWin&&(ye===0)){ze=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR,'FlashXhrTransport',we);}
else{ze=new Error(xe);}
this.getResponse()._setError(ze);this._getManager()._handleCompleteRequest(this);};xmp.net.FlashXhrTransport.prototype._extractErrorCode=function(Ae){var re=/XML\/HTTP Error:\s{2}(\d{1,6}) \w*/;var Be=Ae.match(re);if(Be!==null&&Be.length>1){return parseInt(Be[1],0);}
return-1;};xmp.net.FlashXhrTransport.prototype._handleTimeout=function(){this._getFlashXhrManager().close(this);this.getResponse()._setTimedOut();this._getManager()._handleCompleteRequest(this);};xmp.createNamespace("xmp.net");xmp.net.FlashXhrTransportManager=function(){this._logger=new xmp.util.internals.CategoryLogger('FlashXhrTransportManager');this._CREATION_TIMEOUT=5000;this._FLASH_DATA_CALLBACK="dataCallback";this._FLASH_XML_HTTP_REQUEST_COMPONENT="XMLHttpRequest";this._FLASH_XML_HTTP_REQUEST_COMPONENT_NAME="FlashXMLHttpRequest";this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME="FlashXMLHttpRequestContainer";this._initializationState='None';this._FlashXmlHttpRequestRegistry={};this._create_cb=null;this._transitionInitializationState('Uninitialized');};xmp.net.FlashXhrTransportManager._singeltonInstance=null;xmp.net.FlashXhrTransportManager.getInstance=function(){if(xmp.net.FlashXhrTransportManager._singeltonInstance===null){xmp.net.FlashXhrTransportManager._singeltonInstance=new xmp.net.FlashXhrTransportManager();}
return xmp.net.FlashXhrTransportManager._singeltonInstance;};xmp.net.FlashXhrTransportManager.prototype.init=function(Ce){try{if(this._getInitializationState()!=='Uninitialized'){throw new Error('FlashXhrTransportManager - Already started initialization.');}
this._transitionInitializationState('Before creation');this.createFlashXMLHttpRequest();this._transitionInitializationState('After creation');this._create_cb=Ce;var De=new xmp.util.Callback('FlashXhrTransportManager_init',this._handleInitTimeout,this);De.callAsynchEx(this._CREATION_TIMEOUT,[]);}
catch(ex){Ce.call(new Error(xmp.extractErrorMessage(ex)));}};xmp.net.FlashXhrTransportManager.prototype._handleInitTimeout=function(){var Ee=this._create_cb;this._create_cb=null;if(Ee===null){return;}
var Fe=new xmp.baseplayer.ApplicationError(null,'badInitialFlashObject',null,[{label:"Url",text:this._makeSWFPath()}]);this._logger.warn(Fe.message,Fe);Ee.call(xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_PLUGIN_INIT,'FlashXhrTransportManager','timed out intializing flash XHR SWF'));};xmp.net.FlashXhrTransportManager.prototype.getXhrComponentName=function(){return this._FLASH_XML_HTTP_REQUEST_COMPONENT_NAME;};xmp.net.FlashXhrTransportManager.prototype._getXhrComponent=function(){return document.getElementById(this.getXhrComponentName());};xmp.net.FlashXhrTransportManager.prototype.doRequest=function(Ge){this._enforceReadyState();var He=this._getXhrComponent();He.xhrOpen(Ge._getHandle(),Ge._getRequestVerb(),Ge._getRequestMimeType());if(Ge.getContentType()===xmp.net.ContentTypes.PING){He.xhrSetResultData(Ge._getHandle(),'ping');}
var Ie=Ge._getRequestHeaders();if(Ie){for(var i=0;i<Ie.length;i++){var Je=Ie[i];var Ke=Je.name;if(xmp.isNonEmptyString(Je.type)&&(Je.type===xmp.net.AjaxRequestManager.POST_FORM_TYPE)){Ke='_POST_FORM_VAR_:'+Ke;}
He.xhrAddRequestHeader(Ge._getHandle(),Ke,Je.value);}}
He.xhrSend(Ge._getHandle(),Ge._getUrl());};xmp.net.FlashXhrTransportManager.prototype._makeSWFPath=function(){return xmp.makeSWFPath(this._FLASH_XML_HTTP_REQUEST_COMPONENT,true);};xmp.net.FlashXhrTransportManager.prototype.createFlashXMLHttpRequest=function(){if(document.getElementById(this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME)===null){var Le=document.createElement("div");Le.setAttribute(xmp.ID_ATTRIBUTE,this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);Le.setAttribute(xmp.NAME_ATTRIBUTE,this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);xmp.insertDomChildBefore(document.body,Le);var Me=new SWFObject(this._makeSWFPath(),this.getXhrComponentName(),1,1,8,"#FFFFFF");Me.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);Me.addVariable(xmp.CONTEXT,'create_handle');var Ne='xmp.net.FlashXhrTransportManager.getInstance().';Me.addVariable(xmp.FLASH_INITIALIZATION_CALLBACK,Ne+'onInit');Me.addVariable(this._FLASH_DATA_CALLBACK,Ne+'onData');Me.addVariable(xmp.FLASH_ERROR_CALLBACK,Ne+'onError');Me.write(this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);xmp.util.FlashUtility.buildFSCommandScript(Le,this.getXhrComponentName(),Ne+"_handleFSCommand(command, args);");}};xmp.net.FlashXhrTransportManager.prototype.handleInit=function(){this._logger.debug('In handleInit.');if(this._getInitializationState()!=='After creation'){if(this._getInitializationState()!=='Relaying handleInit'){var Oe=new xmp.util.Callback('FlashXhrTransportManager_relay_handleInit',this.handleInit,this);Oe.callAsynch([]);this._transitionInitializationState('Relaying handleInit');}
return;}
var Pe=this._create_cb;this._create_cb=null;if(Pe===null){this.logger.critical("Unexpected: creation callback is null.");return;}
this._transitionInitializationState('Ready');Pe.call('Ready');};xmp.net.FlashXhrTransportManager.prototype.close=function(Qe){this._getXhrComponent().xhrClose(Qe._getHandle());this._FlashXmlHttpRequestRegistry[Qe._getHandle()]=null;delete this._FlashXmlHttpRequestRegistry[Qe._getHandle()];};xmp.net.FlashXhrTransportManager.prototype.open=function(Re){this._enforceReadyState();this._FlashXmlHttpRequestRegistry[Re._getHandle()]=Re;Re.doRequest();};xmp.net.FlashXhrTransportManager.prototype._handleFSCommand=function(Se,Te){try{Se=xmp.util.FlashUtility.normalizeCommand(Se);var Ue='xmp.net.FlashXhrTransportManager.getInstance().';var Ve=xmp.util.FlashUtility;var We=null;switch(Se){case Ue+'onInit':We=Ve.splitFSCommandData(Te,2);this.onInit(We[0],We[1]);break;case Ue+'onData':We=Ve.splitFSCommandData(Te,2);this.onData(We[0],We[1]);break;case Ue+'onError':We=Ve.splitFSCommandData(Te,3);this.onError(We[0],We[1],We[2]);break;default:this._logger.warn('Unrecognized FSCommand: '+Se);break;}}
catch(e){this._logger.warn('Error executing FSCommand: '+Se,e);}};xmp.net.FlashXhrTransportManager.prototype.onInit=function(Xe,Ye){try{this.handleInit();}
catch(e){this._handleError(e,true);}};xmp.net.FlashXhrTransportManager.prototype.onData=function(Ze,$e){try{var af=this._getTransport(Ze);try{af.handleData(xmp.util.FlashUtility.externalInterfaceDecode($e));}
catch(e2){this._handleTransportError(af,e2,true);}}
catch(e){this._handleError(e,false);}};xmp.net.FlashXhrTransportManager.prototype.onError=function(bf,cf,df){try{var ef=this._getTransport(bf);try{ef.handleError(cf,df);}
catch(e2){this._handleTransportError(ef,e2,false);}}
catch(e){this._handleError(e,false);}};xmp.net.FlashXhrTransportManager.prototype._getTransport=function(ff){var gf=this._findTransport(ff);if(!gf){throw new Error("Could not get transport for handle: "+ff);}
return gf;};xmp.net.FlashXhrTransportManager.prototype._findTransport=function(hf){var jf=this._FlashXmlHttpRequestRegistry[hf];return(jf)?jf:null;};xmp.net.FlashXhrTransportManager.prototype._handleError=function(kf,lf){if(lf){this._logger.critical("Error in FlashXhrTransportManager",kf);}
else{this._logger.warn("Error in FlashXhrTransportManager",kf);}};xmp.net.FlashXhrTransportManager.prototype._handleTransportError=function(mf,nf,of){try{if(of){mf.handleError(nf.name,nf.message);}
else{this._handleError(nf,false);this.close(mf);}}
catch(e){var e2=new Error("Error calling _handleTransportError: "+xmp.extractErrorMessage(e)+"\nOriginal error: "+xmp.extractErrorMessage(nf));this._handleError(e2,true);}};xmp.net.FlashXhrTransportManager.prototype._transitionInitializationState=function(pf){this._logger.debug('Transition init state from "'+this._initializationState+'" to "'+pf+'".');this._initializationState=pf;};xmp.net.FlashXhrTransportManager.prototype._getInitializationState=function(){return this._initializationState;};xmp.net.FlashXhrTransportManager.prototype._isInReadyState=function(){return(this._getInitializationState()==='Ready');};xmp.net.FlashXhrTransportManager.prototype._enforceReadyState=function(){if(!this._isInReadyState()){throw new Error("FlashXhrTransportManager is not iniitialized!");}};xmp.createNamespace("xmp.net");xmp.net.IFrameTagTransport=function(qf,rf,sf,tf,uf){xmp.net.IFrameTagTransport.ctor.call(this,qf,rf,sf,tf,uf);this._logger=new xmp.util.internals.CategoryLogger('IFrameTagTransport');};xmp.DERIVE_CLASS(xmp.net.AbstractTagTransport,xmp.net.IFrameTagTransport);xmp.net.IFrameTagTransport.prototype._initTag=function(vf){var wf=document.createElement('iframe');wf.id=this._makeTagId();document.body.appendChild(wf);wf.src=vf;};xmp.net.IFrameTagTransport.prototype._finiTag=function(){try{var xf=document.getElementById(this._makeTagId());if(xf){document.body.removeChild(xf);}}
catch(e){this._logger.warn('Error removing tag with ID: '+this._makeTagId(),e);}};xmp.net.IFrameTagTransport.prototype._makeTagId=function(){return'IFrameTagTransport'+'_'+this.getRequestId();};xmp.net.IFrameTagTransport.prototype._getLogger=function(){return this._logger;};xmp.createNamespace("xmp.net");xmp.net.MockTransport=function(yf,zf,Af,Bf,Cf){xmp.net.MockTransport.ctor.call(this,yf,zf,Af,Bf,Cf);};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.MockTransport);xmp.net.MockTransport.prototype.request=function(Df,Ef){this._url=Df;this.doRequest();};xmp.net.MockTransport.prototype.doRequest=function(){this._checkAndCreateTimer();this._startTimer();if(this._networkDelayTimer){this._networkDelayTimer.stop();}
this._dataItem=xmp.net.MockTransportData.getInstance().getItem(this._url);var Ff=this._dataItem?this._dataItem.delay:200;this._networkDelayTimer=new xmp.util.Timer(this.getRequestId(),Ff,1,new xmp.util.Callback(this.getRequestId(),this._handleRequest,this));this._networkDelayTimer.start();};xmp.net.MockTransport.prototype._handleRequest=function(Gf,Hf){Hf.stop();try{if(this._dataItem){this.handleData(this._dataItem.data);}
else{this.handleError("MockTransportError","No mock data found for "+this._url);}}
catch(e){this.handleError(e.nam,e.message);}};xmp.net.MockTransport.prototype.handleData=function(If){this._stopTimer();var Jf=null;var Kf=null;if(typeof If==='string'){Jf=If;}
else{Kf=If;Jf="";}
this.getResponse()._setText(Jf);if(this.getContentType()===xmp.net.ContentTypes.JSON){if(!Kf){Kf=this._getManager()._parseJson(Jf);}
this.getResponse()._setJsonObject(Kf);}
this._getManager()._handleCompleteRequest(this);};xmp.net.MockTransport.prototype.handleError=function(Lf,Mf){this._stopTimer();var Nf="Type:  "+Lf+"\nDescription:  "+Mf;this.getResponse()._setError(new Error(Nf));this._getManager()._handleCompleteRequest(this);};xmp.net.MockTransport.prototype._handleTimeout=function(){this.getResponse()._setTimedOut();this._getManager()._handleCompleteRequest(this);};xmp.createNamespace("xmp.net");xmp.net.MockTransportData=function(){this._logger=new xmp.util.internals.CategoryLogger('MockTransportData');this._dataMap={};};xmp.net.MockTransportData._singeltonInstance=null;xmp.net.MockTransportData.getInstance=function(){if(xmp.net.MockTransportData._singeltonInstance===null){xmp.net.MockTransportData._singeltonInstance=new xmp.net.MockTransportData();}
return xmp.net.MockTransportData._singeltonInstance;};xmp.net.MockTransportData.prototype.setDataMap=function(Of){this._dataMap=Of;};xmp.net.MockTransportData.prototype.getDataMap=function(){return this._dataMap;};xmp.net.MockTransportData.prototype.setItem=function(Pf,Qf){var Rf=this._transformUrl(Pf);this._dataMap[Rf]=Qf;};xmp.net.MockTransportData.prototype.getItem=function(Sf){this._logger.info("MockTransportData.getData for "+Sf);var Tf=this._transformUrl(Sf);return this._dataMap[Tf];};xmp.net.MockTransportData.prototype._transformUrl=function(Uf){var Vf=this._hasTileId(Uf)?this._removeTileId(Uf):Uf;return Vf;};xmp.net.MockTransportData.prototype._hasTileId=function(Wf){return Wf.match(/tile=\d+/);};xmp.net.MockTransportData.prototype._removeTileId=function(Xf){var Yf=Xf.replace(/tile=\d+&/,'');if(Yf===Xf){Yf=Xf.replace(/&tile=\d+/,'');}
return Yf;};xmp.createNamespace("xmp.net");xmp.net.ScriptTagTransport=function(Zf,$f,ag,bg,cg){xmp.net.ScriptTagTransport.ctor.call(this,Zf,$f,ag,bg,cg);this._logger=new xmp.util.internals.CategoryLogger('ScriptTagTransport');};xmp.DERIVE_CLASS(xmp.net.AbstractTagTransport,xmp.net.ScriptTagTransport);xmp.net.ScriptTagTransport.prototype._initTag=function(dg){var eg=document.createElement('script');eg.id=this._makeTagId();document.body.appendChild(eg);eg.src=dg;};xmp.net.ScriptTagTransport.prototype._finiTag=function(){try{var fg=document.getElementById(this._makeTagId());if(fg){document.body.removeChild(fg);}}
catch(e){this._logger.warn('Error removing tag with ID: '+this._makeTagId(),e);}};xmp.net.ScriptTagTransport.prototype._makeTagId=function(){return'ScriptTagTransport'+'_'+this.getRequestId();};xmp.net.ScriptTagTransport.prototype._getLogger=function(){return this._logger;};xmp.createNamespace("xmp.net");xmp.net.TransportTypes=function(){};xmp.net.TransportTypes.INVALID=-1;xmp.net.TransportTypes.XHR=0;xmp.net.TransportTypes.IFRAME=1;xmp.net.TransportTypes.SCRIPT=2;xmp.net.TransportTypes.FLASH_XHR=3;xmp.net.TransportTypes.MOCK=4;xmp.net.TransportTypes._BEGIN=-1;xmp.net.TransportTypes._END=4;xmp.net.TransportTypes._calc=function(gg){var hg=xmp.net.TransportTypes;if((typeof gg!=='number')||(gg<hg._BEGIN)||(gg>hg._END)){return hg._BEGIN;}
return gg;};xmp.net.TransportTypes.stringify=function(ig){var jg=xmp.net.TransportTypes;var kg=jg._calc(ig);switch(kg){case jg.INVALID:return'invalid';case jg.XHR:return'xhr';case jg.IFRAME:return'iframe';case jg.SCRIPT:return'script';case jg.FLASH_XHR:return'flash';case jg.MOCK:return'mock';default:return'invalid';}};xmp.net.TransportTypes.fromString=function(lg){var mg=xmp.net.TransportTypes;switch(lg){case'invalid':return mg.INVALID;case'xhr':return mg.XHR;case'iframe':return mg.IFRAME;case'script':return mg.SCRIPT;case'flash':return mg.FLASH_XHR;case'mock':return mg.MOCK;default:return mg.INVALID;}};xmp.createNamespace("xmp.net");xmp.net.XhrTransport=function(ng,og,pg,qg,rg){xmp.net.XhrTransport.ctor.call(this,ng,og,pg,qg,rg);this._requestObject=this._createRequestObject();var sg=this;this._requestObject.onreadystatechange=function(){sg._handleStateChange();};};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.XhrTransport);xmp.net.XhrTransport.prototype.request=function(tg,ug){try{this._checkAndCreateTimer();var vg=this.getConfiguration().rootUrl+tg;this._requestObject.open('GET',vg);if(ug!==null){for(var i=0;i<ug.length;i++){var wg=ug[i];this._requestObject.setRequestHeader(wg.name,wg.value);}}
this._requestObject.send(null);this._startTimer();}
catch(e){this._stopTimer();this.getResponse()._setError(e);this._getManager()._handleCompleteRequest(this);}};xmp.net.XhrTransport.prototype._completeResponse=function(){try{this._stopTimer();if(this._requestObject.status!==200){throw new Error('Status: '+this._requestObject.status);}
var xg=this._requestObject.responseText;this.getResponse()._setText(xg);if(this.getContentType()===xmp.net.ContentTypes.JSON){var yg=this._getManager()._parseJson(xg);this.getResponse()._setJsonObject(yg);}}
catch(e){this.getResponse()._setError(e);}
this._getManager()._handleCompleteRequest(this);};xmp.net.XhrTransport.prototype._handleTimeout=function(){this._requestObject.abort();this.getResponse()._setTimedOut();this._getManager()._handleCompleteRequest(this);};xmp.net.XhrTransport.prototype._handleStateChange=function(){if(this._requestObject.readyState===4){this._completeResponse();}};xmp.net.XhrTransport._factories=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject('Msxml2.XMLHTTP');},function(){return new ActiveXObject('Microsoft.XMLHTTP');}];xmp.net.XhrTransport._factory=null;xmp.net.XhrTransport.prototype._createRequestObject=function(){if(xmp.net.XhrTransport._factory!==null){return xmp.net.XhrTransport._factory();}
for(var i=0;i<xmp.net.XhrTransport._factories.length;i++){try{var zg=xmp.net.XhrTransport._factories[i];var Ag=zg();if(Ag!==null){xmp.net.XhrTransport._factory=zg;return Ag;}}
catch(e){continue;}}
xmp.net.XhrTransport._factory=function(){throw new Error('XMLHttpRequest not supported.');};xmp.net.XhrTransport._factory();return null;};var xmp=xmp||{};xmp.FABridge=function(target,bridgeName)
{this.target=target;this.remoteTypeCache={};this.remoteInstanceCache={};this.remoteFunctionCache={};this.localFunctionCache={};this.bridgeID=xmp.FABridge.nextBridgeID++;this.name=bridgeName;this.nextLocalFuncID=0;xmp.FABridge.instances[this.name]=this;xmp.FABridge.idMap[this.bridgeID]=this;return this;}
xmp.FABridge.TYPE_ASINSTANCE=1;xmp.FABridge.TYPE_ASFUNCTION=2;xmp.FABridge.TYPE_JSFUNCTION=3;xmp.FABridge.TYPE_ANONYMOUS=4;xmp.FABridge.initCallbacks={};xmp.FABridge.userTypes={};xmp.FABridge.addToUserTypes=function()
{for(var i=0;i<arguments.length;i++)
{xmp.FABridge.userTypes[arguments[i]]={'typeName':arguments[i],'enriched':false};}}
xmp.FABridge.argsToArray=function(args)
{var result=[];for(var i=0;i<args.length;i++)
{result[i]=args[i];}
return result;}
xmp.FABridge.instanceFactory=function(objID)
{this.fb_instance_id=objID;return this;}
xmp.FABridge__invokeJSFunction=function(args)
{var funcID=args[0];var throughArgs=args.concat();throughArgs.shift();var bridge=xmp.FABridge.extractBridgeFromID(funcID);return bridge.invokeLocalFunction(funcID,throughArgs);}
xmp.FABridge.addInitializationCallback=function(bridgeName,callback)
{var inst=xmp.FABridge.instances[bridgeName];if(inst!=undefined)
{callback.call(inst);return;}
var callbackList=xmp.FABridge.initCallbacks[bridgeName];if(callbackList==null)
{xmp.FABridge.initCallbacks[bridgeName]=callbackList=[];}
callbackList.push(callback);}
xmp.FABridge__bridgeInitialized=function(bridgeName){var objects=document.getElementsByTagName("object");var ol=objects.length;var activeObjects=[];if(ol>0){for(var i=0;i<ol;i++){if(typeof objects[i].SetVariable!="undefined"){activeObjects[activeObjects.length]=objects[i];}}}
var embeds=document.getElementsByTagName("embed");var el=embeds.length;var activeEmbeds=[];if(el>0){for(var j=0;j<el;j++){if(typeof embeds[j].SetVariable!="undefined"){activeEmbeds[activeEmbeds.length]=embeds[j];}}}
var aol=activeObjects.length;var ael=activeEmbeds.length;var searchStr="bridgeName="+bridgeName;if((aol==1&&!ael)||(aol==1&&ael==1)){xmp.FABridge.attachBridge(activeObjects[0],bridgeName);}
else if(ael==1&&!aol){xmp.FABridge.attachBridge(activeEmbeds[0],bridgeName);}
else{var flash_found=false;if(aol>1){for(var k=0;k<aol;k++){var params=activeObjects[k].childNodes;for(var l=0;l<params.length;l++){var param=params[l];if(param.nodeType==1&&param.tagName.toLowerCase()=="param"&&param["name"].toLowerCase()=="flashvars"&&param["value"].indexOf(searchStr)>=0){xmp.FABridge.attachBridge(activeObjects[k],bridgeName);flash_found=true;break;}}
if(flash_found){break;}}}
if(!flash_found&&ael>1){for(var m=0;m<ael;m++){var flashVarsNode=activeEmbeds[m].attributes.getNamedItem("flashVars");if(flashVarsNode!=null&&flashVarsNode!=undefined){var flashVars=flashVarsNode.nodeValue;if(flashVars.indexOf(searchStr)>=0){xmp.FABridge.attachBridge(activeEmbeds[m],bridgeName);break;}}}}}
return true;}
xmp.FABridge.nextBridgeID=0;xmp.FABridge.instances={};xmp.FABridge.idMap={};xmp.FABridge.refCount=0;xmp.FABridge.extractBridgeFromID=function(id)
{var bridgeID=(id>>16);return xmp.FABridge.idMap[bridgeID];}
xmp.FABridge.attachBridge=function(instance,bridgeName)
{var newBridgeInstance=new xmp.FABridge(instance,bridgeName);xmp.FABridge[bridgeName]=newBridgeInstance;var callbacks=xmp.FABridge.initCallbacks[bridgeName];if(callbacks==null)
{return;}
for(var i=0;i<callbacks.length;i++)
{callbacks[i].call(newBridgeInstance);}
delete xmp.FABridge.initCallbacks[bridgeName]}
xmp.FABridge.blockedMethods={toString:true,get:true,set:true,call:true};xmp.FABridge.prototype={root:function()
{return this.deserialize(this.target.getRoot());},releaseASObjects:function()
{return this.target.releaseASObjects();},releaseNamedASObject:function(value)
{if(typeof(value)!="object")
{return false;}
else
{var ret=this.target.releaseNamedASObject(value.fb_instance_id);return ret;}},create:function(className)
{return this.deserialize(this.target.create(className));},makeID:function(token)
{return(this.bridgeID<<16)+token;},getPropertyFromAS:function(objRef,propName)
{if(xmp.FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{xmp.FABridge.refCount++;retVal=this.target.getPropFromAS(objRef,propName);retVal=this.handleError(retVal);xmp.FABridge.refCount--;return retVal;}},setPropertyInAS:function(objRef,propName,value)
{if(xmp.FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{xmp.FABridge.refCount++;retVal=this.target.setPropInAS(objRef,propName,this.serialize(value));retVal=this.handleError(retVal);xmp.FABridge.refCount--;return retVal;}},callASFunction:function(funcID,args)
{if(xmp.FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{xmp.FABridge.refCount++;retVal=this.target.invokeASFunction(funcID,this.serialize(args));retVal=this.handleError(retVal);xmp.FABridge.refCount--;return retVal;}},callASMethod:function(objID,funcName,args)
{if(xmp.FABridge.refCount>0)
{throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");}
else
{xmp.FABridge.refCount++;args=this.serialize(args);retVal=this.target.invokeASMethod(objID,funcName,args);retVal=this.handleError(retVal);xmp.FABridge.refCount--;return retVal;}},invokeLocalFunction:function(funcID,args)
{var result;var func=this.localFunctionCache[funcID];if(func!=undefined)
{result=this.serialize(func.apply(null,this.deserialize(args)));}
return result;},getTypeFromName:function(objTypeName)
{return this.remoteTypeCache[objTypeName];},createProxy:function(objID,typeName)
{var objType=this.getTypeFromName(typeName);xmp.FABridge.instanceFactory.prototype=objType;var instance=new xmp.FABridge.instanceFactory(objID);this.remoteInstanceCache[objID]=instance;return instance;},getProxy:function(objID)
{return this.remoteInstanceCache[objID];},addTypeDataToCache:function(typeData)
{newType=new xmp.ASProxy(this,typeData.name);var accessors=typeData.accessors;for(var i=0;i<accessors.length;i++)
{this.addPropertyToType(newType,accessors[i]);}
var methods=typeData.methods;for(var i=0;i<methods.length;i++)
{if(xmp.FABridge.blockedMethods[methods[i]]==undefined)
{this.addMethodToType(newType,methods[i]);}}
this.remoteTypeCache[newType.typeName]=newType;return newType;},addPropertyToType:function(ty,propName)
{var c=propName.charAt(0);var setterName;var getterName;if(c>="a"&&c<="z")
{getterName="get"+c.toUpperCase()+propName.substr(1);setterName="set"+c.toUpperCase()+propName.substr(1);}
else
{getterName="get"+propName;setterName="set"+propName;}
ty[setterName]=function(val)
{this.bridge.setPropertyInAS(this.fb_instance_id,propName,val);}
ty[getterName]=function()
{return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName));}},addMethodToType:function(ty,methodName)
{ty[methodName]=function()
{return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id,methodName,xmp.FABridge.argsToArray(arguments)));}},getFunctionProxy:function(funcID)
{var bridge=this;if(this.remoteFunctionCache[funcID]==null)
{this.remoteFunctionCache[funcID]=function()
{bridge.callASFunction(funcID,xmp.FABridge.argsToArray(arguments));}}
return this.remoteFunctionCache[funcID];},getFunctionID:function(func)
{if(func.__bridge_id__==undefined)
{func.__bridge_id__=this.makeID(this.nextLocalFuncID++);this.localFunctionCache[func.__bridge_id__]=func;}
return func.__bridge_id__;},serialize:function(value)
{var result={};var t=typeof(value);if(t=="number"||t=="string"||t=="boolean"||t==null||t==undefined)
{result=value;}
else if(value instanceof Array)
{result=[];for(var i=0;i<value.length;i++)
{result[i]=this.serialize(value[i]);}}
else if(t=="function")
{result.type=xmp.FABridge.TYPE_JSFUNCTION;result.value=this.getFunctionID(value);}
else if(value instanceof xmp.ASProxy)
{result.type=xmp.FABridge.TYPE_ASINSTANCE;result.value=value.fb_instance_id;}
else
{result.type=xmp.FABridge.TYPE_ANONYMOUS;result.value=value;}
return result;},deserialize:function(packedValue)
{var result;var t=typeof(packedValue);if(t=="number"||t=="string"||t=="boolean"||packedValue==null||packedValue==undefined)
{result=this.handleError(packedValue);}
else if(packedValue instanceof Array)
{result=[];for(var i=0;i<packedValue.length;i++)
{result[i]=this.deserialize(packedValue[i]);}}
else if(t=="object")
{for(var i=0;i<packedValue.newTypes.length;i++)
{this.addTypeDataToCache(packedValue.newTypes[i]);}
for(var aRefID in packedValue.newRefs)
{this.createProxy(aRefID,packedValue.newRefs[aRefID]);}
if(packedValue.type==xmp.FABridge.TYPE_PRIMITIVE)
{result=packedValue.value;}
else if(packedValue.type==xmp.FABridge.TYPE_ASFUNCTION)
{result=this.getFunctionProxy(packedValue.value);}
else if(packedValue.type==xmp.FABridge.TYPE_ASINSTANCE)
{result=this.getProxy(packedValue.value);}
else if(packedValue.type==xmp.FABridge.TYPE_ANONYMOUS)
{result=packedValue.value;}}
return result;},addRef:function(obj)
{this.target.incRef(obj.fb_instance_id);},release:function(obj)
{this.target.releaseRef(obj.fb_instance_id);},handleError:function(value)
{if(typeof(value)=="string"&&value.indexOf("__FLASHERROR")==0)
{var myErrorMessage=value.split("||");if(xmp.FABridge.refCount>0)
{xmp.FABridge.refCount--;}
throw new Error(myErrorMessage[1]);return value;}
else
{return value;}}};xmp.ASProxy=function(bridge,typeName)
{this.bridge=bridge;this.typeName=typeName;return this;};xmp.ASProxy.prototype={get:function(propName)
{return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id,propName));},set:function(propName,value)
{this.bridge.setPropertyInAS(this.fb_instance_id,propName,value);},call:function(funcName,args)
{this.bridge.callASMethod(this.fb_instance_id,funcName,args);},addRef:function(){this.bridge.addRef(this);},release:function(){this.bridge.release(this);}};

xmp.createNamespace("xmp.util.internals");xmp.util.internals.XMPError=function(aa,ba,ca,da){xmp.util.internals.XMPError.ctor.call(this);this.name=aa;this.context=ba;this.rawMessage=ca;this.extendedInfo=da;this.innerError=null;this.setMessage();};xmp.DERIVE_CLASS(Error,xmp.util.internals.XMPError);xmp.util.internals.XMPError.prototype.setInnerError=function(e){this.innerError=e;this.setMessage();};xmp.util.internals.XMPError.prototype.setMessage=function(){this.message="Error Type:  "+this.name+((this.context)?"\n\nOccured While:  "+this.context:"")+((this.innerError)?"\n\nInner/Nested Error Type:  "+this.innerError.name:"")+"\n\nError Text:  "+this.rawMessage;var i=0;var ea=0;if(this.extendedInfo){ea=this.extendedInfo.length;for(i=0;i<ea;i++){this.message+="\n\n"+this.extendedInfo[i].label+":  "+this.extendedInfo[i].text;}}
if(this.innerError&&this.innerError.extendedInfo){ea=this.innerError.extendedInfo.length;for(i=0;i<ea;i++){this.message+="\n\n"+this.innerError.extendedInfo[i].label+":  "+this.innerError.extendedInfo[i].text;}}
var fa=((this.innerError)?this.innerError:this);if(fa.number){this.message+="\n\nError Number:  "+fa.number;}
if(fa.lineNumber){this.message+="\n\nLine Number:  "+fa.lineNumber;}
if(fa.fileName){this.message+="\n\nFile Name:  "+fa.fileName;}
if(fa.stack){this.message+="\n\nStack Trace:\n\n"+fa.stack;}};xmp.util.internals.XMPError.prototype.addExtendedInfo=function(ga){if(!this.extendedInfo){this.extendedInfo=[];}
this.extendedInfo.push(ga);this.setMessage();};xmp.util.internals.XMPError.prototype.getInnerError=function(){return this.innerError;};xmp.util.internals.XMPError.prototype.getMessage=function(){return this.message;};xmp.util.internals.XMPError.prototype.getContext=function(){return this.context;};xmp.util.internals.XMPError.prototype.getExtendedInfo=function(){return this.extendedInfo;};xmp.createNamespace("xmp.util");xmp.util.PlayableNode=function(){this._instanceNumber=xmp.util.PlayableNode._instanceNumberCounter;xmp.util.PlayableNode._instanceNumberCounter++;this._valid=false;this._init();};xmp.util.PlayableNode._instanceNumberCounter=0;xmp.util.PlayableNode._nodeOfTypeCounterMap={};xmp.util.PlayableNode._staticInit=function(){xmp.util.PlayableNode._nodeOfTypeCounterMap={};};xmp.util.PlayableNode.prototype._init=function(){this._internalId='';this._mime_type='';this._uri='';this._isUriAbsolute=false;this._timeLimitInSeconds=-1;this._endedFrame='';this._streamingMode='';this._mimeTypes=[];this._sizes=[];this._rules=[];this._nodeOwnsRules=true;this._nodeType=null;this._patternAddress=null;this._emptySlot=false;this._data=null;this._metadataMap=null;this._nodeOwnsMetadataMap=false;this._metaResourceBundle=null;this._associatedResourceBundleType='primary';this._valid=true;};xmp.util.PlayableNode.prototype._clear=function(){var ha=xmp.MapIterator.extractKeys(this._children);for(var i=0;i<ha.length;i++){var ia=ha[i];if(ia==='_instanceNumber'||ia==='_valid'){continue;}
if(typeof this[ia]==='function'){continue;}
delete this[ia];}
this._valid=false;};xmp.util.PlayableNode.prototype.isValid=function(){return this._valid;};xmp.util.PlayableNode.prototype.getNodeTypeName=function(){return this.getNodeType().getTypeName();};xmp.util.PlayableNode.prototype.getNodeTypeId=function(){return this.getNodeType().getId();};xmp.util.PlayableNode.prototype.isContentType=function(){return this.getNodeType().isContentType();};xmp.util.PlayableNode.prototype.isAdType=function(){return this.getNodeType().isAdType();};xmp.util.PlayableNode.prototype.isPromoType=function(){return this.getNodeType().isPromoType();};xmp.util.PlayableNode.prototype.getMetadata=function(ja,ka){if(this._metadataMap===null){return ka;}
return this._metadataMap._get(ja,ka);};xmp.util.PlayableNode.prototype.setMetadata=function(la,ma){this._swivelMetadataMapReferenceBeforeModification();this._metadataMap._set(la,ma);};xmp.util.PlayableNode.prototype.getMetaResource=function(na){return this._metaResourceBundle.getMetaResource(na);};xmp.util.PlayableNode.prototype.setMetaResource=function(oa){this._metaResourceBundle.setMetaResource(oa);};xmp.util.PlayableNode.prototype.getMetaResourceBundle=function(){return this._metaResourceBundle;};xmp.util.PlayableNode.prototype.reSetMetaResourceBundle=function(pa){this._metaResourceBundle=pa;};xmp.util.PlayableNode.prototype.getPlayableData=function(){return this._data;};xmp.util.PlayableNode.prototype.getBestId=function(){var id=this.getPlayableData().getMetaResourceId();if(id.length===0){id=this.getPlayableData().getCompositeMetaResourceId();}
if(id.length===0){id=this._getInternalId();}
return id;};xmp.util.PlayableNode.safeGetBestId=function(qa){try{if(!qa){return"NULL/UNDEFINED";}
return qa.getBestId();}
catch(e){return"UNKNOWN/ERROR";}};xmp.util.PlayableNode.prototype.getUniqueId=function(){return this._getHashKey();};xmp.util.PlayableNode.prototype.getMimeType=function(){return this._mime_type;};xmp.util.PlayableNode.prototype.setMimeType=function(ra){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"PlayableNode.setMimeType");if(ra===null||ra.length===0){throw new xmp.util.internals.InvalidArgsError("Invalid playable node mime type (null or empty).");}
this._mime_type=ra;};xmp.util.PlayableNode.prototype.getURI=function(){return this._uri;};xmp.util.PlayableNode.prototype.setURI=function(sa){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"PlayableNode.setURI");if(sa===null||sa.length===0){throw new xmp.util.internals.InvalidArgsError("Invalid playable node uri (null or empty).");}
this._uri=sa;};xmp.util.PlayableNode.prototype.setUriAbsolute=function(ta){this._isUriAbsolute=ta;};xmp.util.PlayableNode.prototype.isUriAbsolute=function(){return this._isUriAbsolute;};xmp.util.PlayableNode.prototype.getTimeLimitInSeconds=function(){return this._timeLimitInSeconds;};xmp.util.PlayableNode.prototype.setTimeLimitInSeconds=function(ua){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"PlayableNode.setTimeLimitInSeconds");if(ua<-1){throw new xmp.util.internals.InvalidArgsError("Invalid time limit (cannot be less than -1).");}
this._timeLimitInSeconds=ua;};xmp.util.PlayableNode.prototype.getNodeType=function(){return this._nodeType;};xmp.util.PlayableNode.prototype.getRuleCount=function(){return this._rules.length;};xmp.util.PlayableNode.prototype.getRule=function(va){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"PlayableNode.getChild");return this._rules[va];};xmp.util.PlayableNode.prototype.addRule=function(wa){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"PlayableNode.addRule");if(wa===null){throw new xmp.util.internals.InvalidArgsError("Invalid rule context (null).");}
this._swivelRuleArrayReferenceBeforeModification();return this._rules.push(wa);};xmp.util.PlayableNode.prototype.insertRule=function(xa,ya){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.NUMBER_TYPE],"PlayableNode.insertRule");if(xa===null){throw new xmp.util.internals.InvalidArgsError("Invalid rule context (null).");}
this._swivelRuleArrayReferenceBeforeModification();this._rules.splice(ya,0,xa);return this._rules.length;};xmp.util.PlayableNode.prototype.removeRule=function(za){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"PlayableNode.removeRule");this._swivelRuleArrayReferenceBeforeModification();this._rules.splice(za,1);return this._rules.length;};xmp.util.PlayableNode.prototype._getRuleArrayReference=function(){return this._rules;};xmp.util.PlayableNode.prototype._swivelRuleArrayReferenceBeforeModification=function(){if(!this._nodeOwnsRules){this._nodeOwnsRules=true;this._rules=[];if(this.getNodeType()!==null){this._rules=this._rules.concat(this.getNodeType()._getRuleContextArray());}}};xmp.util.PlayableNode.prototype._swivelMetadataMapReferenceBeforeModification=function(){if(!this._nodeOwnsMetadataMap){this._nodeOwnsMetadataMap=true;var Aa=this._metadataMap;this._metadataMap=new xmp.util.internals.MetadataMap(false);if(Aa!==null){this._metadataMap._reInitialize(Aa._getClonedWrappedMetadata());}}};xmp.util.PlayableNode.prototype._setNodeType=function(Ba){this._internalId=this._makeInternalId(Ba);this._nodeType=Ba;this._rules=this.getNodeType()._getRuleContextArray();this._nodeOwnsRules=false;this._metadataMap=this.getNodeType()._getMetadataMapRef();this._nodeOwnsMetadataMap=false;this._metaResourceBundle=this.getNodeType().getMetaResourceBundle().clone();};xmp.util.PlayableNode.prototype._getInstanceNumber=function(){return this._instanceNumber;};xmp.util.PlayableNode.prototype._getHashKey=function(){return('PlayableNode_'+this._instanceNumber);};xmp.util.PlayableNode.prototype._getPatternAddress=function(){return this._patternAddress;};xmp.util.PlayableNode.prototype._setPatternAddress=function(id){this._patternAddress=id;};xmp.util.PlayableNode.prototype._isEmptySlot=function(){return this._emptySlot;};xmp.util.PlayableNode.prototype._mutateEmptySlot=function(Ca){this._emptySlot=Ca;};xmp.util.PlayableNode.prototype._getInternalId=function(){return this._internalId;};xmp.util.PlayableNode.prototype._linkData=function(Da,Ea){this._data=Da._getPlayableData(Ea);};xmp.util.PlayableNode.prototype._setData=function(Fa){this._data=Fa;};xmp.util.PlayableNode.prototype._makeInternalId=function(Ga){var Ha=xmp.util.PlayableNode._getNodeOfTypeCount(Ga.getTypeName());var Ia=8;var id=Ga.getTypeName()+'_'+xmp.zeroPad(Ha,Ia);return id;};xmp.util.PlayableNode._getNodeOfTypeCount=function(Ja){var Ka=xmp.util.PlayableNode._nodeOfTypeCounterMap[Ja];if(typeof Ka==='undefined'){Ka=0;}
else{Ka++;}
xmp.util.PlayableNode._nodeOfTypeCounterMap[Ja]=Ka;return Ka;};xmp.util.PlayableNode.prototype.getStreamingMode=function(){return this._streamingMode;};xmp.util.PlayableNode.prototype.setStreamingMode=function(La){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"PlayableNode.setStreamingMode");var Ma=xmp.PlayerPolicy.getStreamingModes();var Na=Ma.length;for(var i=0;i<Na;i++){if(Ma[i]===La){this._streamingMode=La;return;}}
throw new xmp.util.internals.InvalidArgsError("Invalid playable node streaming mode \""+La+"\".  Expected "+Ma.join(", ")+".");};xmp.util.PlayableNode.prototype.getMimeTypes=function(){return this._mimeTypes;};xmp.util.PlayableNode.prototype.setMimeTypes=function(Oa){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"PlayableNode.setMimeTypes");if(Oa.length===0){throw new xmp.util.internals.InvalidArgsError("Invalid playable node mime types.  Expeced at least 1 mime type.");}
this._mimeTypes=Oa;};xmp.util.PlayableNode.prototype.getSizes=function(){return this._sizes;};xmp.util.PlayableNode.prototype.setSizes=function(Pa){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"PlayableNode.setSizes");if(Pa.length===0){throw new xmp.util.internals.InvalidArgsError("Invalid playable node mime types.  Expeced at least 1 size.");}
this._sizes=Pa;};xmp.util.PlayableNode.prototype.getAssociatedResourceBundleType=function(){return this._associatedResourceBundleType;};xmp.util.PlayableNode.prototype.setAssociatedResourceBundleType=function(Qa){if(!xmp.isNonEmptyString(Qa)){throw new xmp.util.internals.InvalidArgsError("Invalid associated resource bundle type - must be a non-empty string.");}
this._associatedResourceBundleType=Qa;};xmp.createNamespace("xmp.util.internals");xmp.util.internals.InvalidArgsError=function(Ra){xmp.util.internals.InvalidArgsError.ctor.call(this,"InvalidArgsError",null,Ra);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.util.internals.InvalidArgsError);xmp.createNamespace("xmp.util");xmp.util.AbstractLoggerListener=function(Sa){this.setLogLevel(Sa);};xmp.util.AbstractLoggerListener.prototype.handleLog=function(Ta,Ua,Va,Wa){if(Ta<=this.getLogLevel()){if(typeof Wa!=='undefined'){Va+=(" -- Error: "+xmp.extractErrorMessage(Wa));}
this.handleLogMessage(Ta,Ua,Va);}};xmp.util.AbstractLoggerListener.prototype.handleLogMessage=function(Xa,Ya,Za){throw new Error("Subclass must implement handleLogMessage");};xmp.util.AbstractLoggerListener.prototype.getLogLevel=function(){return this._logLevel;};xmp.util.AbstractLoggerListener.prototype.setLogLevel=function($a){var ab=xmp.util.LogLevels._calc($a);this._logLevel=ab;xmp.util.Logger.getInstance().listenerChanged();};xmp.createNamespace("xmp.util");xmp.util.Callback=function(id,bb,db){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.FUNCTION_TYPE,xmp.OBJECT_TYPE],"Callback.ctor");if(id===null||id.length===0||bb===null){throw new xmp.util.internals.InvalidArgsError("The 'id' argument must be non-empty, and the 'theMethod' argument must be non-null.");}
this._id=id;this._theMethod=bb;this._theContextObject=(!db)?null:db;this._metadataMap=new xmp.util.internals.MetadataMap(false);this._addThisToCallback=true;};xmp.util.Callback.prototype.setAddThisToCallback=function(eb){this._addThisToCallback=eb;};xmp.util.Callback.prototype.getId=function(){return this._id;};xmp.util.Callback.prototype.call=function(){this._callCore(this._copyIntrinsicArgs(arguments));};xmp.util.Callback.prototype.callAsynch=function(fb){this.callAsynchEx(5,fb);};xmp.util.Callback.prototype.callAsynchEx=function(gb,hb){var ib=new xmp.util.Callback('Callback.callAsynchEx',this._handleAsynchCallTimer,this);ib.setMetadata('relayCb',this);ib.setMetadata('args',hb);xmp.util.Timer.doSimpleCallbackEx(gb,ib);};xmp.util.Callback.prototype.getMetadata=function(jb,kb){return this._metadataMap._get(jb,kb);};xmp.util.Callback.prototype.setMetadata=function(lb,mb){this._metadataMap._set(lb,mb);};xmp.util.Callback.prototype._copyIntrinsicArgs=function(nb){var ob=[];for(var i=0;i<nb.length;i++){ob.push(nb[i]);}
return ob;};xmp.util.Callback.prototype._callCore=function(pb){var qb=[];if(this._addThisToCallback){qb.push(this);}
qb=qb.concat(pb);this._theMethod.apply(this._theContextObject,qb);};xmp.util.Callback.prototype._handleAsynchCallTimer=function(rb){var sb=rb.getMetadata('relayCb',xmp.util.internals.MetadataMap.defaultObj);var tb=rb.getMetadata('args',xmp.util.internals.MetadataMap.defaultObj);sb._callCore(tb);};xmp.createNamespace("xmp.util");xmp.util.Cookie=function(){};xmp.util.Cookie.getCookieDomain=function(){return window.location.hostname;};xmp.util.Cookie.getTopLevelCookieDomain=function(){var ub=xmp.util.Cookie.getCookieDomain();var vb=ub.indexOf('.');if(vb>-1){ub=ub.substr(vb);}
return ub;};xmp.util.Cookie.canUse=function(){var wb=false;if(document.cookie===''){document.cookie='WM_acceptsCookies=yes';if(document.cookie.indexOf('WM_acceptsCookies=yes')!==-1){wb=true;}}else{wb=true;}
return(wb);};xmp.util.Cookie.write=function(xb,yb,zb,Ab,Bb,Cb){if(xmp.util.Cookie.canUse()){var Db=0;var Eb=(navigator&&navigator.appName&&(navigator.appName==='Netscape')&&navigator.appVersion&&(parseInt(navigator.appVersion,0)===2))?false:true;if(zb&&Eb){if((typeof(zb)==='string')&&Date.parse(zb)){Db=zb;}else if(typeof(zb)==='number'){Db=(new Date((new Date()).getTime()+zb*3600000)).toGMTString();}}
document.cookie=xb+'='+escape(yb)+((Db)?(';expires='+Db):'')+((Ab)?';path='+path:'')+((Bb)?';domain='+domain:'')+((Cb&&(Cb===true))?'; secure':'');}};xmp.util.Cookie.read=function(Fb){if(document.cookie===''){return false;}else{var Gb,lastChar;var Hb=document.cookie;Gb=Hb.indexOf(Fb);var Ib=Gb+Fb.length;if((Gb!==-1)&&(Hb.charAt(Ib)==='=')){Gb+=Fb.length+1;lastChar=Hb.indexOf(';',Gb);if(lastChar===-1){lastChar=Hb.length;}
return unescape(Hb.substring(Gb,lastChar));}else{return false;}}};xmp.util.Cookie.kill=function(Jb,Kb,Lb){var Mb=xmp.util.Cookie.read(Jb);if(Mb){document.cookie=Jb+'='+Mb+'; expires=Fri, 13-Apr-1970 00:00:00 GMT'+((Kb)?';path='+path:'')+((Lb)?';domain='+domain:'');}};xmp.CriticalException=function(Nb,Ob,Pb,Qb,Rb){this._code=xmp.XmpErrorCodes._calc(Nb);var Sb=Qb+" CRTICAL ERROR CODE: "+this.getCriticalErrorCode().toString()+": "+this.getCriticalErrorCodeString();xmp.CriticalException.ctor.call(this,Ob,Pb,Sb,Rb);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.CriticalException);xmp.CriticalException.prototype.getCriticalErrorCode=function(){return this._code;};xmp.CriticalException.prototype.getCriticalErrorCodeString=function(){return xmp.XmpErrorCodes.stringify(this._code);};xmp.CriticalException.createCriticalException=function(Tb,Ub,Vb){return new xmp.CriticalException(Tb,'CriticalException',Ub,Vb);};xmp.FatalException=function(Wb,Xb,Yb,Zb){this._code=xmp.XmpErrorCodes._calc(Wb);var $b=Zb+" FATAL ERROR CODE: "+this.getFatalErrorCode().toString()+": "+this.getFatalErrorCodeString();xmp.FatalException.ctor.call(this,Xb,Yb,$b);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.FatalException);xmp.FatalException.prototype.getFatalErrorCode=function(){return this._code;};xmp.FatalException.prototype.getFatalErrorCodeString=function(){return xmp.XmpErrorCodes.stringify(this._code);};xmp.FatalException.createFatalException=function(ac,bc,cc){return new xmp.FatalException(ac,'FatalException',bc,cc);};xmp.createNamespace("xmp.util");xmp.util.FlashUtility=function(){};xmp.util.FlashUtility.buildFSCommandScript=function(dc,ec,fc){var gc=document.createElement('script');var hc='';if(xmp.isIEBrowser()){gc.defer=true;gc.event='FSCommand(command,args)';gc.htmlFor=ec;hc=fc;gc.text=hc;dc.insertBefore(gc,null);}
else{hc="function "+ec+"_DoFSCommand(command, args) { "+fc+" }";gc.innerHTML=hc;dc.insertBefore(gc,null);}};xmp.util.FlashUtility.normalizeCommand=function(ic){var re=/^FSCommand:(.*)/;if(ic!==null&&xmp.isDefined(ic)&&re.test(ic)===true){ic=ic.match(re)[1];}
return ic;};xmp.util.FlashUtility.splitFSCommandData=function(jc,kc){if(kc<1){throw new xmp.util.internals.InvalidArgsError('Must call fn with "count" >= 1');}
if(kc===1){return[jc];}
var lc=jc.split(xmp.DELIMITER);if(lc.length===kc){return lc;}
if(lc.length<kc){throw new xmp.util.internals.InvalidArgsError('Expected '+kc.toString()+' arguments, got '+lc.length.toString());}
var mc=lc.slice(0,kc-1);var nc=lc.slice(kc-1);var oc=nc.join(xmp.DELIMITER);mc.push(oc);return mc;};xmp.util.FlashUtility.externalInterfaceDecode=function(pc){if(pc.indexOf('&xmp_')===-1){return pc;}
var qc=pc;qc=qc.replace(/&xmp_custom_lt;/g,'<');qc=qc.replace(/&xmp_custom_gt;/g,'>');qc=qc.replace(/&xmp_lit_lf;/g,'\\n');qc=qc.replace(/&xmp_lit_cr;/g,'\\r');qc=qc.replace(/&xmp_lit_tab;/g,'\\t');qc=qc.replace(/&xmp_lit_bs;/g,'\\\\');qc=qc.replace(/&xmp_lit_apos;/g,'\\\'');qc=qc.replace(/&xmp_lit_quot;/g,'\\\"');return qc;};xmp.createNamespace("xmp.util");xmp.util.JsonPath=function(rc,sc){this._nextObj=rc;this._nextPath=sc;this._keepEvaluating=true;};xmp.util.JsonPath.evaluate=function(tc,uc){var vc=new xmp.util.JsonPath(tc,uc);vc._evalInternal();return vc._getResult();};xmp.util.JsonPath.prototype._getResult=function(){if(!this._keepEvaluating||!this._isSNB(this._nextObj)){return null;}
return this._nextObj.toString();};xmp.util.JsonPath.prototype._calcNextObj=function(wc){if(typeof this._nextObj[wc]==='undefined'){this._keepEvaluating=false;return;}
this._nextObj=this._nextObj[wc];};xmp.util.JsonPath.prototype._evalInternal=function(){while(this._keepEvaluating&&this._nextPath.length>0){var xc='';for(var i=0;i<this._nextPath.length;i++){var c=this._nextPath.charAt(i);if(c==='.'){this._calcNextObj(xc);this._calcNextPath(xc);break;}
else if(c==='['){if(xc.length>0){this._calcNextObj(xc);this._calcNextPath(xc);break;}
var yc=this._getBracketExpression();if(yc.charAt(0)==='@'){this._doArrayMatch(yc.substr(1));}
else if(xmp.isNumber(yc,false)){var zc=parseInt(yc,0);if(zc>=this._nextObj.length){this._keepEvaluating=false;break;}
this._nextObj=this._nextObj[zc];}
else{this._calcNextObj(this._unQuote(yc));}
break;}
else{xc+=c;if(i===(this._nextPath.length-1)){this._calcNextObj(xc);this._calcNextPath(xc);}}}}};xmp.util.JsonPath.prototype._unQuote=function(Ac){if(Ac.length>1){if(Ac.charAt(0)==='\''||Ac.charAt(0)==='\"'){return this._stripFirstAndLast(Ac);}}
return Ac;};xmp.util.JsonPath.prototype._stripFirstAndLast=function(Bc){var Cc=Bc.substr(1);Cc=Cc.substr(0,Cc.length-1);return Cc;};xmp.util.JsonPath.prototype._getBracketExpression=function(){var be='';for(var i=0;i<this._nextPath.length;i++){var cb=this._nextPath.charAt(i);be+=cb;if(cb===']'){break;}}
this._calcNextPath(be);return this._stripFirstAndLast(be);};xmp.util.JsonPath.prototype._doArrayMatch=function(Dc){var Ec=Dc.split('=');var Fc=Ec[0];var Gc=this._unQuote(Ec[1]);var Hc=false;for(var i=0;i<this._nextObj.length;i++){var Ic=this._nextObj[i];if(typeof Ic[Fc]==='undefined'){continue;}
if(!this._isSNB(Ic[Fc])){this._keepEvaluating=false;break;}
if(Ic[Fc].toString()===Gc){this._nextObj=Ic;Hc=true;break;}}
if(!Hc){this._keepEvaluating=false;}};xmp.util.JsonPath.prototype._isSNB=function(Jc){var Kc=(typeof Jc);return(Kc==='string'||Kc==='boolean'||Kc==='number');};xmp.util.JsonPath.prototype._calcNextPath=function(Lc){if(Lc.length===this._nextPath.length){this._nextPath='';}
else{this._nextPath=this._nextPath.substr(Lc.length);if(this._nextPath.indexOf('.')===0){this._nextPath=this._nextPath.substr(1);}}};xmp.createNamespace("xmp.util");xmp.util.Latch=function(Mc,Nc){this.cbState={};this.cbComplete={};for(var i=0;i<Mc.length;i++){this.cbComplete[Mc[i]]=false;}
this.completionCb=Nc;};xmp.util.Latch.prototype.called=function(Oc,Pc){this.cbComplete[Oc]=true;this.cbState[Oc]=Pc;var Qc=true;var Rc=null;for(Rc=xmp.MapIterator.create(this.cbComplete);Rc.hasNext();Rc.next()){Qc=Qc&&Rc.currentValue();if(!Qc){break;}}
if(Qc){for(Rc=xmp.MapIterator.create(this.cbState);Rc.hasNext();Rc.next()){this.completionCb.setMetadata(Rc.currentKey(),Rc.currentValue());}
this.completionCb.call();}};xmp.util.Latch.prototype.clear=function(){for(var Sc=xmp.MapIterator.create(this.cbComplete);Sc.hasNext();Sc.next()){Sc.updateCurrentValue(false);}
delete this.cbState;this.cbState={};};xmp.util.Latch.prototype.addCbName=function(Tc){this.cbComplete[Tc]=false;};xmp.createNamespace("xmp.util");xmp.util.Loadable=function(){this._loaded=false;this._rawData=null;this._errorMessage=null;};xmp.util.Loadable.prototype._setRawData=function(Uc){this._rawData=Uc;this._loaded=true;};xmp.util.Loadable.prototype._setErrorMessage=function(Vc){this._errorMessage=Vc;this._loaded=false;};xmp.util.Loadable.prototype.isLoaded=function(){return this._loaded;};xmp.util.Loadable.prototype.isError=function(){return(this._errorMessage!==null);};xmp.util.Loadable.prototype.getErrorMessage=function(){return this._errorMessage;};xmp.util.Loadable.prototype.getError=function(){return(new xmp.util.LoadableDataException(this.isError()?this._errorMessage:'NO ERROR'));};xmp.util.Loadable.prototype.getDataObject=function(){if(this._rawData===null||!this.isLoaded()){throw new Error("Loadable not loaded yet for node: "+this.getLoadableId());}
return this._rawData;};xmp.util.Loadable.prototype.getLoadableId=function(){throw new Error('Subclass must override!');};xmp.util.LoadableDataException=function(Wc){xmp.util.LoadableDataException.ctor.call(this,"LoadableDataException",null,Wc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.util.LoadableDataException);xmp.createNamespace("xmp.util");xmp.util.Loader=function(){this.loadedUris=[];};xmp.util.Loader.instance=null;xmp.util.Loader.getInstance=function(){if(xmp.util.Loader.instance===null){xmp.util.Loader.instance=new xmp.util.Loader();}
return xmp.util.Loader.instance;};xmp.util.Loader.prototype.loadModule=function(Xc,cb){if(!Xc){return;}
var Yc=Xc.replace(/\./g,"/")+".js";this.loadUri(Yc,Xc,cb);};xmp.util.Loader.prototype.loadUri=function(Zc,$c,cb){if(!this.loadedUris[Zc]){var ad=xmp.net.AjaxRequestManager.getInstance();var bd=new xmp.util.Callback('loader.getText',this.callback,this);bd.setMetadata("cb",cb);bd.setMetadata("uri",Zc);ad.request(Zc,bd,$c,Zc,xmp.net.ContentTypes.TEXT);}else{cb(Zc,true);}};xmp.util.Loader.prototype.callback=function(cd,dd){var ed=xmp.net.AjaxRequestManager.getInstance();ed._parseJavaScript(dd.getText());var fd=cd.getMetadata("uri",'');var cb=cd.getMetadata("cb",function(fd){});if(fd===''||cb===function(fd){}){throw new xmp.util.LoadException("uri: "+fd+" cb: "+cb);}
this.loadedUris[fd]=true;cb(fd,false);};xmp.util.Loader.prototype.flushCache=function(){this.loadedUris=[];};xmp.util.LoadException=function(gd){this.name="LoadException";this.message=gd;};xmp.DERIVE_CLASS(Error,xmp.util.LoadException);xmp.createNamespace("xmp.util");xmp.util.LogConfigurator=function(){};xmp.util.LogConfigurator.commonExcludedCategories=['AjaxRequestManager_adPolicy','AjaxRequestManager_ruleClasses','AjaxRequestManager_dhtmlObject','AjaxRequestManager_videoContentMeta','FileRequestHandle','BVPOmnitureTriggerCommand','NullTrigger','PlayerPolicy','MediaPlayer','ContextualUrlStrategy','BandwidthRecorder','SetImageTriggerCommand','AdServerPageController'];xmp.util.LogConfigurator._cfg={'Embedded':{clazz:'xmp.baseplayer.EmbeddedConsoleLoggerListener',exCats:[],h:400,w:1000,cId:null}};xmp.util.LogConfigurator._configured=false;xmp.util.LogConfigurator.configure=function(hd){if(xmp.util.LogConfigurator._configured){return;}
xmp.util.LogConfigurator._configured=true;hd=(hd)?hd:null;if(hd!==null){xmp.util.LogConfigurator.merge(hd,xmp.util.LogConfigurator._cfg);}
var jd=xmp.getQueryArg('xmpLogCfg');if(jd!==null){var kd=xmp.net.AjaxRequestManager.getInstance()._parseJson(xmp.Base64.decode(jd));xmp.util.LogConfigurator.merge(kd,xmp.util.LogConfigurator._cfg);}
var ld=xmp.MapIterator.extractKeys(xmp.util.LogConfigurator._cfg);for(var i=0;i<ld.length;i++){var md=ld[i];var nd=xmp.util.LogConfigurator._cfg[md];var od=xmp.getNamespacedMethod(nd.clazz+'.create');od(nd);}};xmp.util.LogConfigurator.merge=function(pd,qd){var rd=xmp.trueTypeOf(pd);if(!(rd==='Object')){throw new Error('Invalid top-level merge type');}
var sd=xmp.MapIterator.extractKeys(pd);for(var i=0;i<sd.length;i++){var td=sd[i];var ud=pd[td];var vd=xmp.trueTypeOf(ud);if(!(vd==='Null'||vd==='String'||vd==='Boolean'||vd==='Number'||vd==='Object'||vd==='Array')){throw new Error('Invalid merge type');}
var wd=xmp.trueTypeOf(qd[td]);if(wd!=='Undefined'&&wd!==vd){throw new Error('Mismatched types during merge');}
if(vd==='Object'){if(wd==='Undefined'){qd[td]={};}
xmp.util.LogConfigurator.merge(ud,qd[td]);}
else{qd[td]=ud;}}};xmp.createNamespace("xmp.util");xmp.util.LogLevels=function(){};xmp.util.LogLevels.NONE=0;xmp.util.LogLevels.FATAL=1;xmp.util.LogLevels.CRITICAL=2;xmp.util.LogLevels.WARN=3;xmp.util.LogLevels.INFO=4;xmp.util.LogLevels.DEBUG=5;xmp.util.LogLevels._BEGIN=0;xmp.util.LogLevels._END=5;xmp.util.LogLevels._calc=function(xd){var yd=xmp.util.LogLevels;if((typeof xd!=='number')||(xd<yd._BEGIN)||(xd>yd._END)){return yd._BEGIN;}
return xd;};xmp.util.LogLevels.stringify=function(zd){var Ad=xmp.util.LogLevels;var Bd=Ad._calc(zd);switch(Bd){case Ad.NONE:return'none';case Ad.FATAL:return'fatal';case Ad.CRITICAL:return'critical';case Ad.WARN:return'warn';case Ad.INFO:return'info';case Ad.DEBUG:return'debug';default:return'none';}};xmp.util.LogLevels.fromString=function(Cd){var Dd=xmp.util.LogLevels;switch(Cd){case'none':return Dd.NONE;case'fatal':return Dd.FATAL;case'critical':return Dd.CRITICAL;case'warn':return Dd.WARN;case'info':return Dd.INFO;case'debug':return Dd.DEBUG;default:return Dd.NONE;}};xmp.util.Logger=function(){this._levelRef=xmp.util.LogLevels;this._commonLogLevel=this._levelRef.NONE;this._listeners=[];this._filteredCategoryMap={};};xmp.util.Logger._singeltonInstance=null;xmp.util.Logger.getInstance=function(){if(xmp.util.Logger._singeltonInstance===null){xmp.util.Logger._singeltonInstance=new xmp.util.Logger();}
return xmp.util.Logger._singeltonInstance;};xmp.util.Logger.prototype.addListener=function(Ed){if(Ed){for(var i=0;i<this._listeners.length;i++){if(this._listeners[i]===Ed){return;}}
this._listeners.push(Ed);this.listenerChanged();}};xmp.util.Logger.prototype.setCategoryFilterArray=function(Fd){this._filteredCategoryMap={};for(var i=0;i<Fd.length;i++){var Gd=Fd[i];this._filteredCategoryMap[Gd]='true';}};xmp.util.Logger.prototype.fatal=function(Hd,Id,Jd){this._logCore(this._levelRef.FATAL,Hd,Id,Jd);};xmp.util.Logger.prototype.critical=function(Kd,Ld,Md){this._logCore(this._levelRef.CRITICAL,Kd,Ld,Md);};xmp.util.Logger.prototype.warn=function(Nd,Od,Pd){this._logCore(this._levelRef.WARN,Nd,Od,Pd);};xmp.util.Logger.prototype.info=function(Qd,Rd,Sd){this._logCore(this._levelRef.INFO,Qd,Rd,Sd);};xmp.util.Logger.prototype.debug=function(Td,Ud,Vd){this._logCore(this._levelRef.DEBUG,Td,Ud,Vd);};xmp.util.Logger.prototype.isFatalEnabled=function(Wd){return(this._commonLogLevel>=this._levelRef.FATAL&&!this._isFilteredOut(Wd));};xmp.util.Logger.prototype.isCriticalEnabled=function(Xd){return(this._commonLogLevel>=this._levelRef.CRITICAL&&!this._isFilteredOut(Xd));};xmp.util.Logger.prototype.isWarnEnabled=function(Yd){return(this._commonLogLevel>=this._levelRef.WARN&&!this._isFilteredOut(Yd));};xmp.util.Logger.prototype.isInfoEnabled=function(Zd){return(this._commonLogLevel>=this._levelRef.INFO&&!this._isFilteredOut(Zd));};xmp.util.Logger.prototype.isDebugEnabled=function($d){return(this._commonLogLevel>=this._levelRef.DEBUG&&!this._isFilteredOut($d));};xmp.util.Logger.prototype._logCore=function(ae,ce,de,ee){if(this._commonLogLevel>=ae&&!this._isFilteredOut(ce)){try{for(var i=0;i<this._listeners.length;i++){this._listeners[i].handleLog(ae,ce,de,ee);}}
catch(e){xmp.showFatalErrorMessage('Exception occurred while calling LoggerListener.handleLogMessage, disconnecting logging: .'+xmp.extractErrorMessage(e));this._commonLogLevel=this._levelRef.NONE;}}};xmp.util.Logger.prototype._isFilteredOut=function(fe){return(this._filteredCategoryMap[fe]==='true');};xmp.util.Logger.prototype.listenerChanged=function(){this._recalcCommonLogLevel();};xmp.util.Logger.prototype._recalcCommonLogLevel=function(){this._commonLogLevel=this._levelRef.NONE;for(var i=0;i<this._listeners.length;i++){var ge=this._listeners[i].getLogLevel();if(ge>this._commonLogLevel){this._commonLogLevel=ge;}}};xmp.createNamespace("xmp.util");xmp.util.PlayableData=function(he){xmp.util.PlayableData.ctor.call(this);if(typeof he!=='string'){throw new xmp.util.internals.InvalidArgsError("Argument 'metaResourceId' must be a string.");}
this._metaResourceId=he;this._compositeMetaResourceId='';this._metadataMap=new xmp.util.internals.MetadataMap(false);};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.util.PlayableData);xmp.util.PlayableData.prototype._setCompositeMetaResourceId=function(ie){this._compositeMetaResourceId=ie;};xmp.util.PlayableData.prototype.getPlayableId=function(){return this.getDataObject().id;};xmp.util.PlayableData.prototype.getMimeTypeArray=function(){return this.getDataObject().mimeTypes;};xmp.util.PlayableData.prototype.getTotalRunTime=function(){return this.getDataObject().trt;};xmp.util.PlayableData.prototype.isExternal=function(){var je=false;if(typeof this.getDataObject().videoLocation!=='undefined'){je=this.getDataObject().videoLocation==='External';}
return je;};xmp.util.PlayableData.prototype.getMetaResourceId=function(){return this._metaResourceId;};xmp.util.PlayableData.prototype.getCompositeMetaResourceId=function(){return this._compositeMetaResourceId;};xmp.util.PlayableData.prototype.getRuntimeMetadata=function(ke,le){return this._metadataMap._get(ke,le);};xmp.util.PlayableData.prototype.setRuntimeMetadata=function(me,ne){this._metadataMap._set(me,ne);};xmp.util.PlayableData.prototype.reInitRuntimeMetadata=function(){this._metadataMap._reInitialize({});};xmp.util.PlayableData.prototype.getLoadableId=function(){return this.getMetaResourceId();};xmp.createNamespace("xmp.util");xmp.util.PlayerStats=function(){this._array=[];this._map={};this._packCommon();};xmp.util.PlayerStats._singeltonInstance=null;xmp.util.PlayerStats.getInstance=function(){if(xmp.util.PlayerStats._singeltonInstance===null){xmp.util.PlayerStats._singeltonInstance=new xmp.util.PlayerStats();}
return xmp.util.PlayerStats._singeltonInstance;};xmp.util.PlayerStats.prototype.setValue=function(oe,pe){var qe=oe.toString();if(typeof(this._map[qe])==='undefined'){this._array.push(qe);}
this._map[qe]=pe.toString();};xmp.util.PlayerStats.prototype.getValue=function(se){var te=se.toString();var ue=this._map[te];if(typeof(ue)==='undefined'){return'';}
return ue;};xmp.util.PlayerStats.prototype.getKeys=function(){var ve=[];for(var i=0;i<this._array.length;i++){ve.push(this._array[i]);}
return ve;};xmp.util.PlayerStats.prototype._packCommon=function(){this.setValue('sessionId',((new Date()).getTime()).toString());this.setValue('userId',xmp.util.Cookie.read('CNNid'));this.setValue('geoId',xmp.util.Cookie.read('adDEmas'));};xmp.createNamespace("xmp.util");xmp.util.PreferenceNode=function(we,xe,ye){this._parent=null;this._root=null;this._isSystemNode=false;this._name='';this._absolutePath='';this._children={};this._map={};if(typeof xe!=='string'){throw new xmp.util.internals.InvalidArgsError("Argument 'name' must be a non-null string.");}
if(we===null){if(xe.length>0){throw new xmp.util.internals.InvalidArgsError("Root node cannot have a name.");}
this._root=this;this._absolutePath=xmp.util.PreferenceNode._PATH_SEPARATOR;}
else{if(xe.length===0){throw new xmp.util.internals.InvalidArgsError("Non-root node cannot have an empty name.");}
this._root=we.getRoot();if(we===this._root){this._absolutePath=we.getAbsolutePath()+xe;}
else{this._absolutePath=we.getAbsolutePath()+xmp.util.PreferenceNode._PATH_SEPARATOR+xe;}
we._addChild(xe,this);}
this._isSystemNode=ye;this._parent=we;this._name=xe;};xmp.util.PreferenceNode._PATH_SEPARATOR='/';xmp.util.PreferenceNode.prototype.getAbsolutePath=function(){return this._absolutePath;};xmp.util.PreferenceNode.prototype.retrieveChildrenNames=function(){return xmp.MapIterator.extractKeysSorted(this._children);};xmp.util.PreferenceNode.prototype.retrieveChildren=function(){var ze=this.retrieveChildrenNames();var Ae=[];for(var i=0;i<ze.length;i++){var Be=this._getChild(ze[i]);Ae.push(Be);}
return Ae;};xmp.util.PreferenceNode.prototype.retrieveKeys=function(){return xmp.MapIterator.extractKeysSorted(this._map);};xmp.util.PreferenceNode.prototype.getName=function(){return this._name;};xmp.util.PreferenceNode.prototype.getParent=function(){return this._parent;};xmp.util.PreferenceNode.prototype.getRoot=function(){return this._root;};xmp.util.PreferenceNode.prototype.getNodeForPath=function(Ce){try{var De=this._splitPathAndReturnStartingNode(Ce);return this._getNodeForPathRecursive(De[0],De[1]);}
catch(e){throw new Error("Error calling getNodeForPath: "+xmp.extractErrorMessage(e));}};xmp.util.PreferenceNode.prototype.nodeExists=function(Ee){if(Ee===xmp.util.PreferenceNode._PATH_SEPARATOR){return true;}
var Fe=this._splitPathAndReturnStartingNode(Ee);var Ge=Fe[0];var He=Fe[1];for(var i=0;i<He.length;i++){var Ie=He[i];Ge=Ge._getChild(Ie);if(!Ge){return false;}}
return true;};xmp.util.PreferenceNode.prototype.getString=function(Je,Ke){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"PreferenceNode.getString");var Le=this._get(Je);if(!Le){return Ke;}
if(typeof Le!=='string'){throw new Error("Found value, but was not a string.");}
return Le;};xmp.util.PreferenceNode.prototype.getBoolean=function(Me,Ne){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.BOOLEAN_TYPE],"PreferenceNode.getBoolean");var Oe=this._get(Me);if(!Oe){return Ne;}
Oe=Oe.toLowerCase();if(Oe==='false'){return false;}
if(Oe==='true'){return true;}
throw new Error("Found value, but was not a boolean.");};xmp.util.PreferenceNode.prototype.getInt=function(Pe,Qe){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.NUMBER_TYPE],"PreferenceNode.getInt");if(Qe!==Math.floor(Qe)){throw new xmp.util.internals.InvalidArgsError("The 'defaultValue' argument must be an integer.");}
var Re=this._get(Pe);if(!Re){return Qe;}
if(!this._isNumber(Re,false)){throw new Error("Found value, but was not an integer.");}
return parseInt(Re,0);};xmp.util.PreferenceNode.prototype.getFloat=function(Se,Te){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.NUMBER_TYPE],"PreferenceNode.getFloat");var Ue=this._get(Se);if(!Ue){return Te;}
if(!this._isNumber(Ue,true)){throw new Error("Found value, but was not a float.");}
return parseFloat(Ue,0);};xmp.util.PreferenceNode.prototype._addChild=function(Ve,We){this._children[Ve]=We;};xmp.util.PreferenceNode.prototype._createChild=function(Xe){return new xmp.util.PreferenceNode(this,Xe,this._isSystemNode);};xmp.util.PreferenceNode.prototype._getChild=function(Ye){return this._children[Ye];};xmp.util.PreferenceNode.prototype._get=function(Ze){if(Ze.length===0){throw new xmp.util.internals.InvalidArgsError("The 'key' argument must be a non-empty string.");}
var $e=this._map[Ze];return $e;};xmp.util.PreferenceNode.prototype._addValue=function(af,bf){this._map[af]=bf;};xmp.util.PreferenceNode.prototype._isNumber=function(cf,df){return xmp.isNumber(cf,df);};xmp.util.PreferenceNode.prototype._splitPathAndReturnStartingNode=function(ef){var ff=this;var gf=ef.split(xmp.util.PreferenceNode._PATH_SEPARATOR);var i=0;var j=0;for(i=0,j=gf.length;i<j;i++){if(gf[i].length===0){if(i===0){ff=this._root;}
else{throw new Error("pathName contains consecutive slashes: "+ef,"pathName");}}}
if(gf[0].length===0){gf.shift();}
return[ff,gf];};xmp.util.PreferenceNode.prototype._getNodeForPathRecursive=function(hf,jf){if(jf.length>0){var kf=jf[0];var lf=hf._getChild(kf);if(!lf){lf=hf._createChild(kf);hf._addChild(kf,lf);}
hf=lf;jf.shift();return hf._getNodeForPathRecursive(hf,jf);}
return this;};xmp.util.PreferenceNode.prototype.cloneTo=function(mf){var nf=this.retrieveKeys();for(var i=0;i<nf.length;i++){var of=nf[i];var pf=this._get(of);mf._addValue(of,pf);}
var qf=this.retrieveChildrenNames();for(var j=0;j<qf.length;j++){var rf=qf[j];var sf=this.getNodeForPath(rf);var tf=mf.getNodeForPath(rf);sf.cloneTo(tf);}};xmp.util.PreferenceNode.prototype.toXml=function(uf,vf){var wf=null;if(this===this.getRoot()){wf=uf.createNode(1,'root','');wf.setAttribute('type',(this._isSystemNode?'system':'user'));}
else{wf=uf.createNode(1,'node','');wf.setAttribute('name',this.getName());}
vf.appendChild(wf);var xf=uf.createNode(1,'map','');wf.appendChild(xf);var yf=this.retrieveKeys();for(var i=0;i<yf.length;i++){var zf=yf[i];var Af=this._get(zf);var Bf=uf.createNode(1,'entry','');Bf.setAttribute('key',zf);Bf.setAttribute('value',Af);xf.appendChild(Bf);}
var Cf=this.retrieveChildren();for(var j=0;j<Cf.length;j++){var Df=Cf[j];Df.toXml(uf,wf);}};xmp.createNamespace("xmp.util");xmp.util.RootUrlProvider=function(){};xmp.util.RootUrlProvider._instance=null;xmp.util.RootUrlProvider.getInstance=function(){if(xmp.util.RootUrlProvider._instance===null){xmp.util.RootUrlProvider._instance=new xmp.util.RootUrlProvider();}
return xmp.util.RootUrlProvider._instance;};xmp.util.RootUrlProvider.prototype.getRootUrl=function(Ef,Ff){var Gf=this.getRootUrlNode(Ef);if(Gf===null){return'';}
if(!xmp.isNonEmptyString(Ff)){Ff=xmp.NO_DEFAULT_VALUE;}
return Gf.getString(xmp.ROOT_URL,Ff);};xmp.util.RootUrlProvider.prototype.getRootUrlNode=function(Hf){var If=xmp.util.SettingsManager.getInstance().getGlobalContextNode();if(!If.nodeExists('rootUrlMap/'+Hf)){return null;}
return If.getNodeForPath('rootUrlMap/'+Hf);};xmp.createNamespace("xmp.util");xmp.util.SettingsManager=function(){this._doGenericPlayerContextUnderlay=true;this._root=null;this._buildingRoot=null;this._backingStoreArray=[];this._context='';this._contextNode=null;this._globalContextNode=null;this._contextChangeListeners=[];this._buildSubstitutionMap={};};xmp.util.SettingsManager._singeltonInstance=null;xmp.util.SettingsManager.getInstance=function(){if(xmp.util.SettingsManager._singeltonInstance===null){xmp.util.SettingsManager._singeltonInstance=new xmp.util.SettingsManager();}
return xmp.util.SettingsManager._singeltonInstance;};xmp.util.SettingsManager.prototype.getRoot=function(){return this._root;};xmp.util.SettingsManager.prototype.getContextNode=function(){return this._contextNode;};xmp.util.SettingsManager.prototype.getGlobalContextNode=function(){return this._globalContextNode;};xmp.util.SettingsManager.prototype.getContext=function(){return this._context;};xmp.util.SettingsManager.prototype.init=function(Jf,Kf){this._buildSubstitutionMap=(Kf)?Kf:{};this._context='';this._root=null;this._contextNode=null;this._globalContextNode=null;this._buildingRoot=null;this._backingStoreArray=[];this._backingStoreArray=this._backingStoreArray.concat(Jf);this._build();};xmp.util.SettingsManager.prototype.addContextChangeListener=function(Lf){this._contextChangeListeners.push(Lf);};xmp.util.SettingsManager.prototype.setContext=function(Mf){this._context=(!Mf)?'':Mf;this._contextNode=null;if(this._context.length!==0){this._contextNode=this._root.getNodeForPath('/PlayerContexts/'+this._context);}
for(var i=0;i<this._contextChangeListeners.length;i++){this._contextChangeListeners[i].call();}};xmp.util.SettingsManager.prototype._build=function(){this._buildingRoot=new xmp.util.PreferenceNode(null,'',true);try{for(var i=0;i<this._backingStoreArray.length;i++){var Nf=this._backingStoreArray[i];this._buildBackingStore(Nf);}}
catch(e){this._backingStoreArray=[];this._buildingRoot=null;throw e;}
this._backingStoreArray=[];this._root=this._buildingRoot;this.setContext(this._context);this._globalContextNode=this._root.getNodeForPath('/PlayerContexts/Global');};xmp.util.SettingsManager.prototype._buildBackingStore=function(Of){try{var Pf=Of;var Qf=this._buildingRoot;this._buildMap(Qf,Pf.map);this._buildNodes(Qf,Pf.nodes);}
catch(e){throw new Error("Error calling _buildBackingStore: "+xmp.extractErrorMessage(e));}};xmp.util.SettingsManager.prototype._buildNode=function(Rf,Sf){if(!xmp.isNonEmptyString(Sf.name)){throw new Error("Missing 'name' or 'name' is empty");}
var Tf=Rf.getNodeForPath(Sf.name);this._buildGenericContext(Rf,Tf);this._buildMap(Tf,Sf.map);this._buildNodes(Tf,Sf.nodes);};xmp.util.SettingsManager.prototype._buildGenericContext=function(Uf,Vf){if(this._doGenericPlayerContextUnderlay&&(Uf.getAbsolutePath()==='/PlayerContexts')&&!(Vf.getName()==='Global'||Vf.getName()==='Generic')){var Wf=Uf.getNodeForPath('/PlayerContexts/Generic');Wf.cloneTo(Vf);}};xmp.util.SettingsManager.prototype._buildMap=function(Xf,Yf){for(var i=0;i<Yf.length;i++){var Zf=Yf[i];if(!xmp.isNonEmptyString(Zf.key)||(typeof Zf.value!=='string')){throw new Error("Missing or empty 'key' or missing 'value'.");}
Xf._addValue(Zf.key,this._substitute(Zf.value));}};xmp.util.SettingsManager.prototype._substitute=function($f){if($f.indexOf('${{')===-1){return $f;}
for(var ag=xmp.MapIterator.create(this._buildSubstitutionMap);ag.hasNext();ag.next()){var bg=ag.currentKey();var cg=ag.currentValue();var dg='${{'+bg+'}}';$f=$f.replace(dg,cg);}
return $f;};xmp.util.SettingsManager.prototype._buildNodes=function(eg,fg){for(var i=0;i<fg.length;i++){var gg=fg[i];this._buildNode(eg,gg);}};xmp.util.SettingsManager.prototype.saveAsXmlFile=function(hg){if(xmp.isBrowserEnvironment()){xmp.showMessage('This method meant to be called from WSH only.');return;}
var ig=this.toXml();ig.save(hg);};xmp.util.SettingsManager.prototype.toXml=function(){var jg='';jg+='<?xml version="1.0" encoding="UTF-8" ?>';jg+='<!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd">';jg+='<preferences EXTERNAL_XML_VERSION="1.0"/>';var kg=new ActiveXObject('MSXML2.DOMDocument');kg.async=false;kg.resolveExternals=false;kg.validateOnParse=false;kg.loadXML(jg);this.getRoot().toXml(kg,kg.documentElement);return kg;};xmp.createNamespace("xmp.util");xmp.util.Timer=function(id,lg,mg,ng){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.NUMBER_TYPE,xmp.NUMBER_TYPE,xmp.OBJECT_TYPE],"Timer.ctor");if(id===null||id.length===0||lg<0||!(mg===-1||mg>0)||ng===null){throw new xmp.util.internals.InvalidArgsError("The 'id' argument must be non-empty, "+"and the 'interval' argument must a positive integer, "+"and the 'maxRepeatCount' argument must be -1 or a positive integer, "+"and the 'callback' must be non-null.");}
this._id=id;this._interval=lg;this._maxRepeatCount=mg;this._callback=ng;this._repeatCount=0;this._cookie=-1;};xmp.util.Timer._simpleIdCounter=0;xmp.util.Timer._simpleTimerMap={};xmp.util.Timer.doSimpleCallback=function(og){xmp.util.Timer.doSimpleCallbackEx(xmp.DEFAULT_TIMER_INTERVAL,og);};xmp.util.Timer.doSimpleCallbackEx=function(pg,qg){xmp.util.Timer._simpleIdCounter++;var id='SimpleTimer_'+xmp.util.Timer._simpleIdCounter.toString();var rg=new xmp.util.Callback(id,xmp.util.Timer._doSimpleCallbackCb,null);rg.setMetadata('relayCb',qg);var sg=new xmp.util.Timer(id,pg,1,rg);xmp.util.Timer._simpleTimerMap[sg.getId()]=sg;sg.start();};xmp.util.Timer._doSimpleCallbackCb=function(tg,ug){if(typeof(xmp.util.Timer._simpleTimerMap[ug.getId()])!=='undefined'){delete xmp.util.Timer._simpleTimerMap[ug.getId()];}
var vg=tg.getMetadata('relayCb',xmp.util.internals.MetadataMap.defaultObj);vg.call();};xmp.util.Timer.prototype.getId=function(){return this._id;};xmp.util.Timer.prototype.isRunning=function(){return(this._cookie!==-1);};xmp.util.Timer.prototype.start=function(){this.stop();this._repeatCount=0;var wg=this;this._cookie=window.setInterval(function(){wg._timerCallback();},this._interval);};xmp.util.Timer.prototype.stop=function(){if(this._cookie!==-1){window.clearInterval(this._cookie);this._cookie=-1;}};xmp.util.Timer.prototype._timerCallback=function(){if(!this.isRunning()){return;}
try{this._callback.call(this);}
catch(ex){xmp.util.internals.CategoryLogger.create('Timer').warn('Exception calling timer calback.',ex);}
if(!this.isRunning()){return;}
this._repeatCount++;if(this._maxRepeatCount!==-1&&this._repeatCount>=this._maxRepeatCount){this.stop();}};xmp.createNamespace("xmp.util");xmp.util.TriggerHelper=function(){};xmp.util.TriggerHelper.handleTrackRequest=function(xg,yg){xmp.baseplayer.internals.Trigger.getTrigger(xg,'request').doCommands(xmp.util.TriggerHelper._createTriggerContext(xg,yg));};xmp.util.TriggerHelper.handleTrackStart=function(zg,Ag){xmp.baseplayer.internals.Trigger.getTrigger(zg,'start').doCommands(xmp.util.TriggerHelper._createTriggerContext(zg,Ag));};xmp.util.TriggerHelper.handleTrackMidpoint=function(Bg,Cg){xmp.baseplayer.internals.Trigger.getTrigger(Bg,'mid').doCommands(xmp.util.TriggerHelper._createTriggerContext(Bg,Cg));};xmp.util.TriggerHelper.handleTrackEnd=function(Dg,Eg){xmp.baseplayer.internals.Trigger.getTrigger(Dg,'end').doCommands(xmp.util.TriggerHelper._createTriggerContext(Dg,Eg));};xmp.util.TriggerHelper._createTriggerContext=function(Fg,Gg){var Hg=new xmp.baseplayer.TriggerContext();Hg.setPlayableNode(Fg);Hg.setMetadata('player',Gg);return Hg;};xmp.createNamespace("xmp.util");xmp.util.Version=function(){};xmp.util.Version.VERSION_BUILD_TIME_REPLACE_ME="0.1.567.2163";xmp.util.Version.getAsString=function(){return xmp.util.Version.VERSION_BUILD_TIME_REPLACE_ME;};xmp.util.Version.makeFileVersionString=function(Ig,Jg){var Kg=xmp.util.Version.getAsString();Kg=Kg.replace(/\./g,'_');return Ig+'_'+Kg+'.'+Jg;};xmp.XmpErrorCodes=function(){};xmp.XmpErrorCodes.NONE=0;xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR=1;xmp.XmpErrorCodes.FATAL_PLATFORM=1000;xmp.XmpErrorCodes.FATAL_PLUGIN=2000;xmp.XmpErrorCodes.FATAL_PLUGIN_INIT=2100;xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR=5000;xmp.XmpErrorCodes.CRITICAL_FIRST_FRAME_TIMEOUT=6000;xmp.XmpErrorCodes.CRITICAL_PLAYER_CONNECTION=7000;xmp.XmpErrorCodes._calc=function(Lg){var Mg=xmp.XmpErrorCodes;if(typeof Lg==='number'){for(var Ng=xmp.MapIterator.create(Mg);Ng.hasNext();Ng.next()){var v=Ng.currentValue();if(v===Lg){return Lg;}}}
return Mg.NONE;};xmp.XmpErrorCodes.stringify=function(Og){var Pg=xmp.XmpErrorCodes;var Qg=Pg._calc(Og);switch(Qg){case Pg.NONE:return'none';case Pg.FATAL_UNSPECIFIED_ERROR:return'fatal_unspecified_error';case Pg.FATAL_PLATFORM:return'Unsupported Platform (fatal error)';case Pg.FATAL_PLUGIN:return'Plugin Not Found (fatal error)';case Pg.FATAL_PLUGIN_INIT:return'Plugin Timeout (fatal error)';case Pg.CRITICAL_UNSPECIFIED_AJAX_ERROR:return'Unspecified Ajax Error (critical error)';case Pg.CRITICAL_FIRST_FRAME_TIMEOUT:return'Video First Frame Timeout (critical error)';case Pg.CRITICAL_PLAYER_CONNECTION:return'Video Connection Problem (critical error)';default:return'none';}};xmp.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(Rg){var Sg="";var Tg,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;Rg=xmp.Base64._utf8_encode(Rg);while(i<Rg.length){Tg=Rg.charCodeAt(i);i++;chr2=Rg.charCodeAt(i);i++;chr3=Rg.charCodeAt(i);i++;enc1=Tg>>2;enc2=((Tg&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}
Sg=Sg+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}
return Sg;},decode:function(Ug){var Vg="";var Wg,chr2,chr3;var Xg,enc2,enc3,enc4;var i=0;Ug=Ug.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<Ug.length){Xg=this._keyStr.indexOf(Ug.charAt(i));i++;enc2=this._keyStr.indexOf(Ug.charAt(i));i++;enc3=this._keyStr.indexOf(Ug.charAt(i));i++;enc4=this._keyStr.indexOf(Ug.charAt(i));i++;Wg=(Xg<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;Vg=Vg+String.fromCharCode(Wg);if(enc3!==64){Vg=Vg+String.fromCharCode(chr2);}
if(enc4!==64){Vg=Vg+String.fromCharCode(chr3);}}
Vg=xmp.Base64._utf8_decode(Vg);return Vg;},_utf8_encode:function(Yg){Yg=Yg.replace(/\r\n/g,"\n");var Zg="";for(var n=0;n<Yg.length;n++){var c=Yg.charCodeAt(n);if(c<128){Zg+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){Zg+=String.fromCharCode((c>>6)|192);Zg+=String.fromCharCode((c&63)|128);}
else{Zg+=String.fromCharCode((c>>12)|224);Zg+=String.fromCharCode(((c>>6)&63)|128);Zg+=String.fromCharCode((c&63)|128);}}
return Zg;},_utf8_decode:function($g){var ah="";var i=0;var c=0;var c1=0;var c2=0;var c3=0;while(i<$g.length){c=$g.charCodeAt(i);if(c<128){ah+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=$g.charCodeAt(i+1);ah+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=$g.charCodeAt(i+1);c3=$g.charCodeAt(i+2);ah+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return ah;}};xmp.createNamespace("xmp.util.internals");xmp.util.internals.BrowserDetect={init:function(){if(!xmp.isBrowserEnvironment()){return;}
this.buildData();this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(bh){for(var i=0;i<bh.length;i++){var ch=bh[i].string;var dh=bh[i].prop;this.versionSearchString=bh[i].versionSearch||bh[i].identity;if(ch){if(ch.indexOf(bh[i].subString)!==-1){return bh[i].identity;}}
else if(dh){return bh[i].identity;}}
return"";},searchVersion:function(eh){var fh=eh.indexOf(this.versionSearchString);if(fh===-1){return"";}
return parseFloat(eh.substring(fh+this.versionSearchString.length+1));},buildData:function(){this.dataBrowser=[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"SeaMonkey",identity:"SeaMonkey"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}];this.dataOS=[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}];}};xmp.util.internals.BrowserDetect.init();xmp.createNamespace("xmp.util.internals");xmp.util.internals.CategoryLogger=function(gh){this._logger=xmp.util.Logger.getInstance();this._category=(gh&&gh.length>0)?gh:"NULL CATEGORY";};xmp.util.internals.CategoryLogger.create=function(hh){return new xmp.util.internals.CategoryLogger(hh);};xmp.util.internals.CategoryLogger.prototype.fatal=function(ih,jh){this._logger.fatal(this._category,ih,jh);};xmp.util.internals.CategoryLogger.prototype.critical=function(kh,lh){this._logger.critical(this._category,kh,lh);};xmp.util.internals.CategoryLogger.prototype.warn=function(mh,nh){this._logger.warn(this._category,mh,nh);};xmp.util.internals.CategoryLogger.prototype.info=function(oh,ph){this._logger.info(this._category,oh,ph);};xmp.util.internals.CategoryLogger.prototype.debug=function(qh,rh){this._logger.debug(this._category,qh,rh);};xmp.util.internals.CategoryLogger.prototype.isWarnEnabled=function(){return this._logger.isWarnEnabled(this._category);};xmp.util.internals.CategoryLogger.prototype.isInfoEnabled=function(){return this._logger.isInfoEnabled(this._category);};xmp.util.internals.CategoryLogger.prototype.isDebugEnabled=function(){return this._logger.isDebugEnabled(this._category);};xmp.createNamespace("xmp.util.internals");xmp.util.internals.MetadataMap=function(sh){xmp.validateArguments(arguments,[xmp.BOOLEAN_TYPE],"MetadataMap.ctor");this._readOnly=sh;this._wrappedMetadata={};};xmp.util.internals.MetadataMap.defaultObj={};xmp.util.internals.MetadataMap.prototype._isReadOnly=function(){return this._readOnly;};xmp.util.internals.MetadataMap.prototype._get=function(th,uh){if(!((arguments.length===2)&&xmp.isNonEmptyString(th))){throw new xmp.util.internals.InvalidArgsError("Invalid 'key' (undefined, null, or empty).");}
var vh=this._wrappedMetadata[th];return xmp.chooseValueOrDefault(vh,uh);};xmp.util.internals.MetadataMap.prototype._set=function(wh,xh){if(this._readOnly){throw new xmp.playlistapi.internals.PlayListError("Cannot modify readonly MetadataMap");}
if(!xmp.isNonEmptyString(wh)||typeof xh==="undefined"){throw new xmp.util.internals.InvalidArgsError("Invalid key (null or empty) or invalid value (undefined)");}
this._wrappedMetadata[wh]=xh;};xmp.util.internals.MetadataMap.prototype._remove=function(yh){if(!xmp.isNonEmptyString(yh)){throw new xmp.util.internals.InvalidArgsError("Invalid key (null or empty)");}
if(typeof(this._wrappedMetadata[yh])!=='undefined'){delete this._wrappedMetadata[yh];}};xmp.util.internals.MetadataMap.prototype._reInitialize=function(zh){this._wrappedMetadata=zh;};xmp.util.internals.MetadataMap.prototype._getClonedWrappedMetadata=function(){var Ah={};for(var Bh=xmp.MapIterator.create(this._wrappedMetadata);Bh.hasNext();Bh.next()){var Ch=Bh.currentKey();var Dh=Bh.currentValue();Ah[Ch]=Dh;}
return Ah;};xmp.createNamespace("xmp.util.internals");xmp.MOCK_TEST_MODE_ROOTURLMAP_PATH="/PlayerContexts/Global/rootUrlMap/";xmp.MOCK_TEST_MODE_MEDIATYPE_PATH="/PlayerContexts/Global/PlayingPolicy/MediaTypes/";xmp.SAFE_REAL_PLAY_TIME_PER_NODE=500;xmp.FAST_REAL_PLAY_TIME_PER_NODE=50;xmp.util.internals.MockTestMode=function(){this._isActive=false;this._realPlayTimePerNode=xmp.SAFE_REAL_PLAY_TIME_PER_NODE;};xmp.util.internals.MockTestMode._singeltonInstance=null;xmp.util.internals.MockTestMode._playbleNodeTypes=["PreRoll","PostRoll","SponsoredAd","HouseAd","AdInsertNotForSale","Promo","Content","NextUpSlate","StartSlate","CustomSlate"];xmp.util.internals.MockTestMode.getInstance=function(){if(xmp.util.internals.MockTestMode._singeltonInstance===null){xmp.util.internals.MockTestMode._singeltonInstance=new xmp.util.internals.MockTestMode();}
return xmp.util.internals.MockTestMode._singeltonInstance;};xmp.util.internals.MockTestMode.prototype.isActive=function(){return this._isActive;};xmp.util.internals.MockTestMode.prototype.setActive=function(Eh){this._isActive=Eh;};xmp.util.internals.MockTestMode.prototype.getRealPlayTimePerNode=function(){return this._realPlayTimePerNode;};xmp.util.internals.MockTestMode.prototype.setRealPlayTimePerNode=function(Fh){this._realPlayTimePerNode=Fh;};xmp.util.internals.MockTestMode.prototype.overrideMimeType=function(Gh){if((Gh.getMimeType()!==xmp.MOCK_MIME_TYPE||Gh.getMimeTypes()!==[xmp.MOCK_MIME_TYPE])&&this._shouldOverrideMimeType(Gh)){Gh.setMimeType(xmp.MOCK_MIME_TYPE);Gh.setMimeTypes([xmp.MOCK_MIME_TYPE]);}};xmp.util.internals.MockTestMode.prototype._shouldOverrideMimeType=function(Hh){for(var i=0;i<xmp.util.internals.MockTestMode._playbleNodeTypes.length;i++){var Ih=Hh.getNodeTypeName();if(Ih===xmp.util.internals.MockTestMode._playbleNodeTypes[i]){return true;}}
return false;};xmp.util.internals.MockTestMode.prototype.configure=function(){var Jh=['videoContentMeta','videoPromoMeta','adPolicy','ruleClasses','adMan','dhtmlObject','adServer'];for(var i=0;i<Jh.length;i++){var Kh=xmp.MOCK_TEST_MODE_ROOTURLMAP_PATH+Jh[i];var Lh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(Kh);Lh._addValue('transportType','mock');}
var Mh=['Flash','WindowsMedia'];for(var j=0;j<Mh.length;j++){var Nh=xmp.MOCK_TEST_MODE_MEDIATYPE_PATH+Mh[j];var Oh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(Nh);Oh._addValue('mime-type',xmp.MOCK_MIME_TYPE);}};xmp.createNamespace("xmp.util.internals");xmp.util.internals.NullLoggerListener=function(){};xmp.util.internals.NullLoggerListener.prototype.handleLogMessage=function(Ph,Qh,Rh){};xmp.createNamespace("xmp.util.internals");xmp.util.internals.UnsupportedOperationError=function(Sh){xmp.util.internals.UnsupportedOperationError.ctor.call(this,"UnsupportedOperationError",null,Sh);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.util.internals.UnsupportedOperationError);

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);this.properties={};}
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()){this.applyCustomStyle(this.getNativeOverlay());}}
catch(e){this._handleError("Setting overlay style.",e);}};xmp.Overlay.prototype.show=function(ia){try{this.display=xmp.DISPLAY_BLOCK;if(false===this.viewportExists()){return;}
this.setZOrder();this.getNativeOverlay().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(ja,ka,la,ma){try{this.rectangle={left:xmp.getPixelUnits(ja),top:xmp.getPixelUnits(ka),width:xmp.getPixelUnits(la),height:xmp.getPixelUnits(ma)};if(true===this.viewportExists()&&true===this.isVisible()){var na=this.getNativeOverlay();var oa=((this.style.length>0)?this.style+"; ":"")+"z-Index: "+this.zIndex+"; position: "+this.position+"; display: "+this.display+"; marginLeft: "+"0px"+"; marginTop: "+"0px"+"; left: "+this.rectangle.left+"; top: "+this.rectangle.top+"; width: "+this.rectangle.width+"; height: "+this.rectangle.height;na.style.cssText=oa;}}
catch(e){this._handleError("Moving overlay.",e);}};xmp.Overlay.prototype.getNativeOverlay=function(){var pa=document.getElementById(this.name);if(pa===null){pa=document.createElement(xmp.OVERLAY_ELEMENT);pa.setAttribute(xmp.ID_ATTRIBUTE,this.name);pa.setAttribute(xmp.NAME_ATTRIBUTE,this.name);pa.style.display=this.display;this.position=xmp.ABSOLUTE_POSITION;pa.style.position=this.position;pa.style.marginLeft="0px";pa.style.marginTop="0px";pa.style.left=this.rectangle.left;pa.style.top=this.rectangle.top;pa.style.width=this.rectangle.width;pa.style.height=this.rectangle.height;pa.innerHTML=this.getRenderableHTML();this.applyCustomStyle(pa);var qa=xmp.getDomParent(this.viewport.getNative());xmp.insertDomChildBefore(qa,pa);}
return pa;};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(ra){this.viewport=ra;};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(sa,e){var ta=e;if(false===(ta instanceof xmp.OverlayError)){ta=new xmp.OverlayError(((e.context)?e.context:sa),((e.rawMessage)?e.rawMessage:e.message),this);ta.setInnerError(e);}
throw ta;};xmp.Overlay.prototype._destoryNativeOverlay=function(){var ua=document.getElementById(this.name);if(ua!==null){var va=xmp.getDomParent(ua);va.removeChild(ua);}};xmp.Overlay.prototype.onViewportChange=function(wa,xa,ya,za){};xmp.Overlay.prototype.getRenderableHTML=function(){var Aa=this.html;var Ba=[{name:xmp.OVERLAY_WIDTH_PARAMETER,value:this.rectangle.width},{name:xmp.OVERLAY_HEIGHT_PARAMETER,value:this.rectangle.height}];var Ca=Ba.length;for(var i=0;i<Ca;i++){Aa=Aa.replace(Ba[i].name,Ba[i].value);}
return Aa;};xmp.Overlay.prototype.getId=function(){return this.name;};xmp.Overlay.prototype.setProperty=function(Da,Ea){this.properties[Da]=Ea;this.onPropertyChange(Da,Ea);};xmp.Overlay.prototype.getProperty=function(Fa){return this.properties[Fa];};xmp.Overlay.prototype.onPropertyChange=function(Ga,Ha){};xmp.Overlay.prototype.applyCustomStyle=function(Ia){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;};xmp.Overlay.prototype.setZOrder=function(){var Ka=this.viewport.getNativePlayer().getNative();if(!Ka){throw new xmp.OverlayError("Showing overlay.","A native player does not exist for the viewport.",this);}
if(!Ka.style.zIndex||Ka.style.zIndex<=0){Ka.style.zIndex=1;}
var La=this.getNativeOverlay();this.zIndex=parseInt(Ka.style.zIndex,10)+1;La.style.zIndex=this.zIndex;};xmp.NATIVE_VIEWPORT_Z_INDEX=1;xmp.Viewport=function(Ma,Na,Oa,Pa,Qa){this.listener=Ma;this.type=Na;this.mime_type=Oa;this.contextName=Pa;this.name=Pa+this.type.substr(this.type.indexOf(".")+1);this.overlays=Qa;this.opened=false;this.style="";this.nativeViewport=null;this.nativePlayer=null;};xmp.Viewport.prototype.init=function(Ra,Sa,Ta){try{this.createContext=Ra;xmp.ViewportRegistry.addViewport(this);this.nativeViewport=this.listener.onCreateViewport(this.type,this.name,Sa,Ta);}
catch(e){this.setError("Creating viewport.",e);}};xmp.Viewport.prototype.open=function(Ua){this.createContext=Ua;};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(Va){this.createContext=Va;};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(Wa,Xa,Ya){try{var Za=((this.nativeViewport.style.marginLeft.length>0)?this.nativeViewport.style.marginLeft:"0px");var $a=((this.nativeViewport.style.marginTop.length>0)?this.nativeViewport.style.marginTop:"0px");this.moveTo(Za,$a,Wa,Xa,Ya);}
catch(e){this.setError("Setting viewport size.",e);}};xmp.Viewport.prototype.moveTo=function(ab,bb,cb,db,eb){try{if(this.nativePlayer){this.nativePlayer.moveTo(ab,bb,cb,db);}
var fb=((this.style.length>0)?this.style+"; ":"")+((this.nativeViewport.style.zIndex)?"z-Index: "+this.nativeViewport.style.zIndex+";":"")+"margin-left: "+xmp.getPixelUnits(ab)+"; margin-top: "+xmp.getPixelUnits(bb)+"; width: "+xmp.getPixelUnits(cb)+"; height: "+xmp.getPixelUnits(db);this.nativeViewport.style.cssText=fb;if(true===eb){for(var i=0;i<this.overlays.length;i++){this.overlays[i].onViewportChange(ab,bb,cb,db);}}}
catch(e){this.setError("Moving viewport.",e);}};xmp.Viewport.prototype.setStyle=function(gb){try{this.style=gb;var hb=((this.nativeViewport.style.left.length>0)?this.nativeViewport.style.left:"0");var ib=((this.nativeViewport.style.top.length>0)?this.nativeViewport.style.top:"0");var jb=((this.style.length>0)?this.style+"; ":"")+"left: "+hb+"; top: "+ib+"; width: "+this.nativeViewport.style.width+"; height: "+this.nativeViewport.style.height;this.nativeViewport.style.cssText=jb;}
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.getNativeData=function(){return this.native_data;};xmp.Viewport.prototype.setError=function(kb,e){var lb=e;if(false===(lb instanceof xmp.ViewportError)){lb=new xmp.ViewportError(((e.context)?e.context:kb),((e.rawMessage)?e.rawMessage:e.message),this);lb.setInnerError(e);}
this._createTimer({id:"setError",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetError,context:lb}).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(mb){var nb=new xmp.util.Callback(mb.id,mb.handler,this);nb.setMetadata(xmp.CONTEXT,mb.context);return new xmp.util.Timer(mb.id,mb.interval,-1,nb);};xmp.Viewport.prototype.setNativePlayer=function(ob){this.nativePlayer=ob;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(pb,qb){var rb=null;try{qb.stop();rb=pb.getMetadata(xmp.CONTEXT,{});this.listener.onViewportError(rb);}
catch(e){var sb=((rb)?rb:e);xmp.handleFatalError(sb);}};xmp.Viewport.prototype.onSetOpened=function(tb,ub){try{ub.stop();this.listener.onViewportOpened(this,this.createContext);}
catch(e){this.setError("Forwarding opened notification to listener.",e);}};xmp.Viewport.prototype.onSetCreated=function(vb,wb){try{wb.stop();this.listener.onViewportCreated(this,this.createContext);}
catch(e){this.setError("Forwarding created notification to listener.",e);}};xmp.Viewport.prototype.getCallbackMethod=function(xb){return"xmp.ViewportRegistry.getViewport( '"+this.getName()+"' )."+xb;};xmp.DHTML_VIEWPORT="xmp.DHTMLViewport";xmp.DHTMLViewport=function(yb,zb,Ab,Bb){xmp.DHTMLViewport.ctor.call(this,yb,xmp.DHTML_VIEWPORT,zb,Ab,Bb);};xmp.DERIVE_CLASS(xmp.Viewport,xmp.DHTMLViewport);xmp.DHTMLViewport.prototype.open=function(Cb,Db){xmp.DHTMLViewport.base.open.call(this,Cb,Db);this.setOpened();};xmp.DHTMLViewport.prototype.init=function(Eb,Fb,Gb){xmp.DHTMLViewport.base.init.call(this,Eb,Fb,Gb);this.setCreated();};xmp.FLASH_VIEWPORT="xmp.FlashViewport";xmp.FLASH_VIEWPORT_OPENED_METHOD="onOpened";xmp.FLASH_VIEWPORT_CREATED_METHOD="onCreated";xmp.FLASH_VIEWPORT_ERROR_METHOD="onError";xmp.FVP_OPEN_COMMAND="fvpOpen";xmp.FlashViewport=function(Hb,Ib,Jb,Kb){xmp.FlashViewport.ctor.call(this,Hb,xmp.FLASH_VIEWPORT,Ib,Jb,Kb);};xmp.DERIVE_CLASS(xmp.Viewport,xmp.FlashViewport);xmp.FlashViewport.prototype.init=function(Lb,Mb,Nb){var Ob=[{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 Pb=[{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)},{name:xmp.FLASH_NATIVE_PLAYER_COMPONENT,value:xmp.makeSWFPath(xmp.FLASH_PLAYER_SWF_BASE_NAME,true)}];xmp.FlashViewport.base.init.call(this,Lb,Ob,Pb);};xmp.FlashViewport.prototype.open=function(Qb,Rb){xmp.FlashViewport.base.open.call(this,Qb,Rb);var Sb=this.getNative();Sb.style.zIndex=xmp.NATIVE_VIEWPORT_Z_INDEX;Sb.SetVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.FLASH_VIEWPORT_OPENED_METHOD));Sb.fvpOpen();};xmp.FlashViewport.prototype.reset=function(Tb,Ub){};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(Vb,Wb){try{var Xb=[{label:"Flash Error Type",text:Vb}];this.setError(null,new xmp.ViewportError("Handling error.",Wb,this,Xb));}
catch(e){this.setError("Handling error.",e);}};xmp.MEDIA_OVERLAY="MediaOverlay";xmp.MEDIA_OVERLAY_NODE="MediaOverlayNode";xmp.MEDIA_OVERLAY_LISTENER="MediaOverlayListener";xmp.MediaOverlay=function(Yb,Zb,$b,ac){xmp.MediaOverlay.ctor.call(this,Yb,Zb,$b,ac,xmp.MEDIA_OVERLAY);};xmp.DERIVE_CLASS(xmp.Overlay,xmp.MediaOverlay);xmp.MediaOverlay.prototype.show=function(bc){try{this.display=xmp.DISPLAY_BLOCK;if(false===this.viewportExists()){return;}
this.setZOrder();this.moveTo(this.rectangle.left,this.rectangle.top,this.rectangle.width,this.rectangle.height);this.getNativeOverlay().style.display=this.display;this.openMedia();}
catch(e){this._handleError("Showing media overlay.",e);}};xmp.MediaOverlay.prototype.hide=function(){try{if(false===this.viewportExists()||false===this.isVisible()){return;}
this.display=xmp.DISPLAY_NONE;this.getNativeOverlay().style.display=this.display;this.destoryMediaPlayer();}
catch(e){this._handleError("Hiding media overlay.",e);}};xmp.MediaOverlay.prototype.onPropertyChange=function(cc,dc){if(cc!==xmp.MEDIA_OVERLAY_NODE){return;}
if(false===this.viewportExists()||false===this.isVisible()){return;}
this.openMedia();};xmp.MediaOverlay.prototype.onViewportChange=function(ec,fc,gc,hc){};xmp.MediaOverlay.prototype.setPlacement=function(ic,jc){};xmp.MediaOverlay.prototype.getMediaPlayer=function(){if(!this.mediaPlayer){this.mediaPlayer=xmp.MediaPlayerFactory.createPlayer(this.getId()+"MediaPlayer",this);this.mediaPlayer.init();}
return this.mediaPlayer;};xmp.MediaOverlay.prototype.destoryMediaPlayer=function(){if(!this.mediaPlayer){this.mediaPlayer.fini();this.mediaPlayer=null;}};xmp.MediaOverlay.prototype.onInitialized=function(){this.mediaPlayer.setVolume(100);this.mediaPlayer.setMute(true);var kc=[xmp.FLASH_MIME_TYPE,xmp.WINDOWS_MEDIA_MIME_TYPE,xmp.IMAGE_MIME_TYPE,xmp.DHTML_MIME_TYPE,xmp.QUICKTIME_MIME_TYPE];var lc=kc.length;for(var i=0;i<lc;i++){this.mediaPlayer.setViewportConfig(kc[i],xmp.DHTML_VIEWPORT);}};xmp.MediaOverlay.prototype.onTimelineChange=function(mc,nc,oc){this.getListener().onOverlayTimelineChange(mc,nc,oc);};xmp.MediaOverlay.prototype.onStateChange=function(pc,qc,rc){this.getListener().onOverlayStateChange(pc,qc,rc);};xmp.MediaOverlay.prototype.onError=function(sc,e){this.getListener().onOverlayError(sc,e);};xmp.MediaOverlay.prototype.onCreateViewport=function(tc,uc,vc,wc){return this.getNativeOverlay();};xmp.MediaOverlay.prototype.onDestroyViewport=function(xc,yc){};xmp.MediaOverlay.prototype.onPlugInError=function(e){this.getListener().onOverlayPlugInError(e);};xmp.MediaOverlay.prototype.onUnsupportedPlatformError=function(e){this.getListener().onOverlayUnsupportedPlatformError(e);};xmp.MediaOverlay.prototype.openMedia=function(){var zc=this.getProperty(xmp.MEDIA_OVERLAY_NODE);if(!zc){return;}
this.getMediaPlayer().open(zc);};xmp.MediaOverlay.prototype.getListener=function(){var Ac=this.getProperty(xmp.MEDIA_OVERLAY_LISTENER);if(!Ac){throw new xmp.OverlayError("Retrieving media overlay listener.","Missing media overlay listener.",this);}
return Ac;};xmp.OverlayError=function(Bc,Cc,Dc){var Ec=[{label:"Overlay Group",text:((Dc)?Dc.getGroup():"")},{label:"Overlay Type",text:((Dc)?Dc.getType():"")},{label:"Overlay Name",text:((Dc)?Dc.getName():"")},{label:"Overlay Id",text:((Dc)?Dc.getId():"")}];xmp.OverlayError.ctor.call(this,"OverlayError",Bc,Cc,Ec);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.OverlayError);xmp.OverlayFactory=function(){return{createOverlay:function(Fc,Gc,Hc,Ic,Jc){if(Ic===xmp.OVERLAY){return new xmp.Overlay(Fc,Gc,Hc,Jc);}
else if(Ic===xmp.SLATE_OVERLAY){return new xmp.SlateOverlay(Fc,Gc,Hc,Jc);}
else if(Ic===xmp.MEDIA_OVERLAY){return new xmp.MediaOverlay(Fc,Gc,Hc,Jc);}
throw new xmp.OverlayError("Creating overlay.","Unable to create \""+Ic+"\" overlay.",null);}};}();xmp.OverlayProxy=function(Kc){this.object=Kc;};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(Lc){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"OverlayProxy.setHTML");this.object.setHTML(Lc);};xmp.OverlayProxy.prototype.setStyle=function(Mc){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"OverlayProxy.setStyle");this.object.setStyle(Mc);};xmp.OverlayProxy.prototype.moveTo=function(Nc,Oc,Pc,Qc){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"OverlayProxy.moveTo");this.object.moveTo(Nc,Oc,Pc,Qc);};xmp.OverlayProxy.prototype.setProperty=function(Rc,Sc){this.object.setProperty(Rc,Sc);};xmp.OverlayProxy.prototype.getProperty=function(Tc){return this.object.getProperty(Tc);};xmp.SLATE_OVERLAY="SlateOverlay";xmp.SlateOverlay=function(Uc,Vc,Wc,Xc){xmp.SlateOverlay.ctor.call(this,Uc,Vc,Wc,Xc,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(Yc){try{this.display=xmp.DISPLAY_BLOCK;if(false===this.viewportExists()){return;}
if(!this.origViewportRect){var Zc=this.viewport.getSize();this.setPlacement(Zc.width,Zc.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($c,ad,bd,cd){throw new xmp.util.internals.UnsupportedOperationError("The \"moveTo\" operation is not supported.");};xmp.SlateOverlay.prototype.onViewportChange=function(dd,ed,fd,gd){this.setPlacement(fd,gd);this.refresh();};xmp.SlateOverlay.prototype.setPlacement=function(hd,jd){this.origViewportRect={left:"0px",top:"0px",width:hd,height:jd};this.rectangle={left:0,top:0,width:hd,height:jd};};xmp.ALL_OVERLAYS="AllOverlays";xmp.OVERLAY_GROUP_SHOW="GroupShow";xmp.OVERLAY_GROUP_HIDE="GroupHide";xmp.OVERLAY_GROUP_REFRESH="GroupRefresh";xmp.ViewManager=function(kd){this.activeViewport=null;this.viewportsConfig={};this.overlays=[];this.context=kd;};xmp.ViewManager.prototype.setViewportConfig=function(ld,md){if(false===xmp.ViewportFactory.canCreate(md)){throw new xmp.ViewportError("Setting viewport configuration.","Invalid media player viewport type \""+md+"\".",null);}
this.viewportsConfig[ld]=md;};xmp.ViewManager.prototype.getViewportConfig=function(nd){var od=this.viewportsConfig[nd];if(od===null){throw new xmp.InvalidMimeTypeError("Retrieving viewport configuration.","Unable to find media player viewport configuration for MIME type \""+nd+"\".");}
return od;};xmp.ViewManager.prototype.getActiveViewport=function(){return this.activeViewport;};xmp.ViewManager.prototype.openViewport=function(pd,qd,rd,sd){var td=this.getViewportConfig(rd);var ud=this.activeViewport;if(this.activeViewport===null||(this.activeViewport.getType()!==td)){return this.createViewport(pd,qd,rd,sd);}
else if(this.activeViewport.mime_type!==rd){this.activeViewport.reset(sd);}
if(false===ud.isOpen()){try{ud.open(sd);return true;}
catch(e){ud.close();throw e;}}
return false;};xmp.ViewManager.prototype.createViewport=function(vd,wd,xd,yd){var zd=this.getViewportConfig(xd);if(!zd){throw new xmp.ViewportError("Creating viewport.","Unable to find viewport configuration for MIME type \""+xd+"\" .",null);}
if(this.activeViewport===null||(this.activeViewport.getType()!==zd)){var Ad=xmp.ViewportFactory.createViewport(vd,wd,zd,xd,yd,this.overlays);try{if(this.activeViewport!==null){this.activeViewport.close();this.activeViewport=null;}}
catch(e){throw e;}
finally{this.activeViewport=Ad;}
return true;}
return false;};xmp.ViewManager.prototype.createOverlay=function(Bd,Cd,Dd){if(this.getOverlay(Dd)!==null){throw new xmp.OverlayError("Creating overlay.","An overlay already exists with the name \""+Dd+"\".",null);}
var Ed=xmp.OverlayFactory.createOverlay(this.context,this.activeViewport,Bd,Cd,Dd);this.overlays.push(Ed);return Ed;};xmp.ViewManager.prototype.getOverlay=function(Fd){for(var i=0;i<this.overlays.length;i++){if(this.overlays[i].getName()===Fd){return this.overlays[i];}}
return null;};xmp.ViewManager.prototype.showOverlays=function(Gd){this.doOverlayGroupAction(Gd,xmp.OVERLAY_GROUP_SHOW);};xmp.ViewManager.prototype.hideOverlays=function(Hd){this.doOverlayGroupAction(Hd,xmp.OVERLAY_GROUP_HIDE);};xmp.ViewManager.prototype.refreshOverlays=function(Id){this.doOverlayGroupAction(Id,xmp.OVERLAY_GROUP_REFRESH);};xmp.ViewManager.prototype.doOverlayGroupAction=function(Jd,Kd){for(var i=0;i<this.overlays.length;i++){if(this.overlays[i].group===Jd||Jd===xmp.ALL_OVERLAYS){var Ld=this.overlays[i];Ld.setViewport(this.activeViewport);if(Kd===xmp.OVERLAY_GROUP_SHOW){Ld.show();}
else if(Kd===xmp.OVERLAY_GROUP_HIDE){Ld.hide();}
else if(Kd===xmp.OVERLAY_GROUP_REFRESH){Ld.refresh();}}}};xmp.ViewManager.prototype.close=function(){if(this.activeViewport!==null){this.activeViewport.close();this.activeViewport=null;}};xmp.ViewportError=function(Md,Nd,Od,Pd){var Qd=[];if(Od){Qd.push({label:"Viewport Type",text:Od.getType()});Qd.push({label:"Viewport Name",text:Od.getName()});}
if(Pd){Qd=Qd.concat(Pd);}
xmp.ViewportError.ctor.call(this,"ViewportError",Md,Nd,Qd);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ViewportError);xmp.VIEWPORT="Viewport";xmp.ViewportFactory=function(){return{createViewport:function(Rd,Sd,Td,Ud,Vd,Wd){var Xd=xmp.getNamespacedMethod(Td);if(!Xd){throw new xmp.ViewportError("Creating viewport.","Unable to create \""+Td+"\" viewport.",null);}
var Yd=new Xd(Rd,Ud,Sd,Wd);Yd.init(Vd,null,null);return Yd;},canCreate:function(Zd){try{return(true===xmp.isDefined(xmp.getNamespacedMethod(Zd)));}
catch(e){}
return false;}};}();xmp.ViewportProxy=function($d){this.viewManager=$d;};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(ae,be){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.setSize");this.viewManager.getActiveViewport().setSize(ae,be,true);};xmp.ViewportProxy.prototype.moveTo=function(ce,de,ee,fe){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.moveTo");this.viewManager.getActiveViewport().moveTo(ce,de,ee,fe,true);};xmp.ViewportProxy.prototype.setStyle=function(ge){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.setStyle");this.viewManager.getActiveViewport().setStyle(ge);};xmp.ViewportProxy.prototype.createOverlay=function(he,ie,je){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"ViewportProxy.createOverlay");return new xmp.OverlayProxy(this.viewManager.createOverlay(he,ie,je));};xmp.ViewportProxy.prototype.getOverlay=function(ke){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.getOverlay");var le=this.viewManager.getOverlay(ke);return((le!==null)?new xmp.OverlayProxy(le):null);};xmp.ViewportProxy.prototype.showOverlays=function(me){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.showOverlays");this.viewManager.showOverlays(me);};xmp.ViewportProxy.prototype.hideOverlays=function(ne){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.hideOverlays");this.viewManager.hideOverlays(ne);};xmp.ViewportProxy.prototype.refreshOverlays=function(oe){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"ViewportProxy.refreshOverlays");this.viewManager.refreshOverlays(oe);};xmp.ViewportRegistry=function(){var pe={};return{addViewport:function(qe){var re=qe.getName();if(pe[re]!==null&&true===xmp.isDefined(pe[re])){throw new xmp.ViewportError("Adding viewport to registry.","A media player viewport already exists with the name \""+re+"\".",qe);}
pe[re]=qe;},getViewport:function(se){return pe[se];},removeViewport:function(te){if(te===null||false===xmp.isDefined(te)){throw new xmp.ViewportError("Removing viewport from registry.","Cannot remove NULL viewport from viewport registry.",te);}
pe[te.getName()]=null;}};}();

xmp.PlaybackMode=function(aa,ba,ca){this.type=aa;this.name=ba;this.transitionTable=ca;};xmp.PlaybackMode.prototype.getName=function(){return this.name;};xmp.PlaybackMode.prototype.changeMode=function(da,ea,fa,ga){this.validateModeChange(da,ea,fa);da._changeState(ea,ga);};xmp.PlaybackMode.prototype.invalidOperation=function(ha,ia){throw new xmp.PlaybackModeError("Validating state operation.","Invalid mode operation.  The \""+this.name+"\" mode does not change or transition to a mode that supports the \""+ia.toLowerCase()+"\" operation.",this);};xmp.PlaybackMode.prototype.validateModeChange=function(ja,ka,la){if(false===this.isAvailable(ja,ka)){this.invalidOperation(ja,la);}};xmp.PlaybackMode.prototype.canTransition=function(ma){if(this.transitionTable===null){return false;}
for(var i=0;i<this.transitionTable.length;i++){if(this.transitionTable[i]===ma){return true;}}
return false;};xmp.PlaybackMode.prototype.getPlayer=function(na){return na._getPlayer();};xmp.PlaybackMode.prototype.open=function(oa,pa){};xmp.PlaybackMode.prototype.close=function(qa){};xmp.PlaybackMode.prototype.play=function(ra){};xmp.PlaybackMode.prototype.pause=function(sa){};xmp.PlaybackMode.prototype.stop=function(ta){};xmp.PlaybackMode.prototype.rewind=function(ua){};xmp.PlaybackMode.prototype.fastForward=function(va){};xmp.PlaybackMode.prototype.seek=function(wa,xa){};xmp.PlaybackMode.prototype.ended=function(ya){};xmp.PlaybackMode.prototype.error=function(za){};xmp.PlaybackMode.prototype.transition=function(Aa,Ba,Ca){};xmp.PlaybackMode.prototype.isAvailable=function(Da,Ea){return false;};xmp.PlaybackMode.prototype.getPosition=function(Fa){return 0;};xmp.PlaybackMode.prototype.getDuration=function(Ga){return 0;};xmp.PlaybackMode.prototype.getVolume=function(Ha){return 0;};xmp.PlaybackMode.prototype.setVolume=function(Ia,Ja){};xmp.PlaybackMode.prototype.getMute=function(Ka){return false;};xmp.PlaybackMode.prototype.setMute=function(La,Ma){};xmp.PlaybackMode.prototype.getFullscreen=function(Na){return false;};xmp.PlaybackMode.prototype.setFullscreen=function(Oa,Pa){};xmp.PlaybackMode.prototype.getBufferingProgress=function(Qa){return null;};xmp.PlugInError=function(Ra,Sa,Ta,Ua){xmp.PlugInError.ctor.call(this,xmp.XmpErrorCodes.FATAL_PLUGIN,Ra,Sa,Ta);this.plugIn=Ua;};xmp.DERIVE_CLASS(xmp.FatalException,xmp.PlugInError);xmp.MediaPlayer=function(Va,Wa){this.name=Va;this.defaultEventListener=Wa;this._logger=new xmp.util.internals.CategoryLogger('MediaPlayer');this._MEDIA_PLAYER_CONFIGURATION_PATH="/PlayerContexts/Global/Media Player";this._FULLSCREEN_ENABLED="Fullscreen Enabled";this.STRETCH_TO_FIT="Stretch To Fit";};xmp.MediaPlayer.prototype.name=null;xmp.MediaPlayer.prototype.defaultEventListener=null;xmp.MediaPlayer.prototype.init=function(){try{this._urlStrategy=xmp.ContextualUrlStrategy.create();this.registry=new xmp.PlayerModeRegistry();this.state=this.registry.findMode(xmp.FINI);this.viewManager=new xmp.ViewManager(this.name);xmp.NativePlayerRegistry.createGroup(this.name,this);this.player=xmp.NativePlayerRegistry.findPlayerByMimeType(this.name,xmp.NULL_MIME_TYPE);this.setViewportConfig(xmp.NULL_MIME_TYPE,xmp.DHTML_VIEWPORT);this.bandwidthRecorder=new xmp.BandwidthRecorder(this,this._MEDIA_PLAYER_CONFIGURATION_PATH);this.fullscreenEnabled=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(this._MEDIA_PLAYER_CONFIGURATION_PATH).getBoolean(this._FULLSCREEN_ENABLED,false);this.stretchToFit=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(this._MEDIA_PLAYER_CONFIGURATION_PATH).getBoolean(this.STRETCH_TO_FIT,false);this.listeners=[];this.mute=false;this.volume=0;this._addListener(this.defaultEventListener);if(!this.name||this.name.length===0){throw new xmp.MediaPlayerError("Validating media player name.","Invalid media player name.  Missing name.");}
if(this.name.indexOf(" ")!==-1){throw new xmp.MediaPlayerError("Validating media player name.","Invalid media player name.  Name cannot contain spaces.");}
this.listeners[0].onInitialized();}
catch(e){this._handleMethodError("Initializing.",e);}};xmp.MediaPlayer.prototype.fini=function(){try{this.close();this.viewManager.close();xmp.NativePlayerRegistry.destoryGroup(this.name);}
catch(e){this._handleMethodError("Fini.",e);}};xmp.MediaPlayer.prototype.setViewportConfig=function(Xa,Ya){try{xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"MediaPlayer.setViewportConfig");if(false===xmp.PlayerPolicy.isMimeTypeSupported(Xa)){throw new xmp.InvalidMimeTypeError("Setting viewport configuration.","Invalid media player viewport MIME type \""+Xa+"\".");}
this.viewManager.setViewportConfig(Xa,Ya);}
catch(e){this._handleMethodError("Setting viewport configuration.",e);}};xmp.MediaPlayer.prototype.getViewport=function(){try{return new xmp.ViewportProxy(this.viewManager);}
catch(e){this._handleMethodError("Retrieving viewport.",e);}
return null;};xmp.MediaPlayer.prototype.open=function(Za){try{xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"MediaPlayer.open");this.node=Za;Za.setMetadata('originalUri',Za.getURI());if(false===xmp.PlayerPolicy.apply(this,Za)){return;}
this._validateNode(Za);if(false===this._initNativePlayer(Za)){this._handleNativePlayerReady(Za);}}
catch(e){this._handleMethodError("Opening.",e);}};xmp.MediaPlayer.prototype.close=function(){try{this._close();this.viewManager.close();this._setNullPlayer();}
catch(e){this._handleMethodError("Closing.",e);}};xmp.MediaPlayer.prototype.play=function(){try{this.state.play(this);}
catch(e){this._handleMethodError("Playing.",e);}};xmp.MediaPlayer.prototype.pause=function(){try{this.state.pause(this);}
catch(e){this._handleMethodError("Pausing.",e);}};xmp.MediaPlayer.prototype.stop=function(){try{this.state.stop(this);}
catch(e){this._handleMethodError("Stopping.",e);}};xmp.MediaPlayer.prototype.rewind=function(){try{this.state.rewind(this);}
catch(e){this._handleMethodError("Rewinding.",e);}};xmp.MediaPlayer.prototype.fastForward=function(){try{this.state.fastForward(this);}
catch(e){this._handleMethodError("Fast forwarding.",e);}};xmp.MediaPlayer.prototype.seek=function($a){try{xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"MediaPlayer.seek");this._validatePosition($a);this.state.seek(this,$a);}
catch(e){this._handleMethodError("Seeking.",e);}};xmp.MediaPlayer.prototype.isAvailable=function(ab){try{xmp.validateArguments(arguments,[xmp.STRING_TYPE],"MediaPlayer.isAvailable");return this.state.isAvailable(this,ab);}
catch(e){this._handleMethodError("Checking information or action available.",e);}
return false;};xmp.MediaPlayer.prototype.getPosition=function(){try{return this.state.getPosition(this);}
catch(e){this._handleMethodError("Retrieving position.",e);}
return 0;};xmp.MediaPlayer.prototype.getDuration=function(){try{return this.state.getDuration(this);}
catch(e){this._handleMethodError("Retrieving duration.",e);}
return 0;};xmp.MediaPlayer.prototype.setVolume=function(bb){try{xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"MediaPlayer.setVolume");this._validateVolume(bb);this.state.setVolume(this,bb);this.volume=this.state.getVolume(this);}
catch(e){this._handleMethodError("Setting volume.",e);}};xmp.MediaPlayer.prototype.getVolume=function(){try{return this.state.getVolume(this);}
catch(e){this._handleMethodError("Retrieving volume.",e);}
return 0;};xmp.MediaPlayer.prototype.setMute=function(cb){try{xmp.validateArguments(arguments,[xmp.BOOLEAN_TYPE],"MediaPlayer.setMute");this.state.setMute(this,cb);this.mute=this.state.getMute(this);}
catch(e){this._handleMethodError("Setting mute.",e);}};xmp.MediaPlayer.prototype.getMute=function(){try{return this.state.getMute(this);}
catch(e){this._handleMethodError("Retrieving mute.",e);}
return false;};xmp.MediaPlayer.prototype.setFullscreen=function(db){try{xmp.validateArguments(arguments,[xmp.BOOLEAN_TYPE],"MediaPlayer.setFullscreen");this.state.setFullscreen(this,db);}
catch(e){this._handleMethodError("Setting fullscreen.",e);}};xmp.MediaPlayer.prototype.getFullscreen=function(){try{return this.state.getFullscreen(this);}
catch(e){this._handleMethodError("Retrieving fullscreen.",e);}
return false;};xmp.MediaPlayer.prototype.getBufferingProgress=function(){try{return this.state.getBufferingProgress(this);}
catch(e){this._handleMethodError("Retrieving buffering progress.",e);}
return null;};xmp.MediaPlayer.prototype.addEventListener=function(eb){try{xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"MediaPlayer.addEventListener");this._addListener(eb);}
catch(e){this._handleMethodError("Adding event listener.",e);}};xmp.MediaPlayer.prototype._initNativePlayer=function(fb){try{this._close();var gb=fb.getMimeType();var hb=xmp.NativePlayerRegistry.findPlayerByMimeType(this.name,gb);if(!hb){throw new xmp.InvalidMimeTypeError("Initializing native player.","Unable to find native player for MIME type \""+gb+"\".");}
if(gb===xmp.MOCK_MIME_TYPE){this.player=hb;return false;}
var ib={player:hb,data:{group:this.name,viewport:null,volume:this.volume,mute:this.mute,node:fb,fullscreenEnabled:this.fullscreenEnabled,stretchToFit:this.stretchToFit}};if(false===this.viewManager.openViewport(this,this.name,fb.getMimeType(),ib)){if(hb.type!==this.player.type){hb.create({group:this.name,viewport:this.viewManager.getActiveViewport(),volume:this.volume,mute:this.mute,node:fb,fullscreenEnabled:this.fullscreenEnabled,stretchToFit:this.stretchToFit});this.player=hb;return true;}
return false;}
return true;}
catch(e){this._setNullPlayer();throw e;}
return false;};xmp.MediaPlayer.prototype.onNativePlayerStateChange=function(jb,kb){try{if(jb===xmp.OPEN){if(this.state.type===xmp.ERRORS||this.state.type===xmp.FINI){this._logger.debug("Ignoring native player \""+xmp.OPEN+"\" state change.  Media player is in an idle (closed) or error state.");return;}
this._notifyStateChange(jb,kb);this._notifyTimelineChange(this.state.getPosition(this),this.state.getDuration(this));this.state.play(this);return;}
else{if(jb===xmp.ENDED){this._notifyTimelineChange(this.state.getPosition(this),this.state.getDuration(this));this.state.ended(this);}
else if(jb===xmp.CONNECTING){this.bandwidthRecorder.start();}}
this._notifyStateChange(jb,kb);}
catch(e){this._handleError(e);}};xmp.MediaPlayer.prototype.onNativePlayerTrigger=function(lb,mb){};xmp.MediaPlayer.prototype.onNativePlayerError=function(e){this._handleError(e);};xmp.MediaPlayer.prototype.onNativePlayerTimelineChange=function(nb,ob){this._notifyTimelineChange(nb,ob);this._checkTimeLimit(nb,ob);};xmp.MediaPlayer.prototype.onNativePlayerCreated=function(pb,qb){if(this.state.type===xmp.ERRORS){return;}
this._logger.debug("Created \""+pb.getType()+"\" native player \""+pb.getName()+"\".");this._handleNativePlayerReady(qb.node);};xmp.MediaPlayer.prototype.onNativePlayerExecuteCommand=function(rb,sb){var tb=null;if(rb===xmp.PLAY){this.play();}
else if(rb===xmp.PAUSE){this.pause();}
else if(rb===xmp.STOP){this.stop();}
else if(rb===xmp.REWIND){this.rewind();}
else if(rb===xmp.FAST_FORWARD){this.fastForward();}
else if(rb===xmp.SEEKABLE){this.seek(parseInt(sb,10));}
else if(rb===xmp.IS_AVAILABLE){tb=this.isAvailable(sb);}
else if(rb===xmp.GET_POSITION){tb=this.getPosition();}
else if(rb===xmp.GET_DURATION){tb=this.getDuration();}
else if(rb===xmp.GET_VOLUME){tb=this.getVolume();}
else if(rb===xmp.SET_VOLUME){this.setVolume(parseInt(sb,10));}
else if(rb===xmp.GET_MUTE){tb=this.getMute();}
else if(rb===xmp.SET_MUTE){this.setMute(xmp.TRUE===sb);}
return tb;};xmp.MediaPlayer.prototype.onViewportOpened=function(ub,vb){vb.data.viewport=ub;vb.player.create(vb.data);this.player=vb.player;};xmp.MediaPlayer.prototype.onCreateViewport=function(wb,xb,yb,zb){return this.listeners[0].onCreateViewport(wb,xb,yb,zb);};xmp.MediaPlayer.prototype.onDestroyViewport=function(Ab,Bb){this.listeners[0].onDestroyViewport(Ab,Bb);};xmp.MediaPlayer.prototype.onViewportCreated=function(Cb,Db){if(this.state.type===xmp.ERRORS){return;}
if(Db===null){return;}
this._logger.debug("Created \""+Cb.getType()+"\" viewport.");this.viewManager.openViewport(this,this.name,Cb.mime_type,Db);};xmp.MediaPlayer.prototype.onViewportError=function(e){this._handleError(e);};xmp.MediaPlayer.prototype._handleMethodError=function(Eb,e){var Fb=e;if(false===(Fb instanceof xmp.MediaPlayerError)){Fb=new xmp.MediaPlayerError(((e.context)?e.context:Eb),((e.rawMessage)?e.rawMessage:e.message));Fb.setInnerError(e);}
this._handleError(Fb);};xmp.MediaPlayer.prototype._handleError=function(e){try{var Gb=((this.node)?this.node.getURI():"");if(Gb&&Gb.length>0&&(e instanceof xmp.util.internals.XMPError)){e.addExtendedInfo({label:"Url",text:Gb});}
var Hb="\n\n"+e.message;this._logger.debug(Hb);var Ib=new xmp.baseplayer.ApplicationError(e,'mediaPlayerError',e.context,[{label:"Url",text:Gb}]);if(!this.listeners||this.listeners.length===0){this._logAppError(Ib);xmp.handleFatalError(Ib);}
else{this._error();if(this._urlStrategy.tryFailover(this,this.node,e)){return;}
this._logAppError(Ib);for(var i=0;i<this.listeners.length;i++){this.listeners[i].onError(this.node,Ib);}}}
catch(e2){}};xmp.MediaPlayer.prototype._logAppError=function(Jb){if(Jb.getInnerError()instanceof xmp.NativePlayerConnectionError){this._logger.critical(Jb.message,Jb);}
else{this._logger.warn(Jb.message,Jb);}};xmp.MediaPlayer.prototype._validateNode=function(Kb){if(Kb===null){throw new xmp.InvalidPlayableNodeError("Validating playable node.","Invalid playable node.  Missing node.");}
var Lb=Kb.getMimeType();if(!Lb||Lb.length===0){throw new xmp.InvalidPlayableNodeError("Validating playable node mime type.","Invalid playable node.  Missing MIME type.");}
var Mb=Kb.getURI();if(!Mb||Mb.length===0){throw new xmp.InvalidPlayableNodeError("Validating playable node URI.","Invalid playable node.  Missing URI.");}
this._validateTimeLimit(Kb);};xmp.MediaPlayer.prototype._setNullPlayer=function(){try{var Nb=xmp.NativePlayerRegistry.findPlayerByMimeType(this.name,xmp.NULL_MIME_TYPE);if(this.viewManager.getActiveViewport()===null){this.viewManager.createViewport(this,this.name,xmp.NULL_MIME_TYPE,null);}
Nb.create({group:this.name,viewport:this.viewManager.getActiveViewport(),volume:0,mute:false,node:null,fullscreenEnabled:false,stretchToFit:false});this.player=Nb;}
catch(e){}};xmp.MediaPlayer.prototype._validateVolume=function(Ob){if(Ob<0||Ob>100){throw new xmp.util.internals.InvalidArgsError("Invalid volume \""+Ob+"\".  Valid values are 1 to 100.");}};xmp.MediaPlayer.prototype._validatePosition=function(Pb){var Qb=this.getDuration();if(Pb<0||Pb>Qb){throw new xmp.util.internals.InvalidArgsError("Invalid position \""+Pb+"\".  Valid values are 0 to "+Qb+" seconds.");}};xmp.MediaPlayer.prototype._addListener=function(Rb){this._validateListener(Rb);this.listeners.push(Rb);};xmp.MediaPlayer.prototype._validateListener=function(Sb){if(!Sb){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  NULL listener.");}
if(false===xmp.isDefined(Sb.onInitialized)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onInitialized\" handler.");}
if(false===xmp.isDefined(Sb.onError)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onError\" handler.");}
if(false===xmp.isDefined(Sb.onStateChange)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onStateChange\" handler.");}
if(false===xmp.isDefined(Sb.onTimelineChange)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onTimelineChange\" handler.");}
if(false===xmp.isDefined(Sb.onCreateViewport)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onCreateViewport\" handler.");}
if(false===xmp.isDefined(Sb.onDestroyViewport)){throw new xmp.MediaPlayerError("Validating listener.","Invalid media player event listener.  Missing \"onDestroyViewport\" handler.");}
if(false===xmp.isDefined(Sb.onPlugInError)){throw new xmp.MediaPlayerError("Invalid media player event listener.  Missing \"onPlugInError\" handler.");}
if(false===xmp.isDefined(Sb.onUnsupportedPlatformError)){throw new xmp.MediaPlayerError("Invalid media player event listener.  Missing \"onUnsupportedPlatformError\" handler.");}};xmp.MediaPlayer.prototype._checkTimeLimit=function(Tb,Ub){this._validateTimeLimit(this.node);var Vb=this.node.getTimeLimitInSeconds();if(Vb!==xmp.NO_TIME_LIMIT&&Tb>=Vb){this.state.ended(this);this._notifyStateChange(xmp.ENDED,null);}};xmp.MediaPlayer.prototype._notifyTimelineChange=function(Wb,Xb){for(var i=0;i<this.listeners.length;i++){this.listeners[i].onTimelineChange(this.node,Wb,Xb);}};xmp.MediaPlayer.prototype._notifyStateChange=function(Yb,Zb){for(var i=0;i<this.listeners.length;i++){this.listeners[i].onStateChange(this.node,Yb,Zb);}};xmp.MediaPlayer.prototype.onError=function($b,e){this.node=$b;this._handleError(e);};xmp.MediaPlayer.prototype.onPlugInError=function(e){this._error();this.listeners[0].onPlugInError(e);};xmp.MediaPlayer.prototype.onUnsupportedPlatformError=function(e){this._error();this.listeners[0].onUnsupportedPlatformError(e);};xmp.MediaPlayer.prototype._changeState=function(ac,bc){var dc=this.registry.findMode(ac);dc.transition(this,bc,this.state);this._logger.debug("Changed/transitioned to \""+dc.getName()+"\" mode.");this.state=dc;};xmp.MediaPlayer.prototype._getPlayer=function(){return this.player;};xmp.MediaPlayer.prototype._validateTimeLimit=function(ec){var fc=ec.getTimeLimitInSeconds();if(false===xmp.isDefined(fc)){throw new xmp.InvalidPlayableNodeError("Invalid playable node.  Missing time limit.");}
if(fc!==xmp.NO_TIME_LIMIT&&fc<=0){throw new xmp.InvalidPlayableNodeError("Invalid playable node.  Invalid time limit \""+fc+"\". Expected values are "+xmp.NO_TIME_LIMIT+" and greater than 1 seconds.");}};xmp.MediaPlayer.prototype.getName=function(){return this.name;};xmp.MediaPlayer.prototype._error=function(){this.viewManager.hideOverlays(xmp.ALL_OVERLAYS);this.bandwidthRecorder.stop();this.state.error(this);this._setNullPlayer();};xmp.MediaPlayer.prototype._close=function(){this.bandwidthRecorder.stop();this.state.close(this);};xmp.MediaPlayer.prototype._handleNativePlayerReady=function(gc){this._urlStrategy.buildUrlAsynch(gc,new xmp.util.Callback('buildUrlAsynch',this._handleBuildUrlAsynch,this));};xmp.MediaPlayer.prototype._handleBuildUrlAsynch=function(hc,ic,jc){if(this.state.type===xmp.ERRORS){return;}
if(jc!==null){if(jc instanceof xmp.PlugInError){this.onPlugInError(jc);}
else{this.onError(ic,jc);xmp.handleFatalError(jc);}
return;}
this.state.open(this,ic);};xmp.MediaPlayerFactory=function(){};xmp.MediaPlayerFactory.createPlayer=function(kc,lc){return new xmp.MediaPlayer(kc,lc);};xmp.NATIVE_PLAYER_Z_INDEX=1;xmp.VERSION_DELIMITER=".";xmp.MOVETO_OPERATION="moveTo";xmp.ACTIVEX_VERSION_DETECTION_JSON="ActiveX Version Detection JSON";xmp.MOZILLA_VERSION_DETECTION_JSON="Mozilla Version Detection JSON";xmp.AbstractNativePlayer=function(mc,nc,oc){this.type=mc;this.listener=nc;this.configuration=oc;this.data=null;this.volume=0;this.mute=false;this.bufferingProgress={percent:0,bytesDownloaded:0,bytesTotal:0};this.opened=false;this.monitorTimer=null;this.logger=null;this.plugIns=null;};xmp.AbstractNativePlayer.prototype.open=function(pc){};xmp.AbstractNativePlayer.prototype.close=function(){this.opened=false;this.stopMonitor();this.bufferingProgress={percent:0,bytesDownloaded:0,bytesTotal:0};};xmp.AbstractNativePlayer.prototype.fini=function(){try{if(this.data===null){return;}
this.close();var qc=this.getNative();var rc=xmp.getDomParent(qc);rc.removeChild(qc);}
catch(e){}};xmp.AbstractNativePlayer.prototype.play=function(){this.startMonitor();};xmp.AbstractNativePlayer.prototype.pause=function(){this.stopMonitor();};xmp.AbstractNativePlayer.prototype.stop=function(){this.stopMonitor();};xmp.AbstractNativePlayer.prototype.rewind=function(){this.startMonitor();};xmp.AbstractNativePlayer.prototype.fastForward=function(){this.startMonitor();};xmp.AbstractNativePlayer.prototype.seek=function(sc){this.startMonitor();};xmp.AbstractNativePlayer.prototype.ended=function(){this.stopMonitor();};xmp.AbstractNativePlayer.prototype.error=function(){this.close();};xmp.AbstractNativePlayer.prototype.isAvailable=function(tc){return false;};xmp.AbstractNativePlayer.prototype.getPosition=function(){return 0;};xmp.AbstractNativePlayer.prototype.getDuration=function(){return 0;};xmp.AbstractNativePlayer.prototype.getVolume=function(){return this.volume;};xmp.AbstractNativePlayer.prototype.setVolume=function(uc){this.volume=uc;};xmp.AbstractNativePlayer.prototype.getMute=function(){return this.mute;};xmp.AbstractNativePlayer.prototype.setMute=function(vc){this.mute=vc;};xmp.AbstractNativePlayer.prototype.getFullscreen=function(){return false;};xmp.AbstractNativePlayer.prototype.setFullscreen=function(wc){var xc="The \"setFullscreen\" method is not supported.";if(false===this.isFullscreenEnabled()){xc="The \"setFullscreen\" method is not supported.  Fullscreen disabled.";}
throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.",xc,this);};xmp.AbstractNativePlayer.prototype.getBufferingProgress=function(){return this.bufferingProgress;};xmp.AbstractNativePlayer.prototype.moveTo=function(yc,zc,Ac,Bc){var Cc=((this.getNative().style.zIndex)?"z-Index: "+this.getNative().style.zIndex+";":"")+"left: "+xmp.getPixelUnits(yc)+"; top: "+xmp.getPixelUnits(zc)+"; width: "+xmp.getPixelUnits(Ac)+"; height: "+xmp.getPixelUnits(Bc);this.getNative().style.cssText=Cc;};xmp.AbstractNativePlayer.prototype.validate=function(Dc){this.plugIns=xmp.PlayerPolicy.getPlugins();this.onValidatePlugIn(Dc);};xmp.AbstractNativePlayer.prototype.onValidatePlugIn=function(Ec){};xmp.AbstractNativePlayer.prototype.onMonitorTimelineChange=function(Fc,Gc){};xmp.AbstractNativePlayer.prototype.setState=function(Hc,Ic){if(Hc===xmp.OPEN){this.opened=true;}
else if(Hc===xmp.BUFFERING){this.bufferingProgress=Ic;}
this.createTimer({object:this,id:"setState",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetState,context:{type:Hc,data:Ic}}).start();};xmp.AbstractNativePlayer.prototype.setError=function(Jc,e){this.stopMonitor();var Kc=e;if(false===(Kc instanceof xmp.NativePlayerError)&&false===(Kc instanceof xmp.NativePlayerConnectionError)){Kc=new xmp.NativePlayerError(((e.context)?e.context:Jc),((e.rawMessage)?e.rawMessage:e.message),this);Kc.setInnerError(e);}
this.createTimer({object:this,id:"setError",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetError,context:Kc}).start();};xmp.AbstractNativePlayer.prototype.setTrigger=function(Lc,Mc){this.createTimer({object:this,id:"setTrigger",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetTrigger,context:{name:Lc,data:Mc}}).start();};xmp.AbstractNativePlayer.prototype.setCreated=function(){this.data.viewport.setNativePlayer(this);this.createTimer({object:this,id:"setCreated",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetCreated,context:null}).start();};xmp.AbstractNativePlayer.prototype.executeCommand=function(Nc,Oc){return this.listener.onNativePlayerExecuteCommand(Nc,Oc);};xmp.AbstractNativePlayer.prototype.create=function(Pc){this.data=Pc;if(this.logger){this.logger=null;}
this.logger=new xmp.util.internals.CategoryLogger("Native Player ("+this.getName()+")");};xmp.AbstractNativePlayer.prototype.attach=function(Qc){this.data=Qc;};xmp.AbstractNativePlayer.prototype.getNative=function(){var Rc=xmp.findDomElement(this.data.id);if(!Rc){throw new xmp.NativePlayerError("Retrieving native player.","Unable to retrieve \""+this.type+"\" native player.",this);}
return Rc;};xmp.AbstractNativePlayer.prototype.getName=function(){return((this.data)?this.data.id:"");};xmp.AbstractNativePlayer.prototype.getType=function(){return this.type;};xmp.AbstractNativePlayer.prototype.getGroup=function(){return((this.data)?this.data.group:"");};xmp.AbstractNativePlayer.prototype.isFullscreenEnabled=function(){return((this.data)?this.data.fullscreenEnabled:false);};xmp.AbstractNativePlayer.prototype.startMonitor=function(){if(!this.monitorTimer){var Sc=this.getMonitorInterval();this.monitorTimer=this.createTimer({object:this,id:"timelineChange",interval:Sc,handler:this.onTimelineChange,context:null});this.monitorTimer.start();}};xmp.AbstractNativePlayer.prototype.stopMonitor=function(){if(this.monitorTimer){this.monitorTimer.stop();this.monitorTimer=null;}};xmp.AbstractNativePlayer.prototype.parseVersion=function(Tc){var Uc=Tc;var Vc=0;var Wc=-1;var Xc=-1;var Yc=-1;var Zc=Uc.indexOf(xmp.VERSION_DELIMITER);if(Zc!==-1){Vc=parseInt(Uc.substr(0,Zc),10);Uc=Uc.substr(Zc+1);Zc=Uc.indexOf(xmp.VERSION_DELIMITER);if(Zc!==-1){Wc=parseInt(Uc.substr(0,Zc),10);Uc=Uc.substr(Zc+1);Zc=Uc.indexOf(xmp.VERSION_DELIMITER);if(Zc!==-1){Xc=parseInt(Uc.substr(0,Zc),10);Uc=Uc.substr(Zc+1);if(Uc.length>0){Yc=parseInt(Uc,10);}}
else{Xc=parseInt(Uc,10);}}
else{Wc=parseInt(Uc,10);}}
else{Vc=parseInt(Uc,10);Vc=((true===isNaN(Vc))?-1:Vc);}
return{major:Vc,minor:Wc,revision:Xc,build:Yc};};xmp.AbstractNativePlayer.prototype.validatePlugInVersion=function($c,ad){var bd=$c+"PlugInVersion";xmp.util.PlayerStats.getInstance().setValue(bd,ad);var cd=this.parseVersion(ad);var dd=this.getPlugInInfo($c);var ed=this.parseVersion(dd.minVersion);var fd=this.parseVersion(dd.maxVersion);var gd=[{version:cd.major,minVersion:ed.major,maxVersion:fd.major},{version:cd.minor,minVersion:ed.minor,maxVersion:fd.minor},{version:cd.revision,minVersion:ed.revision,maxVersion:fd.revision},{version:cd.build,minVersion:ed.build,maxVersion:fd.build}];var hd=gd.length;for(var i=0;i<hd;i++){if((gd[i].version<gd[i].minVersion)){throw new xmp.InvalidPlugInVersionError("Validating native player plugin version.",dd,ad);}
if((gd[i].maxVersion!==-1)&&(gd[i].version>gd[i].maxVersion)){throw new xmp.UnsupportedPlugInVersionError("Validating native player plugin version.",dd,ad);}
if((gd[i].version!==gd[i].minVersion)&&(gd[i].version!==gd[i].maxVersion)){break;}}};xmp.AbstractNativePlayer.prototype.getPlugInInfo=function(jd){var kd=this.plugIns[jd];if(!kd){throw new xmp.NativePlayerError("Retrieving plugin info.","Unable to retrieve \""+jd+"\" plugin information.",this);}
return kd;};xmp.AbstractNativePlayer.prototype.createTimer=function(ld){var md=new xmp.util.Callback(ld.id,ld.handler,ld.object);md.setMetadata(xmp.CONTEXT,ld.context);return new xmp.util.Timer(ld.id,ld.interval,-1,md);};xmp.AbstractNativePlayer.prototype.onTimelineChange=function(nd,od){try{var pd=parseInt(this.getDuration(),10);var qd=((pd>0)?parseInt(this.getPosition(),10):0);this.onMonitorTimelineChange(qd,pd);this.listener.onNativePlayerTimelineChange(qd,pd);}
catch(e){this.setError("Forwarding timeline change to listener.",e);}};xmp.AbstractNativePlayer.prototype.onSetState=function(rd,sd){try{sd.stop();var td=rd.getMetadata(xmp.CONTEXT,{});this.listener.onNativePlayerStateChange(td.type,td.data);}
catch(e){this.setError("Forwarding state change notification to listener.",e);}};xmp.AbstractNativePlayer.prototype.onSetError=function(ud,vd){var wd=null;try{vd.stop();wd=ud.getMetadata(xmp.CONTEXT,{});this.listener.onNativePlayerError(wd);}
catch(e){var xd=((wd)?wd:e);xmp.handleFatalError(xd);}};xmp.AbstractNativePlayer.prototype.onSetTrigger=function(yd,zd){try{zd.stop();var Ad=yd.getMetadata(xmp.CONTEXT,{});this.listener.onNativePlayerTrigger(Ad.name,Ad.data);}
catch(e){this.setError("Forwarding trigger notification to listener.",e);}};xmp.AbstractNativePlayer.prototype.onSetCreated=function(Bd,Cd){try{Cd.stop();this.listener.onNativePlayerCreated(this,this.data);}
catch(e){this.setError("Forwarding created notification to listener.",e);}};xmp.AbstractNativePlayer.prototype.getCallbackMethod=function(Dd){return"xmp.NativePlayerRegistry.findPlayerByType( '"+this.data.group+"', '"+this.type+"' )."+Dd;};xmp.AbstractNativePlayer.prototype.getLogger=function(){return this.logger;};xmp.AbstractNativePlayer.prototype.isOpen=function(){return this.opened;};xmp.AbstractNativePlayer.prototype.getMonitorInterval=function(){return xmp.MONITOR_INTERVAL;};xmp.AbstractNativePlayer.prototype.getConfigProperty=function(Ed){return xmp.PlayerPolicy.getNativePlayerConfig(this.configuration)[Ed];};xmp.AbstractNativePlayer.prototype.getMonitorInterval=function(){return xmp.MONITOR_INTERVAL;};xmp.AbstractNativePlayer.prototype.getVersionFromString=function(Fd,Gd){var Hd=this.getConfigProperty(Fd);Hd=Hd.replace(/\{\{version\}\}/g,"\""+Gd+"\"");var Id='{getVersion:function(){'+Hd+'}}';var Jd=xmp.net.AjaxRequestManager.getInstance()._parseJson(Id);return Jd.getVersion();};xmp.PLATFORMS_NODE_PATH="/PlayerContexts/Global/PlayingPolicy/Platforms";xmp.HOST_REL_NODE_PATH="video";xmp.BROWSER_NODE_PATH="Browser";xmp.HOST_PARAMETER="{host}";xmp.PATH_PARAMETER="{path}";xmp.SIZE_PARAMETER="{size}";xmp.AbstractPlayingPolicy=function(Kd,Ld){this.type=Kd;this.playerPolicy=Ld;};xmp.AbstractPlayingPolicy.prototype.apply=function(Md,Nd){if(false===this.canApply(Nd)){return true;}
try{this.validatePlatform(Md.getName(),Nd.getStreamingMode());}
catch(e){this.handleApplyError(Md,Nd,e,false);return false;}
var Od=this.getApplyPolicy(Nd);var Pd=Od.media.length;for(var i=0;i<Pd;i++){try{var Qd=this.playerPolicy.getMediaType(Od.media[i]);this.validateMedia(Od.type,Od.media[i],Qd);if(false===this.isPlayable(Qd,Nd)){continue;}
this.playerPolicy.getLogger().debug("Applying playing policy \""+Od.type+"\" to playable node.");this.setPolicy(Md.getName(),Qd,Nd);return true;}
catch(e2){var Rd=this.handleApplyError(Md,Nd,e2,this.canFailover(Od.type,Nd,i,Od.media));if(true===Rd){continue;}
return false;}}
var Sd=[];try{Sd=this.playerPolicy.getSizes();}
catch(e3){}
throw new xmp.PlayingPolicyApplyError("Applying playing policy.",Sd,Od,Nd);};xmp.AbstractPlayingPolicy.prototype.getType=function(){return this.type;};xmp.AbstractPlayingPolicy.prototype.getApplyPolicy=function(Td){var Ud=this.playerPolicy.getSupportedPlatformBrowser(xmp.util.internals.BrowserDetect.OS,xmp.util.internals.BrowserDetect.browser);var Vd=Td.getStreamingMode();var Wd=this.playerPolicy.getPlaybackPriorityGroup(Ud.modes[Vd]);var Xd=xmp.util.internals.BrowserDetect.OS+"/"+xmp.util.internals.BrowserDetect.browser+((Vd&&Vd.length>0)?("/"+Vd):"");return{type:Xd,media:Wd};};xmp.AbstractPlayingPolicy.prototype.isPlayable=function(Yd,Zd){if(false===this.validateMimeType(Yd,Zd)){return false;}
return this.validateSize(Yd,Zd);};xmp.AbstractPlayingPolicy.prototype.setupNode=function($d,ae){if(!ae.isUriAbsolute()){var be=$d.streamingModes[ae.getStreamingMode()];var ce=be.url_mask;var de=[{name:xmp.HOST_PARAMETER,value:this.getHost($d,be)},{name:xmp.PATH_PARAMETER,value:ae.getURI()},{name:xmp.SIZE_PARAMETER,value:this.getSize($d,ae)}];for(var i=0;i<de.length;i++){ce=ce.replace(de[i].name,de[i].value);}
ae.setMimeType($d.mimeType);ae.setURI(ce);this.playerPolicy.getLogger().debug("Setting up playable node URI from mask ("+be.url_mask+") and MIME type ("+$d.mimeType+"). URI - "+ce);}
ae.setUriAbsolute(true);};xmp.AbstractPlayingPolicy.prototype.getSize=function(ee,fe){var ge="";if(true===this.urlMaskContainsSize(ee,fe)){ge=this.playerPolicy.getSizeFromPlayer(fe.getSizes());}
return ge;};xmp.AbstractPlayingPolicy.prototype.getHost=function(he,ie){if(-1===ie.url_mask.indexOf(xmp.HOST_PARAMETER)){return"";}
var je=xmp.HOST_REL_NODE_PATH+"/"+he.type+"/"+ie.type;var ke=xmp.util.RootUrlProvider.getInstance().getRootUrl(je);if(ke.length===0){throw new xmp.PlayingPolicyError("Retrieving host.","Unable to find \""+he.type+"\" playing policy streaming host configuration for \""+ie.type+"\".");}
return ke;};xmp.AbstractPlayingPolicy.prototype.validateMedia=function(le,me,ne){if(!ne){throw new xmp.PlayingPolicyError("Validating media.","Invalid \""+le+"\" playing policy media type \""+me+"\".");}};xmp.AbstractPlayingPolicy.prototype.setPolicy=function(oe,pe,qe){xmp.NativePlayerRegistry.validate(oe,pe.mimeType);this.setupNode(pe,qe);};xmp.AbstractPlayingPolicy.prototype.validateMimeType=function(re,se){var te=se.getMimeTypes();var ue=te.length;for(var i=0;i<ue;i++){if(re.mimeType===te[i]){return true;}}
return false;};xmp.AbstractPlayingPolicy.prototype.validateSize=function(ve,we){if(false===this.urlMaskContainsSize(ve,we)){return true;}
return(this.playerPolicy.getSizeFromPlayer(we.getSizes()).length>0);};xmp.AbstractPlayingPolicy.prototype.urlMaskContainsSize=function(xe,ye){return(xe.streamingModes[ye.getStreamingMode()].url_mask.indexOf(xmp.SIZE_PARAMETER)!==-1);};xmp.AbstractPlayingPolicy.prototype.validateBootstrap=function(ze){};xmp.AbstractPlayingPolicy.prototype.validatePlatform=function(Ae,Be){var Ce=this.playerPolicy.getSupportedPlatformBrowser(xmp.util.internals.BrowserDetect.OS,xmp.util.internals.BrowserDetect.browser);if(!Ce||(Be&&!Ce.modes[Be])){var De=xmp.util.internals.BrowserDetect.OS+"/"+xmp.util.internals.BrowserDetect.browser+((Be&&Be.length>0)?("/"+Be):"");throw new xmp.UnsupportedPlatformError(Ae,"The platform \""+De+"\" is unsupported.");}};xmp.AbstractPlayingPolicy.prototype.handleApplyError=function(Ee,Fe,e,Ge){if(true===this.playerPolicy.getFailover()&&true===Ge){this.playerPolicy.getLogger().warn("\n\n"+e.message,e);return true;}
this.playerPolicy.getLogger().critical("\n\n"+e.message,e);Ee.onError(Fe,e);return false;};xmp.AbstractPlayingPolicy.prototype.canApply=function(He){var Ie=He.getStreamingMode();return((Ie&&Ie.length>0)?true:false);};xmp.AbstractPlayingPolicy.prototype.canFailover=function(Je,Ke,Le,Me){try{var Ne=Me.length;for(var i=Le+1;i<Ne;i++){var Oe=this.playerPolicy.getMediaType(Me[i]);this.validateMedia(Je,Me[i],Oe);if(false===this.isPlayable(Oe,Ke)){continue;}
return true;}}
catch(e){}
return false;};xmp.BANDWIDTH_RECORDER_SAMPLE_TIMER="BandwidthRecorderSampleTimer";xmp.CURRENT_BANDWIDTH_LABEL="CurrentBandwidth";xmp.CUMULATIVE_BANDWIDTH_LABEL="CumulativeBandwidth";xmp.BANDWIDTH_SAMPLE_INTERVAL="Bandwidth Sample Interval";xmp.BandwidthRecorder=function(Pe,Qe){var Re=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(Qe).getInt(xmp.BANDWIDTH_SAMPLE_INTERVAL,-1);if(-1===Re.length){throw new xmp.BandwidthRecorderError("Initializing.","Missing bandwidth recorder sample interval.");}
this.player=Pe;this.logger=new xmp.util.internals.CategoryLogger('BandwidthRecorder');var Se=new xmp.util.Callback(xmp.BANDWIDTH_RECORDER_SAMPLE_TIMER,this.onSample,this);this.sampleTimer=new xmp.util.Timer(xmp.BANDWIDTH_RECORDER_SAMPLE_TIMER,Re,-1,Se);this.totalBytesDownloaded=0;this.totalDuration=0;this.reset();};xmp.BandwidthRecorder.prototype.start=function(){this.stop();this.sampleStartTime=this.initSampleTime();this.sampleTimer.start();};xmp.BandwidthRecorder.prototype.stop=function(){this.sampleTimer.stop();this.totalDuration+=this.lastDuration;this.totalBytesDownloaded+=this.lastBytesDownloaded;this.reset();};xmp.BandwidthRecorder.prototype.onSample=function(Te,Ue){try{var Ve=this.player.getBufferingProgress();this.validateSample(Ve);var We=this.initSampleTime();var Xe=(We-this.sampleStartTime);var Ye=this.calcBandwidth(Xe,Ve.bytesDownloaded);this.logBandwidth(Ye,xmp.CURRENT_BANDWIDTH_LABEL,Ve.bytesDownloaded,"Downloaded Bytes");var Ze=(this.totalBytesDownloaded+Ve.bytesDownloaded);Ye=this.calcBandwidth((this.totalDuration+Xe),Ze);this.logBandwidth(Ye,xmp.CUMULATIVE_BANDWIDTH_LABEL,Ze,"Cumulative Bytes");this.lastBytesDownloaded=Ve.bytesDownloaded;this.lastDuration=Xe;if(100===Ve.percent){this.stop();}}
catch(e){this.logger.warn("\n\n"+e.message);this.stop();}};xmp.BandwidthRecorder.prototype.reset=function(){this.sampleStartTime=0;this.lastBytesDownloaded=0;this.lastDuration=0;};xmp.BandwidthRecorder.prototype.initSampleTime=function(){return(new Date()).getTime();};xmp.BandwidthRecorder.prototype.calcBandwidth=function($e,b){try{var af=($e/1000);var x=((b*8)/1024);return(x/af);}
catch(e){var bf=new xmp.BandwidthRecorderError("Calculating bandwidth.",e.message);bf.setInnerError(e);throw bf;}};xmp.BandwidthRecorder.prototype.logBandwidth=function(cf,df,ef,ff){try{var gf=Math.ceil(cf)+"KB/sec";this.logger.info(df+":  "+gf+", "+ff+":  "+ef);xmp.util.PlayerStats.getInstance().setValue(df,gf);}
catch(e){var hf=new xmp.BandwidthRecorderError("Logging bandwidth.",((e.rawMessage)?e.rawMessage:e.message));hf.setInnerError(e);throw hf;}};xmp.BandwidthRecorder.prototype.validateSample=function(jf){if(!jf){throw new xmp.BandwidthRecorderError("Validating sample.","Missing sample.");}
if(false===xmp.isDefined(jf.bytesDownloaded)){throw new xmp.BandwidthRecorderError("Validating sample.","Missing bytes downloaded.");}};xmp.LAZY_PLAYING_POLICY="Lazy";xmp.VALIDATE_ON_BOOTSTRAP="ValidateOnBootstrap";xmp.LazyPlayingPolicy=function(kf){xmp.LazyPlayingPolicy.ctor.call(this,xmp.LAZY_PLAYING_POLICY,kf);};xmp.DERIVE_CLASS(xmp.AbstractPlayingPolicy,xmp.LazyPlayingPolicy);xmp.LazyPlayingPolicy.prototype.validateBootstrap=function(lf){try{xmp.NativePlayerRegistry.createGroup(xmp.VALIDATE_ON_BOOTSTRAP,lf);this.validatePlatform(xmp.VALIDATE_ON_BOOTSTRAP);var mf=this.playerPolicy.getBootstrapMedia();for(var i=0;i<mf.length;i++){xmp.NativePlayerRegistry.validate(xmp.VALIDATE_ON_BOOTSTRAP,mf[i].mimeType);}}
catch(e){this.playerPolicy.getLogger().fatal("\n\n"+e.message,e);if(e.plugIn){lf.onPlugInError(e);}
else if(true===(e instanceof xmp.UnsupportedPlatformError)){lf.onUnsupportedPlatformError(e);}}
finally{xmp.NativePlayerRegistry.destoryGroup(xmp.VALIDATE_ON_BOOTSTRAP);}};xmp.NativePlayerRegistry=function(){var nf={};var of=new xmp.util.internals.CategoryLogger("NativePlayerRegistry");return{createGroup:function(pf,qf){if(nf[pf]!==null&&true===xmp.isDefined(nf[pf])){throw new xmp.NativePlayerError("Creating group.","A native player group already exists with the name \""+pf+"\".",null);}
var rf=xmp.PlayerPolicy.getSupportedPlatformBrowser(xmp.util.internals.BrowserDetect.OS,xmp.util.internals.BrowserDetect.browser);var sf=((rf)?xmp.PlayerPolicy.getNativePlayerGroup(rf.playersGroup):xmp.PlayerPolicy.getDefaultNativePlayerGroup());nf[pf]={owner:qf,template:sf,players:{}};of.info("Created native player group \""+pf+"\".");},findPlayerByMimeType:function(tf,uf){var vf=this.findGroup(tf);var wf=vf.players[uf];if(wf){return wf;}
this.validate(tf,uf);wf=vf.players[uf];if(wf){return wf;}
throw new xmp.NativePlayerNotFoundError("Finding player by mime type.","Unable to find native player for mime type \""+uf+"\".",tf,uf);},findPlayerByType:function(xf,yf){var zf=this.findGroup(xf);for(var Af=xmp.MapIterator.create(zf.players);Af.hasNext();Af.next()){var Bf=Af.currentValue();if(Bf.getType()===yf){return Bf;}}
throw new xmp.NativePlayerNotFoundError("Finding player by media type.","Unable to find native player for type \""+yf+"\".",xf,yf);},validate:function(Cf,Df){var Ef=this.findGroup(Cf);var Ff=Ef.players[Df];if(Ff){Ff.validate(Df);return;}
var Gf=Ef.template[Df];if(!Gf){throw new xmp.NativePlayerNotFoundError("Validating player.","Unable to find native player for mime type \""+Df+"\".  Missing native player group.",Cf,Df);}
var Hf=Gf.length;var If=null;for(var i=0;i<Hf;i++){try{Ff=this.createNativePlayer(Ef.owner,Gf[i]);Ff.validate(Df);Ef.players[Df]=Ff;of.info("Registered native player \""+Ff.getType()+"\" for mime type \""+Df+"\" and group \""+Cf+"\".");return;}
catch(e){of.warn("\n\n"+e.message,e);if(i===0){If=e;}
if(i===(Hf-1)){throw If;}}}},destoryGroup:function(Jf){var Kf=this.findGroup(Jf);if(!Kf){return;}
for(var Lf=xmp.MapIterator.create(Kf.players);Lf.hasNext();Lf.next()){var Mf=Lf.currentValue();Mf.fini();}
nf[Jf]=null;of.info("Destroyed native player group \""+Jf+"\".");},createNativePlayer:function(Nf,Of){var Pf=xmp.getNamespacedMethod(Of);return new Pf(Nf,Of);},validateGroup:function(Qf,Rf){if(!Rf){throw new xmp.NativePlayerGroupNotFoundError("Validating native player group.","Invalid native player group \""+Qf+"\".",Qf);}},findGroup:function(Sf){var Tf=nf[Sf];this.validateGroup(Sf,Tf);return Tf;}};}();xmp.NULL_PLAYER="Null";xmp.NULL_MIME_TYPE="application/x-null";xmp.NullPlayer=function(Uf,Vf){xmp.NullPlayer.ctor.call(this,xmp.NULL_PLAYER,null,Vf);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.NullPlayer);xmp.NullPlayer.prototype.create=function(Wf){Wf.id=Wf.viewport.name;if(Wf.viewport&&Wf.viewport.getType()===xmp.DHTML_VIEWPORT){Wf.viewport.getNative().style.backgroundColor=xmp.BLACK_BACKGROUND_COLOR;Wf.viewport.getNative().innerHTML="";}
xmp.NullPlayer.base.create.call(this,Wf);};xmp.PlayerPolicy=function(){var Xf="/PlayerContexts/Global/PlayingPolicy";var Yf="PlayingPolicy/MediaTypes";var Zf="PlayingPolicy/PlugIns";var $f="Strategy";var ag="PlayingPolicy/Streaming Modes";var bg="PlayingPolicy/Bootstrap Media";var cg="PlayingPolicy/Supported Platforms";var dg="PlayingPolicy/Playback Priority Groups";var eg="PlayingPolicy/Native Players";var fg="PlayingPolicy/Native Player Groups";var gg="PlayingPolicy/Playback Platforms";var hg="Streaming Modes";var ig="Players";var jg="Properties";var kg="mime-type";var lg="display-name";var mg="download-url";var ng="minimum-version";var og="maximum-version";var pg="Failover";var qg="BasePlayer/PlayerSizes";var rg="PlugIns Overrides";return{initMediaTypes:function(){this.mediaTypes={};var sg=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var tg=sg.getNodeForPath(Yf);var ug=tg.retrieveChildren();var vg=ug.length;for(var i=0;i<vg;i++){var wg=ug[i];var xg=wg.getString(kg,xmp.NO_DEFAULT_VALUE);this.validateMimeType(wg.getName(),xg);var yg={type:wg.getName(),mimeType:xg,streamingModes:{}};var zg=wg.getNodeForPath(hg);var Ag=zg.retrieveKeys();var Bg=Ag.length;for(var j=0;j<Bg;j++){var Cg=this.getStreamingMode(yg.type,zg,Ag[j]);yg.streamingModes[Cg.type]=Cg;}
this.mediaTypes[yg.type]=yg;}},initPlugins:function(){this.plugIns={};var Dg=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var Eg=Dg.getNodeForPath(Zf);var Fg=Eg.retrieveChildren();var Gg=Fg.length;for(var i=0;i<Gg;i++){var Hg=Fg[i];var Ig={name:Hg.getName(),displayName:Hg.getString(lg,xmp.NO_DEFAULT_VALUE),minVersion:Hg.getString(ng,xmp.NO_DEFAULT_VALUE),maxVersion:Hg.getString(og,xmp.NO_DEFAULT_VALUE),downloadUrl:Hg.getString(mg,xmp.NO_DEFAULT_VALUE),properties:{}};this.validatePlugIn(Ig);this.plugIns[Hg.getName()]=Ig;}},apply:function(Jg,Kg){this.init();return this.getStrategy().apply(Jg,Kg);},validateMimeType:function(Lg,Mg){if(!Mg){throw new xmp.InvalidMimeTypeError("Validating player policy media mime type.","NULL \""+Lg+"\" playing policy MIME type \""+Mg+"\".");}
if(Mg.length===0){throw new xmp.InvalidMimeTypeError("Validating player policy media mime type.","Missing \""+Lg+"\" playing policy MIME type \""+Mg+"\".");}},getStreamingMode:function(Ng,Og,Pg){var Qg={type:Pg,url_mask:Og.getString(Pg,xmp.NO_DEFAULT_VALUE)};this.validateStreamingMode(Ng,Qg);return Qg;},validateStreamingMode:function(Rg,Sg){if(false===this.isStreamingModeSupported(Sg.type)){throw new xmp.PlayingPolicyError("Validating streaming mode.","Invalid streaming mode "+Sg.type+" for media type "+Rg+".");}
if(Sg.url_mask.length===0){throw new xmp.PlayingPolicyError("Validating streaming mode.","Missing \""+Rg+"\" playing policy \""+Sg.type+"\" url mask.");}},getStrategy:function(){if(this.strategy===null){var Tg=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(Xf);var Ug=Tg.getString($f,xmp.NO_DEFAULT_VALUE);if(Ug.length===0){throw new xmp.PlayingPolicyError("Retrieving strategy.","Missing playing policy strategy.  Expected \"Lazy\".");}
this.strategy=xmp.PlayingPolicyFactory.createStrategy(Ug,this);this.getLogger().debug("Created player policy \""+Ug+"\" strategy.");}
return this.strategy;},getMediaType:function(Vg){return this.mediaTypes[Vg];},getPlugins:function(){this.init();return this.plugIns;},getPlugin:function(Wg){return this.getPlugins()[Wg];},validatePlugIn:function(Xg){if(Xg.displayName.length===0){throw new xmp.PlayingPolicyError("Validating plugin.","Missing plugin display name.");}
if(Xg.minVersion.length===0){throw new xmp.PlayingPolicyError("Validating plugin.","Missing plugin \""+Xg.displayName+"\" minimum version.");}
if(Xg.downloadUrl.length===0){throw new xmp.PlayingPolicyError("Validating plugin.","Missing plugin \""+Xg.displayName+"\" download url.");}},getLogger:function(){return this.logger;},init:function(){if(this.initialized&&true===this.initialized){return;}
this.initialized=true;this.strategy=null;this.logger=new xmp.util.internals.CategoryLogger('PlayerPolicy');xmp.util.PlayerStats.getInstance().setValue("OS",navigator.platform);xmp.util.PlayerStats.getInstance().setValue("Browser",navigator.userAgent);this.initStreamingModes();this.initMediaTypes();this.initBootstrapMedia();this.initPlugins();this.initNativePlayers();this.initNativePlayerGroups();this.initSupportedPlatforms();this.initPlaybackPriorityGroups();this.initPlaybackPlatforms();},getFailover:function(){if(!this.failover){var Yg=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(Xf);this.failover=Yg.getBoolean(pg,false);}
return this.failover;},getSizes:function(){this.init();if(!this.playerSizes){this.initPlayerSizes();}
return this.playerSizes;},getSizeFromPlayer:function(Zg){this.init();var $g=this.getSizes();var ah=$g.length;for(var i=0;i<ah;i++){var bh=Zg.length;for(var j=0;j<bh;j++){if($g[i]===Zg[j]){return $g[i];}}}
return"";},initPlayerSizes:function(){this.playerSizes=[];var ch=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath(qg);var dh=ch.retrieveKeys();var eh=dh.length;if(eh===0){throw new xmp.PlayingPolicyError("Validating player sizes.","Missing player sizes.");}
for(var i=0;i<eh;i++){var fh=ch.getString(dh[i],xmp.NO_DEFAULT_VALUE);if(fh.length===0){throw new xmp.PlayingPolicyError("Validating player size.","Missing player size.");}
this.playerSizes.push(fh);}},validateBootstrap:function(gh){this.init();this.getStrategy().validateBootstrap(gh);},initStreamingModes:function(){var hh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(ag);var ih=hh.retrieveKeys();var jh=ih.length;this.modes=[];for(var i=0;i<jh;i++){var kh=hh.getString(ih[i],xmp.NO_DEFAULT_VALUE);if(kh.length===0){throw new xmp.PlayingPolicyError("Validating streaming mode.","Missing mode.");}
this.modes.push(kh);}
return this.modes;},getStreamingModes:function(){this.init();if(!this.modes){throw new xmp.PlayingPolicyError("Retrieving streaming modes.","Missing modes.");}
if(this.modes.length===0){throw new xmp.PlayingPolicyError("Validating streaming modes.","Missing modes.");}
return this.modes;},initBootstrapMedia:function(){var lh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(bg);var mh=lh.retrieveKeys();var nh=mh.length;if(nh===0){throw new xmp.PlayingPolicyError("Validating bootstrap media.","Missing media.");}
this.bootstrapMedia=[];for(var i=0;i<nh;i++){var oh=lh.getString(mh[i],xmp.NO_DEFAULT_VALUE);var ph=this.getMediaType(oh);if(!ph){throw new xmp.PlayingPolicyError("Validating bootstrap media.","Invalid bootstrap media type \""+oh+"\".");}
this.bootstrapMedia.push(ph);}
return this.bootstrapMedia;},getBootstrapMedia:function(){this.init();if(!this.bootstrapMedia){throw new xmp.PlayingPolicyError("Retrieving bootstrap media.","Missing media.");}
return this.bootstrapMedia;},initNativePlayers:function(){var qh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(eg);var rh=qh.retrieveChildren();var sh=rh.length;if(sh===0){throw new xmp.PlayingPolicyError("Validating native players.","Missing players.");}
this.nativePlayers=[];for(var i=0;i<sh;i++){var th=rh[i];if(!xmp.getNamespacedMethod(th.getName())){throw new xmp.PlayingPolicyError("Validating native player.","Invalid "+th.getName()+" native player.");}
var uh=th.retrieveKeys();var vh=uh.length;var wh={};for(var j=0;j<vh;j++){wh[uh[j]]=th.getString(uh[j],xmp.NO_DEFAULT_VALUE);}
this.nativePlayers[th.getName()]=wh;}},initNativePlayerGroups:function(){var xh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(fg);var yh=xh.retrieveChildren();var zh=yh.length;if(zh===0){throw new xmp.PlayingPolicyError("Validating native player groups.","Missing groups.");}
this.nativePlayerGroups=[];for(var i=0;i<zh;i++){var Ah=this.getDefaultNativePlayerGroup();var Bh=yh[i];var Ch=Bh.retrieveChildren();var Dh=Ch.length;if(Dh===0){throw new xmp.PlayingPolicyError("Validating native player group mime types.","Missing "+Bh.getName()+" mime types.");}
for(var j=0;j<Dh;j++){var Eh=Ch[j].getString(kg,xmp.NO_DEFAULT_VALUE);if(Eh.length===0){throw new xmp.PlayingPolicyError("Validating native player group mime type.","Missing \""+Bh.getName()+"\" mime type.");}
if(false===this.isMimeTypeSupported(Eh)){continue;}
var Fh=Ch[j].getNodeForPath(ig);var Gh=Fh.retrieveKeys();var Hh=Gh.length;if(Hh===0){throw new xmp.PlayingPolicyError("Validating native player group mime type players.","Missing "+Bh.getName()+" native player group \""+Eh+"\" players.");}
var Ih=[];for(var k=0;k<Hh;k++){var Jh=Fh.getString(Gh[k],xmp.NO_DEFAULT_VALUE);if(Jh.length===0){throw new xmp.PlayingPolicyError("Validating native player group mime type player.","Missing "+Bh.getName()+" native player group \""+Eh+"\" player.");}
if(false===xmp.isDefined(this.getNativePlayerConfig(Jh))){throw new xmp.PlayingPolicyError("Validating native player group mime type player.","Invalid "+Bh.getName()+" native player group \""+Eh+"\" player \""+Jh+".");}
Ih.push(Jh);}
Ah[Eh]=Ih;}
this.nativePlayerGroups[Bh.getName()]=Ah;}},initSupportedPlatforms:function(){var Kh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(cg);var Lh=Kh.retrieveChildren();var Mh=Lh.length;if(Mh===0){throw new xmp.PlayingPolicyError("Validating supported platforms.","Missing platforms.");}
this.platforms={};for(var i=0;i<Mh;i++){var Nh=Lh[i];var Oh=Nh.retrieveKeys();var Ph=Oh.length;if(Ph===0){throw new xmp.PlayingPolicyError("Validating supported platform browsers.","Missing "+Nh.getName()+" browsers.");}
var Qh=[];for(var j=0;j<Ph;j++){var Rh=Nh.getString(Oh[j],xmp.NO_DEFAULT_VALUE);if(Rh.length===0){throw new xmp.PlayingPolicyError("Validating supported platform browser native player group.","Missing "+Nh.getName()+" platform \""+Oh[j]+"\" browser native player group.");}
if(false===xmp.isDefined(this.getNativePlayerGroup(Rh))){throw new xmp.PlayingPolicyError("Validating supported platform browser native player group.","Invalid "+Nh.getName()+" platform \""+Oh[j]+"\" browser native player group \""+Rh+"\".");}
Qh.push({name:Oh[j],playersGroup:Rh,modes:{}});}
if(xmp.util.internals.BrowserDetect.OS===Nh.getName()){this.initPlatformPlugInOverrides(Nh);}
this.platforms[Nh.getName()]=Qh;}},initPlaybackPriorityGroups:function(){var Sh=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(dg);var Th=Sh.retrieveChildren();var Uh=Th.length;if(Uh===0){throw new xmp.PlayingPolicyError("Validating playback priority groups.","Missing groups.");}
this.playbackPriorityGroups=[];for(var i=0;i<Uh;i++){var Vh=Th[i];var Wh=Vh.retrieveKeys();var Xh=Wh.length;if(Xh===0){throw new xmp.PlayingPolicyError("Validating playback priority group media.","Missing "+Vh.getName()+" media.");}
var Yh=[];for(var j=0;j<Xh;j++){var Zh=Vh.getString(Wh[j],xmp.NO_DEFAULT_VALUE);if(Zh.length===0){throw new xmp.PlayingPolicyError("Validating playback priority group media.","Missing "+Vh.getName()+" media type.");}
if(false===xmp.isDefined(this.getMediaType(Zh))){throw new xmp.PlayingPolicyError("Validating playback priority group media.","Invalid "+Vh.getName()+" media type \""+Zh+"\".");}
Yh.push(Zh);}
this.playbackPriorityGroups[Vh.getName()]=Yh;}},initPlaybackPlatforms:function(){var $h=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(gg);var ai=$h.retrieveChildren();var bi=ai.length;if(bi===0){throw new xmp.PlayingPolicyError("Validating playback platforms.","Missing platforms.");}
for(var i=0;i<bi;i++){var ci=ai[i];if(this.getSupportedPlatform(ci.getName())===null){throw new xmp.PlayingPolicyError("Validating playback platform OS.","The "+ci.getName()+"platform OS is not supported.");}
var di=ci.retrieveChildren();var ei=di.length;if(ei===0){throw new xmp.PlayingPolicyError("Validating playback platform browsers.","Missing "+ci.getName()+" platform browsers.");}
for(var j=0;j<ei;j++){var fi=di[j];var gi=this.getSupportedPlatformBrowser(ci.getName(),fi.getName());if(!gi){throw new xmp.PlayingPolicyError("Validating playback platform browser.","The "+ci.getName()+" platform browser "+fi.getName()+" is not supported.");}
var hi=fi.retrieveKeys();var ii=hi.length;if(ii===0){throw new xmp.PlayingPolicyError("Validating playback platform browser streaming modes.","Missing "+ci.getName()+" platform browser "+fi.getName()+" streaming modes.");}
for(var k=0;k<ii;k++){if(false===this.isStreamingModeSupported(hi[k])){throw new xmp.PlayingPolicyError("Validating playback platform browser streaming mode.","Invalid "+ci.getName()+" platform browser "+fi.getName()+" streaming mode "+hi[k]+".");}
var ji=fi.getString(hi[k],xmp.NO_DEFAULT_VALUE);if(ji.length===0){throw new xmp.PlayingPolicyError("Validating playback platform browser streaming mode priority group.","Missing "+ci.getName()+" platform browser "+fi.getName()+" streaming mode "+hi[k]+" playback priority group.");}
if(false===xmp.isDefined(this.getPlaybackPriorityGroup(ji))){throw new xmp.PlayingPolicyError("Validating playback platform browser streaming mode priority group.","Invalid "+ci.getName()+" platform browser "+fi.getName()+" streaming mode "+hi[k]+" playback priority group "+ji+".");}
gi.modes[hi[k]]=ji;}}}},initPlatformPlugInOverrides:function(ki){var li=ki.getNodeForPath(rg);var mi=li.retrieveChildren();var ni=mi.length;for(var i=0;i<ni;i++){var oi=mi[i];var pi=this.getPlugin(oi.getName());if(!pi){throw new xmp.PlayingPolicyError("Validating platform plugin override.","Invalid "+ki.getName()+" platform \""+oi.getName()+"\" plugin.");}
var qi=oi.getString(ng,xmp.NO_DEFAULT_VALUE);if(qi.length>0){pi.minVersion=qi;}
var ri=oi.getString(og,xmp.NO_DEFAULT_VALUE);if(ri.length>0){pi.maxVersion=ri;}
var si=oi.getString(mg,xmp.NO_DEFAULT_VALUE);if(si.length>0){pi.downloadUrl=si;}}},getSupportedPlatform:function(ti){return this.platforms[ti];},getPlaybackPriorityGroup:function(ui){this.init();return this.playbackPriorityGroups[ui];},getSupportedPlatformBrowser:function(vi,wi){this.init();var xi=this.getSupportedPlatform(vi);if(!xi){return null;}
var yi=xi.length;for(var i=0;i<yi;i++){if(wi===xi[i].name){return xi[i];}}
return null;},isStreamingModeSupported:function(zi){var Ai=this.modes.length;for(var i=0;i<Ai;i++){if(zi===this.modes[i]){return true;}}
return false;},isMimeTypeSupported:function(Bi){this.init();for(var Ci=xmp.MapIterator.create(this.mediaTypes);Ci.hasNext();Ci.next()){var Di=Ci.currentValue();if(Di.mimeType===Bi){return true;}}
return((this.getDefaultNativePlayerGroup()[Bi])?true:false);},getNativePlayerConfig:function(Ei){this.init();return this.nativePlayers[Ei];},getNativePlayerGroup:function(Fi){this.init();return this.nativePlayerGroups[Fi];},getDefaultNativePlayerGroup:function(){this.init();return{"application/x-null":["xmp.NullPlayer"],"application/x-dhtml":["xmp.DHTMLPlayer"],"application/xmp-mock":["xmp.MockNativePlayer"]};}};}();xmp.PlayingPolicyFactory=function(){return{createStrategy:function(Gi,Hi){if(Gi===xmp.LAZY_PLAYING_POLICY){return new xmp.LazyPlayingPolicy(Hi);}
throw new xmp.PlayingPolicyError("Creating playing policy strategy.","Unable to create playing policy strategy \""+Gi+"\".");}};}();xmp.BandwidthRecorderError=function(Ii,Ji){xmp.BandwidthRecorderError.ctor.call(this,"BandwidthRecorderError",Ii,Ji);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.BandwidthRecorderError);xmp.DHTMLObjectError=function(Ki,Li){xmp.DHTMLObjectError.ctor.call(this,"DHTMLObjectError",Ki,Li);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.DHTMLObjectError);xmp.InvalidMimeTypeError=function(Mi,Ni){xmp.InvalidMimeTypeError.ctor.call(this,"InvalidMimeTypeError",Mi,Ni);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.InvalidMimeTypeError);xmp.InvalidNativePlayerViewportError=function(Oi,Pi,Qi){var Ri=[{label:"Native Player Type",text:Qi.getType()},{label:"Native Player Name",text:Qi.getName()}];xmp.InvalidNativePlayerViewportError.ctor.call(this,"InvalidNativePlayerViewportError",Oi,Pi,Ri);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.InvalidNativePlayerViewportError);xmp.InvalidPlayableNodeError=function(Si,Ti){xmp.InvalidPlayableNodeError.ctor.call(this,"InvalidMimeTypeError",Si,Ti);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.InvalidPlayableNodeError);xmp.InvalidPlugInVersionError=function(Ui,Vi,Wi){var Xi="Invalid "+Vi.displayName+" version \""+Wi+"\".  Expected version is ";Xi+=((parseInt(Vi.maxVersion,10)>0)?"between \""+Vi.minVersion+"\" and \""+Vi.maxVersion+"\".":"\""+Vi.minVersion+"\" or greater.");Xi+="\n\nThe latest plugin can be downloaded at \""+Vi.downloadUrl+"\".";xmp.InvalidPlugInVersionError.ctor.call(this,"InvalidPlugInVersionError",Ui,Xi,Vi);};xmp.DERIVE_CLASS(xmp.PlugInError,xmp.InvalidPlugInVersionError);xmp.MediaPlayerError=function(Yi,Zi){xmp.MediaPlayerError.ctor.call(this,"MediaPlayerError",Yi,Zi);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.MediaPlayerError);xmp.NativePlayerConnectionError=function($i,aj,bj,cj){var dj=[{label:"Native Player Type",text:((bj)?bj.getType():"")},{label:"Native Player Name",text:((bj)?bj.getName():"")}];if(cj){dj=dj.concat(cj);}
xmp.NativePlayerConnectionError.ctor.call(this,xmp.XmpErrorCodes.CRITICAL_PLAYER_CONNECTION,"NativePlayerConnectionError",$i,aj,dj);};xmp.DERIVE_CLASS(xmp.CriticalException,xmp.NativePlayerConnectionError);xmp.NativePlayerError=function(ej,fj,gj,hj){var ij=[];if(gj){ij.push({label:"Native Player Type",text:gj.getType()});ij.push({label:"Native Player Name",text:gj.getName()});}
if(hj){ij=ij.concat(hj);}
xmp.NativePlayerError.ctor.call(this,"NativePlayerError",ej,fj,ij);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.NativePlayerError);xmp.NativePlayerGroupNotFoundError=function(jj,kj,lj,mj){var nj=[{label:"Native Player Group",text:lj}];if(mj){nj=nj.concat(mj);}
xmp.NativePlayerGroupNotFoundError.ctor.call(this,xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,"NativePlayerGroupNotFoundError",jj,kj,nj);};xmp.DERIVE_CLASS(xmp.FatalException,xmp.NativePlayerGroupNotFoundError);xmp.NativePlayerNotFoundError=function(oj,pj,qj,rj,sj){var tj=[{label:"Native Player Group",text:qj},{label:"MIME Type",text:rj}];if(sj){tj=tj.concat(sj);}
xmp.NativePlayerNotFoundError.ctor.call(this,xmp.XmpErrorCodes.FATAL_PLATFORM,"NativePlayerNotFoundError",oj,pj,tj);};xmp.DERIVE_CLASS(xmp.CriticalException,xmp.NativePlayerNotFoundError);xmp.NativePlayerUnsupportedError=function(uj,vj,wj){var xj=[{label:"Native Player Type",text:((wj)?wj.getType():"")},{label:"Native Player Name",text:((wj)?wj.getName():"")}];xmp.NativePlayerUnsupportedError.ctor.call(this,"NativePlayerUnsupportedError",uj,vj,xj);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.NativePlayerUnsupportedError);xmp.PlaybackModeError=function(yj,zj,Aj){var Bj=[{label:"Playback Mode",text:((Aj)?Aj.getName():"")}];xmp.PlaybackModeError.ctor.call(this,"PlaybackModeError",yj,zj,Bj);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.PlaybackModeError);xmp.PlayingPolicyApplyError=function(Cj,Dj,Ej,Fj){var Gj="Unable to apply playing policy to playable node.\n\nPlayer Sizes:              "+Dj.join(", ")+"\n\nPolicy:"+"\n\n  Type:                     "+Ej.type+"\n  Media:                   "+Ej.media.join(", ")+"\n\nPlayable Node:"+"\n\n  Location:               "+Fj.getURI()+"\n  Streaming Mode:  "+Fj.getStreamingMode()+"\n  Mime Types:         "+Fj.getMimeTypes().join(", ")+"\n  Sizes:                   "+Fj.getSizes().join(", ");xmp.PlayingPolicyApplyError.ctor.call(this,"PlayingPolicyApplyError",Cj,Gj);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.PlayingPolicyApplyError);xmp.PlayingPolicyError=function(Hj,Ij){xmp.PlayingPolicyError.ctor.call(this,"PlayingPolicyError",Hj,Ij);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.PlayingPolicyError);xmp.PlugInDisabledError=function(Jj,Kj,Lj){var Mj="The "+Kj.displayName+" is disabled or not associated with the \""+Lj+"\" MIME type.";xmp.PlugInDisabledError.ctor.call(this,"PlugInDisabledError",Jj,Mj,Kj);};xmp.DERIVE_CLASS(xmp.PlugInError,xmp.PlugInDisabledError);xmp.PlugInNotFoundError=function(Nj,Oj){var Pj=Oj.displayName+" not found.  \n\nThe plugin can be downloaded at \""+Oj.downloadUrl+"\".";xmp.PlugInNotFoundError.ctor.call(this,"PlugInNotFoundError",Nj,Pj,Oj);};xmp.DERIVE_CLASS(xmp.PlugInError,xmp.PlugInNotFoundError);xmp.ServiceError=function(Qj,Rj){xmp.ServiceError.ctor.call(this,"ServiceError",Qj,Rj);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ServiceError);xmp.UnsupportedPlatformError=function(Sj,Tj){xmp.UnsupportedPlatformError.ctor.call(this,xmp.XmpErrorCodes.FATAL_PLATFORM,"UnsupportedPlatformError",Sj,Tj);};xmp.DERIVE_CLASS(xmp.FatalException,xmp.UnsupportedPlatformError);xmp.UnsupportedPlugInVersionError=function(Uj,Vj,Wj){var Xj="The "+Vj.displayName+" version \""+Wj+"\" is not supported.  Expected version is ";Xj+=((parseInt(Vj.maxVersion,10)>0)?"between \""+Vj.minVersion+"\" and \""+Vj.maxVersion+"\".":"\""+Vj.minVersion+"\" or greater.");Xj+="\n\nA supported plugin can be downloaded at \""+Vj.downloadUrl+"\".";xmp.UnsupportedPlugInVersionError.ctor.call(this,"UnsupportedPlugInVersionError",Uj,Xj,Vj);};xmp.DERIVE_CLASS(xmp.PlugInError,xmp.UnsupportedPlugInVersionError);xmp.DefaultPlaybackMode=function(Yj,Zj,$j){xmp.DefaultPlaybackMode.ctor.call(this,Yj,Zj,$j);};xmp.DERIVE_CLASS(xmp.PlaybackMode,xmp.DefaultPlaybackMode);xmp.DefaultPlaybackMode.prototype.open=function(ak,bk){this.changeMode(ak,xmp.INIT,xmp.OPEN_OPERATION,bk);};xmp.DefaultPlaybackMode.prototype.close=function(ck){this.changeMode(ck,xmp.FINI,xmp.CLOSE_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.play=function(dk){this.changeMode(dk,xmp.PLAY,xmp.PLAY_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.pause=function(ek){this.changeMode(ek,xmp.PAUSE,xmp.PAUSE_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.stop=function(fk){this.changeMode(fk,xmp.STOP,xmp.STOP_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.rewind=function(gk){this.changeMode(gk,xmp.REWIND,xmp.REWIND_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.fastForward=function(hk){this.changeMode(hk,xmp.FAST_FORWARD,xmp.FAST_FORWARD_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.seek=function(ik,jk){this.changeMode(ik,xmp.SEEKABLE,xmp.SEEK_OPERATION,jk);};xmp.DefaultPlaybackMode.prototype.ended=function(kk){this.changeMode(kk,xmp.ENDED,xmp.ENDED_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.error=function(lk){this.changeMode(lk,xmp.ERRORS,xmp.ERROR_OPERATION,null);};xmp.DefaultPlaybackMode.prototype.isAvailable=function(mk,nk){try{return(true===this.canTransition(nk)||this.getPlayer(mk).isAvailable(nk));}
catch(e){this.handleError(mk,xmp.IS_AVAILABLE,e);}
return false;};xmp.DefaultPlaybackMode.prototype.getPosition=function(ok){try{return parseInt(this.getPlayer(ok).getPosition(),10);}
catch(e){this.handleError(ok,xmp.GET_POSITION,e);}
return 0;};xmp.DefaultPlaybackMode.prototype.getDuration=function(pk){try{return parseInt(this.getPlayer(pk).getDuration(),10);}
catch(e){this.handleError(pk,xmp.GET_DURATION,e);}
return 0;};xmp.DefaultPlaybackMode.prototype.getVolume=function(qk){try{return this.getPlayer(qk).getVolume();}
catch(e){this.handleError(qk,xmp.GET_VOLUME,e);}
return 0;};xmp.DefaultPlaybackMode.prototype.setVolume=function(rk,sk){try{this.getPlayer(rk).setVolume(sk);}
catch(e){this.handleError(rk,xmp.SET_VOLUME,e);}};xmp.DefaultPlaybackMode.prototype.getMute=function(tk){try{return this.getPlayer(tk).getMute();}
catch(e){this.handleError(tk,xmp.GET_MUTE,e);}
return false;};xmp.DefaultPlaybackMode.prototype.setMute=function(uk,vk){try{this.getPlayer(uk).setMute(vk);}
catch(e){this.handleError(uk,xmp.SET_MUTE,e);}};xmp.DefaultPlaybackMode.prototype.getFullscreen=function(wk){try{return this.getPlayer(wk).getFullscreen();}
catch(e){this.handleError(wk,xmp.GET_FULLSCREEN,e);}
return false;};xmp.DefaultPlaybackMode.prototype.setFullscreen=function(xk,yk){try{this.getPlayer(xk).setFullscreen(yk);}
catch(e){this.handleError(xk,xmp.SET_FULLSCREEN,e);}};xmp.DefaultPlaybackMode.prototype.getBufferingProgress=function(zk){try{return this.getPlayer(zk).getBufferingProgress();}
catch(e){this.handleError(zk,xmp.GET_BUFFERING_PROGRESS,e);}
return null;};xmp.DefaultPlaybackMode.prototype.handleError=function(Ak,Bk,e){var Ck=e;if(false===(Ck instanceof xmp.NativePlayerError)&&false===(Ck instanceof xmp.NativePlayerUnsupportedError)){var Dk="Delegating \""+Bk.toLowerCase()+"\" operation to native player.";Ck=new xmp.NativePlayerError(((e.context)?e.context:Dk),((e.rawMessage)?e.rawMessage:e.message),this.getPlayer(Ak),[{label:"Playback Mode",text:this.getName()}]);Ck.setInnerError(e);}
throw Ck;};xmp.ENDED_PLAYBACK_STATE="EndedPlayback";xmp.ENDED="Ended";xmp.ENDED_OPERATION="Ended";xmp.EndedPlaybackMode=function(){xmp.EndedPlaybackMode.ctor.call(this,xmp.ENDED,xmp.ENDED_PLAYBACK_STATE,[xmp.FINI,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.EndedPlaybackMode);xmp.EndedPlaybackMode.prototype.transition=function(Ek,Fk,Gk){this.ended(Ek);};xmp.EndedPlaybackMode.prototype.ended=function(Hk){try{this.getPlayer(Hk).ended();}
catch(e){this.handleError(Hk,xmp.ENDED_OPERATION,e);}};xmp.ERRORS_PLAYBACK_STATE="ErrorPlayback";xmp.ERRORS="Error";xmp.ERROR_OPERATION="Error";xmp.ErrorPlaybackMode=function(){xmp.ErrorPlaybackMode.ctor.call(this,xmp.ERRORS,xmp.ERRORS_PLAYBACK_STATE,[xmp.FINI]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.ErrorPlaybackMode);xmp.ErrorPlaybackMode.prototype.transition=function(Ik,Jk,Kk){this.error(Ik);};xmp.ErrorPlaybackMode.prototype.error=function(Lk){try{this.getPlayer(Lk).error();}
catch(e){}};xmp.FAST_FORWARD_PLAYBACK_STATE="FastForwardPlayback";xmp.FAST_FORWARD="FastForward";xmp.FAST_FORWARD_OPERATION="FastForward";xmp.FastForwardPlaybackMode=function(){xmp.FastForwardPlaybackMode.ctor.call(this,xmp.FAST_FORWARD,xmp.FAST_FORWARD_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.FastForwardPlaybackMode);xmp.FastForwardPlaybackMode.prototype.transition=function(Mk,Nk,Ok){this.fastForward(Mk);};xmp.FastForwardPlaybackMode.prototype.fastForward=function(Pk){try{this.getPlayer(Pk).fastForward();}
catch(e){this.handleError(Pk,xmp.FAST_FORWARD_OPERATION,e);}};xmp.FINI_PLAYBACK_STATE="FiniPlayback";xmp.FINI="Fini";xmp.CLOSE_OPERATION="Close";xmp.FiniPlaybackMode=function(){xmp.FiniPlaybackMode.ctor.call(this,xmp.FINI,xmp.FINI_PLAYBACK_STATE,[xmp.INIT,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.FiniPlaybackMode);xmp.FiniPlaybackMode.prototype.transition=function(Qk,Rk,Sk){try{this.getPlayer(Qk).close();}
catch(e){this.handleError(Qk,xmp.CLOSE_OPERATION,e);}};xmp.FiniPlaybackMode.prototype.close=function(Tk){};xmp.INIT_PLAYBACK_STATE="InitPlayback";xmp.INIT="Init";xmp.OPEN_OPERATION="Open";xmp.InitPlaybackMode=function(){xmp.InitPlaybackMode.ctor.call(this,xmp.INIT,xmp.INIT_PLAYBACK_STATE,[xmp.FINI,xmp.PLAY,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.InitPlaybackMode);xmp.InitPlaybackMode.prototype.transition=function(Uk,Vk,Wk){try{this.getPlayer(Uk).open(Vk);}
catch(e){this.handleError(Uk,xmp.OPEN_OPERATION,e);}};xmp.InitPlaybackMode.prototype.open=function(Xk,Yk){throw new xmp.PlaybackModeError("Invoking state operation.","The \""+xmp.OPEN_OPERATION.toLowerCase()+"\" operation has already been executed.",this);};xmp.NORMAL_PLAYBACK_STATE="NormalPlayback";xmp.PLAY="Play";xmp.PLAY_OPERATION="Play";xmp.NormalPlaybackMode=function(){xmp.NormalPlaybackMode.ctor.call(this,xmp.PLAY,xmp.NORMAL_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.NormalPlaybackMode);xmp.NormalPlaybackMode.prototype.transition=function(Zk,$k,al){this.play(Zk);};xmp.NormalPlaybackMode.prototype.play=function(bl){try{this.getPlayer(bl).play();}
catch(e){this.handleError(bl,xmp.PLAY_OPERATION,e);}};xmp.PAUSE_PLAYBACK_STATE="PausePlayback";xmp.PAUSE="Pause";xmp.PAUSE_OPERATION="Pause";xmp.PausePlaybackMode=function(){xmp.PausePlaybackMode.ctor.call(this,xmp.PAUSE,xmp.PAUSE_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.PausePlaybackMode);xmp.PausePlaybackMode.prototype.transition=function(cl,dl,el){this.pause(cl);};xmp.PausePlaybackMode.prototype.pause=function(fl){try{this.getPlayer(fl).pause();}
catch(e){this.handleError(fl,xmp.PAUSE_OPERATION,e);}};xmp.PlayerModeRegistry=function(){this.modes=[];var gl=[new xmp.InitPlaybackMode(),new xmp.FiniPlaybackMode(),new xmp.PausePlaybackMode(),new xmp.NormalPlaybackMode(),new xmp.PausePlaybackMode(),new xmp.StopPlaybackMode(),new xmp.RewindPlaybackMode(),new xmp.FastForwardPlaybackMode(),new xmp.SeekablePlaybackMode(),new xmp.EndedPlaybackMode(),new xmp.ErrorPlaybackMode()];for(var i=0;i<gl.length;i++){this.addMode(gl[i]);}};xmp.PlayerModeRegistry.prototype.addMode=function(hl){this.modes[hl.type]=hl;};xmp.PlayerModeRegistry.prototype.findMode=function(il){var jl=this.modes[il];if(jl!==null){return jl;}
throw new xmp.PlaybackModeError("Finding playback mode.","Unable to find player mode \""+il+"\".",null);};xmp.REWIND_PLAYBACK_STATE="RewindPlayback";xmp.REWIND="Rewind";xmp.REWIND_OPERATION="Rewind";xmp.RewindPlaybackMode=function(){xmp.RewindPlaybackMode.ctor.call(this,xmp.REWIND,xmp.REWIND_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.RewindPlaybackMode);xmp.RewindPlaybackMode.prototype.transition=function(kl,ll,ml){this.rewind(kl);};xmp.RewindPlaybackMode.prototype.rewind=function(nl){try{this.getPlayer(nl).rewind();}
catch(e){this.handleError(nl,xmp.REWIND_OPERATION,e);}};xmp.SEEKABLE_PLAYBACK_STATE="SeekablePlayback";xmp.SEEKABLE="Seekable";xmp.SEEK_OPERATION="Seek";xmp.SeekablePlaybackMode=function(){xmp.SeekablePlaybackMode.ctor.call(this,xmp.SEEKABLE,xmp.SEEKABLE_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.SeekablePlaybackMode);xmp.SeekablePlaybackMode.prototype.transition=function(ol,pl,ql){this.seek(ol,pl);};xmp.SeekablePlaybackMode.prototype.seek=function(rl,sl){try{this.getPlayer(rl).seek(sl);}
catch(e){this.handleError(rl,xmp.SEEK_OPERATION,e);}};xmp.STOP_PLAYBACK_STATE="StopPlayback";xmp.STOP="Stop";xmp.STOP_OPERATION="Stop";xmp.StopPlaybackMode=function(){xmp.StopPlaybackMode.ctor.call(this,xmp.STOP,xmp.STOP_PLAYBACK_STATE,[xmp.FINI,xmp.ENDED,xmp.ERRORS]);};xmp.DERIVE_CLASS(xmp.DefaultPlaybackMode,xmp.StopPlaybackMode);xmp.StopPlaybackMode.prototype.transition=function(tl,ul,vl){this.stop(tl);};xmp.StopPlaybackMode.prototype.stop=function(wl){try{this.getPlayer(wl).stop();}
catch(e){this.handleError(wl,xmp.STOP_OPERATION,e);}};xmp.ContextualUrlStrategy=function(){this._logger=new xmp.util.internals.CategoryLogger('ContextualUrlStrategy');this._mapMimeTypeToUrlStrategy=null;this._mapStrategyNameToStrategyObject={};this._defaultStrategy=new xmp.SimpleUrlStrategy();xmp.util.SettingsManager.getInstance().addContextChangeListener(new xmp.util.Callback('ContextualUrlStrategy',this._handleContextChange,this));};xmp.ContextualUrlStrategy.create=function(){var xl=new xmp.ContextualUrlStrategy();return xl;};xmp.ContextualUrlStrategy.prototype.getName=function(){return'Contextual';};xmp.ContextualUrlStrategy.prototype.tryFailover=function(yl,zl,Al){if((!yl)||(!zl)||(!Al)){return false;}
if(Al instanceof xmp.NativePlayerConnectionError&&(this._mapStrategyNameToStrategyObject[this._getStrategyName(zl)].getName()!==this._defaultStrategy.getName())){this._setFailoverStrategy(zl,Al);zl.setURI(zl.getMetadata('originalUri','foo'));zl.setUriAbsolute(false);yl.open(zl);return true;}
return false;};xmp.ContextualUrlStrategy.prototype.buildUrlAsynch=function(Bl,Cl){var Dl=new xmp.util.Callback('ContextualUrlStrategy',this._handleDelegateBuildUrlAsynch,this);Dl.setMetadata('relayCb',Cl);try{this._getStrategy(Bl).buildUrlAsynch(Bl,Dl);}
catch(ex){this._logger.warn('Error calling buildUrlAsynch: '+ex);this._handleDelegateBuildUrlAsynch(Dl,Bl,ex);}};xmp.ContextualUrlStrategy.prototype._handleDelegateBuildUrlAsynch=function(El,Fl,Gl){var Hl=El.getMetadata('relayCb',xmp.util.internals.MetadataMap.defaultObj);if(Gl!==null){this._setFailoverStrategy(Fl,Gl);if(Gl.octoError){this._logger.warn('Trying again after fail over.');this.buildUrlAsynch(Fl,Hl);return;}}
Hl.call(Fl,Gl);};xmp.ContextualUrlStrategy.prototype._setFailoverStrategy=function(Il,Jl){try{if(Jl instanceof xmp.PlugInError){return;}
var Kl=this._getStrategyName(Il);this._logger.critical('Failing over for strategy: '+Kl,Jl);this._mapStrategyNameToStrategyObject[Kl]=this._defaultStrategy;}
catch(ex){this._logger.critical('Error setting failover strategy, setting all strategies to default: '+ex);for(var Ll=xmp.MapIterator.create(this._mapStrategyNameToStrategyObject);Ll.hasNext();Ll.next()){Ll.updateCurrentValue(this._defaultStrategy);}}};xmp.ContextualUrlStrategy.prototype._getStrategyName=function(Ml){var Nl=Ml.getMimeType();if(!xmp.isNonEmptyString(Nl)){throw new Error('No mime-type on playable node.');}
this._loadMimeTypeToUrlStrategyMap();var Ol=this._mapMimeTypeToUrlStrategy[Nl];if(!xmp.isNonEmptyString(Ol)){Ol='Simple';this._mapMimeTypeToUrlStrategy[Nl]=Ol;}
return Ol;};xmp.ContextualUrlStrategy.prototype._getStrategy=function(Pl){var Ql=this._getStrategyName(Pl);var Rl=this._mapStrategyNameToStrategyObject[Ql];if(typeof(Rl)==='undefined'){Rl=this._createStrategy(Ql);this._mapStrategyNameToStrategyObject[Ql]=Rl;}
if(this._logger.isInfoEnabled()){this._logger.info('For mime-type: '+Pl.getMimeType()+', requested strategy: '+Ql+', actual strategy: '+Rl.getName());}
return Rl;};xmp.ContextualUrlStrategy.prototype._createStrategy=function(Sl){if(Sl==='Simple'){return this._defaultStrategy;}
if(Sl==='Octoshape'){return new xmp.OctoshapeUrlStrategy();}
if(Sl==='OctoshapeConditional'){if(xmp.InternalUserDetection.getInstance().isInternal()&&xmp.OctoshapeUrlStrategy.canUse()){return new xmp.OctoshapeUrlStrategy();}
else{return this._defaultStrategy;}}
throw new Error('Unrecogonized URL strategy name: '+Sl);};xmp.ContextualUrlStrategy.prototype._loadMimeTypeToUrlStrategyMap=function(){if(this._mapMimeTypeToUrlStrategy!==null){return;}
this._mapMimeTypeToUrlStrategy={};this._mapStrategyNameToStrategyObject={};var Tl=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('UrlStrategies');var Ul=Tl.retrieveKeys();for(var i=0;i<Ul.length;i++){var Vl=Ul[i];var Wl=Tl.getString(Vl,'dummy');this._mapMimeTypeToUrlStrategy[Vl]=Wl;}};xmp.ContextualUrlStrategy.prototype._handleContextChange=function(){this._mapMimeTypeToUrlStrategy=null;};xmp.InternalUserDetection=function(){this._logger=new xmp.util.internals.CategoryLogger('InternalUserDetection');this._isInited=false;this._isInternal=false;this._primaryCheckResult=-1;};xmp.InternalUserDetection._instance=null;xmp.InternalUserDetection.getInstance=function(){if(xmp.InternalUserDetection._instance===null){xmp.InternalUserDetection._instance=new xmp.InternalUserDetection();}
return xmp.InternalUserDetection._instance;};xmp.InternalUserDetection.prototype.isInternal=function(){if(!this._isInited){throw new Error('InternalUserDetection not initialized.');}
return this._isInternal;};xmp.InternalUserDetection.prototype.init=function(Xl){this._isInited=false;this._isInternal=false;this._primaryCheckResult=-1;try{var Yl=this._getPrefs();if(!Yl.getBoolean('do primary check',false)){this._logger.info('Primary check turned OFF, NOT an internal user.');this._finish(Xl,false);return;}
this._primaryCheckResult=this._isInternalPrimaryCheck();if(1===this._primaryCheckResult){if(Yl.getBoolean('do secondary check',false)){this._logger.info('Primary check returned true, and secondary check turned ON, doing secondary check.');this._checkResourceLoadedFromWeb(Xl);return;}
else{this._logger.info('Primary check returned true, and secondary check turned OFF, IS an internal user.');this._finish(Xl,true);return;}}
else{this._logger.info('Primary check returned: '+this._primaryCheckResult+', NOT an internal user.');this._finish(Xl,false);return;}}
catch(ex){this._logger.info('Error checking internal user.',ex);this._finish(Xl,false);}};xmp.InternalUserDetection.prototype._finish=function(Zl,$l){this._isInternal=$l;this._doAsynchCallback(Zl);};xmp.InternalUserDetection.prototype._isInternalPrimaryCheck=function(){var cc=this._getCountryCode();if(!xmp.isNonEmptyString(cc)){return-1;}
if(cc==='***'){return 1;}
return 0;};xmp.InternalUserDetection.prototype._getCountryCode=function(){var cc='';if(xmp.util.Cookie.canUse()){var am=xmp.util.Cookie.read('adDEmas');if(xmp.isNonEmptyString(am)){var bm=am.split('&');if(bm.length>=5){cc=bm[4];}}}
return cc;};xmp.InternalUserDetection.prototype._doAsynchCallback=function(cm){this._isInited=true;cm.callAsynch([]);};xmp.InternalUserDetection.prototype._checkResourceLoadedFromWeb=function(dm){var em=this._getPrefs();var fm=em.getString('rel url','dummy');var gm='internalUserCheckResource';this._isInternal=false;var hm=new xmp.util.Callback('InternalUserDetection._checkResourceLoadedFromWeb',this._onResourceLoadedFromWeb,this);hm.setMetadata('relayCb',dm);xmp.net.AjaxRequestManager.getInstance().request(fm,hm,gm,fm,xmp.net.ContentTypes.TEXT,null);};xmp.InternalUserDetection.prototype._onResourceLoadedFromWeb=function(im,jm){var km=im.getMetadata('relayCb',xmp.util.internals.MetadataMap.defaultObj);this._isInited=true;this._isInternal=!jm.isError();this._logger.info('Secondary check returned: '+this._isInternal+', user '+(this._isInternal?'IS':'is NOT')+' an internal user.');try{km.call();}
catch(ex){this._logger.error('Error calling callback.',ex);}};xmp.InternalUserDetection.prototype._getPrefs=function(){return xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('InternalUserCheck');};xmp.OctoshapeUrlStrategy=function(){this._logger=new xmp.util.internals.CategoryLogger('OctoshapeUrlStrategy');this._OCTO_MIME_TYPE='application/x-octoshapeplugin';this._VALIDATE_OCTO='ValidateOctoshape';this._OCTO_ASYNCH_INTERVAL=5;this._OCTO_POLL_INTERVAL=this._getPrefs().getInt('octo poll interval',2000);this._OCTO_TRY_LIMIT=this._getPrefs().getInt('octo try limit',8);this._OCTO_STATE_PLUGIN_INITIALIZING=-4500;this._OCTO_STATE_STARTING=1;this._OCTO_STATE_READY=2;this._octoGroup='';this._octoPlugin=null;this._initializingOctoPlugin=null;this._octoException=null;try{this._createOctoPlugin();}
catch(ex){this._initializingOctoPlugin=this._octoPlugin=null;this._octoException=ex;this._logger.warn('Error creating octoshape plugin: '+ex);}};xmp.OctoshapeUrlStrategy.canUse=function(){try{if(typeof(xmp.OctoshapeUrlStrategy._canUseInternal)==='undefined'){var lm=xmp.OctoshapeUrlStrategy._staticGetPrefs();var mm='{fn:function(){'+lm.getString('octo can use fn','return false;')+'}}';var nm=xmp.net.AjaxRequestManager.getInstance()._parseJson(mm);xmp.OctoshapeUrlStrategy._canUseInternal=nm.fn;}
return xmp.OctoshapeUrlStrategy._canUseInternal();}
catch(ex){xmp.util.internals.CategoryLogger.create('OctoshapeUrlStrategy').warn('Error calling canUse.',ex);return false;}};xmp.OctoshapeUrlStrategy.prototype.getName=function(){return'Octoshape';};xmp.OctoshapeUrlStrategy.prototype.buildUrlAsynch=function(om,pm){if(this._octoException!==null){throw this._octoException;}
try{var qm=new xmp.util.Callback('OctoshapeUrlStrategy',this._handleTimer,this);qm.setMetadata('relayCb',pm);qm.setMetadata('node',om);this._doTimer(qm);}
catch(ex){this._octoException=ex;throw this._octoException;}};xmp.OctoshapeUrlStrategy.prototype._doTimer=function(rm){var sm=rm.getMetadata('node',xmp.util.internals.MetadataMap.defaultObj);var tm=this._OCTO_POLL_INTERVAL;var um=rm.getMetadata('octo_tries',0);var vm=this._getOctoStatus(um);switch(vm){case this._OCTO_STATE_PLUGIN_INITIALIZING:case this._OCTO_STATE_STARTING:tm=this._OCTO_POLL_INTERVAL;um++;rm.setMetadata('octo_tries',um);break;case this._OCTO_STATE_READY:tm=this._OCTO_ASYNCH_INTERVAL;var wm=sm.getURI();var xm=sm.getBestId();var ym=this._getPrefs().getNodeForPath('url mapping');var zm=ym.getString(xm,wm);wm=zm;var Am=this._octoPlugin.getLink(wm,false);sm.setURI(Am);this._logger.info('Old URI: '+wm+', New Octoshape URI: '+Am);rm.setMetadata('octo_ready',true);break;default:throw new Error('Unexepected octoshape status: '+vm);}
if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+sm.getBestId()+', timer duration: '+tm+', tries: '+um+', status: '+vm);}
xmp.util.Timer.doSimpleCallbackEx(tm,rm);};xmp.OctoshapeUrlStrategy._staticGetPrefs=function(){return xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('UrlStrategies/Octoshape');};xmp.OctoshapeUrlStrategy.prototype._getPrefs=function(){return xmp.OctoshapeUrlStrategy._staticGetPrefs();};xmp.OctoshapeUrlStrategy.prototype._handleTimer=function(Bm){var Cm=Bm.getMetadata('relayCb',xmp.util.internals.MetadataMap.defaultObj);var Dm=Bm.getMetadata('node',xmp.util.internals.MetadataMap.defaultObj);var Em=Bm.getMetadata('octo_ready',false);if(Em){Cm.call(Dm,null);}
else{try{this._doTimer(Bm);}
catch(ex){this._octoException=ex;Cm.call(Dm,ex);}}};xmp.OctoshapeUrlStrategy.prototype._getOctoStatus=function(Fm){if(Fm>=this._OCTO_TRY_LIMIT){var Gm=new Error('Exceeded limit of attempts to start octoshape: '+this._OCTO_TRY_LIMIT);Gm.octoError=true;throw Gm;}
if(this._checkOctoPlugin(Fm===(this._OCTO_TRY_LIMIT-1))){return this._octoPlugin.getStatus(true);}
else{return this._OCTO_STATE_PLUGIN_INITIALIZING;}};xmp.OctoshapeUrlStrategy.prototype._checkOctoPlugin=function(Hm){if(this._octoPlugin){return true;}
if(!this._octoPlugin){if(!(typeof(this._initializingOctoPlugin.getStatus)!=='undefined'&&typeof(this._initializingOctoPlugin.getLink)!=='undefined')){if(Hm){throw new xmp.InvalidPlugInVersionError(this._VALIDATE_OCTO,this._getPluginInfo(),'out-of-date-version');}
else{return false;}}
this._octoPlugin=this._initializingOctoPlugin;return true;}};xmp.OctoshapeUrlStrategy.prototype._createOctoPlugin=function(){this._octoPlugin=null;this._initializingOctoPlugin=null;if(window.ActiveXObject){try{this._initializingOctoPlugin=new window.ActiveXObject('octoshapeplugin'+this._octoGroup+'.client');}
catch(ex){this._logger.info('Error creating Octoshape ActiveXObject',ex);this._initializingOctoPlugin=null;}}
else{var Im=this._OCTO_MIME_TYPE+this._octoGroup+'-client';var Jm=null;if(window.navigator&&window.navigator.mimeTypes&&window.navigator.mimeTypes.length){Jm=window.navigator.mimeTypes[Im];}
if(!Jm){throw new xmp.PlugInNotFoundError(this._VALIDATE_OCTO,this._getPluginInfo());}
if(!Jm.enabledPlugin){throw new xmp.PlugInDisabledError(this._VALIDATE_OCTO,this._getPluginInfo(),this._OCTO_MIME_TYPE);}
var Km=window.document.createElement("DIV");window.document.body.appendChild(Km);Km.innerHTML='<object id="xmp_octoshapeclientobject" type="'+Im+'" hidden="true"></object>';this._initializingOctoPlugin=window.document.getElementById('xmp_octoshapeclientobject');}
if(!this._initializingOctoPlugin){throw new xmp.PlugInNotFoundError(this._VALIDATE_OCTO,this._getPluginInfo());}};xmp.OctoshapeUrlStrategy.prototype._getPluginInfo=function(){var Lm=xmp.PlayerPolicy;var Mm=Lm.getPlugins();var Nm=Mm.Octoshape;if(!Nm){var ex=new Error('Octoshape plugin incorrectly configured.');this._logger.fatal('Octoshape error',ex);throw ex;}
return Nm;};xmp.SimpleUrlStrategy=function(){};xmp.SimpleUrlStrategy.prototype.getName=function(){return'Simple';};xmp.SimpleUrlStrategy.prototype.buildUrlAsynch=function(Om,Pm){Pm.callAsynch([Om,null]);};

xmp.DHTML_PLAYER="DHTML";xmp.DHTML_MIME_TYPE="application/x-dhtml";xmp.DHTML_OBJECT_TRANSPORT="dhtmlObject";xmp.DHTMLPlayer=function(aa,ba){this.object=null;this.node=null;this.url="";xmp.DHTMLPlayer.ctor.call(this,xmp.DHTML_PLAYER,aa,ba);this._logger=new xmp.util.internals.CategoryLogger('DHTMLPlayer');};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.DHTMLPlayer);xmp.DHTMLPlayer.prototype.open=function(ca){this.node=ca;this.url=ca.getURI();var da=new xmp.util.Callback(this.getName(),this.onDHTMLObjectLoad,this);var ea=xmp.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.url],da);ga.load();};xmp.DHTMLPlayer.prototype.close=function(){if(this.object){this.object.close();this.object=null;}
xmp.DHTMLPlayer.base.close.call(this);};xmp.DHTMLPlayer.prototype.play=function(){this.object.play();xmp.DHTMLPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.DHTMLPlayer.prototype.pause=function(){this.object.pause();xmp.DHTMLPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.DHTMLPlayer.prototype.stop=function(){this.object.stop();xmp.DHTMLPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.DHTMLPlayer.prototype.rewind=function(){this.object.rewind();xmp.DHTMLPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.DHTMLPlayer.prototype.fastForward=function(){this.object.fastForward();xmp.DHTMLPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.DHTMLPlayer.prototype.seek=function(ha){this.object.seek(ha);xmp.DHTMLPlayer.base.seek.call(this,ha);this.setState(xmp.SEEKABLE);};xmp.DHTMLPlayer.prototype.ended=function(){xmp.DHTMLPlayer.base.ended.call(this);this.object.ended();};xmp.DHTMLPlayer.prototype.isAvailable=function(ia){if(!this.object){return false;}
return this.object.isAvailable(ia);};xmp.DHTMLPlayer.prototype.getPosition=function(){return this.object.getPosition();};xmp.DHTMLPlayer.prototype.getDuration=function(){return this.object.getDuration();};xmp.DHTMLPlayer.prototype.moveTo=function(ja,ka,la,ma){xmp.DHTMLPlayer.base.moveTo.call(this,ja,ka,la,ma);this.object.moveTo(ja,ka,la,ma);};xmp.DHTMLPlayer.prototype.create=function(na){na.id=xmp.DHTML_PLAYER+na.group;xmp.DHTMLPlayer.base.create.call(this,na);if(na.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+na.viewport.getType()+"\".  Supported viewports:  DHTML.",this);}
this.volume=na.volume;this.mute=na.mute;var oa=na.viewport.getNative();oa.innerHTML="<div id='"+na.id+"' style='background-color: #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"; width: "+oa.style.width+"; height: "+oa.style.height+"' />";this.setCreated();};xmp.DHTMLPlayer.prototype.onDHTMLObjectLoad=function(pa,qa){try{if(true===qa.isError()){return;}
this.object=qa.getDataObject();this.validateObject();this.object.open(this.getGroup(),this,this.getNative(),this.node);this.node=null;}
catch(e){this.setError("Loading DHTML object via Ajax request.",e);}};xmp.DHTMLPlayer.prototype.validateObject=function(){if(!this.object){throw new xmp.DHTMLObjectError("Validating DHTML object.","NULL DHTML object.");}
var ra=[{name:xmp.OPEN_OPERATION,implementation:this.object.open,args:4},{name:xmp.CLOSE_OPERATION,implementation:this.object.close,args:0},{name:xmp.PLAY_OPERATION,implementation:this.object.play,args:0},{name:xmp.PAUSE_OPERATION,implementation:this.object.pause,args:0},{name:xmp.STOP_OPERATION,implementation:this.object.stop,args:0},{name:xmp.REWIND_OPERATION,implementation:this.object.rewind,args:0},{name:xmp.FAST_FORWARD_OPERATION,implementation:this.object.fastForward,args:0},{name:xmp.SEEK_OPERATION,implementation:this.object.seek,args:1},{name:xmp.ENDED_OPERATION,implementation:this.object.ended,args:0},{name:xmp.IS_AVAILABLE_OPERATION,implementation:this.object.isAvailable,args:1},{name:xmp.GET_POSITION_OPERATION,implementation:this.object.getPosition,args:0},{name:xmp.GET_DURATION_OPERATION,implementation:this.object.getDuration,args:0},{name:xmp.MOVETO_OPERATION,implementation:this.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){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE],"DHTMLPlayer.onStateChange");this.setState(ta,ua);};xmp.DHTMLPlayer.prototype.onError=function(va,e){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE],"DHTMLPlayer.onError");this.setError(va,e);};xmp.FLASH="Flash";xmp.FLASH_MIME_TYPE="video/x-flv";xmp.FLASH_PLUGIN_MIME_TYPE="application/x-shockwave-flash";xmp.FLASH_PLUGIN_NAME="Shockwave Flash";xmp.FLASH_ACTIVEX_BASE_PROGID="ShockwaveFlash.ShockwaveFlash.";xmp.FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID="ShockwaveFlash.ShockwaveFlash";xmp.FLASH_VERSION=8;xmp.FLASH_VERSION_VARIABLE="$version";xmp.ALLOW_SCRIPT_ACCESS="allowScriptAccess";xmp.ALLOW_FULLSCREEN_ACCESS="allowFullScreen";xmp.ALWAYS_ACCESS="always";xmp.QUALITY="quality";xmp.QUALITY_HIGH="high";xmp.ALLOW_TRANSPARENCY="wmode";xmp.WINDOW_MODE="wmode";xmp.TRANSPARENT_WINDOW_MODE="transparent";xmp.FLASH_PLAYER_STATE_CHANGE_METHOD="onStateChange";xmp.FLASH_PLAYER_ERROR_METHOD="onError";xmp.FLASH_PLAYER_INITIALIZATION_METHOD="onInit";xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD="onExecuteCommand";xmp.FLASH_PLAYER_TRIGGER_METHOD="onTrigger";xmp.SCRIPT_ELEMENT_TAG="script";xmp.FLASH_ERROR_CALLBACK="errorCallback";xmp.FLASH_INITIALIZATION_CALLBACK="initializationCallback";xmp.FLASH_STATE_CHANGE_CALLBACK="stateChangeCallback";xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK="executeCommandCallback";xmp.FLASH_TRIGGER_CALLBACK="triggerCallback";xmp.EXECUTE_COMMAND_RESULT="executeCommandResult";xmp.FLASH_NATIVE_PLAYER_COMPONENT="native_player_component";xmp.FLASH_CONNECTION_ERROR="ConnectionError";xmp.FLASH_PLAYER_SWF_BASE_NAME="FlashMediaPlayer";xmp.FLASH_BUFFER_TIME_CONFIG="Buffer Time";xmp.FLASH_BUFFER_TIME="bufferTime";xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG="Streaming Video Adapter";xmp.FLASH_STREAMING_VIDEO_ADAPTER="streamingVideoAdapter";xmp.FLASH_FULLSCREEN_ENABLED="fullscreenEnabled";xmp.FlashPlayer=function(wa,xa){xmp.FlashPlayer.ctor.call(this,xmp.FLASH,wa,xa);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.FlashPlayer);xmp.FlashPlayer.prototype.open=function(ya){this.getNative().fmpOpen(xmp.FLASH_MIME_TYPE,ya.getURI());};xmp.FlashPlayer.prototype.close=function(){this.getNative().fmpClose();xmp.FlashPlayer.base.close.call(this);};xmp.FlashPlayer.prototype.play=function(){this.getNative().fmpPlay();xmp.FlashPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.FlashPlayer.prototype.pause=function(){this.getNative().fmpPause();xmp.FlashPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.FlashPlayer.prototype.stop=function(){this.getNative().fmpStop();xmp.FlashPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.FlashPlayer.prototype.rewind=function(){this.getNative().fmpRewind();xmp.FlashPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.FlashPlayer.prototype.fastForward=function(){this.getNative().fmpFastForward();xmp.FlashPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.FlashPlayer.prototype.seek=function(za){this.getNative().fmpSeek(za);xmp.FlashPlayer.base.seek.call(this,za);this.setState(xmp.SEEKABLE);};xmp.FlashPlayer.prototype.ended=function(){this.getNative().fmpEnded();xmp.FlashPlayer.base.ended.call(this);};xmp.FlashPlayer.prototype.isAvailable=function(Aa){return this.getNative().fmpIsAvailable(Aa);};xmp.FlashPlayer.prototype.getPosition=function(){return this.getNative().fmpGetPosition();};xmp.FlashPlayer.prototype.getDuration=function(){return this.getNative().fmpGetDuration();};xmp.FlashPlayer.prototype.getVolume=function(){return this.getNative().fmpGetVolume();};xmp.FlashPlayer.prototype.setVolume=function(Ba){this.getNative().fmpSetVolume(Ba);};xmp.FlashPlayer.prototype.getMute=function(){return this.getNative().fmpGetMute();};xmp.FlashPlayer.prototype.setMute=function(Ca){this.getNative().fmpSetMute(Ca);};xmp.FlashPlayer.prototype.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.isFullscreenEnabled()){Ea="The \"setFullscreen\" method is not supported.  Fullscreen disabled.";}
throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.",Ea,this);};xmp.FlashPlayer.prototype.onValidatePlugIn=function(Fa){this.validatePlugInVersion(xmp.FLASH,this.validatePlugInExists());};xmp.FlashPlayer.prototype.validatePlugInExists=function(){var Ga=this.getPlugInInfo(xmp.FLASH);if(xmp.isIEBrowser()){try{return this.getActiveXVersion(new ActiveXObject(xmp.FLASH_ACTIVEX_VERSION_INDEPENDENT_PROGID));}
catch(e){var Ha=parseInt(this.parseVersion(Ga.minVersion).major,10);var Ia=Ha;if(Ga.maxVersion&&Ga.maxVersion.length>0){Ia=parseInt(this.parseVersion(Ga.maxVersion).major,10);}
for(var i=Ia;(i>=3&&i>=Ha);i--){try{return this.getActiveXVersion(new ActiveXObject(xmp.FLASH_ACTIVEX_BASE_PROGID+i));}
catch(tempE){}}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ga);}
else{var Ja=navigator.mimeTypes[xmp.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.FLASH_PLUGIN_MIME_TYPE);}
var Ka=Ja.enabledPlugin.name;if(Ka.indexOf(xmp.FLASH_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",Ga,xmp.FLASH_PLUGIN_MIME_TYPE);}
var La=Ja.enabledPlugin.description;var Ma=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,La);return Ma;}
return"";};xmp.FlashPlayer.prototype.create=function(Na){if(true===this.attach(Na)){return;}
Na.id=xmp.FLASH+Na.group;xmp.FlashPlayer.base.create.call(this,Na);var Oa=Na.viewport.getNative();var Pa=new SWFObject(xmp.makeSWFPath(xmp.FLASH_PLAYER_SWF_BASE_NAME,true),Na.id,Oa.style.width,Oa.style.height,xmp.FLASH_VERSION,xmp.BLACK_BACKGROUND_COLOR);Pa.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);Pa.addParam(xmp.QUALITY,xmp.QUALITY_HIGH);Pa.addParam(xmp.ALLOW_TRANSPARENCY,"transparent");Pa.addParam(xmp.ALLOW_FULLSCREEN_ACCESS,xmp.TRUE);Pa.addVariable(xmp.FLASH_BUFFER_TIME,this.getConfigProperty(xmp.FLASH_BUFFER_TIME_CONFIG));Pa.addVariable(xmp.FLASH_STREAMING_VIDEO_ADAPTER,this.getConfigProperty(xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG));Pa.addVariable(xmp.FLASH_FULLSCREEN_ENABLED,((true===this.isFullscreenEnabled())?xmp.TRUE:xmp.FALSE));Pa.addVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_INITIALIZATION_METHOD));Pa.addVariable(xmp.FLASH_STATE_CHANGE_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_STATE_CHANGE_METHOD));Pa.addVariable(xmp.FLASH_TRIGGER_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_TRIGGER_METHOD));Pa.addVariable(xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD));Pa.addVariable(xmp.FLASH_ERROR_CALLBACK,this.getCallbackMethod(xmp.FLASH_PLAYER_ERROR_METHOD));Pa.addVariable(xmp.VOLUME,Na.volume);Pa.addVariable(xmp.MUTE,((true===Na.mute)?xmp.TRUE:xmp.FALSE));Pa.write(Oa.id);};xmp.FlashPlayer.prototype.attach=function(Qa){Qa.id=Qa.viewport.getName();xmp.FlashPlayer.base.attach.call(this,Qa);if(Qa.viewport.getType()!==xmp.DHTML_VIEWPORT&&Qa.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Qa.viewport.getType()+"\".  Supported viewports:  DHTML, Flash",this);}
if(Qa.viewport.getType()!==xmp.FLASH_VIEWPORT){return false;}
var Ra=[{name:xmp.FLASH_BUFFER_TIME,value:this.getConfigProperty(xmp.FLASH_BUFFER_TIME_CONFIG)},{name:xmp.FLASH_STREAMING_VIDEO_ADAPTER,value:this.getConfigProperty(xmp.FLASH_STREAMING_VIDEO_ADAPTER_CONFIG)},{name:xmp.FLASH_INITIALIZATION_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_INITIALIZATION_METHOD)},{name:xmp.FLASH_STATE_CHANGE_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_STATE_CHANGE_METHOD)},{name:xmp.FLASH_TRIGGER_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_TRIGGER_METHOD)},{name:xmp.FLASH_STATE_EXECUTE_COMMAND_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_EXECUTE_COMMAND_METHOD)},{name:xmp.FLASH_ERROR_CALLBACK,value:this.getCallbackMethod(xmp.FLASH_PLAYER_ERROR_METHOD)},{name:xmp.VOLUME,value:Qa.volume},{name:xmp.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.getNative().SetVariable(Ta.name,Ta.value);}
this.setCreated();return true;};xmp.FlashPlayer.prototype.translateState=function(Ua){return Ua;};xmp.FlashPlayer.prototype.getActiveXVersion=function(Va){var Wa=Va.GetVariable(xmp.FLASH_VERSION_VARIABLE);return this.getVersionFromString(xmp.ACTIVEX_VERSION_DETECTION_JSON,Wa);};xmp.FlashPlayer.prototype.onInit=function(){try{this.getNative().style.zIndex=xmp.NATIVE_PLAYER_Z_INDEX;this.setCreated();}
catch(e){this.setError("Initializing.",e);}};xmp.FlashPlayer.prototype.onStateChange=function(Xa,Ya){try{var Za=this.translateState(Xa);if(Za.length>0){this.setState(Za,Ya);}}
catch(e){this.setError("Handling state change.",e);}};xmp.FlashPlayer.prototype.onTrigger=function($a,ab){try{this.setTrigger($a,ab);}
catch(e){this.setError("Handling trigger.",e);}};xmp.FlashPlayer.prototype.onExecuteCommand=function(bb,cb){var db=null;try{db=xmp.FlashPlayer.base.executeCommand.call(this,bb,cb);}
catch(e){this.setError("Execute command.",e);}
return db;};xmp.FlashPlayer.prototype.onError=function(eb,fb,gb){try{var hb=[{label:"Flash Error Type",text:eb}];if(gb){hb.push({label:"Flash Error Code",text:gb});}
var ib=((eb===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",fb,this,hb):new xmp.NativePlayerError("Handling error.",fb,this,hb));this.setError(null,ib);}
catch(e){this.setError("Handling error.",e);}};xmp.IMAGE_PLAYER="Image";xmp.IMAGE_MIME_TYPE="application/x-image";xmp.IMAGE_TAG="IMG";xmp.IMAGE_STATE_CHANGE_METHOD="onStateChange";xmp.IMAGE_ERROR_METHOD="onError";xmp.IMAGE_INITIALIZATION_METHOD="onInit";xmp.ImagePlayer=function(jb,kb){xmp.ImagePlayer.ctor.call(this,xmp.IMAGE_PLAYER,jb,kb);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.ImagePlayer);xmp.ImagePlayer.prototype.open=function(lb){this.url=lb.getURI();this.timeLimit=lb.getTimeLimitInSeconds();this.position=0;if(true===this.isDHTML()){this.setState(xmp.CONNECTING);this.getNative().src=this.url;}
else{this.getNative().fmpOpen(xmp.IMAGE_MIME_TYPE,this.url);}};xmp.ImagePlayer.prototype.close=function(){if(false===this.isDHTML()){this.getNative().fmpClose();}
xmp.ImagePlayer.base.close.call(this);};xmp.ImagePlayer.prototype.play=function(){if(-1!==this.timeLimit){this.startMonitor();}
this.setState(xmp.PLAY);};xmp.ImagePlayer.prototype.stop=function(){this.setState(xmp.STOP);};xmp.ImagePlayer.prototype.ended=function(){if(false===this.isDHTML()){this.getNative().fmpEnded();}
xmp.ImagePlayer.base.ended.call(this);this.close();};xmp.ImagePlayer.prototype.isAvailable=function(mb){return(mb===xmp.ENDED);};xmp.ImagePlayer.prototype.getPosition=function(){return this.position;};xmp.ImagePlayer.prototype.getDuration=function(){return((-1===this.timeLimit)?0:this.timeLimit);};xmp.ImagePlayer.prototype.create=function(nb){if(true===this.attach(nb)){return;}
nb.id=xmp.IMAGE_PLAYER+nb.group;xmp.ImagePlayer.base.create.call(this,nb);this.volume=nb.volume;this.mute=nb.mute;var ob=nb.viewport.getNative();ob.innerHTML="<img style='background-color:  #000000' id='"+nb.id+"' width='"+(ob.style.width)+"' height='"+(ob.style.height)+"' src='"+nb.node.getURI()+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' onError='"+this.createCallbackMethod(xmp.IMAGE_ERROR_METHOD)+"()' onLoad='"+this.createCallbackMethod(xmp.IMAGE_STATE_CHANGE_METHOD)+"(xmp.OPEN, null)' />";this.setCreated();};xmp.ImagePlayer.prototype.onMonitorTimelineChange=function(pb,qb){this.position++;};xmp.ImagePlayer.prototype.attach=function(rb){rb.id=rb.viewport.getName();this.volume=rb.volume;this.mute=rb.mute;xmp.ImagePlayer.base.attach.call(this,rb);if(rb.viewport.getType()!==xmp.DHTML_VIEWPORT&&rb.viewport.getType()!==xmp.FLASH_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+rb.viewport.getType()+"\".  Supported viewports:  DHTML,  Flash",this);}
if(rb.viewport.getType()!==xmp.FLASH_VIEWPORT){return false;}
this.getNative().SetVariable(xmp.FLASH_INITIALIZATION_CALLBACK,this.getCallbackMethod(xmp.IMAGE_INITIALIZATION_METHOD));this.getNative().SetVariable(xmp.FLASH_STATE_CHANGE_CALLBACK,this.getCallbackMethod(xmp.IMAGE_STATE_CHANGE_METHOD));this.getNative().SetVariable(xmp.FLASH_ERROR_CALLBACK,this.getCallbackMethod(xmp.IMAGE_ERROR_METHOD));this.getNative().SetVariable(xmp.CONTEXT,rb.group);this.setCreated();return true;};xmp.ImagePlayer.prototype.isDHTML=function(){return(this.getNative().tagName.toUpperCase()===xmp.IMAGE_TAG);};xmp.ImagePlayer.prototype.createCallbackMethod=function(sb){return this.getCallbackMethod(sb).replace(/\'/g,"\"");};xmp.ImagePlayer.prototype.translateState=function(tb){return tb;};xmp.ImagePlayer.prototype.onInit=function(){try{this.setCreated();}
catch(e){this.setError("Initializing.",e);}};xmp.ImagePlayer.prototype.onStateChange=function(ub,vb){try{var wb=this.translateState(ub);if(wb.length>0){this.setState(wb,vb);}}
catch(e){this.setError("Handling state change.",e);}};xmp.ImagePlayer.prototype.onError=function(xb,yb,zb){try{var Ab=null;if(true===this.isDHTML()){Ab=new xmp.NativePlayerConnectionError("Connecting to media.","Unable to connect to \""+this.getNative().src+"\"",this);}
else{var Bb=[{label:"Flash Error Type",text:xb}];if(zb){Bb.push({label:"Flash Error Code",text:zb});}
Ab=((xb===xmp.FLASH_CONNECTION_ERROR)?new xmp.NativePlayerConnectionError("Connecting to media.",yb,this,Bb):new xmp.NativePlayerError("Handling error.",yb,this,Bb));}
this.setError(null,Ab);}
catch(e){this.setError("Handling error.",e);}};xmp.MOCK_NATIVE="MOCK_NATIVE";xmp.MOCK_MIME_TYPE="application/xmp-mock";xmp.MockNativePlayer=function(Cb,Db){xmp.MockNativePlayer.ctor.call(this,xmp.MOCK_NATIVE,Cb,Db);this.position=0;this.duration=0;this.realTimePosition=0;this.realTimeDuration=0;this.playInstance=-1;this.monitorTimes=4.0;this.logger=new xmp.util.internals.CategoryLogger('MockNativePlayer');};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.MockNativePlayer);xmp.MockNativePlayer.prototype.open=function(Eb){this.node=Eb;this.logger.info("open(): "+this.node.getURI());this.position=0;this.duration=this._getDuration();this.realTimePosition=0;this.realTimeDuration=xmp.util.internals.MockTestMode.getInstance().getRealPlayTimePerNode();this.monitorInterval=this.realTimeDuration/this.monitorTimes;this.positionChangeInterval=this.duration/(this.monitorTimes*2);this.realTimePositionChangeInterval=this.realTimeDuration/(this.monitorTimes*2);this.logger.info("Duration: "+this.duration+" second(s)");this.logger.debug("Real time duration: "+this.realTimeDuration+" milliseconds");this.setState(xmp.OPEN);};xmp.MockNativePlayer.prototype.close=function(){if(this.node){this.logger.info("close(): "+this.node.getURI());}
this.node=null;xmp.MockNativePlayer.base.close.call(this);};xmp.MockNativePlayer.prototype.fini=function(){this.close();};xmp.MockNativePlayer.prototype.onSetState=function(Fb,Gb){xmp.MockNativePlayer.base.onSetState.call(this,Fb,Gb);var Hb=Fb.getMetadata(xmp.CONTEXT,{});if(Hb.type===xmp.PLAY){this.simulatePlay();}};xmp.MockNativePlayer.prototype.play=function(){this.setState(xmp.PLAY);};xmp.MockNativePlayer.prototype.simulatePlay=function(){var Ib=this.node;this.logger.info("play(): "+Ib.getURI());this.logger.info("Node type: "+Ib.getNodeTypeName());this.playInstance++;var Jb=this.createTimer({object:this,id:"position change",interval:this.realTimePositionChangeInterval,handler:this.onSimulatedPositionChange,context:this.playInstance});Jb.start();this.startMonitor();};xmp.MockNativePlayer.prototype.onSimulatedPositionChange=function(Kb,Lb){var Mb=this.node;var Nb=Kb.getMetadata(xmp.CONTEXT,-1);if(!Mb||Nb!==this.playInstance){Lb.stop();}
else if(this.position>=this.duration){Lb.stop();this.stopMonitor();this.setState(xmp.ENDED);}
else{this.position+=this.positionChangeInterval;}};xmp.MockNativePlayer.prototype._getDuration=function(){var Ob=-1;var Pb=this.node;if(Pb.isContentType()||Pb.isAdType()){var Qb=Pb.getPlayableData();Ob=Qb.getTotalRunTime();}
if(Ob<=0){Ob=3;}
return Ob;};xmp.MockNativePlayer.prototype.pause=function(){if(this.node!==null){this.logger.info("pause(): "+this.node.getURI());}
xmp.MockNativePlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.MockNativePlayer.prototype.stop=function(){if(this.node!==null){this.logger.info("stop(): "+this.node.getURI());}
xmp.MockNativePlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.MockNativePlayer.prototype.rewind=function(){if(this.node!==null){this.logger.info("rewind(): "+this.node.getURI());}
xmp.MockNativePlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.MockNativePlayer.prototype.fastForward=function(){if(this.node!==null){this.logger.info("fastForward(): "+this.node.getURI());}
xmp.MockNativePlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.MockNativePlayer.prototype.seek=function(Rb){if(this.node!==null){this.logger.info("seek(): "+this.node.getURI()+" to "+Rb);}
xmp.MockNativePlayer.base.seek.call(this);this.setPosition(Rb);this.setState(xmp.SEEKABLE);};xmp.MockNativePlayer.prototype.ended=function(){if(this.node!==null){this.logger.info("ended(): "+this.node.getURI());}
xmp.MockNativePlayer.base.ended.call(this);};xmp.MockNativePlayer.prototype.isAvailable=function(Sb){return true;};xmp.MockNativePlayer.prototype.getPosition=function(){return this.position;};xmp.MockNativePlayer.prototype.getDuration=function(){return this.duration;};xmp.MockNativePlayer.prototype.validate=function(Tb){};xmp.MockNativePlayer.prototype.onValidatePlugIn=function(Ub){};xmp.MockNativePlayer.prototype.setCreated=function(){this.createTimer({object:this,id:"setCreated",interval:xmp.DEFAULT_TIMER_INTERVAL,handler:this.onSetCreated,context:null}).start();};xmp.MockNativePlayer.prototype.executeCommand=function(Vb,Wb){return this.listener.onNativePlayerExecuteCommand(Vb,Wb);};xmp.MockNativePlayer.prototype.create=function(Xb){this.data=Xb;};xmp.MockNativePlayer.prototype.attach=function(Yb){this.data=Yb;};xmp.MockNativePlayer.prototype.getNative=function(){return null;};xmp.MockNativePlayer.prototype.getMonitorInterval=function(){return this.monitorInterval;};xmp.QUICKTIME="QuickTime";xmp.QUICKTIME_MIME_TYPE="video/quicktime";xmp.FLIP4MAC="Flip4Mac";xmp.QUICKTIME_VERSION_CHECK_PROGID="QuickTimeCheckObject.QuickTimeCheck.1";xmp.FLIP4MAC_VERSION_DETECTION_JSON="Flip4Mac Version Detection JSON";xmp.QuickTimePlayer=function(Zb,$b){this.state=new xmp.QuicktimeStateMachine(this);xmp.QuickTimePlayer.ctor.call(this,xmp.QUICKTIME,Zb,$b);};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.QuickTimePlayer);xmp.QuickTimePlayer.prototype.open=function(ac){this.state.open(ac);};xmp.QuickTimePlayer.prototype.close=function(){xmp.QuickTimePlayer.base.close.call(this);this.state.close();};xmp.QuickTimePlayer.prototype.play=function(){xmp.QuickTimePlayer.base.play.call(this);this.state.play();};xmp.QuickTimePlayer.prototype.pause=function(){xmp.QuickTimePlayer.base.pause.call(this);this.state.pause();};xmp.QuickTimePlayer.prototype.stop=function(){xmp.QuickTimePlayer.base.stop.call(this);this.state.stop();};xmp.QuickTimePlayer.prototype.rewind=function(){xmp.QuickTimePlayer.base.rewind.call(this);this.state.rewind();};xmp.QuickTimePlayer.prototype.fastForward=function(){xmp.QuickTimePlayer.base.fastForward.call(this);this.state.fastForward();};xmp.QuickTimePlayer.prototype.seek=function(bc){xmp.QuickTimePlayer.base.seek.call(this,bc);this.state.seek(bc);};xmp.QuickTimePlayer.prototype.ended=function(){xmp.QuickTimePlayer.base.ended.call(this);this.state.ended();};xmp.QuickTimePlayer.prototype.isAvailable=function(cc){return this.state.isAvailable(cc);};xmp.QuickTimePlayer.prototype.onValidatePlugIn=function(dc){this.validateQuicktime();if(dc.indexOf(xmp.WINDOWS_MEDIA_MIME_TYPE)!==-1){this.validateFlip4Mac();}};xmp.QuickTimePlayer.prototype.getPosition=function(){return this.state.getPosition();};xmp.QuickTimePlayer.prototype.getDuration=function(){return this.state.getDuration();};xmp.QuickTimePlayer.prototype.getVolume=function(){return this.state.getVolume();};xmp.QuickTimePlayer.prototype.setVolume=function(ec){this.state.setVolume(ec);};xmp.QuickTimePlayer.prototype.getMute=function(){return this.state.getMute();};xmp.QuickTimePlayer.prototype.setMute=function(fc){this.state.setMute(fc);};xmp.QuickTimePlayer.prototype.create=function(gc){gc.id=xmp.QUICKTIME+gc.group;xmp.QuickTimePlayer.base.create.call(this,gc);if(gc.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+gc.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var hc=gc.viewport.getNative();if(true===xmp.isIEBrowser()){hc.innerHTML="<object id='"+gc.id+"' width='"+hc.style.width+"' height='"+hc.style.height+"' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'"+" style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' >"+"<param name='src' value='"+gc.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===gc.stretchToFit)?"TOFIT":"ASPECT")+"' />"+"<param name='loop' value='false' />"+"<param name='kioskmode' value='true' /></object>";}
else{hc.innerHTML="<embed type='video/quicktime' name='"+gc.id+"' width='"+hc.style.width+"' height='"+hc.style.height+"' src='"+gc.node.getURI()+"' showlogo='false'"+" style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' bgcolor='#000000' autoplay='true'"+" controller='false' enablejavascript='true' saveembedtags='true'"+" scale='"+((true===gc.stretchToFit)?"TOFIT":"ASPECT")+"' loop='false' kioskmode='true'></embed>";}
this.state.create(gc);this.setCreated();};xmp.QuickTimePlayer.prototype.validateQuicktime=function(){var ic=this.getPlugInInfo(xmp.QUICKTIME);var jc="0.0.0.0";if(true===xmp.isIEBrowser()){try{var kc=new ActiveXObject(xmp.QUICKTIME_VERSION_CHECK_PROGID);jc=this.getVersionFromString(xmp.ACTIVEX_VERSION_DETECTION_JSON,kc.QuickTimeVersion);}
catch(e){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ic);}
this.validatePlugInVersion(xmp.QUICKTIME,jc);}
else{var lc=navigator.mimeTypes[xmp.QUICKTIME_MIME_TYPE];if(!lc){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ic);}
if(!lc.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",ic,xmp.QUICKTIME_MIME_TYPE);}
var mc=lc.enabledPlugin.name;if(mc.indexOf(xmp.QUICKTIME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",ic,xmp.QUICKTIME_MIME_TYPE);}
jc=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,mc);this.validatePlugInVersion(xmp.QUICKTIME,jc);}};xmp.QuickTimePlayer.prototype.validateFlip4Mac=function(){var nc;var oc=this.getPlugInInfo(xmp.FLIP4MAC);var pc=navigator.plugins.length;for(var i=0;i<pc;i++){var qc=navigator.plugins[i];nc=qc.name;var rc=nc.length;if(nc.indexOf(xmp.FLIP4MAC)!==-1){var sc=this.getVersionFromString(xmp.FLIP4MAC_VERSION_DETECTION_JSON,nc);this.validatePlugInVersion(xmp.FLIP4MAC,sc);return;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",oc);};xmp.QUICKTIME_WAITING="Waiting";xmp.QUICKTIME_LOADING="Loading";xmp.QUICKTIME_PLAYABLE="Playable";xmp.QUICKTIME_COMPLETE="Complete";xmp.QUICKTIME_ERROR="Error";xmp.QUICKTIME_NORMAL_RATE=1;xmp.QUICKTIME_PAUSE_RATE=0;xmp.QUICKTIME_REWIND_RATE=-5;xmp.QUICKTIME_FAST_FORWARD_RATE=5;xmp.QUICKTIME_VOLUME_MAX=256;xmp.QUICKTIME_INITIAL_LIVE_DURATION=180000;xmp.QUICKTIME_LOAD_BUFFERING="LoadBuffering";xmp.QUICKTIME_WAIT_BUFFERING="WaitBuffering";xmp.QUICKTIME_BUFFERING_COMPLETE="BufferingComplete";xmp.QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG="State Change Polling Interval";xmp.QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG="Connection Timeout Interval";xmp.QUICKTIME_ERROR_CODE_DELIMITER=",";xmp.QuicktimeStateMachine=function(tc){this.player=tc;this.initTransitionTable();this.initStateChangeHandlers();this.initOperations();this.initErrorCodes();this.live=true;this.stateChangeMonitorTimer=null;this.connectionTimeoutTimer=null;this.bufferingComplete=false;};xmp.QuicktimeStateMachine.prototype.open=function(uc){if(false===this.checkForStaticUrl()){this.initState();this.url=uc.getURI();this.player.getNative().SetURL(this.url);}};xmp.QuicktimeStateMachine.prototype.close=function(){try{this.setState(xmp.FINI,false);this.opened=false;this.stopStateChangeMonitor();this.stopConnectionTimeoutMonitor();this.player.getNative().SetMute(true);this.player.getNative().Stop();}
catch(e){}};xmp.QuicktimeStateMachine.prototype.play=function(){this.player.getNative().Play();this.setState(xmp.PLAY,true);};xmp.QuicktimeStateMachine.prototype.pause=function(){this.player.getNative().SetRate(xmp.QUICKTIME_PAUSE_RATE);this.setState(xmp.PAUSE,true);};xmp.QuicktimeStateMachine.prototype.stop=function(){this.player.getNative().Stop();this.player.getNative().Rewind();this.setState(xmp.STOP,true);};xmp.QuicktimeStateMachine.prototype.rewind=function(){this.player.getNative().SetRate(xmp.QUICKTIME_REWIND_RATE);this.setState(xmp.REWIND,true);};xmp.QuicktimeStateMachine.prototype.fastForward=function(){this.player.getNative().SetRate(xmp.QUICKTIME_FAST_FORWARD_RATE);this.setState(xmp.FAST_FORWARD,true);};xmp.QuicktimeStateMachine.prototype.seek=function(vc){this.player.getNative().SetRate(xmp.QUICKTIME_NORMAL_RATE);this.player.getNative().SetTime(vc*this.player.getNative().GetTimeScale());this.setState(xmp.SEEKABLE,true);};xmp.QuicktimeStateMachine.prototype.ended=function(){this.setState(xmp.ENDED,false);};xmp.QuicktimeStateMachine.prototype.isAvailable=function(wc){var xc=this.operations[this.state];for(var yc=xmp.MapIterator.create(xc);yc.hasNext();yc.next()){var zc=yc.currentValue();if(zc.state===wc){if(false===this.live){return true;}
else{return(true===zc.live);}}}
return false;};xmp.QuicktimeStateMachine.prototype.getPosition=function(){try{return Math.floor(this.player.getNative().GetTime()/this.player.getNative().GetTimeScale());}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getDuration=function(){try{var Ac=this.live;var Bc=this.player.getNative().GetDuration();if(true===this.isInitializing()){Ac=this.isLive(Bc);}
return((true===Ac||Bc===0)?0:Math.floor(Bc/this.player.getNative().GetTimeScale()));}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getVolume=function(){return Math.abs(Math.floor(((this.player.getNative().GetVolume()+1)/xmp.QUICKTIME_VOLUME_MAX)*100));};xmp.QuicktimeStateMachine.prototype.setVolume=function(Cc){this.player.getNative().SetVolume(Math.floor(((Cc.toFixed(1)+1)*0.01)*xmp.QUICKTIME_VOLUME_MAX));this.volume=Cc;this.muted=this.getMute();};xmp.QuicktimeStateMachine.prototype.getMute=function(){var Dc=this.player.getNative().GetMute();return(Dc===true||Dc===1);};xmp.QuicktimeStateMachine.prototype.setMute=function(Ec){this.player.getNative().SetMute(Ec);this.muted=Ec;this.volume=Math.floor(((this.player.getNative().GetVolume()+1)/xmp.QUICKTIME_VOLUME_MAX)*100);};xmp.QuicktimeStateMachine.prototype.create=function(Fc){this.stateChangePollingInterval=parseInt(this.player.getConfigProperty(xmp.QUICKTIME_STATE_CHANGE_POLLING_INTERVAL_CONFIG),10);if(!this.stateChangePollingInterval){throw new xmp.NativePlayerError("Validating state change polling interval.","Missing state change polling interval.",this.player,null);}
this.connectionTimeoutInterval=parseInt(this.player.getConfigProperty(xmp.QUICKTIME_CONNECTION_TIMEOUT_INTERVAL_CONFIG),10);if(!this.connectionTimeoutInterval){throw new xmp.NativePlayerError("Validating connection timeout interval.","Missing connection timeout interval.",this.player,null);}
this.url=Fc.node.getURI();this.staticUrl=this.url;this.volume=Fc.volume;this.muted=Fc.muted;this.initState();};xmp.QuicktimeStateMachine.prototype.onStateChange=function(Gc,Hc){try{if(this.state===xmp.ERRORS){return;}
if(true===this.canGetPluginStatus()){var Ic=this.getRawPluginStatus();if(!Ic){return;}
var Jc=this.translateState(Ic);if(Jc.length>0){if(false===this.stateHandlers[Jc].apply(this,[Ic,Jc])){return;}}}
if(false===this.isInitializing()){var Kc=this.getPosition();if(this.state!==xmp.ENDED&&Kc>0&&(Kc>=this.getDuration())&&false===this.live){this.setState(xmp.ENDED,true);}}}
catch(e){this.setError(null,e);}};xmp.QuicktimeStateMachine.prototype.onConnectionTimeout=function(Lc,Mc){try{this.stopConnectionTimeoutMonitor();if(this.state===xmp.ERRORS){return;}
if(false===this.opened&&false===this.validateUrl()){var e=this.createConnectionError(this.getRawPluginStatus(),"Connection timeout.","Error connecting to \""+this.url+"\".");throw e;}}
catch(e2){this.setError(null,e2);}};xmp.QuicktimeStateMachine.prototype.translateState=function(Nc){if(Nc.indexOf(xmp.QUICKTIME_ERROR)===-1&&false===this.validateUrl()){return"";}
for(var i=0;i<this.transitionTable.length;i++){var Oc=this.transitionTable[i];if(Nc.indexOf(Oc.nativeState)===0){if(0===Oc.currentState.length){return Oc.transitionState;}
else{for(var j=0;j<Oc.currentState.length;j++){if(this.state===Oc.currentState[j]){return Oc.transitionState;}}}}}
return"";};xmp.QuicktimeStateMachine.prototype.initOperations=function(){this.operations={};this.operations[xmp.INIT]=[];this.operations[xmp.CONNECTING]=[];this.operations[xmp.CONNECTED]=[];this.operations[xmp.OPEN]=[];this.operations[xmp.FINI]=[];this.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.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.operations[xmp.STOP]=[{state:xmp.PLAY,live:true},{state:xmp.REWIND,live:false},{state:xmp.FAST_FORWARD,live:false}];this.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.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.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.operations[xmp.ENDED]=[{state:xmp.PLAY,live:false},{state:xmp.FAST_FORWARD,live:false},{state:xmp.SEEKABLE,live:false}];this.operations[xmp.ERRORS]=[];};xmp.QuicktimeStateMachine.prototype.setState=function(Pc,Qc,Rc){this.state=Pc;if(true===Qc){var Sc=((Pc===xmp.QUICKTIME_LOAD_BUFFERING||Pc===xmp.QUICKTIME_WAIT_BUFFERING||Pc===xmp.QUICKTIME_BUFFERING_COMPLETE)?xmp.BUFFERING:Pc);this.player.setState(Sc,Rc);}};xmp.QuicktimeStateMachine.prototype.initTransitionTable=function(){this.transitionTable=[];this.transitionTable.push({nativeState:xmp.QUICKTIME_WAITING,currentState:[xmp.INIT],transitionState:xmp.CONNECTING});this.transitionTable.push({nativeState:xmp.QUICKTIME_WAITING,currentState:[xmp.CONNECTING,xmp.QUICKTIME_WAIT_BUFFERING],transitionState:xmp.QUICKTIME_WAIT_BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_LOADING,currentState:[xmp.INIT,xmp.CONNECTING,xmp.QUICKTIME_WAIT_BUFFERING],transitionState:xmp.CONNECTED});this.transitionTable.push({nativeState:xmp.QUICKTIME_LOADING,currentState:[xmp.CONNECTED,xmp.QUICKTIME_LOAD_BUFFERING,xmp.OPEN],transitionState:xmp.QUICKTIME_LOAD_BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_PLAYABLE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.BUFFERING],transitionState:xmp.BUFFERING});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.QUICKTIME_WAIT_BUFFERING,xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.PLAY,xmp.PAUSE,xmp.STOP,xmp.REWIND,xmp.FAST_FORWARD,xmp.SEEKABLE,xmp.OPEN,xmp.BUFFERING],transitionState:xmp.QUICKTIME_BUFFERING_COMPLETE});this.transitionTable.push({nativeState:xmp.QUICKTIME_PLAYABLE,currentState:[xmp.INIT,xmp.CONNECTING,xmp.CONNECTED,xmp.QUICKTIME_WAIT_BUFFERING,xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.OPEN});this.transitionTable.push({nativeState:xmp.QUICKTIME_COMPLETE,currentState:[xmp.QUICKTIME_LOAD_BUFFERING],transitionState:xmp.ERRORS});this.transitionTable.push({nativeState:xmp.QUICKTIME_ERROR,currentState:[],transitionState:xmp.ERRORS});};xmp.QuicktimeStateMachine.prototype.initStateChangeHandlers=function(){this.stateHandlers={};this.stateHandlers[xmp.ERRORS]=this.onError;this.stateHandlers[xmp.CONNECTING]=this.onConnecting;this.stateHandlers[xmp.CONNECTED]=this.onConnected;this.stateHandlers[xmp.OPEN]=this.onOpen;this.stateHandlers[xmp.QUICKTIME_WAIT_BUFFERING]=this.onBuffering;this.stateHandlers[xmp.QUICKTIME_LOAD_BUFFERING]=this.onBuffering;this.stateHandlers[xmp.QUICKTIME_BUFFERING_COMPLETE]=this.onBuffering;this.stateHandlers[xmp.BUFFERING]=this.onBuffering;};xmp.QuicktimeStateMachine.prototype.onError=function(Tc,Uc){this.opened=false;var Vc="Unknown error.";if(true===this.isInitializing()){Vc="Error connecting to \""+this.url+"\".";}
this.setError(null,this.createConnectionError(Tc,"Connecting to media.",Vc));return false;};xmp.QuicktimeStateMachine.prototype.onConnected=function(Wc,Xc){this.player.startMonitor();this.setState(xmp.CONNECTED,true);return true;};xmp.QuicktimeStateMachine.prototype.onConnecting=function(Yc,Zc){this.player.startMonitor();this.setState(xmp.CONNECTING,true);return true;};xmp.QuicktimeStateMachine.prototype.onOpen=function($c,ad){this.opened=true;this.live=this.isLive(this.player.getNative().GetDuration());this.setVolume(this.volume);if(true===this.muted){this.setMute(true);}
this.setState(xmp.OPEN,true);this.player.setState(xmp.FIRST_FRAME_RENDERED);return true;};xmp.QuicktimeStateMachine.prototype.onBuffering=function(bd,cd){this.checkSetOpen();if(this.state!==xmp.QUICKTIME_WAIT_BUFFERING&&this.state!==xmp.QUICKTIME_LOAD_BUFFERING&&this.state!==xmp.QUICKTIME_BUFFERING_COMPLETE&&this.state!==xmp.BUFFERING){this.operations[cd]=this.operations[this.state];}
var dd=this.getRawBytesTotal();var ed=((cd===xmp.QUICKTIME_BUFFERING_COMPLETE)?dd:this.getRawBytesLoaded());var fd=((dd<=0)?0:Math.floor((ed/dd)*100));fd=((99===fd)?100:fd);if(false===this.bufferingComplete&&(false===this.isLive(this.getRawDuration())||cd===xmp.QUICKTIME_WAIT_BUFFERING||cd===xmp.QUICKTIME_LOAD_BUFFERING||cd===xmp.QUICKTIME_BUFFERING_COMPLETE)){this.setState(cd,true,{percent:fd,bytesDownloaded:ed,bytesTotal:dd});}
this.bufferingComplete=(100===fd);if(cd===xmp.QUICKTIME_LOAD_BUFFERING&&true===this.bufferingComplete){this.onOpen(bd,cd);}
return true;};xmp.QuicktimeStateMachine.prototype.isInitializing=function(){return(this.state===xmp.INIT||this.state===xmp.CONNECTING||this.state===xmp.CONNECTED||this.state===xmp.QUICKTIME_WAIT_BUFFERING||this.state===xmp.QUICKTIME_LOAD_BUFFERING);};xmp.QuicktimeStateMachine.prototype.isBuffering=function(){return(this.state===xmp.BUFFERING||this.state===xmp.QUICKTIME_WAIT_BUFFERING||this.state===xmp.QUICKTIME_LOAD_BUFFERING||this.state===xmp.QUICKTIME_BUFFERING_COMPLETE);};xmp.QuicktimeStateMachine.prototype.isLive=function(gd){return(xmp.QUICKTIME_INITIAL_LIVE_DURATION===gd||0===gd||-1===gd);};xmp.QuicktimeStateMachine.prototype.canGetPluginStatus=function(){return(false===this.bufferingComplete);};xmp.QuicktimeStateMachine.prototype.startStateChangeMonitor=function(){if(!this.stateChangeMonitorTimer){this.stateChangeMonitorTimer=this.player.createTimer({object:this,id:"stateChange",interval:this.stateChangePollingInterval,handler:this.onStateChange,context:null});this.stateChangeMonitorTimer.start();}};xmp.QuicktimeStateMachine.prototype.stopStateChangeMonitor=function(){if(this.stateChangeMonitorTimer){this.stateChangeMonitorTimer.stop();this.stateChangeMonitorTimer=null;}};xmp.QuicktimeStateMachine.prototype.startConnectionTimeoutMonitor=function(){if(!this.connectionTimeoutTimer){this.connectionTimeoutTimer=this.player.createTimer({object:this,id:"connectionTimeout",interval:this.connectionTimeoutInterval,handler:this.onConnectionTimeout,context:null});this.connectionTimeoutTimer.start();}};xmp.QuicktimeStateMachine.prototype.stopConnectionTimeoutMonitor=function(){if(this.connectionTimeoutTimer){this.connectionTimeoutTimer.stop();this.connectionTimeoutTimer=null;}};xmp.QuicktimeStateMachine.prototype.initErrorCodes=function(){this.errorCodeDesc={};this.errorCodeDesc[100]="(Continue)";this.errorCodeDesc[101]="(Switching Protocols)";this.errorCodeDesc[200]="(OK)";this.errorCodeDesc[201]="(Created)";this.errorCodeDesc[202]="(Accepted)";this.errorCodeDesc[204]="(No Content)";this.errorCodeDesc[205]="(Reset Content)";this.errorCodeDesc[206]="(Partial Content)";this.errorCodeDesc[300]="(Multiple Choices)";this.errorCodeDesc[301]="(Moved Permanently)";this.errorCodeDesc[302]="(Found)";this.errorCodeDesc[303]="(See Other)";this.errorCodeDesc[304]="(Not Modified)";this.errorCodeDesc[305]="(Use Proxy)";this.errorCodeDesc[306]="(No Longer Used)";this.errorCodeDesc[307]="(Temporary Redirect)";this.errorCodeDesc[400]="(Bad Request)";this.errorCodeDesc[401]="(Not Authorised)";this.errorCodeDesc[402]="(Payment Required)";this.errorCodeDesc[403]="(Forbidden)";this.errorCodeDesc[404]="(Not Found)";this.errorCodeDesc[405]="(Method Not Allowed)";this.errorCodeDesc[406]="(Not Acceptable)";this.errorCodeDesc[407]="(Proxy Authentication Required)";this.errorCodeDesc[408]="(Request Timeout)";this.errorCodeDesc[409]="(Conflict)";this.errorCodeDesc[410]="(Gone)";this.errorCodeDesc[411]="(Length Required)";this.errorCodeDesc[412]="(Precondition Failed)";this.errorCodeDesc[413]="(Request Entity Too Large)";this.errorCodeDesc[414]="(Request URI Too Long)";this.errorCodeDesc[415]="(Unsupported Media Type)";this.errorCodeDesc[416]="(Requested Range Not Satisfiable)";this.errorCodeDesc[417]="(Expectation Failed)";this.errorCodeDesc[451]="(Parameter Not Understood)";this.errorCodeDesc[452]="(Conference Not Found)";this.errorCodeDesc[453]="(Not Enough Bandwidth)";this.errorCodeDesc[454]="(Session Not Founds)";this.errorCodeDesc[455]="(Method Not Valid In This State)";this.errorCodeDesc[456]="(Header Field Not Valid For Resource)";this.errorCodeDesc[457]="(Invalid Range)";this.errorCodeDesc[458]="(Parameter Is Read Only)";this.errorCodeDesc[459]="(Aggregate Operation Not Allowed)";this.errorCodeDesc[460]="(Only Aggregate Operation Allowed)";this.errorCodeDesc[461]="(Unsupported Transport)";this.errorCodeDesc[462]="(Destination Unreachable)";this.errorCodeDesc[500]="(Internal Server Error)";this.errorCodeDesc[501]="(Not Implemented)";this.errorCodeDesc[502]="(Bad Gateway)";this.errorCodeDesc[503]="(Service Unavailable)";this.errorCodeDesc[504]="(Gateway Timeout)";this.errorCodeDesc[505]="(HTTP Version Not Supported)";};xmp.QuicktimeStateMachine.prototype.getErrorCodeDesc=function(hd){var jd=((this.errorCodeDesc[hd])?this.errorCodeDesc[hd]:"(Unknown)");return hd+" "+jd;};xmp.QuicktimeStateMachine.prototype.getErrorCodes=function(kd){var ld=[];var md=kd.substring(kd.indexOf(":")+1);if(md.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER)===-1){ld.push(this.getErrorCodeDesc(parseInt(md,10)));}
else{while(md.length>0){var nd=md.indexOf(xmp.QUICKTIME_ERROR_CODE_DELIMITER);if(nd===-1){ld.push(this.getErrorCodeDesc(parseInt(md,10)));break;}
else{ld.push(this.getErrorCodeDesc(parseInt(md.substring(0,nd),10)));md=md.substring(nd+1);}}}
return ld;};xmp.QuicktimeStateMachine.prototype.initState=function(){this.opened=false;this.bufferingComplete=false;this.setState(xmp.INIT,false);this.startStateChangeMonitor();this.startConnectionTimeoutMonitor();};xmp.QuicktimeStateMachine.prototype.checkSetOpen=function(){if(false===this.opened&&this.getPosition()>0){this.onOpen("",xmp.OPEN);}};xmp.QuicktimeStateMachine.prototype.createConnectionError=function(od,pd,qd){var rd=[];if(od&&od.indexOf(xmp.QUICKTIME_ERROR)===0){rd.push({label:"QuickTime Error Codes",text:this.getErrorCodes(od).join(", ")});}
return new xmp.NativePlayerConnectionError(pd,qd,this.player,rd);};xmp.QuicktimeStateMachine.prototype.getRawDuration=function(){try{return this.player.getNative().GetDuration();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawMaxTimeLoaded=function(){try{return this.player.getNative().GetMaxTimeLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawBytesLoaded=function(){try{return this.player.getNative().GetMaxBytesLoaded();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawBytesTotal=function(){try{return this.player.getNative().GetMovieSize();}
catch(e){}
return 0;};xmp.QuicktimeStateMachine.prototype.getRawPluginStatus=function(){try{return this.player.getNative().GetPluginStatus();}
catch(e){}
return null;};xmp.QuicktimeStateMachine.prototype.checkForStaticUrl=function(){if(this.staticUrl){this.staticUrl=null;return true;}
return false;};xmp.QuicktimeStateMachine.prototype.setError=function(sd,e){this.setState(xmp.ERRORS,false);this.player.setError(sd,e);};xmp.QuicktimeStateMachine.prototype.validateUrl=function(){try{var td=this.player.getNative().GetURL();if(!td){return false;}
return(td.length>0&&(td===this.url));}
catch(e){}
return false;};xmp.WINDOWS_MEDIA="WindowsMedia";xmp.WINDOWS_MEDIA_MIME_TYPE="video/x-ms-wmv";xmp.OPEN_STATE_CHANGE="OpenState";xmp.PLAY_STATE_CHANGE="PlayState";xmp.WINDOWS_MEDIA_ENDED=8;xmp.WINDOWS_MEDIA_PLAYING=3;xmp.WINDOWS_MEDIA_STOPPED=1;xmp.WINDOWS_MEDIA_CONNECTING=10;xmp.WINDOWS_MEDIA_LOADING=11;xmp.WINDOWS_MEDIA_OPEN=13;xmp.WINDOWS_MEDIA_ACTIVEX_PROGID="WMPlayer.OCX.7";xmp.WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD="onPlayStateChange";xmp.WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD="onOpenStateChange";xmp.WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD="onBuffering";xmp.WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD="onTrigger";xmp.WINDOWS_MEDIA_PLAYER_ERROR_METHOD="onError";xmp.WindowsMediaPlayer=function(ud,vd){xmp.WindowsMediaPlayer.ctor.call(this,xmp.WINDOWS_MEDIA,ud,vd);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlayer);xmp.WindowsMediaPlayer.prototype.open=function(wd){this.getNative().URL=wd.getURI();};xmp.WindowsMediaPlayer.prototype.close=function(){this.getNative().close();xmp.WindowsMediaPlayer.base.close.call(this);};xmp.WindowsMediaPlayer.prototype.play=function(){this.getNative().controls.play();xmp.WindowsMediaPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.WindowsMediaPlayer.prototype.pause=function(){this.getNative().controls.pause();xmp.WindowsMediaPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.WindowsMediaPlayer.prototype.stop=function(){this.getNative().controls.stop();xmp.WindowsMediaPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.WindowsMediaPlayer.prototype.rewind=function(){this.getNative().controls.fastReverse();xmp.WindowsMediaPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.WindowsMediaPlayer.prototype.fastForward=function(){this.getNative().controls.fastForward();xmp.WindowsMediaPlayer.base.fastForward.call(this);this.setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlayer.prototype.seek=function(xd){this.getNative().controls.currentPosition=xd;xmp.WindowsMediaPlayer.base.seek.call(this,xd);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlayer.prototype.isAvailable=function(yd){if(yd===xmp.FULLSCREEN){return(true===this.isFullscreenEnabled()&&this.getNative().playState===xmp.WINDOWS_MEDIA_PLAYING);}
return this.getNative().controls.isAvailable(xmp.WindowsMediaUtility.getCommand([yd]));};xmp.WindowsMediaPlayer.prototype.onValidatePlugIn=function(zd){var Ad=this.getPlugInInfo(xmp.WINDOWS_MEDIA);try{var Bd=new ActiveXObject(xmp.WINDOWS_MEDIA_ACTIVEX_PROGID);this.validatePlugInVersion(xmp.WINDOWS_MEDIA,Bd.versionInfo);return;}
catch(e){if((e instanceof xmp.InvalidPlugInVersionError)||(e instanceof xmp.UnsupportedPlugInVersionError)){throw e;}}
throw new xmp.PlugInNotFoundError("Validating native player plugin.",Ad);};xmp.WindowsMediaPlayer.prototype.getPosition=function(){return this.getNative().controls.currentPosition;};xmp.WindowsMediaPlayer.prototype.getDuration=function(){var Cd=this.getNative().currentMedia;if(Cd===null){return 0;}
return Cd.duration;};xmp.WindowsMediaPlayer.prototype.getVolume=function(){return this.getNative().settings.volume;};xmp.WindowsMediaPlayer.prototype.setVolume=function(Dd){this.getNative().settings.volume=Dd;};xmp.WindowsMediaPlayer.prototype.getMute=function(){return this.getNative().settings.mute;};xmp.WindowsMediaPlayer.prototype.setMute=function(Ed){this.getNative().settings.mute=Ed;};xmp.WindowsMediaPlayer.prototype.getFullscreen=function(){return this.getNative().fullScreen;};xmp.WindowsMediaPlayer.prototype.setFullscreen=function(Fd){if(false===this.isFullscreenEnabled()){throw new xmp.NativePlayerUnsupportedError("Invoking \"setFullscreen\" method.","Fullscreen disabled.",this);}
this.getNative().fullScreen=Fd;};xmp.WindowsMediaPlayer.prototype.create=function(Gd){Gd.id=xmp.WINDOWS_MEDIA+Gd.group;xmp.WindowsMediaPlayer.base.create.call(this,Gd);if(Gd.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+Gd.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var Hd=Gd.viewport.getNative();Hd.innerHTML="<object id='"+Gd.id+"' width='"+Hd.style.width+"' height='"+Hd.style.height+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'>"+"<param name='uiMode' value='none' />"+"<param name='stretchToFit' value='"+((true===Gd.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' />"+"<param name='enableContextMenu' value='false' />"+"<param name='windowlessVideo' value='"+((true===this.isFullscreenEnabled())?xmp.FALSE:xmp.TRUE)+"' />"+"<param name='volume' value='"+Gd.volume+"'/>"+"<param name='mute' value='"+((true===Gd.mute)?xmp.TRUE:xmp.FALSE)+"'/></object>"+"<script language = 'jscript' for='"+Gd.id+"' event=playstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_PLAY_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=openstatechange(newstate)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_OPEN_STATE_CHANGE_METHOD)+"(newstate);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=buffering(start)>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_BUFFERING_METHOD)+"(start);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event='scriptcommand(name, data)'>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_TRIGGER_METHOD)+"(name, data);</script>"+"<script language = 'jscript' for='"+Gd.id+"' event=error()>"+this.getCallbackMethod(xmp.WINDOWS_MEDIA_PLAYER_ERROR_METHOD)+"();</script>";this.setCreated();};xmp.WindowsMediaPlayer.prototype.initCallbackStates=function(){this.callbackStates={};this.callbackStates[xmp.PLAY_STATE_CHANGE]=[{state:xmp.WINDOWS_MEDIA_PLAYING,player_state:xmp.PLAY},{state:xmp.WINDOWS_MEDIA_ENDED,player_state:xmp.ENDED}];this.callbackStates[xmp.OPEN_STATE_CHANGE]=[{state:xmp.WINDOWS_MEDIA_CONNECTING,player_state:xmp.CONNECTING},{state:xmp.WINDOWS_MEDIA_LOADING,player_state:xmp.CONNECTED},{state:xmp.WINDOWS_MEDIA_OPEN,player_state:xmp.OPEN}];};xmp.WindowsMediaPlayer.prototype.translateState=function(Id,Jd){var Kd=this.callbackStates[Id];for(var i=0;i<Kd.length;i++){if(Jd===Kd[i].state){return Kd[i].player_state;}}
return"";};xmp.WindowsMediaPlayer.prototype.onPlayStateChange=function(Ld){try{if(Ld===xmp.WINDOWS_MEDIA_STOPPED){this.getLogger().warn("Play state changed to \"Stopped\".");}
var Md=this.translateState(xmp.PLAY_STATE_CHANGE,Ld);if(Md.length>0){this.setState(Md);}}
catch(e){this.setError("Handling play state change.",e);}};xmp.WindowsMediaPlayer.prototype.onOpenStateChange=function(Nd){try{var Od=this.translateState(xmp.OPEN_STATE_CHANGE,Nd);if(Od.length>0){this.setState(Od);}}
catch(e){this.setError("Handling open state change.",e);}};xmp.WindowsMediaPlayer.prototype.onBuffering=function(Pd){try{var Qd=((true===Pd)?this.getNative().network.bufferingProgress:100);this.setState(xmp.BUFFERING,{percent:Qd,bytesDownloaded:0,bytesTotal:0});if(100===Qd){this.setState(xmp.FIRST_FRAME_RENDERED);}}
catch(e){this.setError("Handling buffering.",e);}};xmp.WindowsMediaPlayer.prototype.onTrigger=function(Rd,Sd){try{this.setTrigger(Rd,Sd);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlayer.prototype.onError=function(){try{var Td=null;var Ud=this.getNative().Error.item(0).errorCode;var Vd=this.getNative().Error.item(0).errorDescription;var Wd=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(Ud)}];if(true===xmp.WindowsMediaUtility.isConnectionError(Ud)){Td=new xmp.NativePlayerConnectionError("Connecting to media.",Vd,this,Wd);}
else{Td=new xmp.NativePlayerError("Handling error.",Vd,this,Wd);}
this.setError(null,Td);}
catch(e){this.setError("Handling error.",e);}};xmp.WINDOWS_MEDIA_PLUGIN="WindowsMediaPlugIn";xmp.WINDOWS_MEDIA_PLUGIN_CONNECTING="1";xmp.WINDOWS_MEDIA_PLUGIN_CONNECTED="2";xmp.WINDOWS_MEDIA_PLUGIN_OPEN="3";xmp.WINDOWS_MEDIA_PLUGIN_ENDED="4";xmp.WINDOWS_MEDIA_PLUGIN_BUFFERING="5";xmp.WINDOWS_MEDIA_PLUGIN_PLAYING="6";xmp.WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD="onStateChange";xmp.WINDOW_MEDIA_PLUGIN_ERROR_METHOD="onError";xmp.WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD="onTrigger";xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE="video/x-turner-wmv";xmp.TURNER_MEDIA_PLUGIN_NAME="Turner Media Plugin";xmp.TURNER_MEDIA_PLUGIN="TurnerMedia";xmp.WindowsMediaPlugInPlayer=function(Xd,Yd){xmp.WindowsMediaPlugInPlayer.ctor.call(this,xmp.WINDOWS_MEDIA_PLUGIN,Xd,Yd);this.initCallbackStates();};xmp.DERIVE_CLASS(xmp.AbstractNativePlayer,xmp.WindowsMediaPlugInPlayer);xmp.WindowsMediaPlugInPlayer.prototype.open=function(Zd){this.setState(xmp.CONNECTING);this.getNative().url=Zd.getURI();};xmp.WindowsMediaPlugInPlayer.prototype.close=function(){this.getNative().close();xmp.WindowsMediaPlugInPlayer.base.close.call(this);};xmp.WindowsMediaPlugInPlayer.prototype.play=function(){this.getNative().play();xmp.WindowsMediaPlugInPlayer.base.play.call(this);this.setState(xmp.PLAY);};xmp.WindowsMediaPlugInPlayer.prototype.pause=function(){this.getNative().pause();xmp.WindowsMediaPlugInPlayer.base.pause.call(this);this.setState(xmp.PAUSE);};xmp.WindowsMediaPlugInPlayer.prototype.stop=function(){this.getNative().stop();xmp.WindowsMediaPlugInPlayer.base.stop.call(this);this.setState(xmp.STOP);};xmp.WindowsMediaPlugInPlayer.prototype.rewind=function(){this.getNative().rewind();xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.REWIND);};xmp.WindowsMediaPlugInPlayer.prototype.fastForward=function(){this.getNative().fastForward();xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.FAST_FORWARD);};xmp.WindowsMediaPlugInPlayer.prototype.seek=function($d){this.getNative().seek($d);xmp.WindowsMediaPlugInPlayer.base.rewind.call(this);this.setState(xmp.SEEKABLE);};xmp.WindowsMediaPlugInPlayer.prototype.isAvailable=function(ae){return this.getNative().isAvailable(xmp.WindowsMediaUtility.getCommand([ae]));};xmp.WindowsMediaPlugInPlayer.prototype.onValidatePlugIn=function(be){var ce=this.getPlugInInfo(xmp.TURNER_MEDIA_PLUGIN);var de=navigator.mimeTypes[xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE];if(!de){throw new xmp.PlugInNotFoundError("Validating native player plugin.",ce);}
if(!de.enabledPlugin){throw new xmp.PlugInDisabledError("Validating native player plugin.",ce,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var ee=de.enabledPlugin.name;if(ee.indexOf(xmp.TURNER_MEDIA_PLUGIN_NAME)===-1){throw new xmp.PlugInDisabledError("Validating native player plugin.",ce,xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE);}
var fe=this.getVersionFromString(xmp.MOZILLA_VERSION_DETECTION_JSON,ee);this.validatePlugInVersion(xmp.TURNER_MEDIA_PLUGIN,fe);};xmp.WindowsMediaPlugInPlayer.prototype.getPosition=function(){return this.getNative().position;};xmp.WindowsMediaPlugInPlayer.prototype.getDuration=function(){return this.getNative().duration;};xmp.WindowsMediaPlugInPlayer.prototype.getVolume=function(){return this.getNative().volume;};xmp.WindowsMediaPlugInPlayer.prototype.setVolume=function(ge){this.getNative().volume=Math.floor(ge);};xmp.WindowsMediaPlugInPlayer.prototype.getMute=function(){return this.getNative().mute;};xmp.WindowsMediaPlugInPlayer.prototype.setMute=function(he){this.getNative().mute=he;};xmp.WindowsMediaPlugInPlayer.prototype.getFullscreen=function(){return this.getNative().fullscreen;};xmp.WindowsMediaPlugInPlayer.prototype.setFullscreen=function(ie){this.getNative().fullscreen=ie;};xmp.WindowsMediaPlugInPlayer.prototype.create=function(je){je.id=xmp.WINDOWS_MEDIA_PLUGIN+je.group;xmp.WindowsMediaPlugInPlayer.base.create.call(this,je);if(je.viewport.getType()!==xmp.DHTML_VIEWPORT){throw new xmp.InvalidNativePlayerViewportError("Creating native player.","Invalid native player viewport \""+je.viewport.getType()+"\".  Supported viewports:  DHTML",this);}
var ke=je.viewport.getNative();ke.innerHTML="<embed id='"+je.id+"' type='"+xmp.WINDOWS_MEDIA_PLUGIN_MIME_TYPE+"' statechangecallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_STATE_CHANGE_METHOD)+"' errorcallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_ERROR_METHOD)+"' triggercallback='"+this.createCallbackMethod(xmp.WINDOW_MEDIA_PLUGIN_TRIGGER_METHOD)+"' "+"fullscreenenabled='"+((true===this.isFullscreenEnabled())?xmp.TRUE:xmp.FALSE)+"' uimode='none' stretchtofit='"+((true===je.stretchToFit)?xmp.TRUE:xmp.FALSE)+"' windowlessvideo='true'"+"' volume='"+je.volume+"' mute='"+((true===je.mute)?xmp.TRUE:xmp.FALSE)+"' enablecontextmenu='false' width='"+ke.style.width+"' height='"+ke.style.height+"' style='background-color:  #000000; z-index: "+xmp.NATIVE_PLAYER_Z_INDEX+"' />";this.setCreated();};xmp.WindowsMediaPlugInPlayer.prototype.initCallbackStates=function(){this.callbackStates={};this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_CONNECTING]=xmp.CONNECTING;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_CONNECTED]=xmp.CONNECTED;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_OPEN]=xmp.OPEN;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_ENDED]=xmp.ENDED;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_BUFFERING]=xmp.BUFFERING;this.callbackStates[xmp.WINDOWS_MEDIA_PLUGIN_PLAYING]=xmp.PLAY;};xmp.WindowsMediaPlugInPlayer.prototype.translateState=function(le){var me=this.callbackStates[le];return((me)?me:"");};xmp.WindowsMediaPlugInPlayer.prototype.onStateChange=function(ne,oe){try{var pe=this.translateState(ne);if(pe.length>0){var qe=((pe===xmp.BUFFERING)?{percent:parseInt(oe,10),bytesDownloaded:0,bytesTotal:0}:null);this.setState(pe,qe);if(pe===xmp.BUFFERING&&100===qe.percent){this.setState(xmp.FIRST_FRAME_RENDERED);}}}
catch(e){this.setError("Handling state change.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onError=function(re,se){try{var te=null;var ue=parseInt(se,10);var ve=[{label:"Windows Media Error Code",text:xmp.WindowsMediaUtility.getErrorCodeDesc(ue)}];if(true===xmp.WindowsMediaUtility.isConnectionError(ue)){te=new xmp.NativePlayerConnectionError("Connecting to media.",re,this,ve);}
else{te=new xmp.NativePlayerError("Handling error.",re,this,ve);}
this.setError(null,te);}
catch(e){this.setError("Handling error.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.onTrigger=function(we,xe){try{this.setTrigger(we,xe);}
catch(e){this.setError("Handling trigger.",e);}};xmp.WindowsMediaPlugInPlayer.prototype.createCallbackMethod=function(ye){return xmp.escapeHtml(this.getCallbackMethod(ye),false,false);};xmp.WindowsMediaUtility=function(){xmp.WINDOWS_MEDIA_PLAY="play";xmp.WINDOWS_MEDIA_PAUSE="pause";xmp.WINDOWS_MEDIA_STOP="stop";xmp.WINDOWS_MEDIA_REWIND="fastReverse";xmp.WINDOWS_MEDIA_FAST_FORWARD="fastForward";xmp.WINDOWS_MEDIA_SEEK="currentPosition";return{getCommand:function(ze){if(!this.commands){this.commands={};this.commands[xmp.PLAY]=xmp.WINDOWS_MEDIA_PLAY;this.commands[xmp.PAUSE]=xmp.WINDOWS_MEDIA_PAUSE;this.commands[xmp.STOP]=xmp.WINDOWS_MEDIA_STOP;this.commands[xmp.REWIND]=xmp.WINDOWS_MEDIA_REWIND;this.commands[xmp.FAST_FORWARD]=xmp.WINDOWS_MEDIA_FAST_FORWARD;this.commands[xmp.SEEKABLE]=xmp.WINDOWS_MEDIA_SEEK;this.commands[xmp.FULLSCREEN]=xmp.FULLSCREEN.toLowerCase();}
return this.commands[ze];},getErrorCodeDesc:function(Ae){this.initConnectionErrorCodes();return((this.connectionErrorCodes[Ae])?this.connectionErrorCodes[Ae]:Ae);},isConnectionError:function(Be){this.initConnectionErrorCodes();return((this.connectionErrorCodes[Be])?true:false);},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)";}}};}();

xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PatternDirective=function(aa,ba,ca){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"PatternDirective.ctor");if(!xmp.isNonEmptyString(aa)){throw new xmp.util.internals.InvalidArgsError("Argument 'type' must be a non-empty string.");}
this._type=aa;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(ba);this._parameters=ca;};xmp.playlistapi.internals.PatternDirective.prototype.getType=function(){return this._type;};xmp.playlistapi.internals.PatternDirective.prototype.getParameterArray=function(){return this._parameters;};xmp.playlistapi.internals.PatternDirective.prototype.getMetadata=function(da,ea){return this._metadataMap._get(da,ea);};xmp.playlistapi.internals.PatternDirective.prototype._findNamedContentNode=function(fa,ga,ha){var ia=this._findNamedContentNodeFromIterator(fa._getDataIterator(),ga,ha);if(ia===null){xmp.util.internals.CategoryLogger.create('PatternDirective').info('Did not find named content node: '+ha+', trying historical data.');ia=this._findNamedContentNodeFromIterator(fa._getHistoricalDataIterator(),ga,ha);}
return ia;};xmp.playlistapi.internals.PatternDirective.prototype._findNamedContentNodeFromIterator=function(ja,ka,la){ja.first();var ma=(la==='@Content');while(ja.hasNext()){var na=ja.next();if(!na.isValid()){continue;}
if(na.isContentType()&&na.getNodeType()._getParent()._isContentCompositeType()){if(ma){if(na._getPatternAddress().isSibling(ka._getPatternAddress(),true)){return na;}}
else{if(na.getNodeType()._getParent().getId()===la){var oa=na._getPatternAddress().getParent();if(oa.isSibling(ka._getPatternAddress(),true)){return na;}}}}}
return null;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.AdPatternPlayList=function(pa,qa,ra,sa){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"AdPatternPlayList.ctor");if(!pa||!qa||!ra){throw new xmp.util.internals.InvalidArgsError("One or more constructor arguments is null.");}
this._LOOK_AHEAD_AND_BEHIND_MIN=7;this._LOOK_AHEAD_AND_BEHIND_MAX=100;this._MAX_NODE_POOL_SIZE=50;this._logger=new xmp.util.internals.CategoryLogger('AdPatternPlayList');this._lockedForModification=false;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._listener=pa;this._adPatternRootNodeType=null;this._invariantRuleContextArray=null;this._ruleIdToFactoryMap={};this._ruleIdToRuleMap={};this._ruleSetRunContext=new xmp.playlistapi.RuleSetRunContext();this._lookAheadAndBehindCount=this._calculateLookAheadAndBehind();this._internalPlayListArray=[];this._historicalPlayListArray=[];this._lastNode=null;this._outStandingPlayableNodeArray=[];this._poolPlayableNodeArray=[];this._iteratator=new xmp.playlistapi.PlayListIterator(this);this._parameterMap=null;xmp.util.PlayableNode._staticInit();this._parameterMap=xmp.playlistapi.internals.ParameterMap.calcInitial(qa,sa);var ta=new xmp.playlistapi.internals.AdPatternBuilder(this._parameterMap);this._metadataMap._reInitialize(ta._extractOptionalMetaData(qa));this._adPatternRootNodeType=ta._build(qa);this._invariantRuleContextArray=ta._buildRuleContextArray(ra,null);this._logger.info('Constructed AdPatternPlayList');};xmp.playlistapi.AdPatternPlayList.prototype.getMetadata=function(ua,va){return this._metadataMap._get(ua,va);};xmp.playlistapi.AdPatternPlayList.prototype.setContentMetaResourceIds=function(wa){try{for(var i=0;i<wa.length;i++){if(typeof wa[i]!=='string'){throw new xmp.util.internals.InvalidArgsError("Argument 'contentMetaResourceIdArray' must be an array of strings.");}}
this._checkLockedForModification();this._lockForModification();var xa=new xmp.playlistapi.internals.PlayListBuilder(this,this._lastNode,this._adPatternRootNodeType,wa,this._listener);this._internalPlayListArray=xa._getOutput();}
finally{this._unlockForModification();}};xmp.playlistapi.AdPatternPlayList.prototype._getHistoricalDataIterator=function(){var ya=[];ya=ya.concat(this._historicalPlayListArray);ya=ya.concat(this._internalPlayListArray);return(new xmp.playlistapi.internals.SimplePlayListIterator(ya));};xmp.playlistapi.AdPatternPlayList.prototype.getIterator=function(){return this._iteratator;};xmp.playlistapi.AdPatternPlayList.prototype.getRuleIdArray=function(){var za=[];var Aa={};for(var i=0;i<this._invariantRuleContextArray.length;i++){var Ba=this._invariantRuleContextArray[i].getId();if(!Aa[Ba]){Aa[Ba]=Ba;za.push(Ba);}}
this._getPatternRuleIdsHelper(this._adPatternRootNodeType,za,Aa);return za;};xmp.playlistapi.AdPatternPlayList.prototype.loadRuleFactoryArray=function(Ca){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"AdPatternPlayList.loadRuleFactoryArray");if(!Ca){throw new xmp.util.internals.InvalidArgsError("Argument 'ruleFactoryArray' cannot be null.");}
this._buildRuleIdToFactoryMap(Ca);if(this._logger.isDebugEnabled()){this._logger.debug('Loaded rule factories.');}};xmp.playlistapi.AdPatternPlayList.prototype.getLookAheadNodeArray=function(){return this._buildLookAheadArray();};xmp.playlistapi.AdPatternPlayList.prototype.getLookBehindNodeArray=function(){return this._buildLookBehindArray();};xmp.playlistapi.AdPatternPlayList.prototype._getParameterMapInternal=function(){return this._parameterMap;};xmp.playlistapi.AdPatternPlayList.prototype._findRule=function(Da){var Ea=this._ruleIdToRuleMap[Da];if(typeof Ea==="undefined"){var Fa=this._getFactory(Da);try{Ea=Fa.createRule(Da);}
catch(e){throw this._createExtensionGuardException(e,'RuleFactory.createRule');}
this._ruleIdToRuleMap[Da]=Ea;}
return Ea;};xmp.playlistapi.AdPatternPlayList.prototype._buildRuleIdToFactoryMap=function(Ga){for(var i=0;i<Ga.length;i++){var Ha=Ga[i];var Ia=null;try{Ia=Ha.getCreatableRuleIds();}
catch(e){throw this._createExtensionGuardException(e,'RuleFactory.getCreatableRuleIds');}
for(var j=0;j<Ia.length;j++){var Ja=Ia[j];if(!Ja||Ja.length===0){throw new xmp.playlistapi.internals.PlayListError("RuleFactory retured a rule ID that is null, undefined, or empty.");}
if(typeof this._ruleIdToFactoryMap[Ja]!=="undefined"){throw new xmp.playlistapi.internals.PlayListError("Rule "+Ja+" found in more than one factory.");}
this._ruleIdToFactoryMap[Ja]=Ha;}}
this._verifyRuleFactories();};xmp.playlistapi.AdPatternPlayList.prototype.addRuleFactory=function(Ka,La){this._ruleIdToFactoryMap[Ka]=La;};xmp.playlistapi.AdPatternPlayList.prototype._createExtensionGuardException=function(e,Ma){var Na='Error occurred while invoking extension method: '+Ma;this._logger.warn(Na,e);Na+=', Error data: ';Na+=xmp.extractErrorMessage(e);return new xmp.playlistapi.internals.PlayListError(Na);};xmp.playlistapi.AdPatternPlayList.prototype._calculateLookAheadAndBehind=function(){var Oa=xmp.util.SettingsManager.getInstance().getContextNode();var Pa=Oa.getNodeForPath('BasePlayer');var Qa=Pa.getInt('look ahead and behind count',this._LOOK_AHEAD_AND_BEHIND_MIN);if(Qa<this._LOOK_AHEAD_AND_BEHIND_MIN){Qa=this._LOOK_AHEAD_AND_BEHIND_MIN;}
else if(Qa>this._LOOK_AHEAD_AND_BEHIND_MAX){Qa=this._LOOK_AHEAD_AND_BEHIND_MAX;}
return Qa;};xmp.playlistapi.AdPatternPlayList.prototype._verifyRuleFactories=function(){this._verifyInvariantRuleFactories();this._verifyPlayableNodeTypeRuleFactoriesHelper(this._adPatternRootNodeType);};xmp.playlistapi.AdPatternPlayList.prototype._verifyInvariantRuleFactories=function(){for(var i=0;i<this._invariantRuleContextArray.length;i++){var Ra=this._invariantRuleContextArray[i].getId();this._getFactory(Ra);}};xmp.playlistapi.AdPatternPlayList.prototype._verifyPlayableNodeTypeRuleFactoriesHelper=function(Sa){if(Sa._isCompositeType()){var Ta=Sa._getChildCount();for(var i=0;i<Ta;i++){this._verifyPlayableNodeTypeRuleFactoriesHelper(Sa._getChild(i));}}
else{var Ua=Sa._getRuleContextArray();for(var j=0;j<Ua.length;j++){var Va=Ua[j].getId();this._getFactory(Va);}}};xmp.playlistapi.AdPatternPlayList.prototype._getFactory=function(Wa){var Xa=this._ruleIdToFactoryMap[Wa];if(!Xa){throw new xmp.playlistapi.internals.PlayListError("No factory defined for rule: "+Wa);}
return Xa;};xmp.playlistapi.AdPatternPlayList.prototype._getNextRuleFilteredPlayableNode=function(){var Ya=null;while(this._internalPlayListArray.length>0){var Za=this._internalPlayListArray.shift();this._historicalPlayListArray.push(Za);if(this._safeRunRulesForNode(Za)){this._addToOutstandingArray(Za);Ya=Za;break;}
else{this._returnNodeToPool(Za);}}
if(Ya!==null){this._lastNode=Ya;}
return Ya;};xmp.playlistapi.AdPatternPlayList.prototype._safeRunRulesForNode=function($a){try{return this._runRulesForNode($a);}
catch(e){var ab='Error occured running rules for node: '+xmp.util.PlayableNode.safeGetBestId($a);ab+='\nNode will be treated AS IF A RULE FAILED, skipped.';this._logger.warn(ab,e);return false;}};xmp.playlistapi.AdPatternPlayList.prototype._runRulesForNode=function(bb){if(bb._isEmptySlot()){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' IS AN EMPTY SLOT, FAILURE.');}
return false;}
var cb=this._buildRuleContextsForNode(bb);if(cb.length===0){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' HAS NO RULES, SUCCESS.');}
return true;}
this._ruleSetRunContext._initialize(bb);for(var i=0;i<cb.length;i++){var db=cb[i];this._ruleSetRunContext._setCurrentRuleContext(db);var eb=this._findRule(db.getId());var fb=false;try{fb=eb.isPlayable(this._ruleSetRunContext);}
catch(e){throw this._createExtensionGuardException(e,'Rule.isPlayable for rule: '+this._ruleSetRunContext.getCurrentRuleContext().getId());}
if(!fb){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+', Rule ID: '+db.getId()+' FAILED.');}
return false;}
else{if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+', Rule ID: '+db.getId()+' SUCCEEDED.');}}}
if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' ALL RULES SUCCEEDED.');}
return true;};xmp.playlistapi.AdPatternPlayList.prototype._buildLookAheadArray=function(){var gb=[];for(var i=0;i<this._lookAheadAndBehindCount;i++){if(i>=(this._internalPlayListArray.length)){break;}
gb.push(this._internalPlayListArray[i]);}
return gb;};xmp.playlistapi.AdPatternPlayList.prototype._buildLookBehindArray=function(){var hb=[];hb=hb.concat(this._outStandingPlayableNodeArray).reverse();return hb;};xmp.playlistapi.AdPatternPlayList.prototype._buildRuleContextsForNode=function(ib){var jb=this._getApplicableInvariantRuleContexts(ib.getNodeTypeName());jb=jb.concat(ib._getRuleArrayReference());return jb;};xmp.playlistapi.AdPatternPlayList.prototype._getApplicableInvariantRuleContexts=function(kb){var lb=[];for(var i=0;i<this._invariantRuleContextArray.length;i++){var mb=this._invariantRuleContextArray[i];if(mb.isApplicable(kb)){lb.push(mb);}}
return lb;};xmp.playlistapi.AdPatternPlayList.prototype._addToOutstandingArray=function(nb){this._outStandingPlayableNodeArray.push(nb);while(this._outStandingPlayableNodeArray.length>this._lookAheadAndBehindCount){this._returnNodeToPool(this._outStandingPlayableNodeArray.shift());}};xmp.playlistapi.AdPatternPlayList.prototype._getNodeFromPool=function(){var ob=new xmp.util.PlayableNode();ob._init();return ob;};xmp.playlistapi.AdPatternPlayList.prototype._returnNodeToPool=function(pb){this._poolPlayableNodeArray.push(pb);while(this._poolPlayableNodeArray.length>this._MAX_NODE_POOL_SIZE){var qb=this._poolPlayableNodeArray.shift();if(qb){qb._clear();}}};xmp.playlistapi.AdPatternPlayList.prototype._createNode=function(){return this._getNodeFromPool();};xmp.playlistapi.AdPatternPlayList.prototype._initializeNode=function(rb){try{this._listener.handleInitializePlayableNode(rb);}
catch(e){throw this._createExtensionGuardException(e,'PlayListListener.handleInitializePlayableNode');}};xmp.playlistapi.AdPatternPlayList.prototype._lockForModification=function(){this._lockedForModification=true;};xmp.playlistapi.AdPatternPlayList.prototype._unlockForModification=function(){this._lockedForModification=false;};xmp.playlistapi.AdPatternPlayList.prototype._checkLockedForModification=function(){if(this._lockedForModification){throw new xmp.playlistapi.internals.PlayListError("Cannot modify playlist while it is locked.");}};xmp.playlistapi.AdPatternPlayList.prototype._getPatternRuleIdsHelper=function(sb,tb,ub){if(sb._isCompositeType()){var vb=sb._getChildCount();for(var i=0;i<vb;i++){var wb=sb._getChild(i);this._getPatternRuleIdsHelper(wb,tb,ub);}}
else{var xb=sb._getRuleContextArray();for(var j=0;j<xb.length;j++){var yb=xb[j].getId();if(!ub[yb]){ub[yb]=yb;tb.push(yb);}}}};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.AdResourceOverrideContext=function(zb,Ab){this._node=zb;this._parameterMap=Ab;};xmp.playlistapi.AdResourceOverrideContext.prototype.getNode=function(){return this._node;};xmp.playlistapi.AdResourceOverrideContext.prototype.addResource=function(Bb){this._node.setMetaResource(Bb);};xmp.playlistapi.AdResourceOverrideContext.prototype.getResource=function(Cb){return this._node.getMetaResource(Cb);};xmp.playlistapi.AdResourceOverrideContext.prototype.copyMetaResourceBundleRefFrom=function(Db){this._node.reSetMetaResourceBundle(Db.getMetaResourceBundle());};xmp.playlistapi.AdResourceOverrideContext.prototype.copyMetaResourceBundleRefTo=function(Eb){Eb.reSetMetaResourceBundle(this._node.getMetaResourceBundle());};xmp.playlistapi.AdResourceOverrideContext.prototype.expandString=function(Fb){return this._parameterMap.expandString(Fb);};xmp.playlistapi.AdResourceOverrideContext.prototype.getNodeAssociatedResourceBundleType=function(){return this._node.getAssociatedResourceBundleType();};xmp.playlistapi.AdResourceOverrideContext.prototype.setNodeAssociatedResourceBundleType=function(Gb){this._node.setAssociatedResourceBundleType(Gb);};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.PlayListIterator=function(Hb){this._playList=Hb;this._currentNode=null;this._initialized=false;this._canAdvance=true;};xmp.playlistapi.PlayListIterator.prototype.first=function(){this._initialized=true;this._canAdvance=true;};xmp.playlistapi.PlayListIterator.prototype.next=function(){if(!this.hasNext()){throw new xmp.playlistapi.internals.PlayListError("Cannot call next if there are no more items to be returned, call 'hasNext' method to check.");}
this._canAdvance=true;return this._currentNode;};xmp.playlistapi.PlayListIterator.prototype.hasNext=function(){this._checkInitialized();if(this._canAdvance){this._currentNode=this._getNextCore();this._canAdvance=false;}
return(this._currentNode!==null);};xmp.playlistapi.PlayListIterator.prototype._getNextCore=function(){try{this._playList._checkLockedForModification();this._playList._lockForModification();return this._playList._getNextRuleFilteredPlayableNode();}
finally{this._playList._unlockForModification();}};xmp.playlistapi.PlayListIterator.prototype._checkInitialized=function(){if(!this._initialized){throw new xmp.playlistapi.internals.PlayListError("Iterator not initialized, call 'first' method.");}};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.PlayableNodeType=function(Ib,id,Jb){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"PlayableNodeType.ctor");if(!xmp.isNonEmptyString(id)||!xmp.isNonEmptyString(Jb)){throw new xmp.util.internals.InvalidArgsError("PlayableNodeType requires non-empty 'id' and 'typeName'.");}
this._typeName=Jb;this._parent=null;this._id=id;this._directive=null;this._dataObject=Ib;};xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName=function(Kb){if(!xmp.playlistapi.PlayableNodeType._typeMapNode){var Lb=xmp.util.SettingsManager.getInstance().getGlobalContextNode();xmp.playlistapi.PlayableNodeType._typeMapNode=Lb.getNodeForPath('nodeTypeMap');}
var Mb=xmp.playlistapi.PlayableNodeType._typeMapNode.getNodeForPath(Kb);var Nb=Mb.getString('baseType','DEFAULT');return Nb;};xmp.playlistapi.PlayableNodeType.prototype.getTypeName=function(){return this._typeName;};xmp.playlistapi.PlayableNodeType.prototype.getId=function(){return this._id;};xmp.playlistapi.PlayableNodeType.prototype.getDataObject=function(){return this._dataObject;};xmp.playlistapi.PlayableNodeType.prototype.getMetadata=function(Ob,Pb){return null;};xmp.playlistapi.PlayableNodeType.prototype._getChildCount=function(){return 0;};xmp.playlistapi.PlayableNodeType.prototype._getParent=function(){return this._parent;};xmp.playlistapi.PlayableNodeType.prototype._isCompositeType=function(){return false;};xmp.playlistapi.PlayableNodeType.prototype._isContentCompositeType=function(){return false;};xmp.playlistapi.PlayableNodeType.prototype.isContentType=function(){var Qb=xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName(this.getTypeName());return Qb==='Content';};xmp.playlistapi.PlayableNodeType.prototype.isAdType=function(){var Rb=xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName(this.getTypeName());return Rb==='Ad';};xmp.playlistapi.PlayableNodeType.prototype.isPromoType=function(){var Sb=xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName(this.getTypeName());return Sb==='Promo';};xmp.playlistapi.PlayableNodeType.prototype._setParent=function(Tb){this._parent=Tb;};xmp.playlistapi.PlayableNodeType.prototype._handlePostBuild=function(){};xmp.playlistapi.PlayableNodeType.prototype._setDirective=function(Ub){this._directive=Ub;};xmp.playlistapi.PlayableNodeType.prototype._getDirective=function(){return this._directive;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.ResouceBundle=function(){xmp.playlistapi.ResouceBundle.ctor.call(this);this._map={};};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.playlistapi.ResouceBundle);xmp.playlistapi.ResouceBundle.prototype.setMetaResource=function(Vb){if(this.getMetaResource(Vb.getType())!==null){throw new xmp.util.internals.InvalidArgsError('Node type already has a resource of type: '+Vb.getType());}
this._map[Vb.getType()]=Vb;};xmp.playlistapi.ResouceBundle.prototype.getMetaResource=function(Wb){var Xb=this._map[Wb];return(Xb)?Xb:null;};xmp.playlistapi.ResouceBundle.prototype.getResourceTypes=function(){return xmp.MapIterator.extractKeys(this._map);};xmp.playlistapi.ResouceBundle.prototype.getCount=function(){return(this.getResourceTypes().length);};xmp.playlistapi.ResouceBundle.prototype.clone=function(){var Yb=new xmp.playlistapi.ResouceBundle();for(var Zb=xmp.MapIterator.create(this._map);Zb.hasNext();Zb.next()){var $b=Zb.currentKey();var ac=this.getMetaResource($b);Yb.setMetaResource(ac._clone());}
return Yb;};xmp.playlistapi.ResouceBundle.prototype.getLoadableId=function(){return'ResouceBundle';};xmp.playlistapi.ResouceBundle.prototype.getErrorCount=function(){var bc=this.getResourceTypes();var cc=0;for(var i=0;i<bc.length;i++){var dc=bc[i];var ec=this.getMetaResource(dc);if(ec.isError()){cc++;}}
return cc;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.Resource=function(id,fc,gc,hc){xmp.playlistapi.Resource.ctor.call(this);if(!gc){gc={};}
if(!hc){hc='default';}
xmp.validateArguments([id,fc,gc,hc],[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.STRING_TYPE],"Resource.ctor");if(!(xmp.isNonEmptyString(id)&&xmp.isNonEmptyString(fc)&&xmp.isNonEmptyString(hc))){throw new xmp.util.internals.InvalidArgsError("Parameters 'id' and 'type' and 'dataType' must be non-empty strings.");}
this._id=id;this._type=fc;this._dataType=hc;this._metadataMap=new xmp.util.internals.MetadataMap(false);this._metadataMap._reInitialize(gc);this._companionAdId=-1;};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.playlistapi.Resource);xmp.playlistapi.Resource.prototype.getId=function(){return this._id;};xmp.playlistapi.Resource.prototype.setId=function(id){this._id=id;};xmp.playlistapi.Resource.prototype.getType=function(){return this._type;};xmp.playlistapi.Resource.prototype.getDataType=function(){return this._dataType;};xmp.playlistapi.Resource.prototype.setDataType=function(ic){this._dataType=ic;};xmp.playlistapi.Resource.prototype.getMetadata=function(jc,kc){return this._metadataMap._get(jc,kc);};xmp.playlistapi.Resource.prototype.setMetadata=function(lc,mc){this._metadataMap._set(lc,mc);};xmp.playlistapi.Resource.prototype.removeMetadata=function(nc){this._metadataMap._remove(nc);};xmp.playlistapi.Resource.prototype._clone=function(){return new xmp.playlistapi.Resource(this._id,this._type,this._metadataMap._getClonedWrappedMetadata(),this._dataType);};xmp.playlistapi.Resource.prototype.getLoadableId=function(){return this.getId();};xmp.playlistapi.Resource.prototype.getCompanionAdId=function(){return this._companionAdId;};xmp.playlistapi.Resource.prototype.setCompanionAdId=function(oc){this._companionAdId=oc;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.RuleContext=function(id,pc,qc,rc){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.BOOLEAN_TYPE],"RuleContext.ctor");if(id===null||id.length===0){throw new xmp.util.internals.InvalidArgsError("RuleContext requires non-empty ID.");}
if(qc.length<1){throw new xmp.util.internals.InvalidArgsError("RuleContext at least one applicable type.");}
this._id=id;this._metadataMap=new xmp.util.internals.MetadataMap(rc);this._metadataMap._reInitialize(pc);this._applicableTypeArray=qc;};xmp.playlistapi.RuleContext.createDynamic=function(id,sc){return new xmp.playlistapi.RuleContext(id,sc,['dynamic'],true);};xmp.playlistapi.RuleContext.prototype.getId=function(){return this._id;};xmp.playlistapi.RuleContext.prototype.getMetadata=function(tc,uc){return this._metadataMap._get(tc,uc);};xmp.playlistapi.RuleContext.prototype.isApplicable=function(vc){if(vc.toLowerCase()==='all'){return true;}
for(var i=0;i<this._applicableTypeArray.length;i++){if(this._applicableTypeArray[i]===vc){return true;}}
return false;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.RuleSetRunContext=function(){this._playableNode=null;this._currentRuleContext=null;};xmp.playlistapi.RuleSetRunContext.prototype.getPlayableNode=function(){return this._playableNode;};xmp.playlistapi.RuleSetRunContext.prototype.getCurrentRuleContext=function(){return this._currentRuleContext;};xmp.playlistapi.RuleSetRunContext.prototype._initialize=function(wc){this._playableNode=wc;this._currentRuleContext=null;};xmp.playlistapi.RuleSetRunContext.prototype._setCurrentRuleContext=function(xc){this._currentRuleContext=xc;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.AdPatternBuilder=function(yc){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"AdPatternBuilder.ctor");this._logger=new xmp.util.internals.CategoryLogger('AdPatternBuilder');this._COMPOSITE_TYPE_ARRAY=['Composite','ContentComposite'];this._patternMap=null;this._parameterMap=yc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._build=function(zc){try{this._patternMap=zc.patternMap;if(!this._isComposite(zc.root)){throw new xmp.playlistapi.internals.PlayListError("Root of ad pattern must have type of one of the following: "+this._COMPOSITE_TYPE_ARRAY.join(', '));}
var Ac=this._buildHelper(zc.root,true);zc=null;return Ac;}
catch(e){e.stack=null;var Bc=new xmp.baseplayer.ApplicationError(e,'badAdPattern','AdPatternPlayList',[{label:'details',text:xmp.extractErrorMessage(e)}]);this._logger.warn(Bc.message,Bc);var Cc="Error building Ad Pattern with memento data";throw new xmp.playlistapi.internals.PlayListError(Cc);}};xmp.playlistapi.internals.AdPatternBuilder.prototype._isComposite=function(Dc){for(var i=0;i<this._COMPOSITE_TYPE_ARRAY.length;i++){if(Dc.type===this._COMPOSITE_TYPE_ARRAY[i]){return true;}}
return false;};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildHelper=function(Ec,Fc){var Gc=null;if(this._isComposite(Ec)){var Hc=(typeof Ec.repeat==="number")?Ec.repeat:1;Gc=new xmp.playlistapi.internals[Ec.type+'PlayableNodeType'](Ec,(Fc?'/':this._calcId(Ec)),Ec.type,Ec.pattern,Hc);if(Gc._isDeferred()){Gc._setReadyToValidate(false);}
else{var Ic=this._patternMap[Gc._getPatternName()];this._buildChildren(Gc,Ic);}}
else{Gc=new xmp.playlistapi.internals.RuleSetPlayableNodeType(Ec,this._calcId(Ec),Ec.type,this._buildRuleContextArray(Ec.rules,Ec.type),this._extractOptionalMetaData(Ec));this._extractOptionalResources(Ec,Gc);this._extractOptionalDirective(Ec,Gc);}
Gc._handlePostBuild();return Gc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._calcId=function(Jc){return(typeof(Jc.id)==='string')?Jc.id:Jc.type;};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalDirective=function(Kc,Lc){var Mc=xmp.playlistapi.internals.PatternDirectiveFactory.create(Kc);Lc._setDirective(Mc);};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalResources=function(Nc,Oc){if(typeof Nc.resources==='object'){for(var i=0;i<Nc.resources.length;i++){var Pc=Nc.resources[i];Oc.setMetaResource(this._buildMetaResource(Pc));}}};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildChildren=function(Qc,Rc){for(var i=0;i<Rc.length;i++){var Sc=this._buildHelper(Rc[i],false);Qc._addChild(Sc);}};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildDeferredContentComposite=function(Tc,Uc){this._buildChildren(Tc,Uc);Tc._setReadyToValidate(true);Tc._handlePostBuild();};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildRuleContextArray=function(Vc,Wc){var Xc=[];if(typeof Vc==="object"){for(var i=0;i<Vc.length;i++){Xc.push(this._buildRuleContext(Vc[i],Wc));}}
return Xc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildMetaResource=function(Yc){return new xmp.playlistapi.Resource(this._parameterMap.expandStringAndFixSlashes(Yc.id),Yc.type,this._extractOptionalMetaData(Yc),'default');};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildRuleContext=function(Zc,$c){var ad=[];if($c!==null){ad.push($c);}
else{if(typeof Zc.nodeTypes==="object"){ad=ad.concat(Zc.nodeTypes);}}
return new xmp.playlistapi.RuleContext(this._parameterMap.expandString(Zc.id),this._extractOptionalMetaData(Zc),ad,true);};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalMetaData=function(bd){var cd={};if(typeof bd.meta==="object"){for(var dd=xmp.MapIterator.create(bd.meta);dd.hasNext();dd.next()){var ed=dd.currentKey();var fd=this._parameterMap.expandString(dd.currentValue());cd[ed]=fd;}}
return cd;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.CompositePlayableNodeType=function(gd,id,hd,jd,kd){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.NUMBER_TYPE],"CompositePlayableNodeType.ctor");if(jd===null||jd.length===0){throw new xmp.util.internals.InvalidArgsError("CompositePlayableNodeType requires non-empty patternName.");}
if(kd<1){throw new xmp.util.internals.InvalidArgsError("CompositePlayableNodeType must have a repeat count of 1 or greater.");}
this._patternName=jd;this._repeatCount=kd;this._children=[];xmp.playlistapi.internals.CompositePlayableNodeType.ctor.call(this,gd,id,hd);};xmp.DERIVE_CLASS(xmp.playlistapi.PlayableNodeType,xmp.playlistapi.internals.CompositePlayableNodeType);xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getRepeatCount=function(){return this._repeatCount;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._isDeferred=function(){return(this._patternName.toLowerCase()==='deferred');};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getPatternName=function(){return this._patternName;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getChildCount=function(){return this._children.length;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getChild=function(ld){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"CompositePlayableNodeType._getChild");return this._children[ld];};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._addChild=function(md){var nd=this._children.push(md);md._setParent(this);return nd;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._isCompositeType=function(){return true;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._removeAllChildren=function(){this._children=[];};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.ContentCompositePlayableNodeType=function(od,id,pd,qd,rd){xmp.playlistapi.internals.ContentCompositePlayableNodeType.ctor.call(this,od,id,pd,qd,rd);this._readyToValidate=true;};xmp.DERIVE_CLASS(xmp.playlistapi.internals.CompositePlayableNodeType,xmp.playlistapi.internals.ContentCompositePlayableNodeType);xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._setReadyToValidate=function(sd){this._readyToValidate=sd;};xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._handlePostBuild=function(){if(!this._readyToValidate){return;}
function throwContentChildException(){throw new xmp.playlistapi.internals.PlayListError("ContentCompositePlayableNodeType must have one and only one node of type 'Content' (can have other leaf node types as well); cannot contain composite node types.");}
var td=-1;var ud=this._getChildCount();for(var i=0;i<ud;i++){var vd=this._getChild(i);if(vd._isCompositeType()){throwContentChildException();}
if(vd.isContentType()){if(td===-1){td=i;}
else{throwContentChildException();}}}
if(td===-1){throwContentChildException();}};xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._isContentCompositeType=function(){return true;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.DefaultAdDataPatternDirective=function(wd,xd,yd){xmp.playlistapi.internals.DefaultAdDataPatternDirective.ctor.call(this,wd,xd,yd);};xmp.DERIVE_CLASS(xmp.playlistapi.internals.PatternDirective,xmp.playlistapi.internals.DefaultAdDataPatternDirective);xmp.playlistapi.internals.DefaultAdDataPatternDirective.prototype.doDirective=function(zd,Ad){var Bd=this.getMetadata('refId','');var Cd=this.getMetadata('defaultDataId','');if(Bd.length===0||Cd.length===0){throw new xmp.playlistapi.internals.PlayListError("Directive '"+this.getType()+"' requires metadata 'refId' and 'defaultDataId'.");}
var Dd=this._findNamedContentNode(zd,Ad,Bd);var Ed=Dd.getPlayableData().getDataObject().adDataMap;if(typeof Ed!=='object'){throw new xmp.playlistapi.internals.PlayListError("Did not find 'adDataMap' for content node: "+Dd.getBestId());}
var Fd=Ed[Cd];if(typeof Fd!=='object'){throw new xmp.playlistapi.internals.PlayListError("Did not find '"+Cd+"' in 'adDataMap' for content node: "+Dd.getBestId());}
var Gd=zd._getParameterMapInternal().clone();Gd.setOverrides(this.getParameterArray());Gd.addContextObject('video',Dd.getPlayableData().getDataObject());Gd.addContextObject('node',Ad.getNodeType().getDataObject());var Hd=new xmp.playlistapi.internals.AdPatternBuilder(Gd);if(typeof Fd.resources==='object'){for(var i=0;i<Fd.resources.length;i++){var Id=Fd.resources[i];Ad.setMetaResource(Hd._buildMetaResource(Id));}}
var Jd=Hd._extractOptionalMetaData(Fd);for(var Kd=xmp.MapIterator.create(Jd);Kd.hasNext();Kd.next()){var Ld=Kd.currentKey();var Md=Kd.currentValue();Ad.setMetadata(Ld,Md);}
Ad.setMetadata('__DIRECTIVE_PARAMETER_MAP__',Gd);};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.NullPatternDirective=function(){};xmp.playlistapi.internals.NullPatternDirective._flyWeight=new xmp.playlistapi.internals.NullPatternDirective();xmp.playlistapi.internals.NullPatternDirective.getNull=function(){return xmp.playlistapi.internals.NullPatternDirective._flyWeight;};xmp.playlistapi.internals.NullPatternDirective.prototype.getType=function(){return'Null';};xmp.playlistapi.internals.NullPatternDirective.prototype.doDirective=function(Nd,Od){};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.ParameterMap=function(){this._logger=new xmp.util.internals.CategoryLogger('ParameterMap');this._map={};this._contextObjectMap={};};xmp.playlistapi.internals.ParameterMap.calcInitial=function(Pd,Qd){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"ParameterMap.calcInitial");var Rd=new xmp.playlistapi.internals.ParameterMap();Rd.init(Pd);Rd.setOverrides(Qd);return Rd;};xmp.playlistapi.internals.ParameterMap.prototype.clone=function(){var Sd=new xmp.playlistapi.internals.ParameterMap();Sd._cloneInternal(this._map);return Sd;};xmp.playlistapi.internals.ParameterMap.prototype.init=function(Td){this._map=this._mapParameters((typeof Td.parameters==='object')?Td.parameters:[]);};xmp.playlistapi.internals.ParameterMap.prototype.setOverrides=function(Ud){this._validateParameters(Ud);for(var i=0;i<Ud.length;i++){var p=Ud[i];if(typeof this._map[p.name]==='undefined'){this._logger.warn('Pattern input parameter dropped, no default value in pattern: '+p.name);continue;}
this._map[p.name]=p.value;}};xmp.playlistapi.internals.ParameterMap.prototype.expandStringAndFixSlashes=function(Vd){var Wd='://';var Xd=this.expandString(Vd);var Yd='';var Zd=Xd;if(Xd.indexOf(Wd)>-1){var $d=Xd.split(Wd);Yd=$d[0]+Wd;Zd=$d[1];}
while(Zd.indexOf('//')>-1){Zd=Zd.replace(/\/\//g,'/');}
return Yd+Zd;};xmp.playlistapi.internals.ParameterMap.prototype.expandString=function(ae){if(typeof ae!=='string'){return ae;}
if(ae.indexOf('${')!==-1){var be=false;if(ae.indexOf('$${')!==-1){ae=ae.replace(/\$\$\{/g,'__PROTECT_DOLLAR_ESCAPE__');be=true;}
ae=ae.replace(/\$\{player./g,'${');for(var ce=xmp.MapIterator.create(this._map);ce.hasNext();ce.next()){var de=ce.currentKey();var ee=ce.currentValue();var fe='${'+de+'}';if(ae.indexOf(fe)!==-1){var ge=ae.split(fe);ae=ge.join(ee);}}
ae=this._makeContextObjectSubs(ae);if(be){ae=ae.replace(/__PROTECT_DOLLAR_ESCAPE__/g,'${');}}
return ae;};xmp.playlistapi.internals.ParameterMap.prototype._makeContextObjectSubs=function(he){var ie=0;var je=true;while(je){var ke=he.indexOf('${',ie);if(ke===-1){je=false;break;}
var le=he.indexOf('}',ke+1);if(le===-1){je=false;break;}
ie=le+1;var me=he.substr(0,ke);var ne=he.substr(le+1);var oe=he.substr(ke+2,le-ke-2);var pe=oe.indexOf('.');if(pe===-1){continue;}
var qe=oe.substr(0,pe);var re=oe.substr(pe+1);var se=this._contextObjectMap[qe];if(!se){continue;}
var te=null;try{te=xmp.util.JsonPath.evaluate(se,re);}
catch(e){te=null;this._logger.warn('Error evaluating JSON Path: '+re,e);}
if(te!==null){var ue=he.length;he=me+te+ne;ie+=(he.length-ue);}}
return he;};xmp.playlistapi.internals.ParameterMap.prototype.addContextObject=function(ve,we){this._contextObjectMap[ve]=we;};xmp.playlistapi.internals.ParameterMap.prototype._validateParameters=function(xe){for(var i=0;i<xe.length;i++){var p=xe[i];if(!((typeof p.name==='string')&&(p.name.length>0)&&(typeof p.value==='string'))){throw new xmp.playlistapi.internals.PlayListError("Parameters must have string 'name and 'value' properties.");}}};xmp.playlistapi.internals.ParameterMap.prototype._mapParameters=function(ye){this._validateParameters(ye);var ze={};for(var i=0;i<ye.length;i++){var p=ye[i];ze[p.name]=p.value;}
return ze;};xmp.playlistapi.internals.ParameterMap.prototype._cloneInternal=function(Ae){for(var Be=xmp.MapIterator.create(Ae);Be.hasNext();Be.next()){var Ce=Be.currentKey();var De=Be.currentValue();this._map[Ce]=De;}};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PatternDirectiveFactory=function(){};xmp.playlistapi.internals.PatternDirectiveFactory._ctors=null;xmp.playlistapi.internals.PatternDirectiveFactory.create=function(Ee){if(xmp.playlistapi.internals.PatternDirectiveFactory._ctors===null){xmp.playlistapi.internals.PatternDirectiveFactory._ctors={};var Fe=xmp.playlistapi.internals.PatternDirectiveFactory._ctors;Fe.defaultAdData=xmp.playlistapi.internals.DefaultAdDataPatternDirective;}
if(typeof Ee.patternDirective==='object'){var Ge=xmp.playlistapi.internals.PatternDirectiveFactory._ctors[Ee.patternDirective.type];if(Ge){var He=Ee.patternDirective.parameters;He=(!He)?[]:He;var Ie=Ee.patternDirective.meta;Ie=(!Ie)?{}:Ie;return new Ge(Ee.patternDirective.type,Ie,He);}
else{throw new xmp.util.internals.InvalidArgsError('Unknown directive type: '+Ee.patternDirective.type);}}
else{return xmp.playlistapi.internals.NullPatternDirective.getNull();}};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListAddress=function(){this._array=[];};xmp.playlistapi.internals.PlayListAddress.prototype.getLength=function(){return this._array.length;};xmp.playlistapi.internals.PlayListAddress.prototype.clone=function(){var Je=new xmp.playlistapi.internals.PlayListAddress();Je._cloneInternal(this._array);return Je;};xmp.playlistapi.internals.PlayListAddress.prototype._cloneInternal=function(Ke){this._array=this._array.concat(Ke);};xmp.playlistapi.internals.PlayListAddress.prototype.getAtIndex=function(Le){return this._array[Le];};xmp.playlistapi.internals.PlayListAddress.prototype.shift=function(){return this._array.shift();};xmp.playlistapi.internals.PlayListAddress.prototype.push=function(Me){return this._array.push(Me);};xmp.playlistapi.internals.PlayListAddress.prototype.pop=function(){return this._array.pop();};xmp.playlistapi.internals.PlayListAddress.prototype.getParent=function(){var Ne=this.clone();Ne.pop();return Ne;};xmp.playlistapi.internals.PlayListAddress.prototype.isSibling=function(Oe,Pe){var Qe=this.getLength();if(Qe!==Oe.getLength()){return false;}
for(var i=0;i<Qe;i++){var Re=this.getAtIndex(i);var Se=Oe.getAtIndex(i);if(i<(Qe-1)){if(!Re.isEqual(Se)){return false;}}
else{if(Pe){if(Re.getRepeatIndex()!==Se.getRepeatIndex()){return false;}}}}
return true;};xmp.playlistapi.internals.PlayListAddress.prototype.asString=function(){var s='';var Te=this.getLength();for(var i=0;i<Te;i++){var Ue=this.getAtIndex(i);s+=Ue.asString();if(i!==(Te-1)){s+=',';}}
return s;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListAddressPart=function(Ve,We){this._repeatIndex=Ve;this._childIndex=We;};xmp.playlistapi.internals.PlayListAddressPart.prototype.getRepeatIndex=function(){return this._repeatIndex;};xmp.playlistapi.internals.PlayListAddressPart.prototype.getChildIndex=function(){return this._childIndex;};xmp.playlistapi.internals.PlayListAddressPart.prototype.isEqual=function(Xe){return(Xe.getRepeatIndex()===this.getRepeatIndex()&&Xe.getChildIndex()===this.getChildIndex());};xmp.playlistapi.internals.PlayListAddressPart.prototype.asString=function(){return('['+this._repeatIndex+','+this._childIndex+']');};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListBuilder=function(Ye,Ze,$e,af,bf){try{this._STATE_TRAVERSE_TO_ADDRESS=0;this._STATE_TRAVERSE_TO_NEXT=1;this._STATE_BUILD=2;this._logger=new xmp.util.internals.CategoryLogger('PlayListBuilder');this._playList=Ye;this._playableDataProvider=bf;this._contentMetaResourceIdArray=[];this._playListDataArray=[];this._traverseToPatternAddress=new xmp.playlistapi.internals.PlayListAddress();this._build_state=this._STATE_TRAVERSE_TO_ADDRESS;this._assignPatternAddress=new xmp.playlistapi.internals.PlayListAddress();this._contentCompositeIdToContentNodeMap={};this._parentIdCounter=0;this._contentMetaResourceIdArray=this._contentMetaResourceIdArray.concat(af);if(Ze!==null){this._traverseToPatternAddress=Ze._getPatternAddress().clone();}
if(this._traverseToPatternAddress.getLength()===0){this._build_state=this._STATE_BUILD;}
this._buildHelper($e,0);this._initializeNodes();}
catch(e){var cf="Error building playlist with meta resource IDs";this._logger.warn(cf,e);cf+=", error = ";cf+=xmp.extractErrorMessage(e);throw new xmp.playlistapi.internals.PlayListError(cf);}};xmp.playlistapi.internals.PlayListBuilder.prototype._getOutput=function(){var df=[];for(var i=0;i<this._playListDataArray.length;i++){var ef=this._playListDataArray[i];var ff=ef[0];df.push(ff);}
if(this._logger.isDebugEnabled()){var gf='Node output: ';for(var j=0;j<df.length;j++){gf+=('('+j.toString()+') ');gf+=df[j].getBestId();gf+=('('+df[j]._getPatternAddress().asString()+')');if(j!==(df.length-1)){gf+=', ';}}
this._logger.debug(gf);}
return df;};xmp.playlistapi.internals.PlayListBuilder.prototype._buildHelper=function(hf,jf){if(hf._isCompositeType()){var kf=0;var lf=0;if(this._build_state===this._STATE_TRAVERSE_TO_ADDRESS){var mf=this._traverseToPatternAddress.shift();kf=mf.getRepeatIndex();lf=mf.getChildIndex();if(this._traverseToPatternAddress.getLength()===0){this._build_state=this._STATE_TRAVERSE_TO_NEXT;}}
if(this._build_state!==this._STATE_TRAVERSE_TO_ADDRESS&&hf._isDeferred()){hf=this._buildDeferredContentComposite(hf);}
var nf=hf._getRepeatCount();var of=hf._getChildCount();for(var pf=kf;pf<nf;pf++){if(this._contentMetaResourceIdArray.length===0){break;}
this._parentIdCounter++;if(this._build_state===this._STATE_BUILD){lf=0;}
for(var qf=lf;qf<of;qf++){var rf=hf._getChild(qf);this._assignPatternAddress.push(new xmp.playlistapi.internals.PlayListAddressPart(pf,qf));this._buildHelper(rf,this._parentIdCounter);this._assignPatternAddress.pop();}}}
else{if(this._build_state===this._STATE_BUILD){this._buildLeaf(hf,jf);}
else if(this._build_state===this._STATE_TRAVERSE_TO_NEXT){this._build_state=this._STATE_BUILD;}}};xmp.playlistapi.internals.PlayListBuilder.prototype._buildLeaf=function(sf,tf){var uf=this._playList._createNode();if(sf.isContentType()){if(this._contentMetaResourceIdArray.length===0){uf._mutateEmptySlot(true);uf._setData(new xmp.util.PlayableData('EMPTY_SLOT'));}
else{var vf=this._contentMetaResourceIdArray.shift();uf._linkData(this._playableDataProvider,vf);}}
uf._setNodeType(sf);uf._setPatternAddress(this._assignPatternAddress.clone());if(uf.isContentType()&&uf.getNodeType()._getParent()._isContentCompositeType()){uf.getPlayableData()._setCompositeMetaResourceId(uf.getPlayableData().getMetaResourceId());this._contentCompositeIdToContentNodeMap[tf.toString()]=uf;}
this._playListDataArray.push([uf,tf]);};xmp.playlistapi.internals.PlayListBuilder.prototype._initializeNodes=function(){for(var i=0;i<this._playListDataArray.length;i++){var wf=this._playListDataArray[i];var xf=wf[0];var yf=wf[1];try{xf.getNodeType()._getDirective().doDirective(this,xf);}
catch(e){var zf=new xmp.baseplayer.ApplicationError(e,'badAdPattern',null,[{label:'cause',text:e.message}]);this._logger.warn(zf.message,zf);}
if(xf.getPlayableData()===null){var Af=xf.getMetaResource('primary');xf._setData(new xmp.util.PlayableData((Af)?Af.getId():''));}
if(!xf.isContentType()&&xf.getNodeType()._getParent()._isContentCompositeType()){this._fixContentCompositeSibling(xf,yf);}
if(!xf._isEmptySlot()&&!xf.getPlayableData().isError()){this._playList._initializeNode(xf);}}};xmp.playlistapi.internals.PlayListBuilder.prototype._fixContentCompositeSibling=function(Bf,Cf){var Df=this._contentCompositeIdToContentNodeMap[Cf.toString()];if(Df._isEmptySlot()){Bf._mutateEmptySlot(true);}
Bf.getPlayableData()._setCompositeMetaResourceId(Df.getPlayableData().getCompositeMetaResourceId());};xmp.playlistapi.internals.PlayListBuilder.prototype._buildDeferredContentComposite=function(Ef){Ef._removeAllChildren();if(this._contentMetaResourceIdArray.length>0){var Ff=this._contentMetaResourceIdArray[0];var Gf=this._playableDataProvider._getPlayableData(Ff);var Hf=null;if(Gf.isError()){Hf=[{type:'Content'}];}
else{Hf=Gf.getDataObject().pattern;}
var If=new xmp.playlistapi.internals.AdPatternBuilder(this._playList._getParameterMapInternal());If._buildDeferredContentComposite(Ef,Hf);}
return Ef;};xmp.playlistapi.internals.PlayListBuilder.prototype._getParameterMapInternal=function(){return this._playList._getParameterMapInternal();};xmp.playlistapi.internals.PlayListBuilder.prototype._getPlayListDataArrayLength=function(){return this._playListDataArray.length;};xmp.playlistapi.internals.PlayListBuilder.prototype._getPlayListDataArrayItemAtIndex=function(Jf){var Kf=this._playListDataArray[Jf];return Kf[0];};xmp.playlistapi.internals.PlayListBuilder.prototype._getDataIterator=function(){return(new xmp.playlistapi.internals.PlayListBuilder.Iterator(this));};xmp.playlistapi.internals.PlayListBuilder.prototype._getHistoricalDataIterator=function(){return this._playList._getHistoricalDataIterator();};xmp.playlistapi.internals.PlayListBuilder.Iterator=function(Lf){this._playListBuilder=Lf;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.getLength=function(){return this._playListBuilder._getPlayListDataArrayLength();};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.first=function(){this._curIndex=0;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.next=function(){var Mf=this._playListBuilder._getPlayListDataArrayItemAtIndex(this._curIndex);this._curIndex++;return Mf;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.hasNext=function(){return(this._curIndex<this.getLength());};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListError=function(Nf){this.name="xmp.playlistapi.internals.PlayListError";this.message=Nf;};xmp.DERIVE_CLASS(Error,xmp.playlistapi.internals.PlayListError);xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.RuleSetPlayableNodeType=function(Of,id,Pf,Qf,Rf){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"RuleSetPlayableNodeType.ctor");this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(Rf);this._ruleContextArray=Qf;this._metaResourceBundle=new xmp.playlistapi.ResouceBundle();xmp.playlistapi.internals.RuleSetPlayableNodeType.ctor.call(this,Of,id,Pf);};xmp.DERIVE_CLASS(xmp.playlistapi.PlayableNodeType,xmp.playlistapi.internals.RuleSetPlayableNodeType);xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.setMetaResource=function(Sf){this._metaResourceBundle.setMetaResource(Sf);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetaResource=function(Tf){return this._metaResourceBundle.getMetaResource(Tf);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetaResourceBundle=function(){return this._metaResourceBundle;};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetadata=function(Uf,Vf){return this._metadataMap._get(Uf,Vf);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype._getRuleContextArray=function(){return this._ruleContextArray;};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype._getMetadataMapRef=function(){return this._metadataMap;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.SimplePlayListIterator=function(Wf){this._playListArray=Wf;this._curIndex=-1;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.getLength=function(){return this._playListArray.length;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.first=function(){this._curIndex=0;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.next=function(){var Xf=this._playListArray[this._curIndex];this._curIndex++;return Xf;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.hasNext=function(){return(this._curIndex<this.getLength());};

xmp.CONTROL_STREAM_NODE_PATH="/PlayerContexts/Global/ControlStream";xmp.CONTROL_STREAM_SERVICE="ControlStream";xmp.CONTROL_STREAM_MEDIA_TYPE="Media Type";xmp.CONTROL_STREAM_ENVIRONMENT_LABEL="Environment Label";xmp.CONTROL_STREAM_URL="Url";xmp.CONTROL_STREAM_RECONNECT_RETRIES="Reconnect Retries";xmp.CONTROL_STREAM_RECONNECT_RETRY_INTERVAL="Reconnect Retry Interval";xmp.CONTROL_STREAM_REFRESH_INTERVAL="RefreshInterval";xmp.CONTROL_STREAM_START_DELAY="Start Delay";xmp.CONTROL_STREAM_RESOURCE_TRANSPORT="controlStreamResource";xmp.ENVIRONMENT_LABEL="{{environment_label}}";xmp.RESOURCE_NAME="name";xmp.RESOURCE_LABEL="label";xmp.RESOURCE_WEB_URL="webUrl";xmp.RESOURCE="resource";xmp.WEB_RESOURCE_CACHING_CONTEXT="retrieved from the web";xmp.TRIGGER_RESOURCE_CACHING_CONTEXT="received from trigger";xmp.START_DELAY_TIMER="StartDelay";xmp.REFRESH_RESOURCE_TIMER="RefreshResources";xmp.RECONNECT_TIMER="Reconnect";xmp.ControlStream=function(){this.listener=null;};xmp.ControlStream.prototype.init=function(aa){try{this.logger=new xmp.util.internals.CategoryLogger(xmp.CONTROL_STREAM_SERVICE);this._validateListener(aa);this.listener=aa;this._resetReconnect();var ba=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(xmp.CONTROL_STREAM_NODE_PATH);this._initProperties(ba);this.reader=xmp.ControlStreamReaderFactory.createReader(xmp.util.internals.BrowserDetect.OS,this,this.mimeType);this._initResources(ba);this._start();}
catch(e){this._handleError("Initializing.",e);}};xmp.ControlStream.prototype.fini=function(){if(this.reader){this.reader.close();}
if(this.startDelayTimer){this.startDelayTimer.stop();this.startDelayTimer=null;}
if(this.refreshResourcesTimer){this.refreshResourcesTimer.stop();this.refreshResourcesTimer=null;}
this._resetReconnect();};xmp.ControlStream.prototype._start=function(){if(0===this.startDelay){this._handleStart();}
else{this.startDelayTimer=this._createTimer({id:xmp.START_DELAY_TIMER,interval:this.startDelay,handler:this._onDelayedStart});this.startDelayTimer.start();}};xmp.ControlStream.prototype._validateListener=function(ca){if(!ca){throw new xmp.ControlStreamError("Validating listener.","Missing control stream listener.");}
if(false===xmp.isDefined(ca.onControlStreamError)){throw new xmp.ControlStreamError("Validating listener.","Invalid control stream listener.  Missing \"onControlStreamError\" handler.");}
if(false===xmp.isDefined(ca.onControlStreamTrigger)){throw new xmp.ControlStreamError("Validating listener.","Invalid control stream listener.  Missing \"onControlStreamTrigger\" handler.");}
if(false===xmp.isDefined(ca.onControlStreamTriggerInit)){throw new xmp.ControlStreamError("Validating listener.","Invalid control stream listener.  Missing \"onControlStreamTriggerInit\" handler.");}};xmp.ControlStream.prototype._validateResource=function(da){if(da.name.length===0){throw new xmp.ControlStreamError("Validating resource.","Missing control stream resource name.");}
if(da.label.length===0){throw new xmp.ControlStreamError("Validating resource.","Missing control stream resource label.");}
if(da.webUrl.length===0){throw new xmp.ControlStreamError("Validating resource.","Missing control stream \""+da.name+"\" web url.");}};xmp.ControlStream.prototype._initProperties=function(ea){var fa=ea.getString(xmp.CONTROL_STREAM_MEDIA_TYPE,xmp.NO_DEFAULT_VALUE);if(fa.length===0){throw new xmp.ControlStreamError("Initializing properties.","Missing control stream media type.");}
var ga=xmp.PlayerPolicy.getMediaType(fa);if(false===xmp.isDefined(ga)){throw new xmp.ControlStreamError("Initializing properties.","Invalid control stream media type \""+fa+"\".");}
this.mimeType=ga.mimeType;this.url=ea.getString(xmp.CONTROL_STREAM_URL,xmp.NO_DEFAULT_VALUE);if(this.url.length===0){throw new xmp.ControlStreamError("Initializing properties.","Missing control stream url.");}
this.reconnectRetryInterval=ea.getInt(xmp.CONTROL_STREAM_RECONNECT_RETRY_INTERVAL,0);if(this.reconnectRetryInterval===0){throw new xmp.ControlStreamError("Initializing properties.","Missing control stream reconnect retry interval.");}
this.maxReconnectRetryCount=ea.getInt(xmp.CONTROL_STREAM_RECONNECT_RETRIES,0);this.startDelay=ea.getInt(xmp.CONTROL_STREAM_START_DELAY,0);var ha=ea.getNodeForPath(xmp.CONTROL_STREAM_REFRESH_INTERVAL);this.refreshInterval=ha.getInt(xmp.util.internals.BrowserDetect.OS,0);if(this.refreshInterval===0){throw new xmp.ControlStreamError("Initializing properties.","Missing control stream refresh interval for the \""+xmp.util.internals.BrowserDetect.OS+"\" platform.");}};xmp.ControlStream.prototype._initResources=function(ia){this.resources={};var ja=ia.getString(xmp.CONTROL_STREAM_ENVIRONMENT_LABEL,xmp.NO_DEFAULT_VALUE);if(ja.Length===0){throw new xmp.ControlStreamError("Initializing resources.","Missing control stream environment label.");}
var ka=ia.retrieveChildren();var la=ka.length;for(var i=0;i<la;i++){var ma=ka[i];if(ma.getName()===xmp.CONTROL_STREAM_REFRESH_INTERVAL){continue;}
var na=ma.getString(xmp.RESOURCE_LABEL,xmp.NO_DEFAULT_VALUE);na=na.replace(xmp.ENVIRONMENT_LABEL,ja);var oa={initialized:false,name:ma.getString(xmp.RESOURCE_NAME,xmp.NO_DEFAULT_VALUE),label:na,webUrl:ma.getString(xmp.RESOURCE_WEB_URL,xmp.NO_DEFAULT_VALUE),data:null};this._validateResource(oa);this.resources[oa.name]=oa;}};xmp.ControlStream.prototype._refreshResources=function(pa){for(var qa=xmp.MapIterator.create(this.resources);qa.hasNext();qa.next()){this._getResourceFromWeb(qa.currentValue(),pa);}};xmp.ControlStream.prototype._getResourceFromWeb=function(ra,sa){var ta=((true===sa)?this._onInitResource:this._onResourceLoadedFromWeb);var ua=new xmp.util.Callback(xmp.CONTROL_STREAM_SERVICE,ta,this);ua.setMetadata(xmp.RESOURCE,ra);var va=xmp.net.AjaxRequestManager.getInstance();va.request(xmp.CONTROL_STREAM_SERVICE,ua,xmp.CONTROL_STREAM_RESOURCE_TRANSPORT,ra.webUrl,xmp.net.ContentTypes.JSON,null);};xmp.ControlStream.prototype._onResourceLoadedFromWeb=function(wa,xa){this._setWebResource(wa,xa,this.listener.onControlStreamTrigger,true);};xmp.ControlStream.prototype._onInitResource=function(ya,za){var Aa=null;try{Aa=ya.getMetadata(xmp.RESOURCE,{});this._setWebResource(ya,za,this.listener.onControlStreamTriggerInit,false);Aa.initialized=true;}
catch(e){if(Aa){if(false===Aa.initialized){try{this.listener.onControlStreamTriggerInit(Aa.name,null);}
catch(e2){}
Aa.initialized=true;}}}};xmp.ControlStream.prototype._setResource=function(Ba,Ca,Da,Ea,Fa){this._validateResourceData(Ca,Da);if(true===Ea&&false===this.checkResourceVersion(Ca,Da)){this.logger.info((new Date()).toString()+" - Ignoring resource \""+Ca.name+"\" "+Ba+".  Already up to date ("+Da.modifiedDate+").");return;}
Ca.data=Da;this.logger.info((new Date()).toString()+" - Resource \""+Ca.name+"\" "+Ba+".");Fa.call(this.listener,Ca.name,Da);};xmp.ControlStream.prototype.checkResourceVersion=function(Ga,Ha){if(!Ga.data){return true;}
return(Ha.modifiedDate>Ga.data.modifiedDate);};xmp.ControlStream.prototype._validateResourceData=function(Ia,Ja){if(!Ja){throw new xmp.ControlStreamError("Validating resource data.","NULL resource data.");}
if(!Ja.id||Ja.id.length===0){throw new xmp.ControlStreamError("Validating resource data.","Invalid control stream resource \""+Ia.name+"\" data.  Missing resource id.");}
if(Ia.label!==Ja.id){throw new xmp.ControlStreamError("Validating resource data.","Invalid control stream resource \""+Ia.name+"\" data id \""+Ja.id+"\".  Expected \""+Ia.label+"\".");}};xmp.ControlStream.prototype._createTimer=function(Ka){var La=new xmp.util.Callback(Ka.id,Ka.handler,this);return new xmp.util.Timer(Ka.id,Ka.interval,-1,La);};xmp.ControlStream.prototype._handleStart=function(){this._connect();this._refreshResources(true);this.refreshResourcesTimer=this._createTimer({id:xmp.REFRESH_RESOURCE_TIMER,interval:this.refreshInterval,handler:this._onRefreshResources});this.refreshResourcesTimer.start();};xmp.ControlStream.prototype._onDelayedStart=function(Ma,Na){try{this.startDelayTimer.stop();this.startDelayTimer=null;this._handleStart();}
catch(e){this._handleError("Starting after delay.",e);}};xmp.ControlStream.prototype._onRefreshResources=function(Oa,Pa){try{this._refreshResources(false);}
catch(e){this._handleError("Refreshing all resources.",e);}};xmp.ControlStream.prototype._handleError=function(Qa,e){var Ra=e;if(false===(Ra instanceof xmp.ControlStreamError)){Ra=new xmp.ControlStreamError(((e.context)?e.context:Qa),((e.rawMessage)?e.rawMessage:e.message));Ra.setInnerError(e);}
this._logError(Ra);if(!this.listener){xmp.handleFatalError(Ra);}
else if(true===xmp.isDefined(this.listener.onControlStreamError)){this.reader.close();this.listener.onControlStreamError(Ra);}};xmp.ControlStream.prototype.onReaderError=function(e){this._logError(e);this._reconnect();};xmp.ControlStream.prototype.onReaderTrigger=function(Sa,Ta){var Ua=null;try{Ua=this._getResourceFromLabel(Sa);this._validateTrigger(Sa,Ua);var Va=xmp.Base64.decode(Ta);var Wa=this._parseJson(Va);this._setResource(xmp.TRIGGER_RESOURCE_CACHING_CONTEXT,Ua,Wa,false,this.listener.onControlStreamTrigger);this.logger.info(Va);}
catch(e){var Xa="TRIGGER PROCESSING ERROR.";if(Ua){Xa="TRIGGER \""+Ua.name+"\" PROCESSING ERROR.";}
this._logError(e);this._getResourceFromWeb(this._getResourceFromLabel(Sa));}};xmp.ControlStream.prototype.onReaderConnected=function(){this.logger.info("Connected.");this._resetReconnect();};xmp.ControlStream.prototype.onReaderPlugInError=function(e){this.listener.onPlugInError(e);};xmp.ControlStream.prototype.onReaderUnsupportedPlatformError=function(e){this.listener.onUnsupportedPlatformError(e);};xmp.ControlStream.prototype._reconnect=function(){if(!this.reconnectTimer){this.reconnectRetryCount=0;this.reconnectTimer=this._createTimer({id:xmp.RECONNECT_TIMER,interval:this.reconnectRetryInterval,handler:this._onReconnect});this.reconnectTimer.start();}};xmp.ControlStream.prototype._onReconnect=function(Ya,Za){try{if(true===this.reader.isConnected()||(this.maxReconnectRetryCount>0&&this.reconnectRetryCount===this.maxReconnectRetryCount)){if(this.reconnectRetryCount===this.maxReconnectRetryCount&&false===this.reader.isConnected()){this.logger.warn("Control stream reconnect retry maximum "+this.maxReconnectRetryCount+" limit reached...");}
this._resetReconnect();return;}
this.reconnectRetryCount++;this.logger.warn("Control stream reconnect retry "+this.reconnectRetryCount+"...");this._connect();this._refreshResources(false);}
catch(e){this._logError(e);}};xmp.ControlStream.prototype._getResourceFromLabel=function($a){for(var ab=xmp.MapIterator.create(this.resources);ab.hasNext();ab.next()){var bb=ab.currentValue();if(bb.label===$a){return bb;}}
return null;};xmp.ControlStream.prototype._logError=function(e){this.logger.warn(e.message);};xmp.ControlStream.prototype._connect=function(){var cb=this.reader.open(this.url);if(cb){this.logger.info("Connecting to \""+cb+"\".");}};xmp.ControlStream.prototype._resetReconnect=function(){if(this.reconnectTimer){this.reconnectTimer.stop();this.reconnectTimer=null;}
this.reconnectRetryCount=0;};xmp.ControlStream.prototype._validateTrigger=function(db,eb){if(!eb){throw new xmp.ControlStreamError("Validating trigger.","Missing control stream resource configuration for \""+db+"\" trigger.");}};xmp.ControlStream.prototype._parseJson=function(fb){var gb=xmp.trimString(fb);return this._parseJavaScript('('+gb+')');};xmp.ControlStream.prototype._parseJavaScript=function(hb){return eval(hb);};xmp.ControlStream.prototype._setWebResource=function(ib,jb,kb,lb){try{var mb=ib.getMetadata(xmp.RESOURCE,{});if(true===jb.isError()){throw new xmp.ControlStreamError("Initializing resources.","Unable to retrieve control stream resource \""+mb.name+"\" from url \""+mb.webUrl+"\". \n\n"+jb.makeReport());}
this._setResource(xmp.WEB_RESOURCE_CACHING_CONTEXT,mb,jb.getJsonObject(),true,kb);}
catch(e){var nb="";if(e instanceof xmp.ControlStreamError){nb=e.message;}
else{nb="Unable to retrieve control stream resource \""+mb.name+"\" from url \""+mb.webUrl+"\". \n\n"+e.message;}
this.logger.warn(nb);if(false===lb){throw e;}}};xmp.CONTROL_STREAM_READER="ControlStreamReader";xmp.ControlStreamReader=function(ob,pb){this.listener=ob;this.mimeType=pb;this.connected=false;this.registry=new xmp.PlayerModeRegistry();this.state=this.registry.findMode(xmp.FINI);xmp.NativePlayerRegistry.createGroup(this.getName(),this);this.player=xmp.NativePlayerRegistry.findPlayerByMimeType(this.getName(),xmp.NULL_MIME_TYPE);this.viewManager=new xmp.ViewManager(this.getName());this.viewManager.setViewportConfig(xmp.NULL_MIME_TYPE,xmp.DHTML_VIEWPORT);this.viewManager.setViewportConfig(this.mimeType,xmp.DHTML_VIEWPORT);};xmp.ControlStreamReader.prototype.open=function(qb){var rb=this.createPlayableNode(qb);if(false===this._initNativePlayer(rb)){this.state.open(this,rb);}
return rb.getURI();};xmp.ControlStreamReader.prototype.close=function(){this.state.close(this);this.connected=false;};xmp.ControlStreamReader.prototype.createPlayableNode=function(sb){var tb=new xmp.util.PlayableNode();tb.setMimeTypes([this.mimeType]);tb.setURI(sb);tb.setStreamingMode(xmp.CONTROL_STREAMING_MODE);xmp.PlayerPolicy.apply(this,tb);return tb;};xmp.ControlStreamReader.prototype.onNativePlayerStateChange=function(ub,vb){try{if(ub===xmp.OPEN){this.state.play(this);this.connected=true;this.listener.onReaderConnected();}
else if(ub===xmp.ENDED){throw new xmp.ControlStreamReaderError("Handling native player state change.","Control stream ended.");}}
catch(e){this._handleError("Handling native player state change.",e);}};xmp.ControlStreamReader.prototype.onNativePlayerTrigger=function(wb,xb){try{this.listener.onReaderTrigger(wb,xb);}
catch(e){this._handleError("Forwarding trigger to listener.",e);}};xmp.ControlStreamReader.prototype.onNativePlayerError=function(e){this._handleError("Forwarding native player error to listener.",e);};xmp.ControlStreamReader.prototype.onNativePlayerTimelineChange=function(yb,zb){};xmp.ControlStreamReader.prototype.onNativePlayerCreated=function(Ab,Bb){if(this.state.type===xmp.ERRORS){return;}
this.state.open(this,Bb.node);};xmp.ControlStreamReader.prototype.onNativePlayerExecuteCommand=function(Cb,Db){return null;};xmp.ControlStreamReader.prototype.onViewportOpened=function(Eb,Fb){Fb.data.viewport=Eb;Fb.player.create(Fb.data);this.player=Fb.player;};xmp.ControlStreamReader.prototype.onCreateViewport=function(Gb,Hb,Ib,Jb){var Kb=document.createElement("div");Kb.setAttribute(xmp.ID_ATTRIBUTE,Hb);Kb.setAttribute(xmp.NAME_ATTRIBUTE,Hb);Kb.style.width="1px";Kb.style.height="1px";xmp.insertDomChildBefore(document.body,Kb,document.body.firstChild);return Kb;};xmp.ControlStreamReader.prototype.onDestroyViewport=function(Lb,Mb){var Nb=xmp.findDomElement(Mb);if(Nb){var Ob=xmp.getDomParent(Nb);Ob.removeChild(Nb);}};xmp.ControlStreamReader.prototype.onViewportCreated=function(Pb,Qb){if(this.state.type===xmp.ERRORS){return;}
if(Qb===null){return;}
this.viewManager.openViewport(this,this.getName(),Pb.mime_type,Qb);};xmp.ControlStreamReader.prototype.onViewportError=function(e){this._handleError("Forwarding viewport error to listener.",e);};xmp.ControlStreamReader.prototype.onError=function(Rb,e){this.listener.onReaderError(e);};xmp.ControlStreamReader.prototype.onPlugInError=function(e){this.listener.onReaderPlugInError(e);};xmp.ControlStreamReader.prototype.onUnsupportedPlatformError=function(e){this.listener.onReaderUnsupportedPlatformError(e);};xmp.ControlStreamReader.prototype._handleError=function(Sb,e){this.connected=false;this.state.error(this);this._setNullPlayer();var Tb=e;if(false===(Tb instanceof xmp.ControlStreamReaderError)){Tb=new xmp.ControlStreamReaderError(((e.context)?e.context:Sb),((e.rawMessage)?e.rawMessage:e.message));Tb.setInnerError(e);}
this.listener.onReaderError(Tb);};xmp.ControlStreamReader.prototype._initNativePlayer=function(Ub){try{this.state.close(this);var Vb=Ub.getMimeType();var Wb=xmp.NativePlayerRegistry.findPlayerByMimeType(this.getName(),Vb);if(!Wb){throw new xmp.InvalidMimeTypeError("Initializing native player..","Unable to find native player for MIME type \""+Vb+"\".");}
var Xb={player:Wb,data:{group:this.getName(),viewport:null,volume:0,mute:true,node:Ub,fullscreenEnabled:false,stretchToFit:false}};if(false===this.viewManager.openViewport(this,this.getName(),Ub.getMimeType(),Xb)){if(Wb.type!==this.player.type){Wb.create({group:this.getName(),viewport:this.viewManager.getActiveViewport(),volume:0,mute:true,node:Ub,fullscreenEnabled:false,stretchToFit:false});this.player=Wb;return true;}
return false;}
return true;}
catch(e){this._setNullPlayer();throw e;}
return false;};xmp.ControlStreamReader.prototype._setNullPlayer=function(){var Yb=xmp.NativePlayerRegistry.findPlayerByMimeType(this.getName(),xmp.NULL_MIME_TYPE);if(this.viewManager.getActiveViewport()===null){this.viewManager.createViewport(this,this.getName(),xmp.NULL_MIME_TYPE,null);}
Yb.create({group:this.getName(),viewport:this.viewManager.getActiveViewport(),volume:0,mute:true,node:null,fullscreenEnabled:false,stretchToFit:false});this.player=Yb;};xmp.ControlStreamReader.prototype.getName=function(){return xmp.CONTROL_STREAM_READER;};xmp.ControlStreamReader.prototype._getPlayer=function(){return this.player;};xmp.ControlStreamReader.prototype._changeState=function(Zb,$b){var ac=this.registry.findMode(Zb);this._transitionState(ac,$b);this.state=ac;};xmp.ControlStreamReader.prototype._transitionState=function(bc,cc){return bc.transition(this,cc,this.state);};xmp.ControlStreamReader.prototype.isConnected=function(){return this.connected;};xmp.ControlStreamReaderFactory=function(){return{createReader:function(dc,ec,fc){if(dc===xmp.WINDOWS_PLATFORM){return new xmp.ControlStreamReader(ec,fc);}
else{return new xmp.NullStreamReader(ec,fc);}}};}();xmp.NullStreamReader=function(gc,hc){};xmp.NullStreamReader.prototype.open=function(ic){return null;};xmp.NullStreamReader.prototype.close=function(){};xmp.NullStreamReader.prototype.isConnected=function(){return false;};xmp.IMAGE_RETRIEVER_NODE_PATH="/PlayerContexts/Global/ImageRetriever";xmp.IMAGE_RETRIEVER_SERVICE="ImageRetriever";xmp.IMAGE_RETRIEVER_REFRESH_INTERVAL="Refresh Interval";xmp.IMAGE_RETRIEVER_START_DELAY="Start Delay";xmp.RESOURCE_NAME="name";xmp.RESOURCE_URL="url";xmp.ImageRetriever=function(){this.listener=null;};xmp.ImageRetriever.prototype.init=function(jc){try{this.logger=new xmp.util.internals.CategoryLogger(xmp.IMAGE_RETRIEVER_SERVICE);this._validateListener(jc);this.listener=jc;this.cacheID=(Math.round(Math.random()*(10000000-1))+1);var kc=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath(xmp.IMAGE_RETRIEVER_NODE_PATH);this._initProperties(kc);this._initResources(kc);this._start();}
catch(e){this._handleError("Initializing.",e);}};xmp.ImageRetriever.prototype.fini=function(){if(this.startDelayTimer){this.startDelayTimer.stop();this.startDelayTimer=null;}
if(this.refreshResourcesTimer){this.refreshResourcesTimer.stop();this.refreshResourcesTimer=null;}};xmp.ImageRetriever.prototype._start=function(){if(0===this.startDelay){this._handleStart();}
else{this.startDelayTimer=this._createTimer({id:xmp.START_DELAY_TIMER,interval:this.startDelay,handler:this._onDelayedStart});this.startDelayTimer.start();}};xmp.ImageRetriever.prototype._handleStart=function(){this.refreshResourcesTimer=this._createTimer({id:xmp.REFRESH_RESOURCE_TIMER,interval:this.refreshInterval,handler:this._onRefreshResources});this.refreshResourcesTimer.start();this._refreshResources();};xmp.ImageRetriever.prototype._validateListener=function(lc){if(!lc){throw new xmp.ImageRetrieverError("Validating listener.","Missing image retriever listener.");}
if(false===xmp.isDefined(lc.onRetrieveImage)){throw new xmp.ImageRetrieverError("Validating listener.","Invalid image retriever listener.  Missing \"onRetrieveImage\" handler.");}
if(false===xmp.isDefined(lc.onImageRetrieverError)){throw new xmp.ImageRetrieverError("Validating listener.","Invalid image retriever listener.  Missing \"onImageRetrieverError\" handler.");}};xmp.ImageRetriever.prototype._validateResource=function(mc){if(mc.name.length===0){throw new xmp.ImageRetrieverError("Validating resource.","Missing image retriever resource name.");}
if(mc.url.length===0){throw new xmp.ImageRetrieverError("Validating resource.","Missing image retriever \""+mc.name+"\" url.");}};xmp.ImageRetriever.prototype._initProperties=function(nc){this.refreshInterval=nc.getInt(xmp.IMAGE_RETRIEVER_REFRESH_INTERVAL,0);if(this.refreshInterval===0){throw new xmp.ImageRetrieverError("Initializing properties.","Missing image retriever refresh interval.");}
this.startDelay=nc.getInt(xmp.IMAGE_RETRIEVER_START_DELAY,0);};xmp.ImageRetriever.prototype._initResources=function(oc){this.resources={};var pc=oc.retrieveChildren();var qc=pc.length;for(var i=0;i<qc;i++){var rc=pc[i];var sc={name:rc.getString(xmp.RESOURCE_NAME,xmp.NO_DEFAULT_VALUE),url:rc.getString(xmp.RESOURCE_URL,xmp.NO_DEFAULT_VALUE)};this._validateResource(sc);this.resources[sc.name]=sc;}};xmp.ImageRetriever.prototype._refreshResources=function(){try{var tc=xmp.getImageRoot();var uc=this._newCacheId();for(var vc=xmp.MapIterator.create(this.resources);vc.hasNext();vc.next()){try{var wc=vc.currentValue();var xc=tc+wc.url+"?"+uc;this.listener.onRetrieveImage(wc.name,xc);this.logger.info((new Date()).toString()+" - Image resource \""+wc.name+"\" retrieval refresh ("+uc+").");}
catch(e){var yc="";if(e instanceof xmp.ImageRetrieverError){yc=e.message;}
else{yc="Error retrieving image resource \""+wc.name+"\" from url \""+xc+"\". \n\n"+e.message;}
this.logger.warn(yc);}}}
catch(e2){this._handleError("Refreshing all resources.",e2);}};xmp.ImageRetriever.prototype._createTimer=function(zc){var Ac=new xmp.util.Callback(zc.id,zc.handler,this);return new xmp.util.Timer(zc.id,zc.interval,-1,Ac);};xmp.ImageRetriever.prototype._onRefreshResources=function(Bc,Cc){this._refreshResources();};xmp.ImageRetriever.prototype._handleError=function(Dc,e){var Ec=e;if(false===(Ec instanceof xmp.ImageRetrieverError)){Ec=new xmp.ImageRetrieverError(((e.context)?e.context:Dc),((e.rawMessage)?e.rawMessage:e.message));Ec.setInnerError(e);}
this._logError(Ec);if(!this.listener){xmp.handleFatalError(Ec);}
else if(true===xmp.isDefined(this.listener.onImageRetrieverError)){this.listener.onImageRetrieverError(Ec);}};xmp.ImageRetriever.prototype._logError=function(e){this.logger.warn(e.message);};xmp.ImageRetriever.prototype._onDelayedStart=function(Fc,Gc){var Hc="";try{this.startDelayTimer.stop();this.startDelayTimer=null;this._handleStart();}
catch(e){this._handleError("Starting after delay.",e);}};xmp.ImageRetriever.prototype._newCacheId=function(){return"cacheID="+this.cacheID++;};xmp.ServiceRegistry=function(){var Ic={};return{getService:function(Jc){if(!Jc){throw new xmp.util.internals.InvalidArgsError("Missing service name.");}
if(!this.services){this.services={};}
var Kc=this.services[Jc];if(Kc){return Kc;}
if(Jc===xmp.CONTROL_STREAM_SERVICE){Kc=new xmp.ControlStream();this.services[Jc]=Kc;return Kc;}
else if(Jc===xmp.IMAGE_RETRIEVER_SERVICE){Kc=new xmp.ImageRetriever();this.services[Jc]=Kc;return Kc;}
throw new xmp.ServiceError("Retrieving service.","Unable to create service \""+Jc+"\".");},init:function(Lc,Ic){var Mc=Ic.length;for(var i=0;i<Mc;i++){this.getService(Ic[i]).init(Lc);}},fini:function(){for(var Nc=xmp.MapIterator.create(this.services);Nc.hasNext();Nc.next()){var Oc=Nc.currentValue();Oc.fini();}}};}();xmp.ControlStreamError=function(Pc,Qc){xmp.ControlStreamError.ctor.call(this,"ControlStreamError",Pc,Qc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ControlStreamError);xmp.ControlStreamReaderError=function(Rc,Sc){xmp.ControlStreamReaderError.ctor.call(this,"ControlStreamReaderError",Rc,Sc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ControlStreamReaderError);xmp.ImageRetrieverError=function(Tc,Uc){xmp.ImageRetrieverError.ctor.call(this,"ImageRetrieverError",Tc,Uc);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.ImageRetrieverError);

xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.Bootstrapper=function(){this._boot_state=0;this._callbackObj=null;};xmp.baseplayer.Bootstrapper.prototype.init=function(){this._addSystemLoggerListeners();};xmp.baseplayer.Bootstrapper.prototype.isNew=function(){return(this._boot_state===0);};xmp.baseplayer.Bootstrapper.prototype.isOk=function(){return(this._boot_state===1);};xmp.baseplayer.Bootstrapper.prototype.bootStrap=function(aa){this._boot_state=-1;this._callbackObj=aa;var cb=new xmp.util.Callback('adServiceCallback',this.p_onAdServiceInit,this);xmp.net.AdService.i_getInstance().i_init(cb,30000);};xmp.baseplayer.Bootstrapper.prototype.p_onAdServiceInit=function(){var cb=new xmp.util.Callback('Bootstrapper_bootStrap',this._onBootStrap,this);xmp.net.AjaxRequestManager.getInstance().init(cb);};xmp.baseplayer.Bootstrapper.prototype._onInternalUserDetectionInited=function(ba){this._boot_state=1;this._callbackObj.handleBootstrappedInternal(null);};xmp.baseplayer.Bootstrapper.prototype._onBootStrap=function(ca,da){if(da==='Ready'){this._boot_state=0;var ea=new xmp.util.Callback('Bootstrapper._onInternalUserDetectionInited',this._onInternalUserDetectionInited,this);xmp.InternalUserDetection.getInstance().init(ea);}
else{this._boot_state=-1;this._callbackObj.handleBootstrappedInternal(da);}};xmp.baseplayer.Bootstrapper.prototype._addSystemLoggerListeners=function(){var fa=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var ga=fa.getNodeForPath('Instrumentation');var ha=ga.getBoolean('enabled',false);if(ha===true){var ia=ga.getString('thresholdLevel','critical');var ja=xmp.util.LogLevels.fromString(ia);var ka=new xmp.baseplayer.InstrumentationLoggerListener(ja);xmp.util.Logger.getInstance().addListener(ka);}
var la=xmp.getQueryArgOpt('xmpErrorThreshold','fatal');var ma=xmp.util.LogLevels.fromString(la);ma=Math.min(xmp.util.LogLevels.WARN,ma);var na=new xmp.baseplayer.ErrorLoggerListener(ma);xmp.util.Logger.getInstance().addListener(na);};xmp.baseplayer.Bootstrapper._cacheHtmlObjects=function(){var oa=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('CacheSlates');var pa=oa.retrieveKeys();for(var i=0;i<pa.length;i++){var qa=pa[i];var ra=oa.getString(qa,"").split(",");var sa=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(qa);sa.setIds(ra,null);sa.load();}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.AbstractNodeListener=function(id,ta){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE],"AbstractNodeListener.ctor");if(id===null||id.length===0||ta===null){throw new xmp.util.internals.InvalidArgsError("The 'id' argument must be non-empty, "+"and the 'player' argument must be non-null.");}
this._id=id;this._player=ta;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.getId=function(){return this._id;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.getPlayer=function(){return this._player;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.canUserControl=function(ua){return true;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleInitialize=function(va){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleDynamicRules=function(wa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleComplete=function(xa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.canCompleteNow=function(ya){return true;};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleCompleteAsynch=function(za,Aa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleRender=function(Ba){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleOpen=function(Ca){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleConnecting=function(Da){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleConnected=function(Ea){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handlePlay=function(Fa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleFirstFrameRendered=function(Ga){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handlePause=function(Ha){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleStop=function(Ia){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleRewind=function(Ja){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleFastForward=function(Ka){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleSeekable=function(La){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleEnded=function(Ma){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleBuffering=function(Na,Oa){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleTimelineChange=function(Pa,Qa,Ra){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleError=function(Sa,e){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleOverrideAdResources=function(Ta,Ua){};xmp.baseplayer.listeners.AbstractNodeListener.prototype.handleValidate=function(Va){};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultBaseNodeListener=function(Wa,Xa){xmp.baseplayer.listeners.DefaultBaseNodeListener.ctor.call(this,Wa,Xa);this._bnl_logger=new xmp.util.internals.CategoryLogger('DefaultBaseNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.DefaultBaseNodeListener);xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleRender=function(Ya){this.getPlayer().getMediaPlayer().open(Ya);};xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleEnded=function(Za){this.getPlayer().advance();};xmp.baseplayer.listeners.DefaultBaseNodeListener.prototype.handleError=function($a,e){this._bnl_logger.warn("Dropping node: "+$a.getBestId()+', error: '+xmp.extractErrorMessage(e));this.getPlayer().advance();};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultSlateNodeListener=function(ab,bb){xmp.baseplayer.listeners.DefaultSlateNodeListener.ctor.call(this,ab,bb);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultSlateNodeListener);xmp.baseplayer.listeners.DefaultSlateNodeListener.prototype.handleInitialize=function(db){var eb=db.getMetadata("url","");if(eb.length>0){db.setURI(eb);}
db.setMimeType(xmp.DHTML_MIME_TYPE);};xmp.baseplayer.listeners.DefaultSlateNodeListener.prototype._findNextContentNode=function(){var fb=this.getPlayer().getLookAheadNodeArray();for(var i=0;i<fb.length;i++){var gb=fb[i];if(gb.isContentType()){return gb;}}
return null;};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.TriggerNodeListener=function(id,hb){xmp.baseplayer.listeners.internal.TriggerNodeListener.ctor.call(this,id,hb);this.tracked_midpoint=false;this.live=false;};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.TriggerNodeListener);xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleRender=function(ib){this.tracked_midpoint=false;this.live=(ib.getStreamingMode()==='live');if(false===this.live){xmp.util.TriggerHelper.handleTrackRequest(ib,this.getPlayer());}
xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleRender.call(this,ib);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleOpen=function(jb){this.tracked_midpoint=false;this.live=(jb.getStreamingMode()==='live');xmp.util.TriggerHelper.handleTrackStart(jb,this.getPlayer());xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleOpen.call(this,jb);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleEnded=function(kb){if(false===this.live){xmp.util.TriggerHelper.handleTrackEnd(kb,this.getPlayer());}
xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleEnded.call(this,kb);};xmp.baseplayer.listeners.internal.TriggerNodeListener.prototype.handleTimelineChange=function(lb,mb,nb){xmp.baseplayer.listeners.internal.TriggerNodeListener.base.handleTimelineChange.call(this,lb,mb,nb);if(false===this.live&&false===this.tracked_midpoint){if(nb===0){return;}
var ob=(((lb.getTimeLimitInSeconds()!==xmp.NO_TIME_LIMIT)?lb.getTimeLimitInSeconds():nb)/2);if(mb>=ob){xmp.util.TriggerHelper.handleTrackMidpoint(lb,this.getPlayer());this.tracked_midpoint=true;}}};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.AdResNodeListener=function(id,pb){xmp.baseplayer.listeners.internal.AdResNodeListener.ctor.call(this,id,pb);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.AdResNodeListener);xmp.baseplayer.listeners.internal.AdResNodeListener.prototype.canCompleteNow=function(qb){var rb=qb.getMetaResourceBundle();if(rb.isError()||rb.isLoaded()){this._handleResBundleLoaded(qb,rb);}
if(rb.isError()){return true;}
return rb.isLoaded();};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype.handleCompleteAsynch=function(sb,tb){var ub=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('videoAdMetaLoader','videoAdMeta');var vb=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create(ub);var wb=new xmp.util.Callback('gotAdCallback',this._gotAdCallback,this);wb.setMetadata('RelayCallback',tb);wb.setMetadata('theNode',sb);vb.setResBundle(sb.getMetaResourceBundle(),wb);vb.load();};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype._gotAdCallback=function(xb,yb){var zb=xb.getMetadata('RelayCallback',{});var Ab=xb.getMetadata('theNode',{});this._handleResBundleLoaded(Ab,yb);zb.call(Ab);};xmp.baseplayer.listeners.internal.AdResNodeListener.prototype._handleResBundleLoaded=function(Bb,Cb){};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.GenericMetaFileLoader=function(Db,Eb,Fb,Gb,Hb,Ib,Jb){this._THIS_TYPE=Db;this._THIS_LOADER_TYPE=Eb;this._CONTENT_TYPE=Fb;this._APP_ERROR_TYPE=Gb;this._MAX_CACHE_TIME=Hb;this._logger=new xmp.util.internals.CategoryLogger(this._THIS_LOADER_TYPE);this._owner=Ib;this._loaderId=Jb;this._handleArray=[];this._handleMap={};this._perIdCallback=null;this._allLoadedCallback=null;this._loadedCount=0;this._loadCalled=false;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.setIds=function(Kb,Lb){this._loadCalled=false;this._handleArray=[];this._perIdCallback=Lb;var Mb={};for(var i=0;i<Kb.length;i++){var id=Kb[i];if(!(typeof id==='string'&&id.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'ids' argument must be an array of non-empty strings.");}
if(typeof Mb[id]!=='undefined'){this._logger.warn('Skipping duplicate ID: '+id);continue;}
Mb[id]=id;var Nb=xmp.baseplayer.internals.MetaFileCache.getInstance().findOrCreate(this._THIS_TYPE,id,this,this._MAX_CACHE_TIME);var Ob={h:Nb,ready:false};this._handleArray.push(Ob);this._handleMap[Nb.getId()]=Ob;}
return this._extractLoadableDataArray();};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.setAllLoadedCallback=function(Pb){this._allLoadedCallback=Pb;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype.load=function(){this._loadCalled=true;if(this._handleArray.length===0){this._releaseThis();this._notifyAllLoaded();return;}
this._loadedCount=0;for(var i=0;i<this._handleArray.length;i++){var Qb=this._handleArray[i];if(Qb.ready){this._notifyPerFile(Qb.h);}}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._extractLoadableDataArray=function(){var Rb=[];for(var i=0;i<this._handleArray.length;i++){var Sb=this._handleArray[i].h;Rb.push(Sb.getDataObject());}
return Rb;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyPerFile=function(Tb){if(Tb.isLoaded()){this._loadedCount++;this._notifyPerFileCore(Tb);}
if(this._loadedCount>=this._handleArray.length){this._releaseThis();this._notifyAllLoaded();}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._releaseThis=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyPerFileCore=function(Ub){try{if(this._perIdCallback!==null){this._perIdCallback.call(Ub.getDataObject());}}
catch(e){this._logger.warn('Error calling per-file-callback',e);}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyAllLoaded=function(){try{if(this._allLoadedCallback!==null){this._allLoadedCallback.call();}}
catch(e){this._logger.warn('Error calling all-loaded-callback',e);}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._notifyFileRequestLoaded=function(Vb){if(this._loadCalled){this._notifyPerFile(Vb);}
else{var Wb=this._handleMap[Vb.getId()];if(Wb.h!==Vb){throw new Error('Unexpected, handles not the same reference.');}
Wb.ready=true;}};xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable=function(id){xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable.ctor.call(this);this._id=id;};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable);xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable.prototype.getLoadableId=function(){return this._id;};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._createLoadable=function(id){return(new xmp.baseplayer.internals.GenericMetaFileLoader.GenericLoadable(id));};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._loadFileRequest=function(Xb){var Yb=null;try{Yb=this._createLoadable(Xb.getId());Xb._setDataObject(Yb);var Zb=new xmp.util.Callback(this._THIS_LOADER_TYPE+'_'+this.getLoaderId()+'_'+Xb.getId(),this._handleAjaxResponse,this);var $b=xmp.net.AjaxRequestManager.getInstance();Zb.setMetadata('handle',Xb);$b.request(Xb.getId(),Zb,Xb.getType(),Xb.getId(),this._CONTENT_TYPE,null);return xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}
catch(e){try{if(Yb!==null){Yb._setErrorMessage(xmp.extractErrorMessage(e));}}
catch(e2){this._logger.warn('Second chance error handling created file request',e2);}
throw e;}};xmp.baseplayer.internals.GenericMetaFileLoader.prototype._handleAjaxResponse=function(ac,bc){var cc=ac.getMetadata('handle',{});var dc=cc.getDataObject();if(!bc.isError()){if(xmp.net.ContentTypes.JSON===this._CONTENT_TYPE){dc._setRawData(bc.getJsonObject());}
else{if(xmp.net.ContentTypes.TEXT!==this._CONTENT_TYPE){throw new Error('Unexpected content type');}
dc._setRawData(bc.getText());}}
else{var ec=new xmp.baseplayer.ApplicationError(bc.getErrorObject(),this._APP_ERROR_TYPE,this._THIS_TYPE,[{label:'url',text:bc.getFullUrl()}]);this._logger.warn(ec.message,ec);cc._setErrorMessage(bc.getErrorMessage());dc._setErrorMessage(bc.getErrorMessage());}
cc._setAsLoaded();};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.AppErrorCodes=function(){};xmp.baseplayer.AppErrorCodes.data=[];xmp.baseplayer.AppErrorCodes.data.badAdPolicy='Ad policy not found';xmp.baseplayer.AppErrorCodes.data.badAdPattern='Bad ad pattern';xmp.baseplayer.AppErrorCodes.data.FailToGetAdPattern='Failed to get the "ad pattern" JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.RulesNotDownLoaded='Failed to get the "rules JavaScript" file:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JS file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JS host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingContent='Missing content';xmp.baseplayer.AppErrorCodes.data.FailToGetDhtmlObject='Failed to load the DHTML object:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid DHTML object exists at the specified location.  Also, make sure that the required cross-domain XML file on the DHTML host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingAd='Failed to get the ad:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid ad file exists at the specified location.  Also, make sure that the required cross-domain XML file on the ad host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.badAdJson='Bad ad JSON';xmp.baseplayer.AppErrorCodes.data.FailToGetAdVideo='Failed to get the ad video:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid ad-video file exists at the specified location.  Also, make sure that the required cross-domain XML file on the ad-video host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.missingVideoJson='Failed to get the video JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.FailToGetVideoJson='Failed to get the video JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.FailToGetPromoJson='Failed to get the promo JSON:  Make sure that the corresponding value for "rootUrl" in primary.js is correct, and that a valid JSON file exists at the specified location.  Also, make sure that the required cross-domain XML file on the JSON host has the needed site entry.';xmp.baseplayer.AppErrorCodes.data.badVideoJson='Exception caught during "all loaded" notification.  The video JSON might be invalid.';xmp.baseplayer.AppErrorCodes.data.mediaPlayerError='Media-player error';xmp.baseplayer.AppErrorCodes.data.badInitialFlashObject='Timed out initializing Flash:  Make sure that the corresponding value for "rootUrl" in primary.js is correct for the initial Flash object.  Also, make sure that the Flash plug-in is installed and that the installation is not corrupted.';xmp.baseplayer.AppErrorCodes.getDescription=function(fc){var gc=xmp.baseplayer.AppErrorCodes.data[fc];if(gc===null){gc='Unknown error: '+fc;}
return gc;};xmp.baseplayer.ApplicationError=function(e,hc,ic,jc){var kc=xmp.baseplayer.AppErrorCodes.getDescription(hc);xmp.baseplayer.ApplicationError.ctor.call(this,"ApplicationError",ic,kc,jc);this.setInnerError(e);};xmp.DERIVE_CLASS(xmp.util.internals.XMPError,xmp.baseplayer.ApplicationError);xmp.baseplayer.ApplicationError.prototype.getInnerError=function(){return this.innerError;};xmp.baseplayer.ApplicationError.prototype.getMessage=function(){return this.message;};xmp.baseplayer.ApplicationError.prototype.getContext=function(){return this.context;};xmp.baseplayer.ApplicationError.prototype.getExtendedInfo=function(){return this.extendedInfo;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.BasePlayer=function(id,lc,mc){xmp.util.LogConfigurator.configure();if(xmp.baseplayer.BasePlayer._singleInstance!==null){throw new Error('Only one instance of BasePlayer allowed per browser session.');}
this._nextPlayListContextKey=1;this._playListContextCollection={};this._currentPlayListContext=null;this._logger=new xmp.util.internals.CategoryLogger('BasePlayer');this._id=id;xmp.baseplayer.BasePlayer._playerMap[this.getId()]=this;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(lc);this._parameters=mc;this._mediaPlayer=null;this._nlMap=new xmp.baseplayer._NLMap(this);this._bootStrapper=xmp.baseplayer.BasePlayer._bootStrapper;this._bootStrapper.init();this._options=lc;xmp.baseplayer.BasePlayer._singleInstance=this;};xmp.baseplayer.BasePlayer._playerMap={};xmp.baseplayer.BasePlayer._singleInstance=null;xmp.baseplayer.BasePlayer._bootStrapper=new xmp.baseplayer.Bootstrapper();xmp.baseplayer.BasePlayer._fatalException=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer','not boostrapped yet');xmp.baseplayer.BasePlayer.prototype.getAbsoluteURI=function(nc,oc){if(nc.length>0&&nc.charAt(0)==='/'){var pc="http://"+window.location.host;var qc=pc;if(typeof oc!=='undefined'&&oc!=='defaultRoot'){qc=xmp.util.RootUrlProvider.getInstance().getRootUrl(oc,pc);}
nc=qc+nc;}
return nc;};xmp.baseplayer.BasePlayer.findPlayer=function(id){var rc=xmp.baseplayer.BasePlayer._playerMap[id];return(!rc)?null:rc;};xmp.baseplayer.BasePlayer.configure=function(sc,tc){var uc=[xmp.internal_settings_pref_api];uc=uc.concat(sc);xmp.util.SettingsManager.getInstance().init(uc,tc);var vc=xmp.util.internals.MockTestMode.getInstance();if(vc.isActive()){vc.configure();}};xmp.baseplayer.BasePlayer.prototype.bootStrap=function(){try{if(!this._bootStrapper.isNew()){throw new Error('Already tried to bootstrap.');}
var wc=xmp.baseplayer.BasePlayer._fatalException;xmp.PlayerPolicy.validateBootstrap(this);if(wc===xmp.baseplayer.BasePlayer._fatalException){this._bootStrapper.bootStrap(this);}
else{this.handleBootstrapped(false);}}
catch(e){this.handleBootstrappedInternal(e);}};xmp.baseplayer.BasePlayer.prototype.fini=function(){if(this._mediaPlayer!==null){this._mediaPlayer.fini();this._mediaPlayer=null;}
xmp.ServiceRegistry.fini();};xmp.baseplayer.BasePlayer.prototype.getId=function(){return this._id;};xmp.baseplayer.BasePlayer.prototype.getMediaPlayer=function(){return this._mediaPlayer;};xmp.baseplayer.BasePlayer.prototype.getLookAheadNodeArray=function(){return this._getCurCtx('getLookAheadNodeArray').getLookAheadNodeArray();};xmp.baseplayer.BasePlayer.prototype.getLookBehindNodeArray=function(){return this._getCurCtx('getLookBehindNodeArray').getLookBehindNodeArray();};xmp.baseplayer.BasePlayer.prototype.getMetadata=function(xc,yc){return this._metadataMap._get(xc,yc);};xmp.baseplayer.BasePlayer.prototype.setPlayerContext=function(zc){xmp.util.PlayerStats.getInstance().setValue('playerContext',zc);xmp.util.SettingsManager.getInstance().setContext(zc);xmp.baseplayer.Bootstrapper._cacheHtmlObjects();};xmp.baseplayer.BasePlayer.prototype.createPlayListContext=function(Ac){this._checkXmpState();this._faultMediaPlayer();var Bc=this._getAdPatternRelPath(Ac);var Cc=this._getContextParameters();Cc=Cc.concat(this._parameters);var Dc=this._createPlayListContext(Bc,Cc);this._setCurrentPlayListContext(Dc);var Ec=Dc.getKey();if(this._logger.isDebugEnabled()){this._logger.debug("Created new playlist, key = "+Ec);Dc.debugPrint("Initial State");}
return Ec;};xmp.baseplayer.BasePlayer.prototype.loadContent=function(Fc,Gc){this._checkXmpState();return this._getCurCtx('loadContent').loadContent(Fc,(Gc?Gc:''));};xmp.baseplayer.BasePlayer.prototype.load=function(Hc,Ic,Jc){this._logger.warn('Method "BasePlayer.load" is deprecated, please change code to no longer use this method.');var Kc=this.createPlayListContext(Jc);this.loadContent(Hc,Ic);return Kc;};xmp.baseplayer.BasePlayer.prototype.loadItem=function(Lc,Mc,Nc){this._faultMediaPlayer();var Oc=this._createPlayableNode(Lc,Mc,Nc);var Pc=this._getNodeListener(Oc);Pc.handleInitialize(Oc);Pc.handleValidate(Oc);Pc.handleComplete(Oc);Pc.handleRender(Oc);};xmp.baseplayer.BasePlayer.prototype._createPlayableNode=function(Qc,Rc,Sc){var Tc=new xmp.util.PlayableNode();Tc._setNodeType(new xmp.playlistapi.internals.RuleSetPlayableNodeType(null,Qc,Qc,[],{}));if(Rc){if(Rc.url){Tc.setURI(Rc.url);}
Tc._setData(((Rc.metadata)?Rc.metadata:new xmp.util.PlayableData('DEFAULT')));}
if(Sc){var Uc=Sc.length;for(var i=0;i<Uc;i++){Tc.setMetadata(Sc[i].name,Sc[i].value);}}
return Tc;};xmp.baseplayer.BasePlayer.prototype._getAdPatternRelPath=function(Vc){var Wc='';var Xc=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer/ad patterns');if(typeof(Vc)==='undefined'){var Yc=Xc.retrieveKeys();if(Yc.length>0){Wc=Xc.getString(Yc[0],'');}}
else{if(!xmp.isNonEmptyString(Vc)){throw new xmp.util.internals.InvalidArgsError('The adPatternKey parameter must be a non-empty string');}
Wc=Xc.getString(Vc,'');}
if(!xmp.isNonEmptyString(Wc)){throw new xmp.util.internals.InvalidArgsError('Failed to find ad pattern relative URL.');}
return Wc;};xmp.baseplayer.BasePlayer.prototype._createPlayListContext=function(Zc,$c){var ad=this._nextPlayListContextKey++;var bd=new xmp.baseplayer._PLCtx(ad,this,Zc,$c);this._playListContextCollection[ad]=bd;return bd;};xmp.baseplayer.BasePlayer.prototype.switchPlayList=function(cd){var dd=this._playListContextCollection[cd];if(!dd){throw new xmp.util.internals.InvalidArgsError(""+cd+" is not a valid playlist context key");}
else{if(this._logger.isDebugEnabled()){this._logger.debug("Switching playlist context:");this._currentPlayListContext.debugPrint("old context");this._setCurrentPlayListContext(dd);this._currentPlayListContext.debugPrint("new context");}
this._tryRender();}};xmp.baseplayer.BasePlayer.prototype.hasPlayListContext=function(){return this._currentPlayListContext!==null;};xmp.baseplayer.BasePlayer.prototype._setCurrentPlayListContext=function(ed){if(this._currentPlayListContext){this._currentPlayListContext.setStateListener(null);}
this._currentPlayListContext=ed;this._currentPlayListContext.setStateListener(this);};xmp.baseplayer.BasePlayer.prototype._getCurCtx=function(fd){if(!this._currentPlayListContext){throw new Error('BasePlayer.'+fd+": Cannot perform operation because playlist context has not been set. Call load() first.");}
return this._currentPlayListContext;};xmp.baseplayer.BasePlayer.prototype.appendToPlayList=function(gd,hd){this._checkXmpState();return this._getCurCtx('appendToPlayList').appendToPlayList(gd,((hd)?hd:false));};xmp.baseplayer.BasePlayer.prototype.removeFromPlayList=function(jd){this._checkXmpState();return this._getCurCtx('removeFromPlayList').removeFromPlayList(jd);};xmp.baseplayer.BasePlayer.prototype.insertInPlayList=function(kd,ld,md){this._checkXmpState();return this._getCurCtx('insertInPlayList').insertInPlayList(kd,ld,((md)?md:false));};xmp.baseplayer.BasePlayer.prototype.moveWithinPlayList=function(nd,od,pd){this._checkXmpState();return this._getCurCtx('moveWithinPlayList').moveWithinPlayList(nd,od,((pd)?pd:false));};xmp.baseplayer.BasePlayer.prototype.setCurrentPlayListPosition=function(qd){this._checkXmpState();return this._getCurCtx('setCurrentPlayListPosition').setCurrentPlayListItem(qd);};xmp.baseplayer.BasePlayer.prototype.getCurrentPlayListItem=function(){return this._getCurCtx('getCurrentPlayListItem').getCurrentPlayListItem();};xmp.baseplayer.BasePlayer.prototype.getPlayListItemCount=function(){return this._getCurCtx('getPlayListItemCount').getPlayListItemCount();};xmp.baseplayer.BasePlayer.prototype.getPlayListItem=function(rd){return this._getCurCtx('getPlayListItem').getPlayListItem(rd);};xmp.baseplayer.BasePlayer.prototype.findPlayListItem=function(sd){return this._getCurCtx('findPlayListItem').findPlayListItem(sd);};xmp.baseplayer.BasePlayer.prototype.findPlayListItemIndex=function(td){return this._getCurCtx('findPlayListItemIndex').findPlayListItemIndex(td);};xmp.baseplayer.BasePlayer.prototype.advance=function(){this._checkXmpState();this._getCurCtx('advance').advance();};xmp.baseplayer.BasePlayer.prototype.onAdvance=function(){this._tryRender();};xmp.baseplayer.BasePlayer.prototype._tryRender=function(){if(this._isReady()){var ud=this._currentPlayListContext.getCurrentNode();if(ud){this._renderNode(ud,true);}}};xmp.baseplayer.BasePlayer.prototype.registerNodeListener=function(vd,wd){this._nlMap._registerNodeListener(vd,wd);};xmp.baseplayer.BasePlayer.prototype._initServices=function(xd){if(xd.services){xmp.ServiceRegistry.init(this,xd.services);}};xmp.baseplayer.BasePlayer.prototype.handlePlayListStarted=function(){this._logger.info('PlayList started, override "handlePlayListStarted" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handlePlayListEnded=function(){this._logger.info('PlayList ended, override "handlePlayListEnded" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handlePlayListModified=function(yd){this._logger.info('PlayList modified, override "handlePlayListModified" to do specific handling.');};xmp.baseplayer.BasePlayer.prototype.handleMediaPlayerReady=function(){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleCreateViewport=function(zd,Bd,Cd,Dd){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleDestroyViewport=function(Ed,Fd){var Gd=xmp.findDomElement(Fd);if(Gd){var Hd=xmp.getDomParent(Gd);Hd.removeChild(Gd);}};xmp.baseplayer.BasePlayer.prototype.handleFatalException=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleBootstrapped=function(Id){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.handleRegisterNodeListeners=function(){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamError=function(e){this.handleControlStreamError(e);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamError=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamTriggerInit=function(Jd,Kd){this.handleControlStreamTriggerInit(Jd,Kd);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamTriggerInit=function(Ld,Md){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onControlStreamTrigger=function(Nd,Od){this.handleControlStreamTrigger(Nd,Od);};xmp.baseplayer.BasePlayer.prototype.handleControlStreamTrigger=function(Pd,Qd){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onRetrieveImage=function(Rd,Sd){this.handleRetrieveImage(Rd,Sd);};xmp.baseplayer.BasePlayer.prototype.handleRetrieveImage=function(Td,Ud){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype.onImageRetrieverError=function(e){this.handleImageRetrieverError(e);};xmp.baseplayer.BasePlayer.prototype.handleImageRetrieverError=function(e){this._throwMustOverrideError();};xmp.baseplayer.BasePlayer.prototype._throwMustOverrideError=function(){throw new xmp.playlistapi.internals.PlayListError('Not implemented, must override.');};xmp.baseplayer.BasePlayer.prototype._getNodeListener=function(Vd){return this._nlMap._getNodeListener(Vd);};xmp.baseplayer.BasePlayer.prototype._faultMediaPlayer=function(){if(this._mediaPlayer===null){this._createMediaPlayer();}};xmp.baseplayer.BasePlayer.prototype._createMediaPlayer=function(){this._mediaPlayer=xmp.MediaPlayerFactory.createPlayer(this.getId(),this);this._mediaPlayer.init();};xmp.baseplayer.BasePlayer.prototype.onInitialized=function(){this.handleMediaPlayerReady();this.handleRegisterNodeListeners();};xmp.baseplayer.BasePlayer.prototype.onTimelineChange=function(Wd,Xd,Yd){this._getNodeListener(Wd).handleTimelineChange(Wd,Xd,Yd);};xmp.baseplayer.BasePlayer.prototype.onStateChange=function(Zd,$d,ae){switch($d){case xmp.OPEN:this._getNodeListener(Zd).handleOpen(Zd);break;case xmp.CONNECTING:this._getNodeListener(Zd).handleConnecting(Zd);break;case xmp.CONNECTED:this._getNodeListener(Zd).handleConnected(Zd);break;case xmp.PLAY:this._getNodeListener(Zd).handlePlay(Zd);break;case xmp.PAUSE:this._getNodeListener(Zd).handlePause(Zd);break;case xmp.STOP:this._getNodeListener(Zd).handleStop(Zd);break;case xmp.REWIND:this._getNodeListener(Zd).handleRewind(Zd);break;case xmp.FAST_FORWARD:this._getNodeListener(Zd).handleFastForward(Zd);break;case xmp.SEEKABLE:this._getNodeListener(Zd).handleSeekable(Zd);break;case xmp.ENDED:this._getNodeListener(Zd).handleEnded(Zd);break;case xmp.FIRST_FRAME_RENDERED:this._getNodeListener(Zd).handleFirstFrameRendered(Zd);break;case xmp.BUFFERING:this._getNodeListener(Zd).handleBuffering(Zd,ae);break;default:this._logger.warn('Unrecognized media player state: '+$d);break;}};xmp.baseplayer.BasePlayer.prototype.onError=function(be,e){this._getNodeListener(be).handleError(be,e);};xmp.baseplayer.BasePlayer.prototype.onCreateViewport=function(ce,de,ee,fe){return this.handleCreateViewport(ce,de,ee,fe);};xmp.baseplayer.BasePlayer.prototype.onDestroyViewport=function(ge,he){this.handleDestroyViewport(ge,he);};xmp.baseplayer.BasePlayer.prototype.onPlugInError=function(e){this._raiseFatalException(e);};xmp.baseplayer.BasePlayer.prototype.onUnsupportedPlatformError=function(e){this._raiseFatalException(e);};xmp.baseplayer.BasePlayer.prototype._getContextParameters=function(){var je=[];var ke=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('pattern parameters');var le=ke.retrieveKeys();for(var i=0;i<le.length;i++){var me=le[i];je.push({name:me,value:ke.getString(me,'')});}
return je;};xmp.baseplayer.BasePlayer.prototype._isReady=function(){return(this._currentPlayListContext!==null);};xmp.baseplayer.BasePlayer.prototype.handleInitializePlayableNode=function(ne){this._getNodeListener(ne).handleInitialize(ne);this._getNodeListener(ne).handleDynamicRules(ne);};xmp.baseplayer.BasePlayer.prototype._isStillCurrentNode=function(oe){var pe=this._currentPlayListContext.getCurrentNode();return(oe===pe);};xmp.baseplayer.BasePlayer.prototype._gotAsynchCompleteCallback=function(qe,se){if(this._isStillCurrentNode(se)){this._renderNode(se,false);}};xmp.baseplayer.BasePlayer.prototype._renderNode=function(te,ue){var ve=null;try{ve=this._getNodeListener(te);if(ue){this._overrideAdRes(ve,te);}
if(!this._isStillCurrentNode(te)){return;}
if(ve.canCompleteNow(te)){if(te.getPlayableData().isError()){ve.handleError(te,te.getPlayableData().getError());return;}
ve.handleValidate(te);ve.handleComplete(te);var we=xmp.util.internals.MockTestMode.getInstance();if(we.isActive()){we.overrideMimeType(te);}
if(!this._isStillCurrentNode(te)){return;}
te.getPlayableData().setRuntimeMetadata('history_played',true);ve.handleRender(te);}
else{if(!ue){throw new Error('_renderNode: prevent infinite loop');}
var xe=new xmp.util.Callback('gotAsynchCompleteCallback',this._gotAsynchCompleteCallback,this);ve.handleCompleteAsynch(te,xe);}}
catch(e){this._logger.warn("Error rendering node: "+te.getBestId(),e);try{ve.handleError(te,e);}
catch(e2){this._logger.warn("Error calling handleError for node: "+te.getBestId(),e2);}}};xmp.baseplayer.BasePlayer.prototype._overrideAdRes=function(ye,ze){var pm=ze.getMetadata('__DIRECTIVE_PARAMETER_MAP__',xmp.util.internals.MetadataMap.defaultObj);if(pm===xmp.util.internals.MetadataMap.defaultObj){pm=this._getCurCtx('_overrideAdRes')._xmpPlayList._getParameterMapInternal().clone();pm.addContextObject('node',ze.getNodeType().getDataObject());}
var Ae=new xmp.playlistapi.AdResourceOverrideContext(ze,pm);ye.handleOverrideAdResources(ze,Ae);};xmp.baseplayer.BasePlayer.prototype.registerRuleClass=function(Be,Ce){this._getCurCtx('registerRuleClass').registerRuleClass(Be,Ce);};xmp.baseplayer.BasePlayer.prototype._checkXmpState=function(){if(xmp.baseplayer.BasePlayer._fatalException!==null){throw new Error('XMP in bad state: '+xmp.extractErrorMessage(xmp.baseplayer.BasePlayer._fatalException));}};xmp.baseplayer.BasePlayer.prototype._raiseFatalException=function(e){try{var De=null;if(e instanceof xmp.FatalException){De=e;}
else{De=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer',xmp.extractErrorMessage(e));}
xmp.baseplayer.BasePlayer._fatalException=De;this._logger.fatal('fatal exception',De);this.handleFatalException(De);}
catch(secondE){xmp.showFatalErrorMessage('Second chance exception while raising fatal exception: '+xmp.extractErrorMessage(secondE));}};xmp.baseplayer.BasePlayer._staticHandleFatalEx=function(cb,e){if(xmp.baseplayer.BasePlayer._singleInstance!==null){xmp.baseplayer.BasePlayer._singleInstance._raiseFatalException(e);}
else{xmp.showFatalErrorMessage(xmp.extractErrorMessage(e));}};xmp.fatalErrorCallback=new xmp.util.Callback('BasePlayer_fatalErrorCallback',xmp.baseplayer.BasePlayer._staticHandleFatalEx,null);xmp.baseplayer.BasePlayer.prototype.handleBootstrappedInternal=function(ex){xmp.baseplayer.BasePlayer._fatalException=null;if(ex===null){try{this._doAfterBootstrap();}
catch(afterEx){this._raiseFatalException(afterEx);ex=afterEx;}}
else{this._raiseFatalException(ex);}
this.handleBootstrapped((ex===null)?true:false);};xmp.baseplayer.BasePlayer.prototype._doAfterBootstrap=function(){this._initServices(this._options);};xmp.baseplayer.BasePlayer.prototype.seek=function(){var Ee=this.getMediaPlayer().getPosition();var Fe=this.getMediaPlayer().getDuration();if((Ee+10)>Fe){if((Ee-10)<0){this.getMediaPlayer().seek(0);}
else{this.getMediaPlayer().seek(Ee-10);}}
else{this.getMediaPlayer().seek(Ee+10);}};xmp.baseplayer.BasePlayer.prototype.setVolume=function(){var Ge=this.getMediaPlayer().getVolume();if((Ge+10)>100){Ge=0;}
else{Ge=Ge+10;}
this.getMediaPlayer().setVolume(Ge);};xmp.baseplayer.BasePlayer.prototype.play=function(){this.getMediaPlayer().getViewport().hideOverlays(xmp.ALL_OVERLAYS);this.getMediaPlayer().play();};xmp.baseplayer.BasePlayer.prototype.pause=function(){this.getMediaPlayer().pause();};xmp.baseplayer.BasePlayer.prototype.stop=function(){this.getMediaPlayer().stop();};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.EmbeddedConsoleLoggerListener=function(He,Ie,Je,Ke,Le,Me){if(xmp.baseplayer.EmbeddedConsoleLoggerListener._instance!==null){throw new Error('Can have only one instance of EmbeddedConsoleLoggerListener.');}
xmp.baseplayer.EmbeddedConsoleLoggerListener.ctor.call(this,He);xmp.baseplayer.EmbeddedConsoleLoggerListener._instance=this;this._ID_PREFIX='xmp_ec_';var Ne=xmp.util.Logger.getInstance();Ne.addListener(this);Ne.setCategoryFilterArray(Ie);this._consoleDivContainerId=(Me)?Me:null;this._consoleVisible=Je;this._logAreaVisible=true;this._logAreaDims={};this._logAreaDims.h=Ke;this._logAreaDims.w=Le;this._messageQueue=[];this._createLogArea();this.showConsole(this._consoleVisible);};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.EmbeddedConsoleLoggerListener);xmp.baseplayer.EmbeddedConsoleLoggerListener.create=function(Oe){var Pe=xmp.util.LogLevels.fromString(xmp.getQueryArgOpt('xmpLog','none'));if(Pe===xmp.util.LogLevels.NONE){return null;}
var Qe=new xmp.baseplayer.EmbeddedConsoleLoggerListener(Pe,Oe.exCats,(Pe!==xmp.util.LogLevels.NONE),Oe.h,Oe.w,Oe.cId);return Qe;};xmp.baseplayer.EmbeddedConsoleLoggerListener._instance=null;xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance=function(){return xmp.baseplayer.EmbeddedConsoleLoggerListener._instance;};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.showConsole=function(Re){this._consoleVisible=Re;var Se=window.document.getElementById(this._consoleDivContainerId);if(Se){Se.style.display=this._consoleVisible?'block':'none';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.isConsoleVisible=function(){return this._consoleVisible;};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.clearLogOutput=function(){var Te=window.document.getElementById(this._ID_PREFIX+'log_output_area');if(Te){Te.innerHTML='';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.toggleLogOutput=function(){var Ue=window.document.getElementById(this._ID_PREFIX+'log_output_area_scroll_clip');if(Ue){this._logAreaVisible=!this._logAreaVisible;Ue.style.display=this._logAreaVisible?'block':'none';}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype.handleLogMessage=function(Ve,We,Xe){try{var Ye='<span class="'+this._ID_PREFIX+xmp.util.LogLevels.stringify(Ve)+'_message">'+We+': '+xmp.escapeHtml(Xe,true,true)+'</span>';this._messageQueue.push(Ye);while(this._messageQueue.length>25){this._messageQueue.shift();}
var Ze=window.document.getElementById(this._ID_PREFIX+'log_output_area');if(Ze){while(this._messageQueue.length>0){var $e=this._messageQueue.shift();var p=window.document.createElement('P');p.innerHTML=$e;Ze.appendChild(p);}
var af=window.document.getElementById(this._ID_PREFIX+'log_output_area_scroll_clip');if(af){af.scrollTop=af.scrollHeight;}}}
catch(e){this._handleInternalError('Error in xmp.baseplayer.EmbeddedConsoleLoggerListener.handleLogMessage: '+xmp.extractErrorMessage(e));}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._handleInternalError=function(bf){xmp.showMessage(bf);};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._createLogArea=function(){var cf=null;if(this._consoleDivContainerId===null){this._consoleDivContainerId=this._ID_PREFIX+'DebugConsole';cf=window.document.createElement('div');cf.style.display='none';cf.id=this._consoleDivContainerId;xmp.insertDomChildBefore(window.document.body,cf);}
cf=window.document.getElementById(this._consoleDivContainerId);if(cf){cf.innerHTML=this._buildConsoleInnerHtml();}};xmp.baseplayer.EmbeddedConsoleLoggerListener.prototype._buildConsoleInnerHtml=function(){var df='BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; display: block; position:absolute; overflow:auto';df+=('; width:'+this._logAreaDims.w+'px');df+=('; height:'+this._logAreaDims.h+'px');var ih='';ih+='<div style="text-align:left; background-color:white; color:black; font-size: medium;">\n';if(xmp.addDynamicStyle('.'+this._ID_PREFIX+'fatal_message','{ font-weight: bold; color: #FF0000}')){xmp.addDynamicStyle('.'+this._ID_PREFIX+'critical_message','{ font-weight: bold; color: #FF0000}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'warn_message','{ color: #FF0000}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'info_message','{color: #009966}');xmp.addDynamicStyle('.'+this._ID_PREFIX+'debug_message','{color: #0000FF}');}
else{ih+='<style>\n';ih+='.'+this._ID_PREFIX+'fatal_message { font-weight: bold; color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'critical_message { font-weight: bold; color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'warn_message { color: #FF0000}\n';ih+='.'+this._ID_PREFIX+'info_message { color: #009966}\n';ih+='.'+this._ID_PREFIX+'debug_message { color: #0000FF}\n';ih+='</style>\n';}
ih+='<br>\n';ih+='<b>Logging</b>&nbsp;&nbsp;<INPUT TYPE="button" ID="'+this._ID_PREFIX+'ShowHideLogButton" VALUE="Show/Hide Log" onClick="xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance().toggleLogOutput();"\n';ih+='NAME="'+this._ID_PREFIX+'ShowHideLogButton"> &nbsp; <INPUT TYPE="button" ID="'+this._ID_PREFIX+'ClearLogButton" VALUE="Clear Log" onClick="xmp.baseplayer.EmbeddedConsoleLoggerListener.getInstance().clearLogOutput()"\n';ih+='NAME="'+this._ID_PREFIX+'ClearLogButton">&nbsp;&nbsp;\n';ih+='<br><i>(Log messages are color coded:\n';ih+='<span class="'+this._ID_PREFIX+'fatal_message">Fatal</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'critical_message">Critical</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'warn_message">Warning</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'info_message">Information</span>\n';ih+='-\n';ih+='<span class="'+this._ID_PREFIX+'debug_message">Debug</span>)\n';ih+='</i>\n';ih+='<br>\n';ih+='<br>\n';ih+='<div id="'+this._ID_PREFIX+'log_output_area_scroll_clip" style="'+df+'">\n';ih+='<div id="'+this._ID_PREFIX+'log_output_area">\n';ih+='</div>\n';ih+='</div>\n';ih+='</div>\n';return ih;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.ErrorLoggerListener=function(ef){xmp.baseplayer.ErrorLoggerListener.ctor.call(this,ef);};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.ErrorLoggerListener);xmp.baseplayer.ErrorLoggerListener.prototype.handleLog=function(ff,gf,hf,jf){if(ff>xmp.util.LogLevels.FATAL&&ff<=this.getLogLevel()){this.handleLogError(ff,gf,hf,jf);}};xmp.baseplayer.ErrorLoggerListener.prototype.handleLogError=function(kf,lf,mf,nf){try{var of=xmp.FatalException.createFatalException(xmp.XmpErrorCodes.FATAL_UNSPECIFIED_ERROR,'BasePlayer',xmp.extractErrorMessage(nf));xmp.baseplayer.BasePlayer._fatalException=of;if(nf instanceof xmp.baseplayer.ApplicationError){this.showError(mf,nf);}
xmp.util.Logger.getInstance().fatal("ErrorLogger",mf,nf);}
catch(secondE){xmp.showFatalErrorMessage('Second chance exception while raising fatal exception: '+xmp.extractErrorMessage(secondE));}};xmp.baseplayer.ErrorLoggerListener.prototype.showError=function(pf,qf){if(pf===null||pf===undefined){pf="Unknown error";}
var rf=pf;var sf="";if(qf instanceof xmp.baseplayer.ApplicationError){rf=qf.message;var ie=qf.getInnerError();if(ie!==null&&ie!==undefined){sf=ie.message;}}
if(xmp.isFirefoxBrowser()){this.showErrorFirefox(rf,sf);}
else{this.showErrorIE(rf,sf);}};xmp.baseplayer.ErrorLoggerListener.prototype.showErrorFirefox=function(tf,uf){var re=/[\n\f\r]/gm;tf=tf.replace(re,'<br/>');uf=uf.replace(re,'<br/>');var vf="width=500,height=400,toolbar=0,";vf+="status=0,menubar=0,scrollbars=1,resizable=0";var wf=window.open("","",vf);var xf=wf.document;xf.open();xf.writeln("<html><head>");xf.writeln("<title>Error</title>");xf.writeln("<script type='text/javascript'>");xf.writeln("var showDetails = function()");xf.writeln("{");xf.writeln("  document.getElementById('mode').value = 'Hide Details';");xf.writeln("  document.getElementById('details').innerHTML = '"+uf+"';");xf.writeln("}");xf.writeln("var hideDetails = function()");xf.writeln("{");xf.writeln("  document.getElementById('mode').value = 'Show Details';");xf.writeln("  document.getElementById('details').innerHTML = '';");xf.writeln("}");xf.writeln("var showHideDetails = function()");xf.writeln("{");xf.writeln("  var mv = document.getElementById('mode').value;");xf.writeln("  if (mv === 'Show Details')");xf.writeln("    showDetails();");xf.writeln("  else");xf.writeln("    hideDetails();");xf.writeln("}");xf.writeln("</script>");xf.writeln("</head><body onblur='window.focus();'>");xf.writeln("<p style='color:red'><b>"+tf+"</b></p>");xf.writeln("<fieldset>");xf.writeln("<legend><input type=button id=mode value='Show Details' onclick='showHideDetails();' /></legend>");xf.writeln("<div id=details></div>");xf.writeln("</fieldset>");xf.writeln("<p align=right><input type=button value=Close onclick='window.close();' /></p>");xf.writeln("</body></html>");xf.close();};xmp.baseplayer.ErrorLoggerListener.prototype.showErrorIE=function(yf,zf){xmp.showMessage(yf);};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.InstrumentationLoggerListener=function(Af){var Bf=Math.min(xmp.util.LogLevels.CRITICAL,Af);xmp.baseplayer.InstrumentationLoggerListener.ctor.call(this,Bf);this._handler=new xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler();};xmp.DERIVE_CLASS(xmp.util.AbstractLoggerListener,xmp.baseplayer.InstrumentationLoggerListener);xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLog=function(Cf,Df,Ef,Ff){if(Cf<=this.getLogLevel()){this.handleLogError(Cf,Df,Ff);}};xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLogMessage=function(Gf,Hf,If){};xmp.baseplayer.InstrumentationLoggerListener.prototype.handleLogError=function(Jf,Kf,Lf){this._handler.log(xmp.util.PlayerStats.getInstance(),Lf);};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler=function(){var Mf=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var Nf=Mf.getNodeForPath('Instrumentation');this._maxPostsPerSession=Nf.getInt('maxPostsPerSession',1);this._numPosts=0;this._postUrl=Nf.getString('postUrl','');this._reportingDiv=null;};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.createHiddenForm=function(Of,Pf){if(this._postUrl.length>0){var Qf=this.assembleReport(Of,Pf);var Rf=window.document.createElement('div');Rf.style.display='none';window.document.body.insertBefore(Rf,null);var Sf='post';var Tf="<form name='xmp_fatalErrorReportingForm' id='xmp_fatalErrorReportingForm' target='xmp_fatalErrorReportingFormIFrame' ";Tf+=("action='"+this._postUrl+"' ");Tf+=("method='"+Sf+"' ");Tf+=(">");for(var Uf=xmp.MapIterator.create(Qf);Uf.hasNext();Uf.next()){var Vf=Uf.currentKey();var Wf=Uf.currentValue();Tf+=("<input type='hidden' id='"+Vf+"' name='"+Vf+"' value='"+Wf+"'/>");}
Tf+=("</form><iframe id='xmp_fatalErrorReportingFormIFrame' name='xmp_fatalErrorReportingFormIFrame'/>");Rf.innerHTML=Tf;this._reportingDiv=Rf;}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.populateHiddenForm=function(Xf,Yf){var Zf=window.document.xmp_fatalErrorReportingForm;var $f=this.assembleReport(Xf,Yf);for(var ag=xmp.MapIterator.create($f);ag.hasNext();ag.next()){var bg=ag.currentKey();var cg=ag.currentValue();Zf[bg].value=cg;}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.log=function(dg,eg){if(this._numPosts>=this._maxPostsPerSession){return;}
this._numPosts++;if(this._reportingDiv===null){this.createHiddenForm(dg,eg);}
else{this.populateHiddenForm(dg,eg);}
if(this._reportingDiv){var fg=window.document.xmp_fatalErrorReportingForm;fg.submit();}};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype.assembleReport=function(gg,hg){var ig={};ig.timestamp=((new Date()).getTime()).toString();ig.reason=this._extractErrorCode(hg).toString();ig.detail=hg.message;var jg=gg.getKeys();for(var i=0;i<jg.length;++i){var kg=jg[i];var lg=gg.getValue(kg);ig[kg.toLowerCase()]=lg;}
return ig;};xmp.baseplayer.InstrumentationLoggerListener._HttpPostHandler.prototype._extractErrorCode=function(mg){if(mg instanceof xmp.FatalException){return mg.getFatalErrorCode();}
if(mg instanceof xmp.CriticalException){return mg.getCriticalErrorCode();}
return xmp.XmpErrorCodes.NONE;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.MetaFileLoaderFactory=function(){this._loaderIdCount=0;this._map={};this._loaderCtorMap={};this._addLoaderCtors();};xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance=null;xmp.baseplayer.MetaFileLoaderFactory.getInstance=function(){if(xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance===null){xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance=new xmp.baseplayer.MetaFileLoaderFactory();}
return xmp.baseplayer.MetaFileLoaderFactory._singeltonInstance;};xmp.baseplayer.MetaFileLoaderFactory.prototype.create=function(ng){var og=this._createInternal(ng);this._map[og.getLoaderId()]=og;return og;};xmp.baseplayer.MetaFileLoaderFactory.prototype._createInternal=function(pg){this._loaderIdCount++;var id=this._loaderIdCount.toString();var qg=this._loaderCtorMap[pg];if(!qg){throw new Error('Unrecognized serializer type: '+pg);}
var rg=xmp.getNamespacedMethod(qg);var sg=new rg(this,id);return sg;};xmp.baseplayer.MetaFileLoaderFactory.prototype._release=function(tg){if(typeof this._map[tg.getLoaderId()]!=='undefined'){delete this._map[tg.getLoaderId()];}};xmp.baseplayer.MetaFileLoaderFactory.prototype._addLoaderCtors=function(){var ug=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('loaders');var vg=ug.retrieveChildrenNames();for(var i=0;i<vg.length;i++){var wg=vg[i];var xg=ug.getNodeForPath(wg);var yg=xg.getString('JSClass','');this._loaderCtorMap[wg]=yg;}};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.PlayListMod=function(zg,id){this._id=id;this._action=zg;xmp.baseplayer.PlayListMod._staticCounter++;this._modNum=xmp.baseplayer.PlayListMod._staticCounter;};xmp.baseplayer.PlayListMod._staticCounter=0;xmp.baseplayer.PlayListMod.prototype.getModNum=function(){return this._modNum;};xmp.baseplayer.PlayListMod.prototype.getId=function(){return this._id;};xmp.baseplayer.PlayListMod.prototype.getAction=function(){return this._action;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer.TriggerContext=function(){this._triggerType='';this._commandData='';this._metadataMap=new xmp.util.internals.MetadataMap(false);this._node=null;};xmp.baseplayer.TriggerContext.prototype.getTriggerType=function(){return this._triggerType;};xmp.baseplayer.TriggerContext.prototype.setTriggerType=function(Ag){this._triggerType=(Ag)?Ag:'';};xmp.baseplayer.TriggerContext.prototype.getCommandData=function(){return this._commandData;};xmp.baseplayer.TriggerContext.prototype.setCommandData=function(Bg){this._commandData=(Bg)?Bg:'';};xmp.baseplayer.TriggerContext.prototype.getPlayableNode=function(){return this._node;};xmp.baseplayer.TriggerContext.prototype.setPlayableNode=function(Cg){this._node=(Cg)?Cg:null;};xmp.baseplayer.TriggerContext.prototype.getMetadata=function(Dg,Eg){return this._metadataMap._get(Dg,Eg);};xmp.baseplayer.TriggerContext.prototype.setMetadata=function(Fg,Gg){this._metadataMap._set(Fg,Gg);};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._NLMap=function(Hg){this._player=Hg;this._nodeListernerMap={};this._frameworkListenerMap={};this._frameworkListenerMap.adLoader=new xmp.baseplayer.listeners.internal.AdLoaderNodeListener(this._player);this._frameworkListenerMap.nonAdLoader=new xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener(this._player);this._frameworkListenerMap.promoLoader=new xmp.baseplayer.listeners.internal.PromoLoaderNodeListener(this._player);this._frameworkListenerMap.tracking=new xmp.baseplayer.listeners.internal.TrackingNodeListener(this._player);this._frameworkListenerMap.metering=new xmp.baseplayer.listeners.internal.MeteringNodeListener(this._player);this._frameworkListenerMap.firstFrame=new xmp.baseplayer.listeners.internal.FirstFrameNodeListener(this._player);this._frameworkListenerNameMap={};this._frameworkListenerNameMap.Ad=['adLoader','metering','firstFrame'];this._frameworkListenerNameMap.Promo=['promoLoader','firstFrame'];this._frameworkListenerNameMap.Content=['nonAdLoader','tracking','firstFrame'];this._frameworkListenerNameMap.DEFAULT=['nonAdLoader'];this._registrationArray=[];};xmp.baseplayer._NLMap.prototype._getNodeListener=function(Ig){var Jg=this._nodeListernerMap[Ig.getNodeTypeName()];if(!Jg){Jg=this._createCompositeNodeListener(Ig.getNodeTypeName());this._nodeListernerMap[Ig.getNodeTypeName()]=Jg;}
return Jg;};xmp.baseplayer._NLMap.prototype._registerNodeListener=function(Kg,Lg){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"_NLMap.registerNodeListener");if(!Kg||!Lg||(Lg.length===0)){throw new xmp.util.internals.InvalidArgsError("The 'listener' argument must be non-null, and the 'nodeTypeArray' argument must be non-null and non-empty.");}
for(var i=0;i<Lg.length;i++){var Mg=Lg[i];if(!(typeof Mg==='string'&&Mg.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'nodeTypeArray' argument must be an array of non-empty strings.");}}
this._registrationArray.push({l:Kg,nta:Lg});};xmp.baseplayer._NLMap.prototype._getFrameworkListeners=function(Ng){var Og=[];var Pg=xmp.playlistapi.PlayableNodeType.getBaseNodeTypeName(Ng);var Qg=this._frameworkListenerNameMap[Pg];for(var i=0;i<Qg.length;i++){var Rg=Qg[i];var Sg=this._frameworkListenerMap[Rg];Og.push(Sg);}
return Og;};xmp.baseplayer._NLMap.prototype._getVerticalListeners=function(Tg){var Ug=[];for(var i=0;i<this._registrationArray.length;i++){var Vg=this._registrationArray[i];var Wg=Vg.l;var Xg=Vg.nta;for(var j=0;j<Xg.length;j++){var Yg=Xg[j];if((Yg==='*')||(Yg===Tg)){Ug.push(Wg);}}}
return Ug;};xmp.baseplayer._NLMap.prototype._getAndCheckVerticalListeners=function(Zg){var $g=this._getVerticalListeners(Zg);if($g.length===0){throw new xmp.util.internals.InvalidArgsError('No vertical node listener registered for node type: '+Zg);}
return $g;};xmp.baseplayer._NLMap.prototype._validateListeners=function(ah,bh){for(var i=0;i<bh.length;i++){var ch=bh[i];for(var j=i+1;j<bh.length;j++){var dh=bh[j];if(ch===dh){throw new xmp.util.internals.InvalidArgsError('Same listener registered more than once for node type: '+ah);}}}};xmp.baseplayer._NLMap.prototype._createCompositeNodeListener=function(eh){var fh=this._getFrameworkListeners(eh);fh=fh.concat(this._getAndCheckVerticalListeners(eh));this._validateListeners(eh,fh);var gh=new xmp.baseplayer.listeners.CompositeNodeListener(this._player);for(var i=0;i<fh.length;i++){gh.addChild(fh[i]);}
return gh;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._PDMapArray=function(){this._array=[];this._map={};};xmp.baseplayer._PDMapArray.prototype.insert=function(hh,jh){if(hh>=this.getCount()){this._array.push(jh);}
else{this._array.splice(hh,0,jh);}
this._map[jh.getMetaResourceId()]=jh;};xmp.baseplayer._PDMapArray.prototype.removeAll=function(){this._array=[];this._map={};};xmp.baseplayer._PDMapArray.prototype.remove=function(kh){var lh=this._array.splice(kh,1)[0];delete this._map[lh.getMetaResourceId()];return lh;};xmp.baseplayer._PDMapArray.prototype.move=function(mh,nh){var oh=this.remove(mh);this.insert(nh,oh);};xmp.baseplayer._PDMapArray.prototype.getCount=function(){return this._array.length;};xmp.baseplayer._PDMapArray.prototype.getAtIndex=function(ph){return this._array[ph];};xmp.baseplayer._PDMapArray.prototype.findItem=function(id){var qh=this._map[id];return(!qh)?null:qh;};xmp.baseplayer._PDMapArray.prototype.findItemIndex=function(id){var rh=this.getCount();for(var i=0;i<rh;i++){if(this.getAtIndex(i).getMetaResourceId()===id){return i;}}
return-1;};xmp.baseplayer._PDMapArray.prototype.extractIdArray=function(sh){var th=[];for(var i=sh;i<this._array.length;i++){var uh=this._array[i];th.push(uh.getMetaResourceId());}
return th;};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._PLCtx=function(vh,wh,xh,yh){this._AD_PATTERN_CALL_BACK='adPatternCB';this._key=vh;this._owner=wh;this._logger=this._owner._logger;this._latch=null;this._advanceToId="";this._pdMapArray=new xmp.baseplayer._PDMapArray();this._xmpPlayList=null;this._ruleMap=null;this._currentNode=null;this._currentContentNode=null;this._previousNode=null;this._stateListener=null;this._initPlayListData={p:yh,ira:[]};this._modArray=[];this.init(xh);};xmp.baseplayer._PLCtx._staticCbCounter=0;xmp.baseplayer._PLCtx.prototype.debugPrint=function(zh){var Ah=zh+": ";Ah+="key = "+this._key+"; ";Ah+="owner = "+this._owner.getId()+"; ";Ah+="advanceToId = "+this._advanceToId+"; ";Ah+="currently rendering node = "+xmp.util.PlayableNode.safeGetBestId(this._currentNode)+"; ";Ah+="current content node = "+xmp.util.PlayableNode.safeGetBestId(this._currentContentNode)+"; ";Ah+="current playing index = "+this._getCurrentlyPlayingItemIndex()+"; ";this._logger.debug(Ah);};xmp.baseplayer._PLCtx.prototype.getLookAheadNodeArray=function(){return this._xmpPlayList.getLookAheadNodeArray();};xmp.baseplayer._PLCtx.prototype.getLookBehindNodeArray=function(){return this._xmpPlayList.getLookBehindNodeArray();};xmp.baseplayer._PLCtx.prototype.init=function(Bh){xmp.validateArguments(arguments,[xmp.STRING_TYPE],"_PLCtx.init");try{var Ch=new xmp.util.Callback('masterCB',this._latchComplete,this);this._latch=new xmp.util.Latch([],Ch);this._ruleMap=new xmp.baseplayer._RuleMap(this._latch,this);this._initPlayListData.ira=this._ruleMap._loadInvariantRules();this._loadAdPattern(Bh);this._ruleMap._loadRuleImplementations();}
catch(e){this._logger.warn('Error in init',e);throw e;}};xmp.baseplayer._PLCtx.prototype.loadContent=function(Dh,Eh){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE],"_PLCtx.loadContent");try{var Fh=[];var Gh={};for(var i=0;i<Dh.length;i++){var Hh=Dh[i];if(!xmp.isNonEmptyString(Hh)){throw new xmp.util.internals.InvalidArgsError("The 'mridArray' argument must contain only non-empty strings.");}
if(typeof(Gh[Hh])!=='undefined'){this._logger.info('Dropping duplicate content ID: '+Hh);continue;}
Gh[Hh]=Hh;Fh.push(Hh);}
Dh=Fh;if(Dh.length===0){throw new xmp.util.internals.InvalidArgsError("The 'mridArray' argument must contain at least one unique id.");}
if(Eh.length===0){Eh=Dh[0];}
if(typeof(Gh[Eh])==='undefined'){throw new xmp.util.internals.InvalidArgsError("The 'startResourceId' argument must be empty or refer to an id in 'mridArray'.");}
this._advanceToId=Eh;this._pdMapArray.removeAll();return this.handleLoadContent('loadContent','Batch',Dh,0);}
catch(e){this._logger.warn('Error in loadContent',e);throw e;}};xmp.baseplayer._PLCtx.prototype.handleLoadContent=function(Ih,id,Jh,Kh){var cb=this._createPLModCbObj(Ih,id);this._latch.addCbName(cb.getId());var Lh=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create('videoContentMeta');var Mh=Lh.setIds(Jh,null);Lh.setAllLoadedCallback(cb);for(var i=0;i<Mh.length;i++){var Nh=Mh[i];Nh.reInitRuntimeMetadata();this._pdMapArray.insert(Kh+i,Nh);}
Lh.load();return cb.getMetadata('_modNum',0);};xmp.baseplayer._PLCtx.prototype.getKey=function(){return this._key;};xmp.baseplayer._PLCtx.prototype.setStateListener=function(Oh){this._stateListener=Oh;};xmp.baseplayer._PLCtx.prototype.appendToPlayList=function(Ph,Qh){var Rh=null;var Sh=this.getPlayListItemCount();if(Sh>0){Rh=this.getPlayListItem(Sh-1).getMetaResourceId();}
return this.insertInPlayListEx('append',Ph,Rh,Qh);};xmp.baseplayer._PLCtx.prototype.removeFromPlayList=function(Th){var Uh=this.findPlayListItemIndex(Th);if(Uh<0){return-1;}
this._pdMapArray.remove(Uh);return this._doLatchAsynch('remove',Th);};xmp.baseplayer._PLCtx.prototype.insertInPlayList=function(Vh,Wh,Xh){return this.insertInPlayListEx('insert',Vh,Wh,Xh);};xmp.baseplayer._PLCtx.prototype.insertInPlayListEx=function(Yh,Zh,$h,ai){var bi=this._validateInsertAndMoveArgs(Zh,$h,ai,false);if(ai||!this._isRunning()){this._advanceToId=Zh;}
return this.handleLoadContent(Yh,Zh,[Zh],bi.a+1);};xmp.baseplayer._PLCtx.prototype.moveWithinPlayList=function(ci,di,ei){var fi=this._validateInsertAndMoveArgs(ci,di,ei,true);var gi=fi.a;if(fi.a<fi.i){gi++;}
this._pdMapArray.move(fi.i,gi);if(ei){this._advanceToId=ci;}
return this._doLatchAsynch('move',ci);};xmp.baseplayer._PLCtx.prototype.setCurrentPlayListItem=function(hi){var ii=this.findPlayListItemIndex(hi);if(ii<0){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must refer to an exising playlist item.");}
this._advanceToId=hi;return this._doLatchAsynch('setCur',hi);};xmp.baseplayer._PLCtx.prototype.getCurrentPlayListItem=function(){var ji=this._currentNode;if(this._isValidNode(ji)){if(ji.isContentType()){return ji.getPlayableData().getMetaResourceId();}
else{var a=this.getLookAheadNodeArray();for(var i=0;i<a.length;i++){var ki=a[i];if(ki.isContentType()){return ki.getPlayableData().getMetaResourceId();}}}}
return'';};xmp.baseplayer._PLCtx.prototype.getPlayListItemCount=function(){return this._pdMapArray.getCount();};xmp.baseplayer._PLCtx.prototype.getPlayListItem=function(li){return this._pdMapArray.getAtIndex(li);};xmp.baseplayer._PLCtx.prototype.findPlayListItem=function(mi){return this._pdMapArray.findItem(mi);};xmp.baseplayer._PLCtx.prototype.findPlayListItemIndex=function(ni){return this._pdMapArray.findItemIndex(ni);};xmp.baseplayer._PLCtx.prototype.registerRuleClass=function(oi,pi){this._ruleMap.registerRuleClass(oi,pi);this._xmpPlayList.addRuleFactory(oi,this._ruleMap);};xmp.baseplayer._PLCtx.prototype._loadAdPattern=function(qi){var cb=new xmp.util.Callback(this._AD_PATTERN_CALL_BACK,this._adPatternCb,this);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(qi,cb,'adPolicy',qi,xmp.net.ContentTypes.JSON,null);};xmp.baseplayer._PLCtx.prototype._adPatternCb=function(cb,ri){var si=null;if(ri.isError()){si={e:ri.getErrorObject(),j:null};var ti=new xmp.baseplayer.ApplicationError(ri.getErrorObject(),'FailToGetAdPattern',null,[{label:"Url",text:ri.getFullUrl()}]);this._logger.warn(ti.message,ti);}
else{si={e:null,j:ri.getJsonObject()};}
this._latch.called(cb.getId(),si);if(this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._adPatternCb");}};xmp.baseplayer._PLCtx.prototype._PLModCb=function(cb){this._latch.called(cb.getId(),null);if(this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._PLModCb: "+cb.getId());}};xmp.baseplayer._PLCtx.prototype._latchComplete=function(cb){if(!this._xmpPlayList){var ui=cb.getMetadata(this._AD_PATTERN_CALL_BACK,{});this._initXmpPlayList(ui);}
var vi=this._isRunning();var wi=this._getCurrentlyPlayingItemIndex();if(this._logger.isDebugEnabled()){var xi='Latch Complete, run state = '+this._calcRunState()+', count = '+this.getPlayListItemCount()+', current index = '+wi+', _advanceToId = '+this._advanceToId;this._logger.debug(xi);}
var yi=this._calcAdvanceToIndex();var zi=-1;if(yi>=0){zi=yi;}
else{if(wi<0&&vi){wi=-1;}
zi=(wi+1);}
if(zi<0){this._logger.warn('Invalid refreshFromIndex, correcting to 0: '+zi);zi=0;}
this._xmpPlayList.setContentMetaResourceIds(this._pdMapArray.extractIdArray(zi));this._xmpPlayList.getIterator().first();if(yi>=0&&this._canAdvance()){this.advance();}
this._notifyPLMods();};xmp.baseplayer._PLCtx.prototype._initXmpPlayList=function(Ai){try{if(Ai.e!==null){throw Ai.e;}
this._xmpPlayList=new xmp.playlistapi.AdPatternPlayList(this,Ai.j,this._initPlayListData.ira,this._initPlayListData.p);var Bi=this._xmpPlayList.getRuleIdArray();this._ruleMap._registerRules(Bi);this._xmpPlayList.loadRuleFactoryArray([this._ruleMap]);}
catch(e){this._logger.warn('Error initializing playlist',e);}};xmp.baseplayer._PLCtx.prototype.getCurrentNode=function(){return this._currentNode;};xmp.baseplayer._PLCtx.prototype.advance=function(){if(this._xmpPlayList.getIterator().hasNext()){var Ci=this._xmpPlayList.getIterator().next();this._previousNode=this._currentNode;if(this._currentNode===null){this._notifyPLStarted();}
this._currentNode=Ci;if(Ci.isContentType()){this._currentContentNode=Ci;}
if(this._stateListener){this._stateListener.onAdvance();}}
else{this._currentNode=null;this._currentContentNode=null;this._notifyPLEnded();}};xmp.baseplayer._PLCtx.prototype._calcAdvanceToIndex=function(){var Di=-1;if(this._advanceToId.length>0){Di=this.findPlayListItemIndex(this._advanceToId);if((Di<0)&&this._logger.isDebugEnabled()){this._logger.debug("_PLCtx._calcAdvanceToIndex: "+this._advanceToId+" is not a valid play list item id; cannot advance to it.");}}
this._advanceToId='';return Di;};xmp.baseplayer._PLCtx.prototype._canAdvance=function(){var Ei=this._isRunning();var Fi=this._currentNode;return(!Ei||(Ei&&this._owner._getNodeListener(Fi).canUserControl(Fi)));};xmp.baseplayer._PLCtx.prototype._isRunning=function(){return this._isValidNode(this._currentNode);};xmp.baseplayer._PLCtx.prototype._isValidNode=function(Gi){return(Gi&&Gi.isValid()&&Gi.getPlayableData());};xmp.baseplayer._PLCtx.prototype.handleInitializePlayableNode=function(Hi){this._owner.handleInitializePlayableNode(Hi);};xmp.baseplayer._PLCtx.prototype._createPLModCbObj=function(Ii,id){xmp.baseplayer._PLCtx._staticCbCounter++;var c=xmp.baseplayer._PLCtx._staticCbCounter.toString();var Ji='PLModCb_'+c+'_'+Ii+':'+id;var cb=new xmp.util.Callback(Ji,this._PLModCb,this);var Ki=new xmp.baseplayer.PlayListMod(Ii,id);cb.setMetadata('_modNum',Ki.getModNum());this._modArray.push(Ki);return cb;};xmp.baseplayer._PLCtx.prototype._doLatchAsynch=function(Li,id){var cb=this._createPLModCbObj(Li,id);this._latch.addCbName(cb.getId());xmp.util.Timer.doSimpleCallback(cb);return cb.getMetadata('_modNum',0);};xmp.baseplayer._PLCtx.prototype._getCurrentlyPlayingItemIndex=function(){var Mi=this._currentContentNode;if(this._isValidNode(Mi)){return this.findPlayListItemIndex(Mi.getPlayableData().getMetaResourceId());}
return-1;};xmp.baseplayer._PLCtx.prototype._getPlayableData=function(Ni){return this.findPlayListItem(Ni);};xmp.baseplayer._PLCtx.prototype._validateInsertAndMoveArgs=function(Oi,Pi,Qi,Ri){var Si={a:-1,i:-1};if(!(xmp.isNonEmptyString(Oi)&&(Pi===null||xmp.isNonEmptyString(Pi)))){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must be a non-null, non-empty string, "+"and the 'afterMrid' must EITHER be null OR a a non-null, non-empty string");}
if(Oi===Pi){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must NOT be the same value as the 'afterMrid' value.");}
if(typeof(Qi)!=='boolean'){throw new xmp.util.internals.InvalidArgsError("The 'setPos' argument must be of boolean type.");}
if(Pi!==null){Si.a=this.findPlayListItemIndex(Pi);if(Si.a<0){throw new xmp.util.internals.InvalidArgsError("The 'afterMrid' argument must be set to null, or must refer to an exising playlist item.");}}
Si.i=this.findPlayListItemIndex(Oi);if(Ri){if(Si.i<0){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must refer to an exising playlist item when moving.");}}
else{if(Si.i>-1){throw new xmp.util.internals.InvalidArgsError("The 'mrid' argument must NOT refer to an exising playlist item when inserting/appending.");}}
return Si;};xmp.baseplayer._PLCtx.prototype._calcRunState=function(){if(this._isRunning()){return'running';}
else{return this._isValidNode(this._previousNode)?'stopped':'never started';}};xmp.baseplayer._PLCtx.prototype._notifyPLStarted=function(){try{this._owner.handlePlayListStarted();}
catch(e){this._logger.warn('Error calling handlePlayListStarted',e);}};xmp.baseplayer._PLCtx.prototype._notifyPLEnded=function(){try{this._owner.handlePlayListEnded();}
catch(e){this._logger.warn('Error calling handlePlayListEnded',e);}};xmp.baseplayer._PLCtx.prototype._notifyPLMods=function(){var Ti=[];Ti=Ti.concat(this._modArray);this._modArray=[];try{this._owner.handlePlayListModified(Ti);}
catch(e){this._logger.warn('Error calling handlePlayListModified',e);}};xmp.createNamespace("xmp.baseplayer");xmp.baseplayer._RuleMap=function(Ui,Vi){this._logger=new xmp.util.internals.CategoryLogger('_RuleMap');this._ruleIdArray=[];this._ruleIdToConstructorMap={};this._latch=Ui;this._player=Vi;};xmp.baseplayer._RuleMap.prototype.registerRuleClass=function(Wi,Xi){if(!(xmp.isNonEmptyString(Wi)&&xmp.isNonEmptyString(Xi))){throw new xmp.util.internals.InvalidArgsError("The 'ruleId' and 'ruleFullyQualifiedConstructor' arguments must be non-null, non-empty strings.");}
if(typeof(this._ruleIdToConstructorMap[Wi])==='undefined'){this._ruleIdArray.push(Wi);this._ruleIdToConstructorMap[Wi]=Xi;}};xmp.baseplayer._RuleMap.prototype._loadInvariantRules=function(){var Yi=xmp.util.SettingsManager.getInstance().getContextNode();if(!Yi.nodeExists('invariantRules')){return[];}
var Zi=Yi.getNodeForPath('invariantRules');var $i=Zi.retrieveKeys();var aj="[";for(var i=0;i<$i.length;i++){var bj=$i[i];aj+=Zi.getString(bj,'');if(i!==($i.length-1)){aj+=",";}}
aj+="]";try{return xmp.net.AjaxRequestManager.getInstance()._parseJson(aj);}
catch(e){this._logger.warn('Error loading invariant rule ids.',e);throw e;}};xmp.baseplayer._RuleMap.prototype._registerRules=function(cj){var dj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('rule classes namespace','');for(var i=0;i<cj.length;i++){var ej=cj[i];var fj=ej;if(dj.length>0){fj=(dj+'.'+fj);}
this.registerRuleClass(ej,fj);}};xmp.baseplayer._RuleMap.prototype._loadRuleImplementations=function(){var gj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getString('rule classes relative URL','');var cb=new xmp.util.Callback('getRulesCB',this._ruleImplementationsCb,this);this._latch.addCbName(cb.getId());if(gj==='NONE'){cb.setMetadata('no_rules','true');cb.callAsynch([]);}
else{xmp.net.AjaxRequestManager.getInstance().request(gj,cb,'ruleClasses',gj,xmp.net.ContentTypes.TEXT,null);}};xmp.baseplayer._RuleMap.prototype._ruleImplementationsCb=function(cb,hj){if(cb.getMetadata('no_rules','false')==='true'){this._latch.called(cb.getId(),{e:null});return;}
if(hj.isError()){var ij=new xmp.baseplayer.ApplicationError(hj.getErrorObject(),'RulesNotDownLoaded',null,[{label:"Url",text:hj.getFullUrl()}]);this._logger.warn(ij.message,ij);this._latch.called(cb.getId(),{e:hj.getErrorObject()});}
else{try{xmp.net.AjaxRequestManager.getInstance()._parseJavaScript(hj.getText());this._latch.called(cb.getId(),{e:null});}
catch(e){var kj=(e instanceof Error)?e:new Error('UKNOWN ERROR');this._latch.called(cb.getId(),{e:kj});}}};xmp.baseplayer._RuleMap.prototype.getCreatableRuleIds=function(){return this._ruleIdArray;};xmp.baseplayer._RuleMap.prototype.createRule=function(lj){var mj=this._ruleIdToConstructorMap[lj];if(!mj){return null;}
var nj=xmp.getNamespacedMethod(mj);var oj=new nj(this._player);return oj;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.Ad=function(){};xmp.baseplayer.internals.Ad.prototype.buildRelativeURL=function(pj,qj,rj,sj){var tj=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer/Additional segvars').getString(pj,'');var uj='';if(qj>0){uj=this._makeQueryPair('tile',qj);}
uj=this._appendToQuery(uj,rj);uj=this._appendToQuery(uj,tj);uj=this._appendToQuery(uj,sj);return uj;};xmp.baseplayer.internals.Ad.getAdServerRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('adServer');};xmp.baseplayer.internals.Ad.getAdManRoot=function(){return xmp.util.RootUrlProvider.getInstance().getRootUrl('adMan');};xmp.baseplayer.internals.Ad.prototype._appendToQuery=function(vj,wj){var xj=vj;if(wj&&wj.length!==0){if(xj.length>0){xj+='&';}
xj+=wj;}
return xj;};xmp.baseplayer.internals.Ad.prototype.setPingImage=function(yj){return xmp.baseplayer.internals.AdMeteringImagePool.getInstance().setPingImage(yj);};xmp.baseplayer.internals.Ad.createCompanionAdId=function(){return Math.floor((new Date()).getTime()/1000);};xmp.baseplayer.internals.Ad.prototype._makeQueryPair=function(zj,Aj){if(!Aj){Aj='';}
return zj+'='+escape(Aj.toString());};xmp.baseplayer.internals.Ad._singeltonInstance=null;xmp.baseplayer.internals.Ad.getInstance=function(){if(xmp.baseplayer.internals.Ad._singeltonInstance===null){xmp.baseplayer.internals.Ad._singeltonInstance=new xmp.baseplayer.internals.Ad();}
return xmp.baseplayer.internals.Ad._singeltonInstance;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.AdMeteringImagePool=function(){this._initializedState=-1;this._adMeteringImage='';this._POOL_SIZE=10;this._BASE_IMG_NAME='AdMeteringImg_';};xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter=-1;xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance=null;xmp.baseplayer.internals.AdMeteringImagePool.getInstance=function(){if(xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance===null){xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance=new xmp.baseplayer.internals.AdMeteringImagePool();}
return xmp.baseplayer.internals.AdMeteringImagePool._singeltonInstance;};xmp.baseplayer.internals.AdMeteringImagePool.prototype.setPingImage=function(Bj){this._init();if(this._initializedState!==1){return'';}
xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter++;var Cj=xmp.baseplayer.internals.AdMeteringImagePool._imgPingCounter%this._POOL_SIZE;var Dj=this._BASE_IMG_NAME+Cj.toString();var Ej=window.document.images[Dj];if(!Ej){throw new Error('Unexpectded did not find DOM image'+Dj);}
Ej.src=Bj;return Dj;};xmp.baseplayer.internals.AdMeteringImagePool.prototype._init=function(){if(this._initializedState===-1){try{var Fj=xmp.util.SettingsManager.getInstance().getContextNode();var Gj=Fj.getNodeForPath('BasePlayer');this._adMeteringImage=xmp.trimString(Gj.getString('Ad metering image URL',''));if(this._adMeteringImage.length===0){var Hj='Ad metering image URL not specified in primary configuration';throw new Error(Hj);}
var Ij=window.document.createElement('div');Ij.style.display='none';window.document.body.insertBefore(Ij,null);for(var i=0;i<this._POOL_SIZE;i++){var Jj=window.document.createElement('img');Jj.src=this._adMeteringImage;Jj.id=this._BASE_IMG_NAME+i.toString();Jj.name=Jj.id;Jj.alt='';Jj.align='right';Jj.width=Jj.height=Jj.border=Jj.vspace=Jj.hspace=0;Ij.insertBefore(Jj,null);}}
catch(e){xmp.handleFatalError(e);this._initializedState=0;throw e;}
this._initializedState=1;}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.AdServiceMetaFileLoader=function(Kj,Lj){this._CLASS_NAME='AdServiceMetaFileLoader';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoAdMeta';this._owner=Kj;this._loaderId=Lj;this._resBundle=null;this._callback=null;this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();this._latchCompleteCb=this._createCb(null,'LatchComplete',this._handleLatchComplete);this._latch=new xmp.util.Latch([],this._latchCompleteCb);this._responseCallback=this._createCb(null,'responseCallback',this.i_handleAdServiceResponse);this._errorCallback=this._createCb(null,'errorCallback',this.i_handleAdServiceError);this._adService=xmp.net.AdService.i_getInstance();this._adService.i_setResponseCallback(this._responseCallback);this._adService.i_setErrorCallback(this._errorCallback);};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype.setResBundle=function(Mj,Nj){this._resBundle=Mj;this._callback=Nj;};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype.load=function(){try{if(this._shortCircuit()){return;}
this._latchCompleteCb.setMetadata('LatchPhase',this._AD_MAN_TYPE);var Oj=this._resBundle.getResourceTypes();for(var i=0;i<Oj.length;i++){var Pj=this._resBundle.getMetaResource(Oj[i]);Pj.setCompanionAdId(this._companionAdId);this._loadARM(Pj,this._AD_MAN_TYPE,xmp.net.ContentTypes.TEXT,Pj.getId());}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._handleLatchComplete=function(cb){try{var Qj=this._latchCompleteCb.getMetadata('LatchPhase','');if(Qj===this._AD_MAN_TYPE){this._doAdManComplete();}
else if(Qj===this._AD_SERVER_TYPE){this._doAdServerComplete();}
else{throw new Error('Unrecognized phase: '+Qj);}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._doAdManComplete=function(){this._latchCompleteCb.setMetadata('LatchPhase',this._AD_SERVER_TYPE);var Rj=this._resBundle.getResourceTypes();var Sj=0;for(var i=0;i<Rj.length;i++){var Tj=this._resBundle.getMetaResource(Rj[i]);var Uj=this._makeCbName(Tj,this._AD_MAN_TYPE);var Vj=this._latchCompleteCb.getMetadata(Uj,xmp.util.internals.MetadataMap.defaultObj);if(!Vj.isError()){var Wj=this._buildAdServerRelUrl(Tj,Vj.getText());if(Tj.getType()==='primary'){Sj++;this._loadARM(Tj,this._AD_SERVER_TYPE,xmp.net.ContentTypes.JSON,Wj);}
else if(Tj.getType()==='synch_unit'){var Xj=xmp.baseplayer.internals.Ad.getAdServerRoot();Tj._setRawData(Xj+Wj);Tj.setDataType('url');}}
else{Tj._setErrorMessage(Vj.getErrorMessage());}}
if(Sj===0){this._end();}};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._doAdServerComplete=function(){var Yj=this._resBundle.getMetaResource('primary');var Zj=this._makeCbName(Yj,this._AD_MAN_TYPE);var $j=this._latchCompleteCb.getMetadata(Zj,xmp.util.internals.MetadataMap.defaultObj);if(!$j.isError()){var ak=this._buildAdServerRelUrl(Yj,$j.getText());var bk=xmp.util.SettingsManager.getInstance().getGlobalContextNode();if(bk.nodeExists("rootUrlMap/adServer")){var ck=bk.getNodeForPath("rootUrlMap/adServer");var dk=ck.getString(xmp.ROOT_URL,"")+ak;var ek=this._latchCompleteCb.getMetadata(dk,xmp.util.internals.MetadataMap.defaultObj);if(!ek.isError){Yj._setRawData(xmp.net.AjaxRequestManager.getInstance()._parseJson(ek.data));}
else{Yj._setErrorMessage(ek.data);}}}
this._end();};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._handleErrorMessage=function(fk){this._resBundle._setErrorMessage(fk);this._end();};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){var gk=this._resBundle.getMetaResource('primary');if(gk!==null&&gk.isError()){this._resBundle._setErrorMessage('Primary Resource Error: '+gk.getErrorMessage());}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._createCb=function(hk,ik,jk){return(new xmp.util.Callback(this._makeCbName(hk,ik),jk,this));};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._makeCbName=function(kk,lk){var mk=(kk!==null)?kk.getType():'';return(this._CLASS_NAME+'_'+lk+'_'+mk+'_'+this._loaderId);};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._buildAdServerRelUrl=function(nk,pk){var qk=xmp.trimString(pk);var rk=nk.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(nk.getType(),this._companionAdId,qk,rk);};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._loadARM=function(sk,tk,uk,vk){try{var wk=this._latchCompleteCb.getMetadata('LatchPhase','');if(wk===this._AD_MAN_TYPE){var cb=this._createCb(sk,tk,this._handleARMResponse);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(vk,cb,tk,vk,uk,null);}
else if(wk===this._AD_SERVER_TYPE){var xk=xmp.util.SettingsManager.getInstance().getGlobalContextNode();if(xk.nodeExists("rootUrlMap/adServer")){var yk=xk.getNodeForPath("rootUrlMap/adServer");var zk=yk.getString(xmp.ROOT_URL,"")+vk;this._latch.addCbName(zk);var Ak=this._adService.i_createRequest(zk);this._adService.i_makeRequest(Ak);}}
else{throw new Error('Unrecognized phase: '+wk);}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype._handleARMResponse=function(Bk,Ck){if(Ck.isError()){var Dk=new xmp.baseplayer.ApplicationError(Ck.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Ck.getFullUrl()}]);this._logger.warn(Dk.message,Dk);}
this._latch.called(Bk.getId(),Ck);};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype.i_handleAdServiceResponse=function(Ek,Fk){var Gk={isError:false,data:Fk.getData()};this._latch.called(Fk.getAdRequest().getUrl(),Gk);};xmp.baseplayer.internals.AdServiceMetaFileLoader.prototype.i_handleAdServiceError=function(Hk,Ik){var Jk={isError:true,data:Ik.getData()};this._latch.called(Ik.getAdRequest().getUrl(),Jk);};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.DhtmlObjectMetaFileLoader=function(Kk,Lk){xmp.baseplayer.internals.DhtmlObjectMetaFileLoader.ctor.call(this,'dhtmlObject','DhtmlObjectMetaFileLoader',xmp.net.ContentTypes.JSON,'FailToGetDhtmlObject',-1,Kk,Lk);};xmp.DERIVE_CLASS(xmp.baseplayer.internals.GenericMetaFileLoader,xmp.baseplayer.internals.DhtmlObjectMetaFileLoader);xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader=function(Mk,Nk){xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader.ctor.call(this,'errorDhtmlObject','ErrorDhtmlObjectMetaFileLoader',xmp.net.ContentTypes.JSON,'FailToGetDhtmlObject',-1,Mk,Nk);};xmp.DERIVE_CLASS(xmp.baseplayer.internals.GenericMetaFileLoader,xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader);xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.FileRequestHandle=function(Ok,id,Pk){this._id=id;this._type=Ok;this._dataObject=null;this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED;this._listenerArray=[];this._errorMessage=null;this._maxCacheTime=Pk;this._createdTime=this._getCurrentTimeInSeconds();};xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED=0;xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING=1;xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED=2;xmp.baseplayer.internals.FileRequestHandle.prototype.getId=function(){return this._id;};xmp.baseplayer.internals.FileRequestHandle.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.FileRequestHandle.prototype.isNew=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_CREATED);};xmp.baseplayer.internals.FileRequestHandle.prototype.isLoading=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING);};xmp.baseplayer.internals.FileRequestHandle.prototype.isLoaded=function(){return(this._loadState===xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED);};xmp.baseplayer.internals.FileRequestHandle.prototype.getDataObject=function(){return this._dataObject;};xmp.baseplayer.internals.FileRequestHandle.prototype._setDataObject=function(Qk){this._dataObject=Qk;};xmp.baseplayer.internals.FileRequestHandle.prototype._setAsLoading=function(){if(this._loadState!==xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED){this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}};xmp.baseplayer.internals.FileRequestHandle.prototype._setAsLoaded=function(){this._loadState=xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED;this._notifyListeners();};xmp.baseplayer.internals.FileRequestHandle.prototype._notifyListener=function(Rk){var Sk=new xmp.util.Callback('onExecuteCB',this._onExecuteTimer,this);Sk.setMetadata('listener',Rk);var Tk=new xmp.util.Timer(this.getId(),xmp.DEFAULT_TIMER_INTERVAL,1,Sk);Tk.start();};xmp.baseplayer.internals.FileRequestHandle.prototype._onExecuteTimer=function(Uk,Vk){var Wk=Uk.getMetadata('listener',{});Wk._notifyFileRequestLoaded(this);};xmp.baseplayer.internals.FileRequestHandle.prototype._notifyListeners=function(){for(var i=0;i<this._listenerArray.length;i++){var Xk=this._listenerArray[i];this._notifyListener(Xk);}
this._listenerArray=[];};xmp.baseplayer.internals.FileRequestHandle.prototype._addListener=function(Yk){this._listenerArray.push(Yk);};xmp.baseplayer.internals.FileRequestHandle.prototype._setErrorMessage=function(Zk){this._errorMessage=Zk;};xmp.baseplayer.internals.FileRequestHandle.prototype._isError=function(){return(this._errorMessage!==null);};xmp.baseplayer.internals.FileRequestHandle.prototype._getErrorMessage=function(){return this._errorMessage;};xmp.baseplayer.internals.FileRequestHandle.prototype._getCurrentTimeInSeconds=function(){return Math.floor((new Date()).getTime()/1000);};xmp.baseplayer.internals.FileRequestHandle.prototype._getAgeInSeconds=function(){return(this._getCurrentTimeInSeconds()-this._createdTime);};xmp.baseplayer.internals.FileRequestHandle.prototype._isExpiredFromCache=function(){if(this._maxCacheTime<=-1){return false;}
if(this._maxCacheTime===0){return true;}
if(this._maxCacheTime<=this._getAgeInSeconds()){return true;}
return false;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.MetaFileCache=function(){this._map={};this._logger=new xmp.util.internals.CategoryLogger('FileRequestHandle');};xmp.baseplayer.internals.MetaFileCache._singeltonInstance=null;xmp.baseplayer.internals.MetaFileCache.getInstance=function(){if(xmp.baseplayer.internals.MetaFileCache._singeltonInstance===null){xmp.baseplayer.internals.MetaFileCache._singeltonInstance=new xmp.baseplayer.internals.MetaFileCache();}
return xmp.baseplayer.internals.MetaFileCache._singeltonInstance;};xmp.baseplayer.internals.MetaFileCache.prototype.add=function($k){this._map[this._makeKeyH($k)]=$k;};xmp.baseplayer.internals.MetaFileCache.prototype.find=function(al,id){var bl=this._map[this._makeKey(al,id)];return(!bl)?null:bl;};xmp.baseplayer.internals.MetaFileCache.prototype.findOrCreate=function(cl,id,dl,el){this._checkForExpiredHandles();var fl=this.find(cl,id);if(fl===null){fl=new xmp.baseplayer.internals.FileRequestHandle(cl,id,el);this.add(fl);fl._addListener(dl);if(this._logger.isDebugEnabled()){this._logger.debug('Request handle NOT in cache, loading now: '+this._makeKeyH(fl));}
try{var gl=dl._loadFileRequest(fl);switch(gl){case xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING:fl._setAsLoading();break;case xmp.baseplayer.internals.FileRequestHandle.STATE_LOADED:fl._setAsLoaded();break;default:throw new Error('Unexpected load state.');}}
catch(e){fl._setErrorMessage(xmp.extractErrorMessage(e));fl._setAsLoaded();}}
else{if(fl.isLoading()){if(this._logger.isDebugEnabled()){this._logger.debug('Request handle FOUND in cache, ANOTHER LOADER is loading, will wait: '+this._makeKeyH(fl));}
fl._addListener(dl);}
else if(fl.isLoaded()){if(this._logger.isDebugEnabled()){this._logger.debug('Request handle FOUND in cache, already loaded: '+this._makeKeyH(fl));}
fl._notifyListener(dl);}}
return fl;};xmp.baseplayer.internals.MetaFileCache.prototype._makeKey=function(hl,id){return(hl+'|'+id);};xmp.baseplayer.internals.MetaFileCache.prototype._makeKeyH=function(il){return this._makeKey(il.getType(),il.getId());};xmp.baseplayer.internals.MetaFileCache.prototype._checkForExpiredHandles=function(){var jl=[];var kl='';var ll=null;for(var ml=xmp.MapIterator.create(this._map);ml.hasNext();ml.next()){kl=ml.currentKey();ll=ml.currentValue();if(this._isHandleExpired(ll,kl)){jl.push(ll);}}
for(var i=0;i<jl.length;i++){ll=jl[i];try{kl=this._makeKeyH(ll);delete this._map[kl];}
catch(e){this._logger.debug('Error removing request handle from cache.',e);}}};xmp.baseplayer.internals.MetaFileCache.prototype._isHandleExpired=function(nl,ol){try{if(nl._isExpiredFromCache()){this._logger.debug('Request handle expired, will remove from cache.');return true;}
return false;}
catch(e){this._logger.warn('Error checking for expiration: '+ol,e);}
return false;};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.NullTrigger=function(pl){this._logger=new xmp.util.internals.CategoryLogger('NullTrigger');this._type=pl;};xmp.baseplayer.internals.NullTrigger.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.NullTrigger.prototype.doCommands=function(ql){if(this._logger.isDebugEnabled()){this._logger.debug('Trigger type: '+this.getType()+', Null Trigger, no commands to do.');}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.Trigger=function(rl,sl){this._logger=new xmp.util.internals.CategoryLogger('Trigger');this._type=rl;this._triggerCommandArray=sl;};xmp.baseplayer.internals.Trigger.getTrigger=function(tl,ul){var vl=[];if(tl.getPlayableData().isLoaded()){var wl=tl.getPlayableData().getDataObject().triggers;if(typeof wl==='object'){for(var i=0;i<wl.length;i++){var xl=wl[i];if(typeof xl==='object'&&xl.trigger===ul&&typeof xl.commands==='object'&&xl.commands.length>0){vl=xmp.baseplayer.internals.Trigger._cloneTriggerCommands(xl.commands);break;}}}
var yl=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('NodeTriggers/'+tl.getNodeTypeName()).getString(ul,'');if(yl.length>0){var zl=null;try{zl=xmp.net.AjaxRequestManager.prototype._parseJson(yl);}
catch(e){zl=null;this._logger.warn('Error getting global trigger for type: '+tl.getNodeTypeName(),e);}
if(zl!==null){vl=zl.concat(vl);}}}
if(vl.length>0){return new xmp.baseplayer.internals.Trigger(ul,vl);}
else{return new xmp.baseplayer.internals.NullTrigger(ul);}};xmp.baseplayer.internals.Trigger._cloneTriggerCommands=function(Al){var Bl=[];for(var i=0;i<Al.length;i++){var Cl=Al[i];Bl.push({type:Cl.type,data:Cl.data});}
return Bl;};xmp.baseplayer.internals.Trigger.prototype.getType=function(){return this._type;};xmp.baseplayer.internals.Trigger.prototype.doCommands=function(Dl){for(var i=0;i<this._triggerCommandArray.length;i++){var El=null;try{El=this._triggerCommandArray[i];var Fl=xmp.baseplayer.internals.TriggerCommandFactory.getInstance().create(El.type);Dl.setCommandData(El.data);Dl.setTriggerType(this.getType());Fl.doCommand(Dl);}
catch(e){this._logger.warn('Error invoking trigger command, type: '+El.type+', data: '+El.data,e);}}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.TriggerCommandFactory=function(){this._logger=new xmp.util.internals.CategoryLogger('TriggerCommandFactory');xmp.util.SettingsManager.getInstance().addContextChangeListener(new xmp.util.Callback('TriggerCommandFactory',this._handleContextChange,this));this._triggerCommandMap=null;this._faultCfg();};xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance=null;xmp.baseplayer.internals.TriggerCommandFactory.getInstance=function(){if(xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance===null){xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance=new xmp.baseplayer.internals.TriggerCommandFactory();}
return xmp.baseplayer.internals.TriggerCommandFactory._singeltonInstance;};xmp.baseplayer.internals.TriggerCommandFactory.prototype.create=function(Gl){var Hl=this._triggerCommandMap[Gl];if(!Hl){return(new xmp.baseplayer.internals.NullTriggerCommand(Gl));}
try{var Il=xmp.getNamespacedMethod(Hl);var Jl=new Il();return Jl;}
catch(e){this._logger.warn('Error creating Trigger Command: '+Gl,e);return(new xmp.baseplayer.internals.NullTriggerCommand(Gl));}};xmp.baseplayer.internals.TriggerCommandFactory.prototype._faultCfg=function(){if(this._triggerCommandMap===null){this._triggerCommandMap={};var Kl=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('TriggerCommands');var Ll=Kl.retrieveKeys();for(var i=0;i<Ll.length;i++){var Ml=Ll[i];var Nl=Kl.getString(Ml,'');this._triggerCommandMap[Ml]=Nl;}
this._triggerCommandMap.setImg='xmp.baseplayer.internals.SetImageTriggerCommand';this._triggerCommandMap.echo='xmp.baseplayer.internals.EchoTriggerCommand';}};xmp.baseplayer.internals.TriggerCommandFactory.prototype._handleContextChange=function(){this._triggerCommandMap=null;this._faultCfg();};xmp.baseplayer.internals.NullTriggerCommand=function(Ol){this._type=Ol;this._logger=new xmp.util.internals.CategoryLogger('NullTriggerCommand');};xmp.baseplayer.internals.NullTriggerCommand.prototype.doCommand=function(Pl){if(this._logger.isDebugEnabled()){this._logger.debug('Trigger Command unrecognized: '+this._type);}};xmp.baseplayer.internals.EchoTriggerCommand=function(){this._logger=new xmp.util.internals.CategoryLogger('EchoTriggerCommand');};xmp.baseplayer.internals.EchoTriggerCommand.prototype.doCommand=function(Ql){var Rl=Ql.getCommandData();xmp.baseplayer.internals.AdStatusReporter.report(this._logger,'Trigger type: '+Ql.getTriggerType()+', Doing "echo" command, data = '+Rl);};xmp.baseplayer.internals.SetImageTriggerCommand=function(){this._logger=new xmp.util.internals.CategoryLogger('SetImageTriggerCommand');};xmp.baseplayer.internals.SetImageTriggerCommand.prototype.doCommand=function(Sl){var Tl=this._cleanImageData(Sl.getCommandData());var Ul=xmp.baseplayer.internals.Ad.getInstance().setPingImage(Tl);xmp.baseplayer.internals.AdStatusReporter.report(this._logger,'Trigger type: '+Sl.getTriggerType()+', Doing "setImg" command, data = '+Tl+', using img dom ID: '+Ul);};xmp.baseplayer.internals.SetImageTriggerCommand.prototype._cleanImageData=function(Vl){var Wl=Vl.indexOf('\"');if(Wl===-1){return Vl;}
Vl=Vl.substr(Wl+1);var Xl=Vl.indexOf('\"');Vl=Vl.substr(0,Xl);return Vl;};xmp.baseplayer.internals.AdStatusReporter=function(){};xmp.baseplayer.internals.AdStatusReporter._cb=null;xmp.baseplayer.internals.AdStatusReporter.dummySetAdStatus=function(){};xmp.baseplayer.internals.AdStatusReporter.report=function(Yl,Zl){if(xmp.baseplayer.internals.AdStatusReporter._cb===null){var p=xmp.baseplayer.BasePlayer._singleInstance;if((p)&&(p.setAdStatus)){xmp.baseplayer.internals.AdStatusReporter._cb=new xmp.util.Callback('adStatus',p.setAdStatus,p);}
else{xmp.baseplayer.internals.AdStatusReporter._cb=new xmp.util.Callback('adStatus',xmp.baseplayer.internals.AdStatusReporter.dummySetAdStatus,null);}
xmp.baseplayer.internals.AdStatusReporter._cb.setAddThisToCallback(false);}
try{xmp.baseplayer.internals.AdStatusReporter._cb.call('SMARTCOUNT: '+Zl);}
catch(ex){}
if(Yl.isDebugEnabled()){Yl.debug(Zl);}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoAdMetaFileLoader=function($l,am){this._CLASS_NAME='VideoAdMetaFileLoader';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoAdMeta';this._owner=$l;this._loaderId=am;this._resBundle=null;this._callback=null;this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();this._latchCompleteCb=this._createCb(null,'LatchComplete',this._handleLatchComplete);this._latch=new xmp.util.Latch([],this._latchCompleteCb);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.setResBundle=function(bm,cm){this._resBundle=bm;this._callback=cm;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype.load=function(){try{if(this._shortCircuit()){return;}
this._latchCompleteCb.setMetadata('LatchPhase',this._AD_MAN_TYPE);var dm=this._resBundle.getResourceTypes();for(var i=0;i<dm.length;i++){var em=this._resBundle.getMetaResource(dm[i]);em.setCompanionAdId(this._companionAdId);this._loadARM(em,this._AD_MAN_TYPE,xmp.net.ContentTypes.TEXT,em.getId());}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleLatchComplete=function(cb){try{var fm=this._latchCompleteCb.getMetadata('LatchPhase','');if(fm===this._AD_MAN_TYPE){this._doAdManComplete();}
else if(fm===this._AD_SERVER_TYPE){this._doAdServerComplete();}
else{throw new Error('Unrecognized phase: '+fm);}}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._doAdManComplete=function(){this._latchCompleteCb.setMetadata('LatchPhase',this._AD_SERVER_TYPE);var gm=this._resBundle.getResourceTypes();var hm=0;for(var i=0;i<gm.length;i++){var im=this._resBundle.getMetaResource(gm[i]);var jm=this._makeCbName(im,this._AD_MAN_TYPE);var km=this._latchCompleteCb.getMetadata(jm,xmp.util.internals.MetadataMap.defaultObj);if(!km.isError()){var lm=this._buildAdServerRelUrl(im,km.getText());if(im.getType()==='primary'){hm++;this._loadARM(im,this._AD_SERVER_TYPE,xmp.net.ContentTypes.JSON,lm);}
else if(im.getType()==='synch_unit'){var mm=xmp.baseplayer.internals.Ad.getAdServerRoot();im._setRawData(mm+lm);im.setDataType('url');}}
else{im._setErrorMessage(km.getErrorMessage());}}
if(hm===0){this._end();}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._doAdServerComplete=function(){var nm=this._resBundle.getMetaResource('primary');var om=this._makeCbName(nm,this._AD_SERVER_TYPE);var qm=this._latchCompleteCb.getMetadata(om,xmp.util.internals.MetadataMap.defaultObj);if(!qm.isError()){nm._setRawData(qm.getJsonObject());}
else{nm._setErrorMessage(qm.getErrorMessage());}
this._end();};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleErrorMessage=function(rm){this._resBundle._setErrorMessage(rm);this._end();};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){var sm=this._resBundle.getMetaResource('primary');if(sm!==null&&sm.isError()){this._resBundle._setErrorMessage('Primary Resource Error: '+sm.getErrorMessage());}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._createCb=function(tm,um,vm){return(new xmp.util.Callback(this._makeCbName(tm,um),vm,this));};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._makeCbName=function(wm,xm){var ym=(wm!==null)?wm.getType():'';return(this._CLASS_NAME+'_'+xm+'_'+ym+'_'+this._loaderId);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._buildAdServerRelUrl=function(zm,Am){var Bm=xmp.trimString(Am);var Cm=zm.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(zm.getType(),this._companionAdId,Bm,Cm);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._loadARM=function(Dm,Em,Fm,Gm){var cb=this._createCb(Dm,Em,this._handleARMResponse);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(Gm,cb,Em,Gm,Fm,null);};xmp.baseplayer.internals.VideoAdMetaFileLoader.prototype._handleARMResponse=function(Hm,Im){if(Im.isError()){var Jm=new xmp.baseplayer.ApplicationError(Im.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Im.getFullUrl()}]);this._logger.warn(Jm.message,Jm);}
this._latch.called(Hm.getId(),Im);};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader=function(Km,Lm){this._CLASS_NAME='VideoCompositeAdMetaFileLoader';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoCompositeAdMeta';this._owner=Km;this._loaderId=Lm;this._resBundle=null;this._callback=null;this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.setResBundle=function(Mm,Nm){this._resBundle=Mm;this._callback=Nm;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype.load=function(){try{if(this._shortCircuit()){return;}
xmp.baseplayer.internals.AdServerPageController.getInstance().waitUntilReady(new xmp.util.Callback('_doCompositeJob',this._doCompositeJob,this));}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._doCompositeJob=function(){try{var Om=this._createJobJson();var Pm='tile='+this._companionAdId.toString();this._logger.info(Om);var cb=this._createCb(null,'adCompositor',this._handleARMResponse);var Qm=xmp.baseplayer.internals.AdServerPageController.getInstance().getData('NGUserIDCookie','false');var Rm=[{name:'job_json',value:xmp.Base64.encode(Om),type:xmp.net.AjaxRequestManager.POST_FORM_TYPE},{name:'NGUserID',value:Qm,type:xmp.net.AjaxRequestManager.POST_FORM_TYPE},{name:'adDEmas',value:xmp.util.Cookie.read('adDEmas'),type:xmp.net.AjaxRequestManager.POST_FORM_TYPE}];xmp.net.AjaxRequestManager.getInstance().request(Pm,cb,'adCompositor',Pm,xmp.net.ContentTypes.JSON,Rm);}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._createJobJson=function(){var jj="{ inmeta: { adManRoot: '"+xmp.baseplayer.internals.Ad.getAdManRoot()+"', adServerRoot: '"+xmp.baseplayer.internals.Ad.getAdServerRoot()+"'}, inoutmeta: { debug: {} }, commands: [";var Sm=this._resBundle.getResourceTypes();for(var i=0;i<Sm.length;i++){var Tm=Sm[i];var Um=this._resBundle.getMetaResource(Tm);var Vm=this._getDataType(Um);Um.setDataType(Vm);Um.setCompanionAdId(this._companionAdId);var Wm=this._buildAdServerRelUrl(Um,'');var Xm="{ type: 'loadAd', inmeta: { type: '"+Tm+"', dataType: '"+Vm+"', "+"query: '"+Wm+"', id: '"+Um.getId()+"'}, "+"inoutmeta: { data: '', error: '', debug: {}}}";jj+=Xm;if(i!==(Sm.length-1)){jj+=', ';}}
jj+=']}';return jj;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._getDataType=function(Ym){var Zm=Ym.getType();var $m=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('ad data types');return $m.getString(Zm,'default');};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleErrorMessage=function(an){this._resBundle._setErrorMessage(an);this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){if(this._resBundle.getCount()===this._resBundle.getErrorCount()){this._resBundle._setErrorMessage('All resources in composite failed.');}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._createCb=function(bn,cn,dn){return(new xmp.util.Callback(this._makeCbName(bn,cn),dn,this));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._makeCbName=function(en,fn){var gn=(en!==null)?en.getType():'';return(this._CLASS_NAME+'_'+fn+'_'+gn+'_'+this._loaderId);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._buildAdServerRelUrl=function(hn,jn){var kn=xmp.trimString(jn);var ln=hn.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(hn.getType(),this._companionAdId,kn,ln);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._handleARMResponse=function(mn,nn){if(nn.isError()){var on=new xmp.baseplayer.ApplicationError(nn.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:nn.getFullUrl()}]);this._logger.warn(on.message);this._failAll(nn.getErrorMessage());this._end();return;}
var pn=nn.getJsonObject();var qn=this._decodeOpt(pn.jobError,'');if(qn.length!==0){this._logger.warn('jobError: '+qn);this._failAll('composite jobError: '+qn);this._end();return;}
var rn=this._getOpt(pn.inoutmeta.debug.job_duration,0);this._logger.info("Servlet job duration (ms): "+rn);var sn=this._resBundle.getResourceTypes();for(var i=0;i<sn.length;i++){var tn=sn[i];var un=this._resBundle.getMetaResource(tn);var vn=null;for(var j=0;j<pn.commands.length;j++){if(pn.commands[j].inmeta.type===tn){vn=pn.commands[j];break;}}
var wn=this._decodeOpt(vn.inoutmeta.debug.adServerUrl,'NOT_FOUND');var xn=this._decodeOpt(vn.inoutmeta.debug.fullAdManUrl,'NOT_FOUND');var yn=this._decodeOpt(vn.inoutmeta.data,'');var zn=this._decodeOpt(vn.inoutmeta.error,'');var An=vn.inmeta.dataType;var Bn='Ad type: '+tn+', dataType: '+An+', adServerUrl: '+wn+', fullAdManUrl: '+xn;if((zn.length===0)&&this._logger.isInfoEnabled()){this._logger.info(Bn);this._logger.info('Data: '+yn);}
if(zn.length!==0){this._logger.warn(Bn);this._logger.warn('Error: '+zn);un._setErrorMessage(zn);continue;}
if(An==='url'){var Cn=xmp.baseplayer.internals.Ad.getAdServerRoot();un._setRawData(Cn+yn);}
else if(An==='videoJson'){try{var Dn=xmp.net.AjaxRequestManager.getInstance()._parseJson(yn);un._setRawData(Dn);}
catch(parseEx){this._logger.warn('Parse error with ad type: '+tn+', '+xmp.extractErrorMessage(parseEx));un._setErrorMessage(xmp.extractErrorMessage(parseEx));}}
else{un._setRawData(yn);}}
this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._failAll=function(En){this._resBundle._setErrorMessage(En);var Fn=this._resBundle.getResourceTypes();for(var i=0;i<Fn.length;i++){var Gn=Fn[i];var Hn=this._resBundle.getMetaResource(Gn);Hn._setErrorMessage(En);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._getOpt=function(In,Jn){if(typeof(In)!=='undefined'){return In;}
return Jn;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader.prototype._decodeOpt=function(Kn,Ln){if(xmp.isNonEmptyString(Kn)){return xmp.Base64.decode(Kn);}
return Ln;};xmp.updateAdServerData=function(Mn){xmp.baseplayer.internals.AdServerPageController.getInstance().update(Mn);};xmp.baseplayer.internals.AdServerPageController=function(){this._READY_POLL_INTERVAL=250;this._IFRAME_ID='xmp_AdServerPageController';this._logger=new xmp.util.internals.CategoryLogger('AdServerPageController');this._dataMap={};this._readyCB=null;this._readyTimer=null;this._gotData=false;this._startTime=-1;this._readyTries=0;this._refreshCount=0;this._refreshTimer=null;this._init();};xmp.baseplayer.internals.AdServerPageController._instance=null;xmp.baseplayer.internals.AdServerPageController.getInstance=function(){if(xmp.baseplayer.internals.AdServerPageController._instance===null){xmp.baseplayer.internals.AdServerPageController._instance=new xmp.baseplayer.internals.AdServerPageController();}
return xmp.baseplayer.internals.AdServerPageController._instance;};xmp.baseplayer.internals.AdServerPageController.prototype.waitUntilReady=function(cb){this._readyCB=null;this._stopReadyTimer();this._startTime=-1;this._readyTries=0;if(this._gotData){cb.call();return;}
this._readyCB=cb;this._startTime=this.getNowMs();var Nn=new xmp.util.Callback('_readyTest',this._readyTest,this);this._readyTimer=new xmp.util.Timer(Nn.getId(),this._READY_POLL_INTERVAL,1000,Nn);this._readyTimer.start();};xmp.baseplayer.internals.AdServerPageController.prototype.getNowMs=function(){return(new Date()).getTime();};xmp.baseplayer.internals.AdServerPageController.prototype.getData=function(On,Pn){var Qn=this._dataMap[On];return(Qn)?Qn:Pn;};xmp.baseplayer.internals.AdServerPageController.prototype.update=function(Rn){for(var Sn=xmp.MapIterator.create(Rn);Sn.hasNext();Sn.next()){var Tn=Sn.currentKey();this._dataMap[Tn]=Sn.currentValue();if(this._logger.isInfoEnabled()){this._logger.info('Updated key: '+Tn+', value: '+this._dataMap[Tn]);}}
this._gotData=true;this._refreshCount++;this._logger.info('Data updated, count: '+this._refreshCount);};xmp.baseplayer.internals.AdServerPageController.prototype._stopReadyTimer=function(){if(this._readyTimer!==null){this._readyTimer.stop();this._readyTimer=null;}};xmp.baseplayer.internals.AdServerPageController.prototype._readyTest=function(cb,Un){this._readyTries++;if(this._gotData){this._stopReadyTimer();this._logger.info('Got data, try: '+this._readyTries);}
else{var Vn=this.getNowMs()-this._startTime;if(Vn>30000){this._stopReadyTimer();this._logger.warn('Failed to get initial ad server data.');}
else{return;}}
if(this._readyCB!==null){this._readyCB.call();this._readyCB=null;}};xmp.baseplayer.internals.AdServerPageController.prototype._init=function(){var Wn=window.document.createElement('div');Wn.style.display='none';xmp.insertDomChildBefore(window.document.body,Wn);var Xn=this._getCfgNode().getString('adServerDataPage','');if(Xn.toLowerCase().indexOf('http')!==0){var Yn=xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('rootUrlMap/adServer');Xn=Yn+Xn;}
var Zn='<iframe hspace="0" vspace="0" marginHeight="0" marginWidth="0" src="'+Xn+'" border="0" frameBorder="0" height="0" width="0" scrolling="no"  id="'+this._IFRAME_ID+'" name="'+this._IFRAME_ID+'" style="position: absolute; visibility: hidden;" ></iframe>';Wn.innerHTML=Zn;var cb=new xmp.util.Callback('_doRefresh',this._doRefresh,this);this._refreshTimer=new xmp.util.Timer(cb.getId(),30000,-1,cb);this._refreshTimer.start();};xmp.baseplayer.internals.AdServerPageController.prototype._doRefresh=function(){try{this._logger.info('Attempting to refresh.');var $n=window.frames[this._IFRAME_ID];$n.xmp_cnn_updateAdServerData();}
catch(ex){this._logger.warn('Failed to refresh.',ex);}};xmp.baseplayer.internals.AdServerPageController.prototype._getCfgNode=function(){return xmp.util.SettingsManager.getInstance().getGlobalContextNode().getNodeForPath('loaders/videoCompositeAdMeta/cfg');};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2=function(ao,bo){this._CLASS_NAME='VideoCompositeAdMetaFileLoader2';this._AD_MAN_TYPE='adMan';this._AD_SERVER_TYPE='adServer';this._DELIM='__@@$$@@__';this._DELIM_RE=/__@@\$\$@@__/gm;this._AD_REQUEST_ID_PREFIX='ad';this._logger=new xmp.util.internals.CategoryLogger(this._CLASS_NAME);this._THIS_TYPE='videoCompositeAdMeta';this._owner=ao;this._loaderId=bo;this._resBundle=null;this._callback=null;this._latchCompleteCb=this._createCb(null,'LatchComplete',this._handleLatchComplete);this._latch=new xmp.util.Latch([],this._latchCompleteCb);this._adDataArray=[];this._companionAdId=xmp.baseplayer.internals.Ad.createCompanionAdId();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.setResBundle=function(co,eo){this._resBundle=co;this._callback=eo;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype.load=function(){try{if(this._shortCircuit()){return;}
this._loadAdMan();}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._shortCircuit=function(){if(this._resBundle.getCount()===0){this._resBundle._setRawData('Loaded (no resources)');}
if(this._resBundle.isLoaded()||this._resBundle.isError()){xmp.util.Timer.doSimpleCallback(this._createCb(null,'endAsynch',this._end));return true;}
return false;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._getDataType=function(fo){var go=fo.getType();var ho=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('ad data types');return ho.getString(go,'default');};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleError=function(e){this._handleErrorMessage(xmp.extractErrorMessage(e));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleErrorMessage=function(io){this._resBundle._setErrorMessage(io);this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._end=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}
if(!this._resBundle.isError()){if(this._resBundle.getCount()===this._resBundle.getErrorCount()){this._resBundle._setErrorMessage('All resources in composite failed.');}}
if(!this._resBundle.isError()){this._resBundle._setRawData('Loaded');}
try{this._callback.call(this._resBundle);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._createCb=function(jo,ko,lo){return(new xmp.util.Callback(this._makeCbName(jo,ko),lo,this));};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._makeCbName=function(mo,no){var oo=(mo!==null)?mo.getType():'';return(this._CLASS_NAME+'_'+no+'_'+oo+'_'+this._loaderId);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._buildAdServerRelUrl=function(po,qo){var ro=xmp.trimString(qo);var so=po.getMetadata('segvars','');return xmp.baseplayer.internals.Ad.getInstance().buildRelativeURL(po.getType(),this._companionAdId,ro,so);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._crackRawData=function(to){var uo=to.indexOf('\n');if(uo===-1){throw new Error('Ad server returned malformed composite - missing line feed between header and data.');}
var vo=xmp.trimString(to.substr(0,uo));if(vo.length===0){throw new Error('Ad server returned malformed composite - empty string header.');}
if(0!==vo.indexOf(this._AD_REQUEST_ID_PREFIX)){throw new Error('Ad server returned malformed composite - header does not begin with "'+this._DELIM+' '+this._AD_REQUEST_ID_PREFIX+'".');}
var wo=to.substr(uo+1);uo=vo.indexOf(' ');if(uo===-1){throw new Error('Ad server returned malformed composite - missing space in header between ID and status.');}
var id=xmp.trimString(vo.substr(0,uo));var xo=xmp.trimString(vo.substr(uo+1));if(!(xo==='OK'||xo==='ERROR')){throw new Error('Ad server returned malformed composite - status must be either "OK" or "ERROR".');}
var yo=(xo==='OK');if(yo&&(xmp.trimString(wo).length===0)){yo=false;wo='No data returned by ad server (or only white space).';}
return{'adReqId':id,'data':wo,'ok':yo};};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._breakComposite=function(zo){var Ao={};var Bo=zo.indexOf(this._DELIM);if(Bo===-1){return Ao;}
if(Bo>0){zo=zo.substr(Bo);}
var Co=zo.split(this._DELIM_RE);for(var i=1;i<Co.length;i++){var Do=this._crackRawData(Co[i]);Ao[Do.adReqId]=Do;}
return Ao;};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdServerARMResponse=function(Eo,Fo){try{this._handleAdServerARMResponseInternal(Eo,Fo);}
catch(e){this._failAll(xmp.extractErrorMessage(e));this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdServerARMResponseInternal=function(Go,Ho){if(Ho.isError()){var Io=new xmp.baseplayer.ApplicationError(Ho.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Ho.getFullUrl()}]);this._logger.warn(Io.message);this._failAll(Ho.getErrorMessage());this._end();return;}
var Jo=this._breakComposite(Ho.getText());for(var i=0;i<this._adDataArray.length;i++){var Ko=this._adDataArray[i];var Lo=Jo[Ko.adReqId];if(typeof(Lo)==='undefined'){throw new Error('Ajax response missing ad request ID: '+Ko.adReqId+' for res type: '+Ko.res.getType());}
if(Lo.ok){if(Ko.res.getDataType()==='videoJson'){try{var Mo=xmp.net.AjaxRequestManager.getInstance()._parseJson(Lo.data);Ko.res._setRawData(Mo);}
catch(parseEx){this._logger.warn('Parse error with ad type: '+Ko.res.getType()+', '+xmp.extractErrorMessage(parseEx));Ko.res._setErrorMessage(xmp.extractErrorMessage(parseEx));}}
else{Ko.res._setRawData(Lo.data);}}
else{Ko.res._setErrorMessage(Lo.data);}}
this._end();};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._failAll=function(No){this._resBundle._setErrorMessage(No);var Oo=this._resBundle.getResourceTypes();for(var i=0;i<Oo.length;i++){var Po=Oo[i];var Qo=this._resBundle.getMetaResource(Po);Qo._setErrorMessage(No);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._loadAdMan=function(){var Ro=this._resBundle.getResourceTypes();for(var i=0;i<Ro.length;i++){var So=this._resBundle.getMetaResource(Ro[i]);So.setCompanionAdId(this._companionAdId);var To=this._getDataType(So);So.setDataType(To);this._loadARM(So,this._AD_MAN_TYPE,xmp.net.ContentTypes.TEXT,So.getId());}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._loadARM=function(Uo,Vo,Wo,Xo){var cb=this._createCb(Uo,Vo,this._handleAdManARMResponse);this._latch.addCbName(cb.getId());xmp.net.AjaxRequestManager.getInstance().request(Xo,cb,Vo,Xo,Wo,null);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleAdManARMResponse=function(Yo,Zo){if(Zo.isError()){var $o=new xmp.baseplayer.ApplicationError(Zo.getErrorObject(),'FailToGetAdVideo',null,[{label:"Url",text:Zo.getFullUrl()}]);this._logger.warn($o.message,$o);}
this._latch.called(Yo.getId(),Zo);};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._handleLatchComplete=function(cb){try{this._doAdManComplete();}
catch(e){this._handleError(e);}};xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2.prototype._doAdManComplete=function(){var ap=this._resBundle.getResourceTypes();var bp=[];this._adDataArray=[];for(var i=0;i<ap.length;i++){var cp=this._resBundle.getMetaResource(ap[i]);var dp=this._makeCbName(cp,this._AD_MAN_TYPE);var ep=this._latchCompleteCb.getMetadata(dp,xmp.util.internals.MetadataMap.defaultObj);if(!ep.isError()){var fp=this._AD_REQUEST_ID_PREFIX+xmp.zeroPad(bp.length,2);var gp=this._buildAdServerRelUrl(cp,ep.getText());bp.push({name:fp,value:gp,type:xmp.net.AjaxRequestManager.POST_FORM_TYPE});this._adDataArray.push({'adReqId':fp,'res':cp});}
else{cp._setErrorMessage(ep.getErrorMessage());}}
if(bp.length===0){this._end();}
else{bp.reverse();var hp='/multi';var cb=this._createCb(null,'adCompositor',this._handleAdServerARMResponse);xmp.net.AjaxRequestManager.getInstance().request(hp,cb,'adCompositor',hp,xmp.net.ContentTypes.TEXT,bp);}};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoContentMetaFileLoader=function(ip,jp){this._logger=new xmp.util.internals.CategoryLogger('VideoContentMetaFileLoader');this._THIS_TYPE='videoContentMeta';this._owner=ip;this._loaderId=jp;this._handleArray=[];this._handleMap={};this._perIdCallback=null;this._allLoadedCallback=null;this._loadedCount=0;this._loadCalled=false;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.setIds=function(kp,lp){this._loadCalled=false;this._handleArray=[];this._perIdCallback=lp;var mp={};for(var i=0;i<kp.length;i++){var id=kp[i];if(!(typeof id==='string'&&id.length>0)){throw new xmp.util.internals.InvalidArgsError("The 'ids' argument must be an array of non-empty strings.");}
if(typeof mp[id]!=='undefined'){this._logger.warn('Skipping duplicate ID: '+id);continue;}
mp[id]=id;var np=xmp.baseplayer.internals.MetaFileCache.getInstance().findOrCreate(this._THIS_TYPE,id,this,-1);var op={h:np,ready:false};this._handleArray.push(op);this._handleMap[np.getId()]=op;}
return this._extractPlayableDataArray();};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.setAllLoadedCallback=function(pp){this._allLoadedCallback=pp;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype.load=function(){this._loadCalled=true;if(this._handleArray.length===0){this._releaseThis();this._notifyAllLoaded();return;}
this._loadedCount=0;for(var i=0;i<this._handleArray.length;i++){var qp=this._handleArray[i];if(qp.ready){this._notifyPerFile(qp.h);}}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._extractPlayableDataArray=function(){var rp=[];for(var i=0;i<this._handleArray.length;i++){var sp=this._handleArray[i].h;rp.push(sp.getDataObject());}
return rp;};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyPerFile=function(tp){if(tp.isLoaded()){this._loadedCount++;this._notifyPerFileCore(tp);}
if(this._loadedCount>=this._handleArray.length){this._releaseThis();this._notifyAllLoaded();}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._releaseThis=function(){if(this._owner!==null){this._owner._release(this);this._owner=null;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyPerFileCore=function(up){try{if(this._perIdCallback!==null){this._perIdCallback.call(up.getDataObject());}}
catch(e){this._logger.warn('Error calling per-file-callback',e);}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyAllLoaded=function(){try{if(this._allLoadedCallback!==null){this._allLoadedCallback.call();}}
catch(e){var vp=new xmp.baseplayer.ApplicationError(e,'badVideoJson',e.context,null);this._logger.warn(vp.message,vp);}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._notifyFileRequestLoaded=function(wp){if(this._loadCalled){this._notifyPerFile(wp);}
else{var xp=this._handleMap[wp.getId()];if(xp.h!==wp){throw new Error('Unexpected, handles not the same reference.');}
xp.ready=true;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._loadFileRequest=function(yp){var zp=null;try{zp=new xmp.util.PlayableData(yp.getId());yp._setDataObject(zp);var Ap=new xmp.util.Callback('VideoContentMetaFileLoader'+'_'+this.getLoaderId()+'_'+yp.getId(),this._handleAjaxResponse,this);var Bp=xmp.net.AjaxRequestManager.getInstance();Ap.setMetadata('handle',yp);Bp.request(yp.getId(),Ap,yp.getType(),yp.getId(),xmp.net.ContentTypes.JSON,null);return xmp.baseplayer.internals.FileRequestHandle.STATE_LOADING;}
catch(e){try{if(zp!==null){zp._setErrorMessage(xmp.extractErrorMessage(e));}}
catch(e2){this._logger.warn('Second chance error handling created file request',e2);}
throw e;}};xmp.baseplayer.internals.VideoContentMetaFileLoader.prototype._handleAjaxResponse=function(Cp,Dp){var Ep=Cp.getMetadata('handle',{});var Fp=Ep.getDataObject();if(!Dp.isError()){Fp._setRawData(Dp.getJsonObject());}
else{var Gp=new xmp.baseplayer.ApplicationError(Dp.getErrorObject(),'FailToGetVideoJson','VideoContent',[{label:'url',text:Dp.getFullUrl()}]);this._logger.warn(Gp.message,Gp);Ep._setErrorMessage(Dp.getErrorMessage());Fp._setErrorMessage(Dp.getErrorMessage());}
Ep._setAsLoaded();};xmp.createNamespace("xmp.baseplayer.internals");xmp.baseplayer.internals.VideoPromoMetaFileLoader=function(Hp,Ip){this._logger=new xmp.util.internals.CategoryLogger('VideoPromoMetaFileLoader');this._THIS_TYPE='videoPromoMeta';this._owner=Hp;this._loaderId=Ip;this._playableNode=null;this._callback=null;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.getLoaderId=function(){return this._loaderId;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.setNode=function(Jp,Kp){this._playableNode=Jp;this._callback=Kp;};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype.load=function(){var Lp=new xmp.util.Callback('VideoPromoMetaFileLoader'+'_'+this._loaderId,this._handleAjaxResponse,this);var Mp=xmp.net.AjaxRequestManager.getInstance();var Np=this._playableNode.getPlayableData();var id=Np.getMetaResourceId();Mp.request(id,Lp,this._THIS_TYPE,id,xmp.net.ContentTypes.JSON,null);};xmp.baseplayer.internals.VideoPromoMetaFileLoader.prototype._handleAjaxResponse=function(Op,Pp){var Qp=this._playableNode.getPlayableData();if(!Pp.isError()){var Rp=new xmp.baseplayer.ApplicationError(Pp.getErrorObject(),'FailToGetPromoJson','VideoPromo',[{label:'url',text:Pp.getFullUrl()}]);this._logger.warn(Rp.message,Rp);Qp._setRawData(Pp.getJsonObject());}
else{Qp._setErrorMessage(Pp.getErrorMessage());}
if(this._owner!==null){this._owner._release(this);this._owner=null;}
try{this._callback.call(this._playableNode);}
catch(e){this._logger.warn('Error calling callback',e);}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.CompositeNodeListener=function(Sp){this._com_logger=new xmp.util.internals.CategoryLogger('CompositeNodeListener');this._constants=xmp.baseplayer.listeners.CompositeNodeListener;xmp.baseplayer.listeners.CompositeNodeListener.ctor.call(this,this._constants.COMPOSITE_NODE_LISTENER,Sp);this.children=[];};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.CompositeNodeListener);xmp.baseplayer.listeners.CompositeNodeListener.COMPOSITE_NODE_LISTENER="Composite";xmp.baseplayer.listeners.CompositeNodeListener.INITIALIZE="Initialize";xmp.baseplayer.listeners.CompositeNodeListener.COMPLETE="Complete";xmp.baseplayer.listeners.CompositeNodeListener.RENDER="Render";xmp.baseplayer.listeners.CompositeNodeListener.DYNAMIC_RULES="DynamicRules";xmp.baseplayer.listeners.CompositeNodeListener.TIMELINE_CHANGE="TimelineChange";xmp.baseplayer.listeners.CompositeNodeListener.CAN_USER_CONTROL="CanUserControl";xmp.baseplayer.listeners.CompositeNodeListener.CAN_COMPLETE_NOW="CanCompleteNow";xmp.baseplayer.listeners.CompositeNodeListener.COMPLETE_ASNCH="CompleteAsynch";xmp.baseplayer.listeners.CompositeNodeListener.OVERRIDE_AD_RESOURCES="OverrideAdResources";xmp.baseplayer.listeners.CompositeNodeListener.VALIDATE="Validate";xmp.baseplayer.listeners.CompositeNodeListener.prototype.canUserControl=function(Tp){return this.dispatch(this._constants.CAN_USER_CONTROL,[Tp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleDynamicRules=function(Up){this.dispatch(this._constants.DYNAMIC_RULES,[Up]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleRender=function(Vp){this.dispatch(this._constants.RENDER,[Vp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleInitialize=function(Wp){this.dispatch(this._constants.INITIALIZE,[Wp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleComplete=function(Xp){this.dispatch(this._constants.COMPLETE,[Xp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.canCompleteNow=function(Yp){return this.dispatch(this._constants.CAN_COMPLETE_NOW,[Yp]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleCompleteAsynch=function(Zp,$p){this.dispatch(this._constants.COMPLETE_ASNCH,[Zp,$p]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleOpen=function(aq){this.dispatch(xmp.OPEN,[aq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleConnecting=function(bq){this.dispatch(xmp.CONNECTING,[bq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleConnected=function(cq){this.dispatch(xmp.CONNECTED,[cq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handlePlay=function(dq){this.dispatch(xmp.PLAY,[dq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleFirstFrameRendered=function(eq){this.dispatch(xmp.FIRST_FRAME_RENDERED,[eq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handlePause=function(fq){this.dispatch(xmp.PAUSE,[fq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleStop=function(gq){this.dispatch(xmp.STOP,[gq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleRewind=function(hq){this.dispatch(xmp.REWIND,[hq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleFastForward=function(iq){this.dispatch(xmp.FAST_FORWARD,[iq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleSeekable=function(jq){this.dispatch(xmp.SEEKABLE,[jq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleEnded=function(kq){this.dispatch(xmp.ENDED,[kq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleBuffering=function(lq,mq){this.dispatch(xmp.BUFFERING,[lq,mq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleTimelineChange=function(nq,oq,pq){this.dispatch(this._constants.TIMELINE_CHANGE,[nq,oq,pq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleError=function(qq,e){this.dispatch(xmp.ERRORS,[qq,e]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleOverrideAdResources=function(rq,sq){this.dispatch(this._constants.OVERRIDE_AD_RESOURCES,[rq,sq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.handleValidate=function(tq){this.dispatch(this._constants.VALIDATE,[tq]);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.dispatch=function(uq,vq){var wq=this.children.length;for(var i=0;i<wq;i++){var xq=this.children[i];var yq=xq.callbacks[uq];var zq=null;try{zq=yq.method.apply(xq.listener,vq);}
catch(e){this._com_logger.warn('Error dispatching: '+uq+' on '+xq.listener.getId()+' node listener.',e);try{var Aq=vq[0];xq.listener.handleError(Aq,e);}
catch(e2){try{this._com_logger.warn('Error calling handleError while dispatching: '+uq+' on '+xq.listener.getId()+' node listener.',e2);}
catch(e3){}}}
if(yq.return_type===xmp.BOOLEAN_TYPE&&false===zq){return false;}}
return true;};xmp.baseplayer.listeners.CompositeNodeListener.prototype.addChild=function(Bq){var Cq={listener:Bq,callbacks:null};this.initChildCallbacks(Cq,Bq);this.children.push(Cq);};xmp.baseplayer.listeners.CompositeNodeListener.prototype.initChildCallbacks=function(Dq,Eq){var Fq=[{name:this._constants.CAN_USER_CONTROL,data:{method:Eq.canUserControl,return_type:xmp.BOOLEAN_TYPE}},{name:this._constants.DYNAMIC_RULES,data:{method:Eq.handleDynamicRules,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.INITIALIZE,data:{method:Eq.handleInitialize,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.COMPLETE,data:{method:Eq.handleComplete,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.RENDER,data:{method:Eq.handleRender,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.OPEN,data:{method:Eq.handleOpen,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.CONNECTING,data:{method:Eq.handleConnecting,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.CONNECTED,data:{method:Eq.handleConnected,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.FIRST_FRAME_RENDERED,data:{method:Eq.handleFirstFrameRendered,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.PLAY,data:{method:Eq.handlePlay,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.PAUSE,data:{method:Eq.handlePause,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.STOP,data:{method:Eq.handleStop,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.REWIND,data:{method:Eq.handleRewind,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.FAST_FORWARD,data:{method:Eq.handleFastForward,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.SEEKABLE,data:{method:Eq.handleSeekable,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.ENDED,data:{method:Eq.handleEnded,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.BUFFERING,data:{method:Eq.handleBuffering,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.TIMELINE_CHANGE,data:{method:Eq.handleTimelineChange,return_type:xmp.UNDEFINED_TYPE}},{name:xmp.ERRORS,data:{method:Eq.handleError,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.CAN_COMPLETE_NOW,data:{method:Eq.canCompleteNow,return_type:xmp.BOOLEAN_TYPE}},{name:this._constants.COMPLETE_ASNCH,data:{method:Eq.handleCompleteAsynch,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.OVERRIDE_AD_RESOURCES,data:{method:Eq.handleOverrideAdResources,return_type:xmp.UNDEFINED_TYPE}},{name:this._constants.VALIDATE,data:{method:Eq.handleValidate,return_type:xmp.UNDEFINED_TYPE}}];Dq.callbacks={};var Gq=Fq.length;for(var i=0;i<Gq;i++){Dq.callbacks[Fq[i].name]=Fq[i].data;}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultAdNodeListener=function(Hq,Iq){xmp.baseplayer.listeners.DefaultAdNodeListener.ctor.call(this,Hq,Iq);this._logger=new xmp.util.internals.CategoryLogger('DefaultAdNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultAdNodeListener);xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.canUserControl=function(Jq){var Kq=xmp.util.SettingsManager.getInstance().getContextNode().getNodeForPath('BasePlayer').getBoolean('user can control ad',false);return Kq;};xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.handleComplete=function(Lq){var Mq=Lq.getPlayableData();Lq.setURI(Mq.getPlayableId());Lq.setMimeTypes(Mq.getMimeTypeArray());Lq.setStreamingMode(xmp.AD_STREAMING_MODE);if(Mq.isExternal()){Lq.setUriAbsolute(true);if(Mq.getMimeTypeArray().length>0){var Nq=Mq.getMimeTypeArray()[0];Lq.setMimeType(Nq);if(Nq==='video/x-flv'){var Oq=Mq.getPlayableId().toLowerCase().split(".");if(Oq[Oq.length-1]!=='flv'){Lq.setURI(Mq.getPlayableId()+"&.flv");}}}}};xmp.baseplayer.listeners.DefaultAdNodeListener.prototype.handleRender=function(Pq){var Qq=Pq.getMetaResource('primary');if(Qq!==null){this._logger.info('Playing ad with tile ID: '+Qq.getCompanionAdId());}
xmp.baseplayer.listeners.DefaultAdNodeListener.base.handleRender.call(this,Pq);};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener=function(Rq,Sq){xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.ctor.call(this,Rq,Sq);this._logger=new xmp.util.internals.CategoryLogger('DefaultNextUpSlateNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultSlateNodeListener,xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener);xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.prototype.handleComplete=function(Tq){xmp.baseplayer.listeners.DefaultNextUpSlateNodeListener.base.handleComplete.call(this,Tq);var Uq=this._findNextContentNode();if(Uq!==null){Tq.setMetadata("headline",Uq.getPlayableData().getDataObject().headline);}
else{this._logger.debug("Unusual state: The NextUpSlate failed to find a next content node.");}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultPlayerListener=function(Vq,Wq){xmp.baseplayer.listeners.DefaultPlayerListener.ctor.call(this,Vq,Wq);this._logger=new xmp.util.internals.CategoryLogger('DefaultPlayerListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultPlayerListener);xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleRender=function(Xq){};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleError=function(Yq,e){};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleOpen=function(Zq){this.setStatus(Zq,xmp.OPEN);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleConnecting=function($q){this.setStatus($q,xmp.CONNECTING);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleConnected=function(ar){this.setStatus(ar,xmp.CONNECTED);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handlePlay=function(br){this.setStatus(br,xmp.PLAY);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handlePause=function(cr){this.setStatus(cr,xmp.PAUSE);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleStop=function(dr){this.setStatus(dr,xmp.STOP);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleRewind=function(er){this.setStatus(er,xmp.REWIND);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleFastForward=function(fr){this.setStatus(fr,xmp.FAST_FORWARD);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleSeekable=function(gr){this.setStatus(gr,xmp.SEEKABLE);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleEnded=function(hr){this.setStatus(hr,xmp.ENDED);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.handleBuffering=function(ir,jr){this.setStatus(ir,xmp.BUFFERING,jr);};xmp.baseplayer.listeners.DefaultPlayerListener.prototype.setStatus=function(kr,lr,mr){this._logger.debug('Player Listener setStatus, override to do specific handling.');};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultPromoNodeListener=function(nr,or){xmp.baseplayer.listeners.DefaultPromoNodeListener.ctor.call(this,nr,or);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultPromoNodeListener);xmp.baseplayer.listeners.DefaultPromoNodeListener.prototype.handleComplete=function(pr){var qr=pr.getPlayableData();pr.setMimeTypes(qr.getMimeTypeArray());var rr=qr.getDataObject().sizes;if(rr&&rr.length>0){pr.setSizes(qr.getDataObject().sizes);}
pr.setURI(qr.getDataObject().location);pr.setStreamingMode(qr.getDataObject().streamingMode);};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultStartSlateNodeListener=function(sr,tr){xmp.baseplayer.listeners.DefaultStartSlateNodeListener.ctor.call(this,sr,tr);this._logger=new xmp.util.internals.CategoryLogger('DefaultStartSlateNodeListener');};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultSlateNodeListener,xmp.baseplayer.listeners.DefaultStartSlateNodeListener);xmp.baseplayer.listeners.DefaultStartSlateNodeListener.prototype.handleComplete=function(ur){xmp.baseplayer.listeners.DefaultStartSlateNodeListener.base.handleComplete.call(this,ur);var vr=this._findNextContentNode();if(vr!==null){var wr=vr.getPlayableData().getDataObject().images;var xr=wr.length;var yr=[];var zr={};for(var i=0;i<xr;i++){yr.push(wr[i].id);zr[wr[i].id]=wr[i].resource;}
ur.setMetadata("image",zr[xmp.PlayerPolicy.getSizeFromPlayer(yr)]);}
else{this._logger.debug("Unusual state: The StartSlate failed to find a next content node.");}};xmp.createNamespace("xmp.baseplayer.listeners");xmp.baseplayer.listeners.DefaultVideoNodeListener=function(Ar,Br){xmp.baseplayer.listeners.DefaultVideoNodeListener.ctor.call(this,Ar,Br,false);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.DefaultBaseNodeListener,xmp.baseplayer.listeners.DefaultVideoNodeListener);xmp.baseplayer.listeners.DefaultVideoNodeListener.prototype.handleInitialize=function(Cr){var Dr=Cr.getPlayableData();Cr.setMimeTypes(Dr.getMimeTypeArray());var Er=Dr.getDataObject().sizes;if(Er&&Er.length>0){Cr.setSizes(Dr.getDataObject().sizes);}
Cr.setURI(Dr.getDataObject().location);Cr.setStreamingMode(Dr.getDataObject().streamingMode);};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.AdLoaderNodeListener=function(Fr){xmp.baseplayer.listeners.internal.AdLoaderNodeListener.ctor.call(this,'AdLoader',Fr);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.AdResNodeListener,xmp.baseplayer.listeners.internal.AdLoaderNodeListener);xmp.baseplayer.listeners.internal.AdLoaderNodeListener.prototype._handleResBundleLoaded=function(Gr,Hr){if(Hr.isError()){Gr.getPlayableData()._setErrorMessage(Hr.getErrorMessage());}
else{var Ir=Gr.getAssociatedResourceBundleType();var Jr=Hr.getMetaResource(Ir);if(Jr.isError()){Gr.getPlayableData()._setErrorMessage(Jr.getErrorMessage());}
else{Gr.getPlayableData()._setRawData(Jr.getDataObject());}}};xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener=function(Kr){xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener.ctor.call(this,'NonAdLoader',Kr);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.AdResNodeListener,xmp.baseplayer.listeners.internal.NonAdLoaderNodeListener);xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.FirstFrameNodeListener=function(Lr){this._logger=new xmp.util.internals.CategoryLogger('FirstFrameNodeListener');this._FIRST_FRAME_TIMEOUT_MIN=10000;this._firstFrameTimer=null;this._FIRST_FRAME_TIMER_ID="FIRST_FRAME_TIMER";this._currentNode=null;xmp.baseplayer.listeners.internal.FirstFrameNodeListener.ctor.call(this,'FirstFrameCheck',Lr);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.FirstFrameNodeListener);xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleConnecting=function(Mr){if(Mr.getMimeType()!==xmp.FLASH_MIME_TYPE){return;}
if(this._firstFrameTimer){this._firstFrameTimer.stop();}
var Nr=new xmp.util.Callback('basePlayerTimeout',this._handleFirstFrameTimeout,this);var Or=xmp.util.SettingsManager.getInstance().getGlobalContextNode();var Pr=Or.getInt('first frame timeout',this._FIRST_FRAME_TIMEOUT_MIN);this._firstFrameTimer=new xmp.util.Timer(this._FIRST_FRAME_TIMER_ID,Pr,1,Nr);this._currentNode=Mr;this._startTimer(this._firstFrameTimer);};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleFirstFrameRendered=function(Qr){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handlePause=function(Rr){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleStop=function(Sr){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleRewind=function(Tr){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleFastForward=function(Ur){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleSeekable=function(Vr){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype.handleError=function(Wr,e){this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._reset=function(){this._currentNode=null;this._stopTimer(this._firstFrameTimer);this._firstFrameTimer=null;};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._handleFirstFrameTimeout=function(){var Xr=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_FIRST_FRAME_TIMEOUT,'FirstFrameNodeListener',"Timeout received in playing "+this._currentNode.getBestId());this._logger.critical('First Frame Timeout',Xr);this.getPlayer().getMediaPlayer().close();this.getPlayer().onError(this._currentNode,Xr);this._reset();};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._startTimer=function(Yr){if(Yr){Yr.start();}};xmp.baseplayer.listeners.internal.FirstFrameNodeListener.prototype._stopTimer=function(Zr){if(Zr){Zr.stop();}};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.MeteringNodeListener=function($r){this._constants=xmp.baseplayer.listeners.internal.MeteringNodeListener;xmp.baseplayer.listeners.internal.MeteringNodeListener.ctor.call(this,this._constants.METERING_NODE_LISTENER,$r);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.TriggerNodeListener,xmp.baseplayer.listeners.internal.MeteringNodeListener);xmp.baseplayer.listeners.internal.MeteringNodeListener.METERING_NODE_LISTENER="Metering";xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.PromoLoaderNodeListener=function(as){xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.ctor.call(this,'PromoLoader',as);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.AbstractNodeListener,xmp.baseplayer.listeners.internal.PromoLoaderNodeListener);xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype.canCompleteNow=function(bs){if(bs.getPlayableData().isError()){return true;}
return bs.getPlayableData().isLoaded();};xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype.handleCompleteAsynch=function(cs,ds){var es=xmp.baseplayer.MetaFileLoaderFactory.getInstance().create('videoPromoMeta');var fs=new xmp.util.Callback('gotPromoCallback',this._gotPromoCallback,this);fs.setMetadata('RelayCallback',ds);es.setNode(cs,fs);es.load();};xmp.baseplayer.listeners.internal.PromoLoaderNodeListener.prototype._gotPromoCallback=function(gs,hs){var is=gs.getMetadata('RelayCallback',{});is.call(hs);};xmp.createNamespace("xmp.baseplayer.listeners.internal");xmp.baseplayer.listeners.internal.TrackingNodeListener=function(js){this._constants=xmp.baseplayer.listeners.internal.TrackingNodeListener;xmp.baseplayer.listeners.internal.TrackingNodeListener.ctor.call(this,this._constants.TRACKING_NODE_LISTENER,js);};xmp.DERIVE_CLASS(xmp.baseplayer.listeners.internal.TriggerNodeListener,xmp.baseplayer.listeners.internal.TrackingNodeListener);xmp.baseplayer.listeners.internal.TrackingNodeListener.TRACKING_NODE_LISTENER="Tracking";xmp.internal_settings_pref_api={type:"system",map:[],nodes:[{name:"PlayerContexts",map:[],nodes:[{name:"Generic",map:[],nodes:[{name:"BasePlayer",map:[{key:"user can control ad",value:"true"},{key:"look ahead and behind count",value:"7"},{key:"bandwidth threshold",value:"500"},{key:"videoAdMetaLoader",value:"videoAdMeta"},{key:"Ad metering image URL",value:"NO_DEFAULT_VALUE"},{key:"rule classes relative URL",value:"NO_DEFAULT_VALUE"},{key:"rule classes namespace",value:"NO_DEFAULT_VALUE"}],nodes:[{name:"ad patterns",map:[],nodes:[]},{name:"PlayerSizes",map:[],nodes:[]}]},{name:"invariantRules",map:[],nodes:[]},{name:"Additional segvars",map:[],nodes:[]},{name:"pattern parameters",map:[],nodes:[]},{name:"ad data types",map:[{key:"primary",value:"videoJson"},{key:"synch_unit",value:"url"}],nodes:[]},{name:"UrlStrategies",map:[],nodes:[{name:"Octoshape",map:[{key:"octo poll interval",value:"2000"},{key:"octo try limit",value:"8"},{key:"octo can use fn",value:"return ((xmp.getQueryArgOpt(\"xmpUseOctoshape\", \"true\") === \"true\") && ((xmp.isWindowsOS() && (xmp.isIEBrowser() || xmp.isFirefoxBrowser())) || (xmp.isMacOSX() && (xmp.isSafariBrowser() || xmp.isFirefoxBrowser()))));"}],nodes:[{name:"url mapping",map:[],nodes:[]}]}]}]},{name:"Global",map:[{key:"first frame timeout",value:"10000"}],nodes:[{name:"rootUrlMap",map:[],nodes:[{name:"videoContentMeta",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"videoTracking",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"videoPromoMeta",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adPolicy",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"ruleClasses",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adMan",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"dhtmlObject",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"errorDhtmlObject",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"xhr"}],nodes:[]},{name:"controlStreamResource",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"internalUserCheckResource",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"video",map:[],nodes:[{name:"Flash",map:[],nodes:[{name:"ad",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]},{name:"WindowsMedia",map:[],nodes:[{name:"ad",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"live",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]},{name:"control",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]},{name:"QuickTime",map:[],nodes:[{name:"vod",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"}],nodes:[]}]}]},{name:"image",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adVideo",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"swf",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adServer",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"}],nodes:[]},{name:"adCompositor",map:[{key:"rootUrl",value:"NO_DEFAULT_VALUE"},{key:"transportType",value:"flash"},{key:"requestVerb",value:"POST"}],nodes:[]}]},{name:"loaders",map:[],nodes:[{name:"videoContentMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoContentMetaFileLoader"}],nodes:[]},{name:"videoPromoMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoPromoMetaFileLoader"}],nodes:[]},{name:"videoAdMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.AdServiceMetaFileLoader"}],nodes:[]},{name:"videoCompositeAdMeta",map:[{key:"JSClass",value:"xmp.baseplayer.internals.VideoCompositeAdMetaFileLoader2"}],nodes:[]},{name:"dhtmlObject",map:[{key:"JSClass",value:"xmp.baseplayer.internals.DhtmlObjectMetaFileLoader"}],nodes:[]},{name:"errorDhtmlObject",map:[{key:"JSClass",value:"xmp.baseplayer.internals.ErrorDhtmlObjectMetaFileLoader"}],nodes:[]}]},{name:"Media Player",map:[{key:"Bandwidth Sample Interval",value:"5000"},{key:"Fullscreen Enabled",value:"true"},{key:"Stretch To Fit",value:"true"}],nodes:[]},{name:"PlayingPolicy",map:[],nodes:[{name:"Streaming Modes",map:[{key:"001",value:"live"},{key:"002",value:"control"},{key:"003",value:"ad"},{key:"004",value:"vod"}],nodes:[]},{name:"PlugIns",map:[],nodes:[{name:"Flash",map:[{key:"display-name",value:"Flash PlugIn/ActiveX Player"},{key:"minimum-version",value:"8.0.0"},{key:"download-url",value:"http://www.adobe.com/go/getflashplayer"}],nodes:[]},{name:"WindowsMedia",map:[{key:"display-name",value:"Windows Media Player"},{key:"minimum-version",value:"9.0.0"},{key:"download-url",value:"http://www.microsoft.com/windows/windowsmedia/download"}],nodes:[]},{name:"TurnerMedia",map:[{key:"display-name",value:"Turner Media Plugin"},{key:"minimum-version",value:"1.0.0.9"},{key:"download-url",value:"http://www.cnn.com/download"}],nodes:[]},{name:"QuickTime",map:[{key:"display-name",value:"QuickTime Plugin"},{key:"minimum-version",value:"7.1.2"},{key:"download-url",value:"http://www.apple.com/quicktime/download"}],nodes:[]},{name:"Flip4Mac",map:[{key:"display-name",value:"Flip4Mac Plugin"},{key:"minimum-version",value:"2.1"},{key:"download-url",value:"http://www.flip4mac.com/downloads/wmv_components/Flip4Mac%20WMV%202.1.3.10.dmg"}],nodes:[]},{name:"Octoshape",map:[{key:"display-name",value:"Octoshape Plugin"},{key:"minimum-version",value:"please-get-latest-release-version"},{key:"download-url",value:"http://www.octoshape.com/plugin/get.asp"}],nodes:[]}]},{name:"Native Players",map:[],nodes:[{name:"xmp.FlashPlayer",map:[{key:"Buffer Time",value:"4000"},{key:"Streaming Video Adapter",value:"StreamingVideoMedia"},{key:"ActiveX Version Detection JSON",value:"var version = {{version}}.split(/\\s+/g)[1];return version.replace( /,/g, \".\" );"},{key:"Mozilla Version Detection JSON",value:"var temp = {{version}}.split(/\\s+/g);var majorAndMinor = temp[2];var revision = temp[3].match(/\\d+/);var version = majorAndMinor + \".\" + revision;return version;"}],nodes:[]},{name:"xmp.WindowsMediaPlayer",map:[],nodes:[]},{name:"xmp.WindowsMediaPlugInPlayer",map:[{key:"Mozilla Version Detection JSON",value:"return {{version}}.split(/\\s+/g)[3];"}],nodes:[]},{name:"xmp.QuickTimePlayer",map:[{key:"State Change Polling Interval",value:"200"},{key:"Connection Timeout Interval",value:"30000"},{key:"ActiveX Version Detection JSON",value:"var tempVersion = parseInt({{version}}, 10).toString( 16 );return ( tempVersion.substr(0, 1) + \".\" + tempVersion.substr(1, 1) + \".\" + tempVersion.substr(2, 1) + \".\" + tempVersion.substr(3) );"},{key:"Mozilla Version Detection JSON",value:"return {{version}}.split(/\\s+/g)[2];"},{key:"Flip4Mac Version Detection JSON",value:"return {{version}}.split(/\\s+/g)[4];"}],nodes:[]},{name:"xmp.ImagePlayer",map:[],nodes:[]}]},{name:"Native Player Groups",map:[],nodes:[{name:"WindowsIEPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.WindowsMediaPlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"WindowsMozillaPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.WindowsMediaPlugInPlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"MacPlayers",map:[],nodes:[{name:"001",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]},{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]},{name:"004",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.QuickTimePlayer"}],nodes:[]}]}]},{name:"LinuxPlayers",map:[],nodes:[{name:"002",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.FlashPlayer"}],nodes:[]}]},{name:"003",map:[{key:"mime-type",value:"application/x-image"}],nodes:[{name:"Players",map:[{key:"001",value:"xmp.ImagePlayer"}],nodes:[]}]}]}]},{name:"Supported Platforms",map:[],nodes:[{name:"Windows",map:[{key:"Explorer",value:"WindowsIEPlayers"},{key:"Firefox",value:"WindowsMozillaPlayers"},{key:"Opera",value:"WindowsMozillaPlayers"},{key:"Netscape",value:"WindowsMozillaPlayers"},{key:"Safari",value:"WindowsMozillaPlayers"},{key:"SeaMonkey",value:"WindowsMozillaPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"QuickTime",map:[{key:"minimum-version",value:"7.1.5"}],nodes:[]}]}]},{name:"Mac",map:[{key:"Safari",value:"MacPlayers"},{key:"Firefox",value:"MacPlayers"},{key:"Netscape",value:"MacPlayers"},{key:"Camino",value:"MacPlayers"},{key:"SeaMonkey",value:"MacPlayers"},{key:"Opera",value:"MacPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"Octoshape",map:[{key:"download-url",value:"http://www.octoshape.com/plugin/mac.asp"}],nodes:[]}]}]},{name:"Linux",map:[{key:"Firefox",value:"LinuxPlayers"},{key:"Opera",value:"LinuxPlayers"},{key:"Netscape",value:"LinuxPlayers"},{key:"SeaMonkey",value:"LinuxPlayers"},{key:"Konqueror",value:"LinuxPlayers"}],nodes:[{name:"PlugIns Overrides",map:[],nodes:[{name:"Octoshape",map:[{key:"download-url",value:"http://www.octoshape.com/plugin/linux.asp"}],nodes:[]}]}]}]},{name:"MediaTypes",map:[],nodes:[{name:"Flash",map:[{key:"mime-type",value:"video/x-flv"}],nodes:[]},{name:"WindowsMedia",map:[{key:"mime-type",value:"video/x-ms-wmv"}],nodes:[]},{name:"QuickTime",map:[{key:"mime-type",value:"video/quicktime"}],nodes:[]},{name:"Image",map:[{key:"mime-type",value:"application/x-image"}],nodes:[]}]},{name:"Playback Priority Groups",map:[],nodes:[{name:"DefaultVODPlayback",map:[{key:"001",value:"WindowsMedia"},{key:"002",value:"Flash"},{key:"003",value:"QuickTime"}],nodes:[]},{name:"DefaultAdPlayback",map:[{key:"001",value:"Flash"},{key:"002",value:"WindowsMedia"},{key:"003",value:"QuickTime"}],nodes:[]},{name:"DefaultLivePlayback",map:[{key:"001",value:"WindowsMedia"},{key:"002",value:"Flash"}],nodes:[]},{name:"DefaultControlPlayback",map:[{key:"001",value:"WindowsMedia"}],nodes:[]}]},{name:"Playback Platforms",map:[],nodes:[{name:"Windows",map:[],nodes:[{name:"Explorer",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Safari",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]},{name:"Mac",map:[],nodes:[{name:"Safari",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Camino",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]},{name:"Linux",map:[],nodes:[{name:"Opera",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Firefox",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Netscape",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"SeaMonkey",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]},{name:"Konqueror",map:[{key:"ad",value:"DefaultAdPlayback"},{key:"vod",value:"DefaultVODPlayback"},{key:"live",value:"DefaultLivePlayback"},{key:"control",value:"DefaultControlPlayback"}],nodes:[]}]}]}]}]}]}]};

function unmute(node){var volumeLevel=callControllerMethod('getVolume');if(volumeLevel==0)
{volumeLevel=45;callControllerMethod('setVolume',volumeLevel);}}
function volumeCookie(val)
{if(xmp.util.Cookie.canUse())
{val=val*100;expireCookie(val);}
storeVolume(val);}
function getVolumeCookie()
{var volume=45;if(cnnVideoStorage){try{if(cnnVideoStorage.contains('moneyvidvolume')){volume=cnnVideoStorage.get('moneyvidvolume');}else{volume=45;}}
catch(e){volume=45;}}
return volume;}
function initVideoStorage()
{try{cnnVideoStorage=StorageManager.getInstance().getStorage();cnnVideoStorage.setOnload(videoStorageLoaded);cnnVideoStorage.load();}
catch(e){}}
function videoStorageLoaded()
{var volume=null;try{if(document.cookie.length>0)
{var c_name='videovolume';var c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;var c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;volume=unescape(document.cookie.substring(c_start,c_end));expireCookie(volume);}}}
catch(e){}
if(volume==null){volume=getVolumeCookie();}
storeVolume(volume);}
function storeVolume(volume)
{if(c