
if(window.self!==window.top){window.top.location=window.location}window.apple={};Object.create=function(B){function A(){}A.prototype=B;return new A()};if(!window.console){console={log:function(A){if(window.DebugMenu&&window.DebugMenu.log!==null){window.DebugMenu.log(A)}}}}window.apple.data={};if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v;default:return"null"}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());apple.data.json={parse:JSON.parse,stringify:JSON.stringify};(function(){window.apple.cookie=function(B,I,H){var G=document.cookie;if(arguments.length==1){if(B){var J=G.lastIndexOf(B+"=");if(J==-1){return null}var C=J+B.length+1;var E=G.indexOf(";",J+B.length+1);if(E==-1){E=G.length}return decodeURIComponent(G.substring(C,E))}else{return null}}else{if(B&&undefined!==typeof (I)){H=H||{};I=encodeURIComponent(I);var D=H.expires;if(typeof (D)=="number"){var F=new Date();F.setTime(F.getTime()+(D*24*60*60*1000));D=F}document.cookie=B+"="+I+(D?"; expires="+D.toUTCString():"")+(H.path?"; path="+H.path:"")+(H.domain?"; domain="+H.domain:"")+(H.secure?"; secure":"")}return null}};var A=apple.cookie;A.deleteCookie=function(B,C){if(B){var D=Object.create(C);D.expires=D.expires||0;A(B,null,D)}};A.objectCookie=function(B,E,C){if(arguments.length==1){var F=window.apple.cookie(B);return A.decodeObject(F)}var D=A.encodeObject(E);A(B,D,C);return null};A.encodeObject=function(B){if(!B){return null}return escape(JSON.stringify(B))};A.decodeObject=function(B){if(!B){return null}try{return JSON.parse(unescape(B))}catch(C){return null}}})();window.dojo={require:function(){},provide:function(){},lang:{doesObjectExist:function(E){try{var A=0,D=window,C=E.split(".");do{D=D[E[A++]]}while(A<E.length&&D);return D&&D!=window}catch(B){return false}}}};window.Event=Object.create(window.Event||{});window.Event.onLoad=function(A){if(Event.onLoad.done){window.setTimeout(A,0);return }if(!Event.onLoad.callbacks){Event.onLoad.callbacks=[]}Event.onLoad.callbacks.push(A)};window.Event.scripts=function(){var B={},A=[];B.collect=function(C){if(typeof C==="function"){A.push(C)}};B.execute=function(){var C=A.length,D;for(D=0;D<C;D+=1){A[D]()}Event.scripts.collect=function(E){if(typeof E==="function"){console.log("function "+E);E()}}};return B}();window.Event.onDomReady=window.Event.onLoad;window.onload=function(){Event.onLoad.done=true;if(Event.onLoad.callbacks){while(Event.onLoad.callbacks.length){Event.onLoad.callbacks.shift()()}}};function StorageSimulator(B){var C=B||{};function D(G){var E=[];if(G){for(var F in G){if(Object.prototype.hasOwnProperty.call(G,F)){E.push(F)}}}return E}function A(){var E=apple.cookie.objectCookie(C.name)||{};return E}return{get:function(E){return A()[E]},set:function(E,F){var G=A();G[E]=F;apple.cookie.objectCookie(C.name,G,C);return true},remove:function(E){var G=A(),F;F=(delete G[E]);apple.cookie.objectCookie(C.name,G,C);if(this.length()<1){apple.cookie.deleteCookie(C.name,C)}return F},length:function(){var E=A();return D(E).length},getKey:function(E){var F=A();return D(F)[E]}}}function Storage(){var F,A,E,C,D,B;F={};A={};E=function(){A=C()||D()||B()};C=function(){try{return window.localStorage}catch(G){console.log("Could not access window.localStorage");return null}};D=function(){try{return window.globalStorage[window.location.hostname]}catch(G){console.log("Could not access globalStorage with this host",window.location.hostname);return null}};B=function(){var J=document.getElementById("aos-pocket")||document.body,H=document.createElement("textarea");H.style.behavior="url(#default#userData)";H.style.display="none";J.appendChild(H);function L(){H.load("AOSMeta");return(H.getAttribute("keys")||"").split("\u0000")}function G(M){H.load("AOSMeta");H.setAttribute("keys",M.join("\u0000"));H.save("AOSMeta")}function K(N){var O=L(),M=O.indexOf(N);if(M!==-1){return }O.push(N);G(O)}function I(N){var O=L(),M=O.indexOf(N);if(M===-1){return }O.splice(M,1);G(O)}F.get=function(M){H.load("AOSData");return H.getAttribute(M)};F.set=function(N,O){H.load("AOSData");var M=H.getAttribute(N);H.setAttribute(N,O);H.save("AOSData");if(H.getAttribute(N)===O){if(!M){K(N)}return true}H.setAttribute(N,M);H.save("AOSData");return false};F.remove=function(M){H.load("AOSData");H.removeAttribute(M);H.save("AOSData");I(M)};F.length=function(){return L().length};F.getKey=function(M){return L()[M]};return F};F.get=function(G){return A.getItem(G)};F.set=function(G,H){this.remove(G);return A.setItem(G,H)};F.remove=function(G){return A.removeItem(G)};F.length=function(){return A.length};F.getKey=function(G){return A.key(G)};E();if(!A){console.log("Error: could not create your Storage.");return null}return F}window.apple.metrics={};apple.metrics.Metrics=function(A){this.config=A;apple.metrics.evarDataNodesEnabled=this.config.evarDataNodes?this.config.evarDataNodes:true;this.cookieProps=Object.create(apple.metrics.Metrics.CONSTANTS.cookieDefaults);this.metrics=this.getObjectCookie()||{};this.init()};apple.metrics.Metrics.CONSTANTS={AosNamespace:"AOS: ",cookieDefaults:{name:"asmetrics",path:"/",domain:window.location.host,expires:0.0208333333,secure:false},pageLoadDataKeyPrefix:"apple.metrics"};apple.metrics.evarDataNodesEnabled;apple.metrics.pageLoadMetricsData;apple.metrics.Metrics.reportCustomLink=function(G,F){var D=window.s;if(!D){return }try{var E=D.linkTrackVars,C=D.linkTrackEvents,B=D.eVar5,A=apple.metrics.Metrics.CONSTANTS.AosNamespace;if(F.indexOf(A)!==0){F=A+F}D.linkTrackVars="eVar5";D.linkTrackEvents="None";D.eVar5=F;D.tl(G,"o",apple.metrics.Metrics.getCustomLinkName(F))}finally{D.linkTrackVars=E;D.linkTrackEvents=C;D.eVar5=B}};apple.metrics.Metrics.getCustomLinkName=function(B){var A=B.split("|");if(A.length<=4){return B}return B.substring(B.indexOf(A[2]))};apple.metrics.Metrics.getProductSubstring=function(B){if(!B){return""}var A=B.split(";");if(A.length<6){return B}return A[1]};apple.metrics.Metrics.prototype={setObjectCookie:function(A){apple.cookie.objectCookie(this.cookieProps.name,A,this.cookieProps)},getObjectCookie:function(){return apple.cookie.objectCookie(this.cookieProps.name)},pageName:function(A){return A+(this.pageSuffix()||"")},mark:function(){if(this.config.isHome){this.getStore().vh=true}this.setObjectCookie(this.metrics)},hasReturnedHome:function(){return this.getStore().vh},pageSuffix:function(){if(this.config.isHome){return" - "+(this.hasReturnedHome()?"Return":"First")}else{return null}},getStore:function(){if(!this.metrics.store){this.initStore()}return this.metrics.store},getEvar1:function(){return(apple.metrics.pageLoadMetricsData&&apple.metrics.pageLoadMetricsData.evar1)||""},getEvar30:function(){return(apple.metrics.pageLoadMetricsData&&apple.metrics.pageLoadMetricsData.evar30)||""},getProp30:function(){var A=apple.metrics.pageLoadMetricsData&&apple.metrics.pageLoadMetricsData.evar1||"";return A.split("|")[0]},initStore:function(){var A=this.metrics.store;if(A&&A.sid!=this.config.storeId){A=null}if(!A){A={sid:this.config.storeId};this.metrics.store=A}return A},loadStorageData:function(){if(!apple.metrics.evarDataNodesEnabled){return }var D,E;if(!apple.metrics.pageLoadMetricsData){D=apple.metrics.getStorageKey();E=metricsStorage.get(D);if(!E){var A=metricsStorage.length(),C=apple.metrics.transformKey(window.location.pathname),F;for(var B=0;B<A;B++){F=metricsStorage.getKey(B);if(F.indexOf(C)!==-1){D=F;E=metricsStorage.get(D);break}}}apple.metrics.pageLoadMetricsData=E?apple.data.json.parse(E):{};metricsStorage.remove(D)}},init:function(){this.initStore();this.loadStorageData()}};apple.metrics.fireMicroEvent=function(A){apple.metrics.fireMicroEventImpl(A,false)};apple.metrics.fireMicroEventNoDuplicates=function(A){apple.metrics.fireMicroEventImpl(A,true)};apple.metrics.fireMicroEventImpl=function(A,H){var I=window.s||null,E=apple.metrics.Metrics.CONSTANTS.AosNamespace;if(!I){return }if(!("feature" in A&&"action" in A)){throw new Error("Microevents require a feature and an action.")}A=Object.applyDefaults(A,{page:I.pageName,slot:"",part:"",eVar:"eVar5"});if(A.page.indexOf(E)!==0){A.page=E+A.page}var F=A.eVar,D=[A.page,A.slot,A.feature,A.part,A.action].join(" | "),B=[A.feature,A.part,A.action].join(" | "),G={lnk:I.lnk,events:I.events,linkType:I.linkType,linkName:I.linkName,linkTrackVars:I.linkTrackVars,linkTrackEvents:I.linkTrackEvents},C;G[F]=I[F];if(A.events){I.linkTrackVars=F+",events";I.linkTrackEvents=A.events;I.events=A.events}else{I.linkTrackVars=F;I.linkTrackEvents="None"}I[F]=D;apple.metrics.onEventCompletion.wait();if(!H||!apple.metrics.checkDuplicateMicroEvent(D)){I.tl(A.node||null,"o",B)}for(C in G){I[C]=G[C]}};apple.metrics.microEventDuplicateDetector={};apple.metrics.checkDuplicateMicroEvent=function(B){var A=apple.metrics.microEventDuplicateDetector;if(A[B]){return true}A[B]=true;return false};apple.metrics.fireEvent=function(A){var D=window.s||null,C={},B;if(!D){return }for(B in A){C[B]=D[B];D[B]=A[B]}apple.metrics.onEventCompletion.wait();D.t();for(B in A){D[B]=C[B]}};apple.metrics.fireEventCollection=function(D){var C,A,B;if(!D){return }if(D.microEvent){C=[].concat(D.microEvent);A=C.length;for(B=0;B<A;B++){apple.metrics.fireMicroEvent(C[B])}}if(D.metrics){C=[].concat(D.metrics);A=C.length;for(B=0;B<A;B++){apple.metrics.fireEvent(C[B])}}};apple.metrics.transformKey=function(A){return A?A.replace(/\W+(\w){1}/g,function(){return arguments[1]?arguments[1].toUpperCase():""}):A};apple.metrics.getStorageKey=function(A){var B,C;if(A){B=(A.charAt(0)!=="/")?("/"+A):A;C=apple.metrics.Metrics.CONSTANTS.pageLoadDataKeyPrefix+window.location.href+B}else{C=apple.metrics.Metrics.CONSTANTS.pageLoadDataKeyPrefix+(document.referrer||"")+window.location.pathname}return apple.metrics.transformKey(C)};apple.metrics.onEventCompletion=(function(){var A=250,F,D=[],C;function B(){F=null;var I,G,H;while(D.length){I=D.shift();G=I.fn;H=I.obj;G.call(H)}}function E(){if(F){window.clearTimeout(F)}F=window.setTimeout(B,A)}C=function(H,G){if(!F){H.call(G)}else{D.push({fn:H,obj:G})}};C.wait=E;return C}());var metricsStorage=(function(){var C,A={name:"asmco",path:"/",domain:window.location.host,secure:false},B=!!(window.attachEvent&&!window.opera)&&(function(){var E=/MSIE (\d+)/;var D=E.exec(navigator.userAgent);return D&&parseInt(D[1],10)})();if(B&&B<8){C=StorageSimulator(A)}else{C=Storage()}return C})();
