// Turner XMP, Release Build, © 2007 Turner Broadcasting System, Inc. A Time Warner Company.  File: xmp_net, Version: 0.1.555.2010

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.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(Dc){xmp.net.FlashXhrTransportManager.getInstance().init(Dc);};xmp.net.AjaxRequestManager.handleLoaded=function(Ec,Fc){xmp.net.AjaxRequestManager.getInstance()._handleLoadedCore(Ec,Fc);};xmp.net.AjaxRequestManager.ping=function(Gc,Hc){var cb=new xmp.util.Callback('Ping',xmp.net.AjaxRequestManager._pingCallback,null);xmp.net.AjaxRequestManager.getInstance().request(Hc,cb,Gc,Hc,xmp.net.ContentTypes.PING,null);};xmp.net.AjaxRequestManager._pingCallback=function(Ic,Jc){};xmp.net.AjaxRequestManager.prototype.request=function(Kc,Lc,Mc,Nc,Oc,Pc){var ok=xmp.isNonEmptyString(Kc)&&xmp.isNonEmptyString(Mc)&&xmp.isNonEmptyString(Nc);if(ok){ok=(Lc!==null)&&(typeof Lc==='object');}
if(ok){Oc=xmp.net.ContentTypes._calc(Oc);ok=(Oc!==xmp.net.ContentTypes.INVALID);}
if(ok){if(!Pc){Pc=null;}
ok=((Pc===null)||(typeof Pc==='object'));}
if(!ok){throw new xmp.util.internals.InvalidArgsError('Invalid arguments, please read documentation for xmp.net.AjaxRequestManager.prototype.request.');}
var Qc=this._findConfiguration(Mc);if(!Qc){throw new Error('Could not find proper configuration for URL root type: '+Mc);}
this._requestWithConfiguration(Qc,Kc,Lc,Nc,Oc,Pc);};xmp.net.AjaxRequestManager.prototype._requestWithConfiguration=function(Rc,Sc,Tc,Uc,Vc,Wc){var Xc=this._createTransport(Rc.transportType,Sc,Tc,Rc,Vc);this._requestMap[Xc.getRequestId()]=Xc;this._logRequestReport(Xc,Uc,Wc);Xc.request(Uc,Wc);};xmp.net.AjaxRequestManager.prototype._buildRequestReport=function(Yc,Zc,$c){var ad='Making request = ';ad+=(Yc.makeReport()+', ');ad+=('Relative URL: '+Zc+', ');ad+=('Request Headers: ');if($c===null){ad+='NONE';}
else{for(var i=0;i<$c.length;i++){var bd=$c[i];ad+=(bd.name+' = '+bd.value);if(i!==($c.length-1)){ad+=' & ';}}}
return ad;};xmp.net.AjaxRequestManager.prototype._createTransport=function(cd,dd,ed,fd,gd){var hd=xmp.net.TransportTypes;var jd=hd._calc(cd);this._requestIdCounter++;var kd=this._requestIdCounter.toString();switch(jd){case hd.XHR:return new xmp.net.XhrTransport(kd,dd,ed,fd,gd);case hd.IFRAME:return new xmp.net.IFrameTagTransport(kd,dd,ed,fd,gd);case hd.SCRIPT:return new xmp.net.ScriptTagTransport(kd,dd,ed,fd,gd);case hd.FLASH_XHR:return new xmp.net.FlashXhrTransport(kd,dd,ed,fd,gd);case hd.MOCK:return new xmp.net.MockTransport(kd,dd,ed,fd,gd);default:return null;}};xmp.net.AjaxRequestManager.prototype._parseJson=function(ld){ld=xmp.trimString(ld);return this._parseJavaScript('('+ld+')');};xmp.net.AjaxRequestManager.prototype._parseJavaScript=function(md){return eval(md);};xmp.net.AjaxRequestManager.prototype._handleCompleteRequest=function(nd){var od=nd.getRequestId();if(!this._requestMap[od]){this._logger.debug("Did not find transport: "+od);return;}
delete this._requestMap[od];try{if(nd.getResponse().isError()){if(nd.getResponse().isTimedOut()||(nd.getResponse().isCriticalOrFatalError())){var pd=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR,'ARM',this._buildReponseReport(nd));this._logger.debug('ARM transport timeout',pd);}
else{this._logReponseReport(nd);}}
else{this._logReponseReport(nd);}
nd.getCallback().call(nd.getResponse());}
catch(e){this._logger.trace("Error while calling request callback.",e);}};xmp.net.AjaxRequestManager.prototype._getLoggerByType=function(qd){var rd=this._loggerByTypeMap[qd];if(!rd){rd=new xmp.util.internals.CategoryLogger('AjaxRequestManager'+'_'+qd);this._loggerByTypeMap[qd]=rd;}
return rd;};xmp.net.AjaxRequestManager.prototype._logRequestReport=function(sd,td,ud){var vd=this._getLoggerByType(sd.getConfiguration().rootUrlType);if(vd.isDebugEnabled()){vd.debug(this._buildRequestReport(sd,td,ud));}};xmp.net.AjaxRequestManager.prototype._logReponseReport=function(wd){var xd=this._getLoggerByType(wd.getConfiguration().rootUrlType);if(xd.isDebugEnabled()){xd.debug(this._buildReponseReport(wd));}};xmp.net.AjaxRequestManager.prototype._buildReponseReport=function(yd){var zd='Request complete (Request ID: '+yd.getRequestId()+'), response = '+yd.getResponse().makeReport();return zd;};xmp.net.AjaxRequestManager.prototype._handleLoadedCore=function(Ad,Bd){try{for(var Cd=xmp.MapIterator.create(this._requestMap);Cd.hasNext();Cd.next()){var Dd=Cd.currentValue();if(Dd.getLoadId()===Ad){Dd.setLoadedData(Bd);return;}}
this._logger.info("Dropping loaded data, could not find transport for: "+Ad);}
catch(e){this._logger.warn("Error while calling _handleLoadedCore.",e);}};xmp.net.AjaxRequestManager.prototype._findConfiguration=function(Ed){var Fd=xmp.util.RootUrlProvider.getInstance().getRootUrl(Ed);if(Fd.length===0){return null;}
var Gd=xmp.util.RootUrlProvider.getInstance().getRootUrlNode(Ed);var Hd=xmp.net.TransportTypes.fromString(Gd.getString('transportType',this._DEFAULT_TRANSPORT_TYPE));if(Hd===xmp.net.TransportTypes.INVALID){return null;}
var Id={};Id.rootUrl=Fd;Id.rootUrlType=Ed;Id.transportType=Hd;Id.timeout=Gd.getInt('timeout',this._DEFAULT_TIMEOUT);Id.retries=Gd.getInt('retries',this._DEFAULT_RETRIES);Id.waitBetweenRetries=Gd.getInt('waitBetweenRetries',this._DEFAULT_WAIT_BETWEEN_RETRIES);Id.requestVerb=Gd.getString('requestVerb',this._DEFAULT_REQUEST_VERB);return Id;};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(Jd){this._fullUrl=Jd;};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(Kd){this._setErrorCore(Kd);};xmp.net.AjaxResponse.prototype._setTimedOut=function(){this._timedOutError=true;this._setErrorCore(new Error("AjaxResponse: Request timed out."));};xmp.net.AjaxResponse.prototype._setJsonObject=function(Ld){this._jsonObject=Ld;};xmp.net.AjaxResponse.prototype._setText=function(Md){this._text=Md;};xmp.net.AjaxResponse.prototype._setErrorCore=function(Nd){this._isCriticalOrFatalError=false;if(Nd instanceof Error){this._errorObject=new xmp.net.AjaxResponseException('AjaxResponse, see nested exception');this._errorObject.message+=('\nNESTED ERROR: '+xmp.extractErrorMessage(Nd));if((Nd instanceof xmp.FatalException)||(Nd instanceof xmp.CriticalException)){this._isCriticalOrFatalError=true;}}
else{this._errorObject=new xmp.net.AjaxResponseException("AjaxResponse: UNKNOWN ERROR");}};xmp.net.AjaxResponse.prototype.makeReport=function(){var Od='';Od+=('Response ID: '+this.getFullUrl()+'\n');if(this.isError()){Od+=('Response Text: '+this._text+'\n');Od+=('Response JSON: null\n');Od+=('ERROR Message: '+this.getErrorMessage());}
else{Od+=('Response Text: '+this.getText()+'\n');Od+=('Response JSON: '+((this.getJsonObject()===null)?'null':'not null')+'\n');Od+='SUCCESS';}
return Od;};xmp.net.AjaxResponseException=function(Pd){this.name="AjaxResponseException";this.message=Pd;};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(Qd){var Rd=xmp.net.ContentTypes;if((typeof Qd!=='number')||(Qd<Rd._BEGIN)||(Qd>Rd._END)){return Rd._BEGIN;}
return Qd;};xmp.net.ContentTypes.stringify=function(Sd){var Td=xmp.net.ContentTypes;var Ud=Td._calc(Sd);switch(Ud){case Td.INVALID:return'invalid';case Td.TEXT:return'text';case Td.JSON:return'json';case Td.PING:return'ping';default:return'invalid';}};xmp.net.ContentTypes.fromString=function(Vd){var Wd=xmp.net.ContentTypes;switch(Vd){case'invalid':return Wd.INVALID;case'text':return Wd.TEXT;case'json':return Wd.JSON;case'ping':return Wd.PING;default:return Wd.INVALID;}};xmp.createNamespace("xmp.net");xmp.net.FlashXhrTransport=function(Xd,Yd,Zd,$d,ae){xmp.net.FlashXhrTransport.ctor.call(this,Xd,Yd,Zd,$d,ae);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(be,ce){try{this._requestHeaderArray=ce;this._url=this.getConfiguration().rootUrl+be;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(de){this._stopTimer();this.getResponse()._setText(de);if(this.getContentType()===xmp.net.ContentTypes.JSON){var ee=this._getManager()._parseJson(de);this.getResponse()._setJsonObject(ee);}
this._getFlashXhrManager().close(this);this._getManager()._handleCompleteRequest(this);};xmp.net.FlashXhrTransport.prototype.handleError=function(fe,ge){this._stopTimer();var he="Type:  "+fe+"\nDescription:  "+ge;this._getFlashXhrManager().close(this);var ie=this._extractErrorCode(ge);var je=null;if(this._isIEWin&&(ie===0)){je=xmp.CriticalException.createCriticalException(xmp.XmpErrorCodes.CRITICAL_UNSPECIFIED_AJAX_ERROR,'FlashXhrTransport',ge);}
else{je=new Error(he);}
this.getResponse()._setError(je);this._getManager()._handleCompleteRequest(this);};xmp.net.FlashXhrTransport.prototype._extractErrorCode=function(ke){var re=/XML\/HTTP Error:\s{2}(\d{1,6}) \w*/;var le=ke.match(re);if(le!==null&&le.length>1){return parseInt(le[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(me){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=me;var ne=new xmp.util.Callback('FlashXhrTransportManager_init',this._handleInitTimeout,this);ne.callAsynchEx(this._CREATION_TIMEOUT,[]);}
catch(ex){me.call(new Error(xmp.extractErrorMessage(ex)));}};xmp.net.FlashXhrTransportManager.prototype._handleInitTimeout=function(){var oe=this._create_cb;this._create_cb=null;if(oe===null){return;}
var pe=new xmp.baseplayer.ApplicationError(null,'badInitialFlashObject',null,[{label:"Url",text:this._makeSWFPath()}]);this._logger.warn(pe.message,pe);oe.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(qe){this._enforceReadyState();var se=this._getXhrComponent();se.xhrOpen(qe._getHandle(),qe._getRequestVerb(),qe._getRequestMimeType());if(qe.getContentType()===xmp.net.ContentTypes.PING){se.xhrSetResultData(qe._getHandle(),'ping');}
var te=qe._getRequestHeaders();if(te){for(var i=0;i<te.length;i++){var ue=te[i];var ve=ue.name;if(xmp.isNonEmptyString(ue.type)&&(ue.type===xmp.net.AjaxRequestManager.POST_FORM_TYPE)){ve='_POST_FORM_VAR_:'+ve;}
se.xhrAddRequestHeader(qe._getHandle(),ve,ue.value);}}
se.xhrSend(qe._getHandle(),qe._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 we=document.createElement("div");we.setAttribute(xmp.ID_ATTRIBUTE,this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);we.setAttribute(xmp.NAME_ATTRIBUTE,this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);xmp.insertDomChildBefore(document.body,we);var xe=new SWFObject(this._makeSWFPath(),this.getXhrComponentName(),1,1,8,"#FFFFFF");xe.addParam(xmp.ALLOW_SCRIPT_ACCESS,xmp.ALWAYS_ACCESS);xe.addVariable(xmp.CONTEXT,'create_handle');var ye='xmp.net.FlashXhrTransportManager.getInstance().';xe.addVariable(xmp.FLASH_INITIALIZATION_CALLBACK,ye+'onInit');xe.addVariable(this._FLASH_DATA_CALLBACK,ye+'onData');xe.addVariable(xmp.FLASH_ERROR_CALLBACK,ye+'onError');xe.write(this._FLASH_XML_HTTP_REQUEST_COMPONENT_CONTAINER_NAME);xmp.util.FlashUtility.buildFSCommandScript(we,this.getXhrComponentName(),ye+"_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 ze=new xmp.util.Callback('FlashXhrTransportManager_relay_handleInit',this.handleInit,this);ze.callAsynch([]);this._transitionInitializationState('Relaying handleInit');}
return;}
var Ae=this._create_cb;this._create_cb=null;if(Ae===null){this.logger.critical("Unexpected: creation callback is null.");return;}
this._transitionInitializationState('Ready');Ae.call('Ready');};xmp.net.FlashXhrTransportManager.prototype.close=function(Be){this._getXhrComponent().xhrClose(Be._getHandle());this._FlashXmlHttpRequestRegistry[Be._getHandle()]=null;delete this._FlashXmlHttpRequestRegistry[Be._getHandle()];};xmp.net.FlashXhrTransportManager.prototype.open=function(Ce){this._enforceReadyState();this._FlashXmlHttpRequestRegistry[Ce._getHandle()]=Ce;Ce.doRequest();};xmp.net.FlashXhrTransportManager.prototype._handleFSCommand=function(De,Ee){try{De=xmp.util.FlashUtility.normalizeCommand(De);var Fe='xmp.net.FlashXhrTransportManager.getInstance().';var Ge=xmp.util.FlashUtility;var He=null;switch(De){case Fe+'onInit':He=Ge.splitFSCommandData(Ee,2);this.onInit(He[0],He[1]);break;case Fe+'onData':He=Ge.splitFSCommandData(Ee,2);this.onData(He[0],He[1]);break;case Fe+'onError':He=Ge.splitFSCommandData(Ee,3);this.onError(He[0],He[1],He[2]);break;default:this._logger.warn('Unrecognized FSCommand: '+De);break;}}
catch(e){this._logger.warn('Error executing FSCommand: '+De,e);}};xmp.net.FlashXhrTransportManager.prototype.onInit=function(Ie,Je){try{this.handleInit();}
catch(e){this._handleError(e,true);}};xmp.net.FlashXhrTransportManager.prototype.onData=function(Ke,Le){try{var Me=this._getTransport(Ke);try{Me.handleData(xmp.util.FlashUtility.externalInterfaceDecode(Le));}
catch(e2){this._handleTransportError(Me,e2,true);}}
catch(e){this._handleError(e,false);}};xmp.net.FlashXhrTransportManager.prototype.onError=function(Ne,Oe,Pe){try{var Qe=this._getTransport(Ne);try{Qe.handleError(Oe,Pe);}
catch(e2){this._handleTransportError(Qe,e2,false);}}
catch(e){this._handleError(e,false);}};xmp.net.FlashXhrTransportManager.prototype._getTransport=function(Re){var Se=this._findTransport(Re);if(!Se){throw new Error("Could not get transport for handle: "+Re);}
return Se;};xmp.net.FlashXhrTransportManager.prototype._findTransport=function(Te){var Ue=this._FlashXmlHttpRequestRegistry[Te];return(Ue)?Ue:null;};xmp.net.FlashXhrTransportManager.prototype._handleError=function(Ve,We){if(We){this._logger.critical("Error in FlashXhrTransportManager",Ve);}
else{this._logger.warn("Error in FlashXhrTransportManager",Ve);}};xmp.net.FlashXhrTransportManager.prototype._handleTransportError=function(Xe,Ye,Ze){try{if(Ze){Xe.handleError(Ye.name,Ye.message);}
else{this._handleError(Ye,false);this.close(Xe);}}
catch(e){var e2=new Error("Error calling _handleTransportError: "+xmp.extractErrorMessage(e)+"\nOriginal error: "+xmp.extractErrorMessage(Ye));this._handleError(e2,true);}};xmp.net.FlashXhrTransportManager.prototype._transitionInitializationState=function($e){this._logger.debug('Transition init state from "'+this._initializationState+'" to "'+$e+'".');this._initializationState=$e;};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(af,bf,cf,df,ef){xmp.net.IFrameTagTransport.ctor.call(this,af,bf,cf,df,ef);this._logger=new xmp.util.internals.CategoryLogger('IFrameTagTransport');};xmp.DERIVE_CLASS(xmp.net.AbstractTagTransport,xmp.net.IFrameTagTransport);xmp.net.IFrameTagTransport.prototype._initTag=function(ff){var gf=document.createElement('iframe');gf.id=this._makeTagId();document.body.appendChild(gf);gf.src=ff;};xmp.net.IFrameTagTransport.prototype._finiTag=function(){try{var hf=document.getElementById(this._makeTagId());if(hf){document.body.removeChild(hf);}}
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(jf,kf,lf,mf,nf){xmp.net.MockTransport.ctor.call(this,jf,kf,lf,mf,nf);};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.MockTransport);xmp.net.MockTransport.prototype.request=function(of,pf){this._url=of;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 qf=this._dataItem?this._dataItem.delay:200;this._networkDelayTimer=new xmp.util.Timer(this.getRequestId(),qf,1,new xmp.util.Callback(this.getRequestId(),this._handleRequest,this));this._networkDelayTimer.start();};xmp.net.MockTransport.prototype._handleRequest=function(rf,sf){sf.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(tf){this._stopTimer();var uf=null;var vf=null;if(typeof tf==='string'){uf=tf;}
else{vf=tf;uf="";}
this.getResponse()._setText(uf);if(this.getContentType()===xmp.net.ContentTypes.JSON){if(!vf){vf=this._getManager()._parseJson(uf);}
this.getResponse()._setJsonObject(vf);}
this._getManager()._handleCompleteRequest(this);};xmp.net.MockTransport.prototype.handleError=function(wf,xf){this._stopTimer();var yf="Type:  "+wf+"\nDescription:  "+xf;this.getResponse()._setError(new Error(yf));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(zf){this._dataMap=zf;};xmp.net.MockTransportData.prototype.getDataMap=function(){return this._dataMap;};xmp.net.MockTransportData.prototype.setItem=function(Af,Bf){var Cf=this._transformUrl(Af);this._dataMap[Cf]=Bf;};xmp.net.MockTransportData.prototype.getItem=function(Df){this._logger.info("MockTransportData.getData for "+Df);var Ef=this._transformUrl(Df);return this._dataMap[Ef];};xmp.net.MockTransportData.prototype._transformUrl=function(Ff){var Gf=this._hasTileId(Ff)?this._removeTileId(Ff):Ff;return Gf;};xmp.net.MockTransportData.prototype._hasTileId=function(Hf){return Hf.match(/tile=\d+/);};xmp.net.MockTransportData.prototype._removeTileId=function(If){var Jf=If.replace(/tile=\d+&/,'');if(Jf===If){Jf=If.replace(/&tile=\d+/,'');}
return Jf;};xmp.createNamespace("xmp.net");xmp.net.ScriptTagTransport=function(Kf,Lf,Mf,Nf,Of){xmp.net.ScriptTagTransport.ctor.call(this,Kf,Lf,Mf,Nf,Of);this._logger=new xmp.util.internals.CategoryLogger('ScriptTagTransport');};xmp.DERIVE_CLASS(xmp.net.AbstractTagTransport,xmp.net.ScriptTagTransport);xmp.net.ScriptTagTransport.prototype._initTag=function(Pf){var Qf=document.createElement('script');Qf.id=this._makeTagId();document.body.appendChild(Qf);Qf.src=Pf;};xmp.net.ScriptTagTransport.prototype._finiTag=function(){try{var Rf=document.getElementById(this._makeTagId());if(Rf){document.body.removeChild(Rf);}}
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(Sf){var Tf=xmp.net.TransportTypes;if((typeof Sf!=='number')||(Sf<Tf._BEGIN)||(Sf>Tf._END)){return Tf._BEGIN;}
return Sf;};xmp.net.TransportTypes.stringify=function(Uf){var Vf=xmp.net.TransportTypes;var Wf=Vf._calc(Uf);switch(Wf){case Vf.INVALID:return'invalid';case Vf.XHR:return'xhr';case Vf.IFRAME:return'iframe';case Vf.SCRIPT:return'script';case Vf.FLASH_XHR:return'flash';case Vf.MOCK:return'mock';default:return'invalid';}};xmp.net.TransportTypes.fromString=function(Xf){var Yf=xmp.net.TransportTypes;switch(Xf){case'invalid':return Yf.INVALID;case'xhr':return Yf.XHR;case'iframe':return Yf.IFRAME;case'script':return Yf.SCRIPT;case'flash':return Yf.FLASH_XHR;case'mock':return Yf.MOCK;default:return Yf.INVALID;}};xmp.createNamespace("xmp.net");xmp.net.XhrTransport=function(Zf,$f,ag,bg,cg){xmp.net.XhrTransport.ctor.call(this,Zf,$f,ag,bg,cg);this._requestObject=this._createRequestObject();var dg=this;this._requestObject.onreadystatechange=function(){dg._handleStateChange();};};xmp.DERIVE_CLASS(xmp.net.AbstractTransport,xmp.net.XhrTransport);xmp.net.XhrTransport.prototype.request=function(eg,fg){try{this._checkAndCreateTimer();var gg=this.getConfiguration().rootUrl+eg;this._requestObject.open('GET',gg);if(fg!==null){for(var i=0;i<fg.length;i++){var hg=fg[i];this._requestObject.setRequestHeader(hg.name,hg.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 ig=this._requestObject.responseText;this.getResponse()._setText(ig);if(this.getContentType()===xmp.net.ContentTypes.JSON){var jg=this._getManager()._parseJson(ig);this.getResponse()._setJsonObject(jg);}}
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 kg=xmp.net.XhrTransport._factories[i];var lg=kg();if(lg!==null){xmp.net.XhrTransport._factory=kg;return lg;}}
catch(e){continue;}}
xmp.net.XhrTransport._factory=function(){throw new Error('XMLHttpRequest not supported.');};xmp.net.XhrTransport._factory();return null;};