// Turner XMP, Release Build, � 2007 Turner Broadcasting System, Inc. A Time Warner Company.  File: xmp_util, Version: 0.1.567.2163

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);
