/*

    Copyright © 2000-2010 Apple Inc. All Rights Reserved.
    
*/

var $=function(A){if("string"===typeof A||A instanceof String){return document.getElementById(A)}return A};Package=(function(){var A={};return function(C){if(C in A){return }A[C]=true;var E=window;var G=C.split(".");var B=G.length;var D;var F;for(D=0;D<B;++D){F=G[D];if(!E[F]){E[F]={}}E=E[F]}}})();coherent.strings["marker.image.placeholder"]="/rs/img/block1px.gif";coherent.strings["error.required_value"]="This field is required.";Package("apple");if(typeof (AC)=="undefined"){AC={}}AC.addEvent=function(B,A,C){if(B.addEventListener){return B.addEventListener(A,C,false)}else{return B.attachEvent("on"+A,C)}};AC.removeEvent=function(B,A,C){if(B.removeEventListener){return B.removeEventListener(A,C,false)}else{return B.detachEvent("on"+A,C)}};AC.removeClassName=function(A,B){B=new RegExp(B,"g");A.className=A.className.replace(B,"").replace(/ +/g," ").replace(/ +$/gm,"").replace(/^ +/gm,"")};AC.getPreviousSibling=function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}};if(typeof (AC.Detector)=="undefined"){AC.Detector={_iOSVersion:null,iOSVersion:function(){if(this._iOSVersion===null){this._iOSVersion=(navigator.userAgent.match(/applewebkit/i)&&(navigator.platform.match(/iphone/i)||navigator.platform.match(/ipod/i)||navigator.platform.match(/ipad/i)))?parseFloat(navigator.userAgent.match(/os ([\d_]*)/i)[1].replace("_",".")):false}return this._iOSVersion},_style:null,_prefixes:null,_preFixes:null,_css:null,isCSSAvailable:function(I){if(!this._style){this._style=document.createElement("browserdetect").style}if(!this._prefixes){this._prefixes="-webkit- -moz- -o- -ms- -khtml- ".split(" ")}if(!this._preFixes){this._preFixes="Webkit Moz O ms Khtml ".split(" ")}if(!this._css){this._css={}}I=I.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").replace(/^(\-*webkit|\-*moz|\-*o|\-*ms|\-*khtml)\-/,"").toLowerCase();switch(I){case"gradient":if(this._css.gradient!==undefined){return this._css.gradient}var I="background-image:",G="gradient(linear,left top,right bottom,from(#9f9),to(white));",F="linear-gradient(left top,#9f9, white);";this._style.cssText=(I+this._prefixes.join(G+I)+this._prefixes.join(F+I)).slice(0,-I.length);this._css.gradient=(this._style.backgroundImage.indexOf("gradient")!==-1);return this._css.gradient;case"inset-box-shadow":if(this._css["inset-box-shadow"]!==undefined){return this._css["inset-box-shadow"]}var I="box-shadow:",H="#fff 0 1px 1px inset;";this._style.cssText=this._prefixes.join(I+H);this._css["inset-box-shadow"]=(this._style.cssText.indexOf("inset")!==-1);return this._css["inset-box-shadow"];default:var E=I.split("-"),A=E.length,D,C,B;if(E.length>0){I=E[0];for(C=1;C<A;C++){I+=E[C].substr(0,1).toUpperCase()+E[C].substr(1)}}D=I.substr(0,1).toUpperCase()+I.substr(1);if(this._css[I]!==undefined){return this._css[I]}for(B=this._preFixes.length-1;B>=0;B--){if(this._style[this._preFixes[B]+I]!==undefined||this._style[this._preFixes[B]+D]!==undefined){this._css[I]=true;return true}}return false}return false}}}apple.GlobalNav=function(){var A=this;this.globalHeader=document.getElementById("apple-header");this.globalSearch=Element.query("#apple-header .search .wrapper input");if(this.globalHeader){if(navigator.userAgent.match(/applewebkit/i)){if(!navigator.geolocation){this.globalHeader.className+=" decelerate"}else{if(navigator.platform.match(/ipad/i)||navigator.platform.match(/iphone/i)||navigator.platform.match(/ipod/i)){this.globalHeader.className+=" ios"}}if(AC.Detector.iOSVersion()&&AC.Detector.iOSVersion()<=3.2){this.globalHeader.className+=" ios3"}if(!AC.Detector.isCSSAvailable("inset-box-shadow")||navigator.userAgent.match(/chrome/i)&&navigator.userAgent.match(/windows/i)){this.globalHeader.className+=" noinset"}}this.decorateSearchInput();this.vml();this.decorateTabStates();this.cancelRevealTimeout=window.setTimeout(function(){A.cancelReveal()},3000);if(AC.Detector.isCSSAvailable("transition-property")&&AC.Detector.isCSSAvailable("gradient")&&(AC.Detector.iOSVersion()===false||AC.Detector.iOSVersion()>=3.2)){this.globalHeader.className+=" enhanced";window.setTimeout(function(){A.reveal()},30)}else{this.show()}}};apple.GlobalNav.prototype.decorateSearchInput=function(){if(this.globalSearch){var B=this,A=true,C=Element.query(".search-reset"),D=Element.locateAncestor(this.globalSearch,function(E){return E.tagName.toLowerCase()=="fieldset"});AC.addEvent(C,"mousedown",function(E){A=false;window.setTimeout(function(){A=true},75)});AC.addEvent(this.globalSearch,"focus",function(E){if(A){window.setTimeout(function(){B.globalHeader.className+=" searchmode"},10)}});AC.addEvent(this.globalSearch,"blur",function(E){if(A){window.setTimeout(function(){AC.removeClassName(B.globalHeader,"searchmode")},10)}else{A=true}})}};apple.GlobalNav.prototype.vml=function(){var E,A,C,B,D;if(!AC.Detector.isCSSAvailable("border-radius")&&document.namespaces&&this.globalHeader){document.namespaces.add("v","urn:schemas-microsoft-com:vml");E=document.createDocumentFragment();A=document.createElement("v:roundrect");A.setAttribute("id","globalheader-roundrect");A.setAttribute("stroked",true);A.setAttribute("strokeColor","#737373");A.setAttribute("arcSize",".1");E.appendChild(A);C=this.globalHeader.currentStyle.backgroundImage;this.globalHeader.style.backgroundImage="none";C=C.replace(/url\(["']*([^"']*)["']*\)/,"$1");B=document.createElement("v:fill");B.setAttribute("id","globalheader-fill");B.setAttribute("type","tile");B.setAttribute("src",C);A.appendChild(B);D=document.createElement("v:roundrect");D.setAttribute("id","globalheader-shadow");D.setAttribute("stroked",false);D.setAttribute("fillColor","#999");D.setAttribute("arcSize",".1");E.appendChild(D);this.globalHeader.appendChild(E)}};apple.GlobalNav.prototype.getPreviousNavItem=function(A){while(A.tagName.toLowerCase()!=="li"){A=A.parentNode}A=AC.getPreviousSibling(A);if(!A){return false}if(A.tagName.toLowerCase()!=="li"){return false}A=A.getElementsByTagName("a");if(!A[0]){return false}return A[0]};apple.GlobalNav.prototype.decorateTabStates=function(){this.globalNavItems=Element.queryAll(this.globalHeader,"ul.links a");var A=this,C=this.globalHeader.className.replace(/ .*/,""),B;for(B=this.globalNavItems.length-1;B>=0;B--){if(this.globalNavItems[B].href.match(C)){this.currentTab=this.globalNavItems[B]}AC.addEvent(this.globalNavItems[B],"mousedown",function(D){var E=(D.target)?D.target:D.srcElement;E=A.getPreviousNavItem(E);if(E&&E!==A.currentTab){E.className+=" before"}});AC.addEvent(this.globalNavItems[B],"mouseout",function(D){var E=(D.target)?D.target:D.srcElement;E=A.getPreviousNavItem(E);if(E&&E!==A.currentTab){AC.removeClassName(E,"before")}})}if(this.currentTab){this.currentTab=this.getPreviousNavItem(this.currentTab);this.currentTab.className+=" before"}};apple.GlobalNav.prototype.reveal=function(){if(!this.revealCanceled){var A=this;if(AC.Detector.isCSSAvailable("animation-name")&&!document.referrer.match(/^\w*:\/\/([^\.]*\.)+apple\.com/)){this.globalHeader.className+=" outside";this.globalHeader.addEventListener("webkitAnimationEnd",function(){A.revealed()},false)}else{window.setTimeout(function(){A.revealed()},300)}}};apple.GlobalNav.prototype.revealed=function(A){if(!this.revealCanceled&&(!A||typeof (A)=="number"||(A.target==this.globalHeader&&A.animationName.match(/reveal/i)))){this.show()}};apple.GlobalNav.prototype.show=function(){var A=this;window.clearTimeout(this.cancelRevealTimeout);this.globalHeader.style.visibility="visible";window.setTimeout(function(){A.loaded()},100)};apple.GlobalNav.prototype.loaded=function(){this.globalHeader.className+=" globalheader-loaded"};apple.GlobalNav.prototype.cancelReveal=function(){this.revealCanceled=true;this.show()};Package("apple.util");Math.clamp=function(C,B,A){return Math.min(Math.max(B,C),A)};apple.util.aliasMethodChain=function(B,D,C,A){B[D+"Without"+C.charAt(0).toUpperCase()+C.substring(1)]=B[D];B[D]=A};apple.util.elementSupportsAttribute=function(A,B){var C=document.createElement(A);if(B in C){return true}else{return false}};apple.util.makeSubclass=function(A,C){function B(){}B.prototype=C.prototype;A.prototype=new B();A.prototype.constructor=A;A.superclass=C;if(C.prototype.constructor!=C){C.prototype.constructor=C}A.prototype.base=function(F){var D=this;var E=C.prototype[F];if("function"!=typeof (E)){return E}return function(){return E.apply(D,arguments)}}};apple.util.TEMPLATE_REGEX=/\$\{(\w+)\}/g;apple.util.expandTemplate=function(B,D,A){function C(G,E){var F=D[E];if(null===F||"undefined"===typeof (F)){return A}return F}return B.replace(this.TEMPLATE_REGEX,C)};apple.util.addOverflowEllipsis=function(F,D){var B=Element.getStyle(F,"display"),G=(F.textContent||F.innerText),A=0,C=0,E=G.length,H=G;F.style.display="inline";if(F.offsetWidth<=D){Element.setStyle(F,"display",B);return }while(F.offsetWidth!=D&&(A<E)){C=Math.floor(A+((E-A)/2));H=G.substr(0,C)+"&hellip;";F.innerHTML=H;if(F.offsetWidth<D){A=C+1}else{E=C}}F.innerHTML=H;Element.setStyle(F,"display",B)};apple.util.assignId=Element.assignId;apple.util.applyDefaults=Object.applyDefaults;apple.util.merge=Object.merge;Object.extend(Element,{hide:function(A){if(typeof A.cssDisplayCache=="undefined"){var B=A.style.display;if(B!="none"){A.cssDisplayCache=B}}A.style.display="none"},show:function(A){A.style.display=A.cssDisplayCache||"";A.cssDisplayCache=undefined},getDimensions:function(C){C=$(C);var G=Element.getStyle(C,"display");if(G&&G!="none"){return{left:C.offsetLeft,top:C.offsetTop,width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var E={width:C.offsetWidth,height:C.offsetHeight,left:C.offsetLeft,top:C.offsetTop};B.display=A;B.position=D;B.visibility=F;return E},getMarginBox:function(D){var C=Element.getStyles(D,["marginTop","marginBottom","marginRight","marginLeft"]);for(var B in C){C[B]=parseInt(C[B],10)||0}var A=C.marginLeft+C.marginRight;var E=C.marginTop+C.marginBottom;return{width:D.offsetWidth+A,height:D.offsetHeight+E}},setMarginBox:function(F,B){var E=Element.getStyles(F,["marginTop","marginBottom","marginRight","marginLeft","paddingTop","paddingBottom","paddingRight","paddingLeft","borderTopWidth","borderBottomWidth","borderRightWidth","borderLeftWidth"]);for(var D in E){E[D]=parseInt(E[D],10)||0}var C=E.marginLeft+E.marginRight+E.borderLeftWidth+E.borderRightWidth+E.paddingLeft+E.paddingRight;var A=E.marginTop+E.marginBottom+E.borderTopWidth+E.borderBottomWidth+E.paddingTop+E.paddingBottom;F.style.width=(B.width-C)+"px";F.style.height=(B.height-A)+"px"},makeClipping:function(A){A=$(A);if(!A){return A}A._originalOverflow=A.style.overflow||A.style.overflowY||A.style.overflowX;A.style.overflow="hidden";return A},undoClipping:function(A){A=$(A);if(!A||!("_originalOverflow" in A)){return A}A.style.overflow=A._originalOverflow||"";A._originalOverflow=null;return A},makePositioned:function(C,A){C=$(C);if(!C){return C}A=A||"relative";var B=Element.getStyle(C,"position");if("relative"==B||"absolute"==B||A==B){return C}C._originalPosition=B;C.style.position=A||"relative";if(window.opera){C.style.top=C.style.left="0"}return C},undoPositioned:function(A){A=$(A);if(!A||!("_originalPosition" in A)){return A}A.style.position=A._originalPosition||"";A._originalPosition=null;return A},getPositionedOffset:function(B){B=$(B);var A=0;var D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break}var C=Element.getStyle(B,"position");if(C=="relative"||C=="absolute"){break}}}while(B);return{left:D,top:A}},makeAbsolute:function(B){B=$(B);if(B.style.position=="absolute"){return }var F=Element.getPositionedOffset(B);var E=F.top-parseFloat(Element.getStyle(B,"margin-top")||0);var D=F.left-parseFloat(Element.getStyle(B,"margin-left")||0);var C=B.clientWidth-parseFloat(Element.getStyle(B,"padding-left")||0)-parseFloat(Element.getStyle(B,"padding-right")||0);var A=B.clientHeight-parseFloat(Element.getStyle(B,"padding-top")||0)-parseFloat(Element.getStyle(B,"padding-bottom")||0);B._originalLeft=B.style.left;B._originalTop=B.style.top;B._originalWidth=B.style.width;B._originalHeight=B.style.height;B._originalPosition=B.style.position;B.style.position="absolute";B.style.top=E+"px";B.style.left=D+"px";B.style.width=C+"px";B.style.height=A+"px"},undoMakeAbsolute:function(A){A=$(A);if(A.style.position!="absolute"){return }A.style.position=A._originalPosition;A.style.left=A._originalLeft;A.style.top=A._originalTop;A.style.width=A._originalWidth;A.style.height=A._originalHeight},getElementsByClassName:function(B,A){return Element.queryAll(A,"."+B)},getOpacity:function(A){return Element.getStyles(A,"opacity")},setOpacity:function(A,B){A=$(A);if(B==1||B===""){A.style.opacity=""}else{if(B<0.00001){A.style.opacity=0}else{A.style.opacity=B}}return A},getPadding:function(C){var A=document.defaultView;var B=A.getComputedStyle(C,null);return{left:parseFloat(B.paddingLeft)||0,top:parseFloat(B.paddingTop)||0,right:parseFloat(B.paddingRight)||0,bottom:parseFloat(B.paddingBottom)||0}},setStyles:function(B,A){for(var C in A){if(C!="opacity"){B.style[C]=A[C]}else{Element.setOpacity(B,A[C])}}},setStyle:function(B,D,C){var A={};A[D]=C;Element.setStyles(B,A)}});var useOpacity=(typeof document.createElement("div").style.opacity!="undefined");if(!useOpacity){Object.extend(Element,{setOpacity:function(A,D){A=$(A);var C=Element.getStyle(A,"filter");var B=A.style;if(D==1||D===""){B.filter=C.replace(/alpha\([^\)]*\)/gi,"");return A}if(D<0.00001){D=0}B.filter=C.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(D*100)+")";return A}})}if(coherent.Browser.IE){Object.extend(Element,{getPadding:function(B){var A=B.currentStyle;return{left:parseFloat(A.paddingLeft)||0,top:parseFloat(A.paddingTop)||0,right:parseFloat(A.paddingRight)||0,bottom:parseFloat(A.paddingBottom)||0}}})}Object.extend(Event,{sendMouseEvent:(function(){if(document.createEvent){return function(E,C,A,B){var D=document.createEvent("MouseEvents");if(D.initMouseEvent){D.initMouseEvent(C,A,B,window,0,0,0,0,0,false,false,false,false,0,null)}else{D=document.createEvent("UIEvents");D.initEvent(C,A,B);D.view=window;D.detail=0;D.screenX=0;D.screenY=0;D.clientX=0;D.clientY=0;D.ctrlKey=false;D.altKey=false;D.metaKey=false;D.shiftKey=false;D.button=0;D.relatedTarget=null}return E.dispatchEvent(D)}}else{return function(E,C,A,B){var D=document.createEventObject("MouseEvents");D.bubbles=A;D.cancelable=B;D.view=window;D.detail=0;D.screenX=0;D.screenY=0;D.clientX=0;D.clientY=0;D.ctrlKey=false;D.altKey=false;D.metaKey=false;D.shiftKey=false;D.button=1;return E.fireEvent("on"+C,D)}}})(),isNumpadNumKey:function(A){return A>=96&&A<=111},isAlphaNumKey:function(A){if(!this._reverseKeys){this._reverseKeys=(function(){var D={};var C=Event.KEYS;for(var B in C){D[C[B]]=B}return D})()}return this.isNumpadNumKey(A)||!this._reverseKeys[A]},mousePosition:function(B){var C={x:0,y:0};if(B.pageX||B.pageY){C.x=B.pageX;C.y=B.pageY}else{var A=document.documentElement||document.body;C.x=B.clientX+A.scrollLeft-A.clientLeft;C.y=B.clientY+A.scrollTop-A.clientTop}return C},isMouseOverElement:function(E,D){var B=Event.mousePosition(E);var H=Element.getRect(D);var G=H.top;var A=G+D.offsetHeight;var F=H.left;var C=F+D.offsetWidth;return(B.x>=F&&B.x<=C&&B.y>=G&&B.y<=A)},onUnload:function(A){if(!arguments.callee.__fn){arguments.callee.__fn=function(){var B=arguments.callee.__handlers;while(B.length){(B.pop())()}delete arguments.callee.__handlers};Event.observe(window,"unload",arguments.callee.__fn);arguments.callee.__fn.__handlers=[]}arguments.callee.__fn.__handlers.push(A)},fixEvent:function(B){if(!B){if(window.event){B=window.event}}if(coherent.Browser.IE){if(!B.target){B.target=B.srcElement}if(!B.currentTarget){B.currentTarget=B.srcElement}if(!B.layerX){B.layerX=B.offsetX}if(!B.layerY){B.layerY=B.offsetY}var C=(B.srcElement&&B.srcElement.ownerDocument)?B.srcElement.ownerDocument:document;var A=(C.compatMode=="BackCompat")?C.body:C.documentElement;if(!B.pageX){B.pageX=B.clientX+(A.scrollLeft||0)}if(!B.pageY){B.pageY=B.clientY+(A.scrollTop||0)}if(B.type=="mouseover"){B.relatedTarget=B.fromElement}if(B.type=="mouseout"){B.relatedTarget=B.toElement}}return B},KEYS:{KEY_BACKSPACE:8,KEY_TAB:9,KEY_CLEAR:12,KEY_ENTER:13,KEY_SHIFT:16,KEY_CTRL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT_ARROW:37,KEY_UP_ARROW:38,KEY_RIGHT_ARROW:39,KEY_DOWN_ARROW:40,KEY_INSERT:45,KEY_DELETE:46,KEY_HELP:47,KEY_LEFT_WINDOW:91,KEY_RIGHT_WINDOW:92,KEY_SELECT:93,KEY_NUMPAD_0:96,KEY_NUMPAD_1:97,KEY_NUMPAD_2:98,KEY_NUMPAD_3:99,KEY_NUMPAD_4:100,KEY_NUMPAD_5:101,KEY_NUMPAD_6:102,KEY_NUMPAD_7:103,KEY_NUMPAD_8:104,KEY_NUMPAD_9:105,KEY_NUMPAD_MULTIPLY:106,KEY_NUMPAD_PLUS:107,KEY_NUMPAD_ENTER:108,KEY_NUMPAD_MINUS:109,KEY_NUMPAD_PERIOD:110,KEY_NUMPAD_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_F13:124,KEY_F14:125,KEY_F15:126,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145}});window.JSONP={get:function(B,I){if(!B){return{}}var D=((new Date()).getTime()+Math.floor(Math.random()*100000)).toString(32);var L=new coherent.Deferred();var E=I.callbackParamName||"callback";var G="apple_jsonp_callback_"+D,F=I.params||{},K;if(I.enableCache){K="apple_jsonp_callback";var J=F.query;window.queryParamsToFunctionNameMap=window.queryParamsToFunctionNameMap||{};window.queryParamsToFunctionNameMap[J]=G;if(!window[K]){window[K]=function(){var N=arguments[0];J=N.body.query;var M=window.queryParamsToFunctionNameMap[J];if(M&&window[M]){window[M](N)}}}}else{K=G}F[E]=K;var A=B+((-1==B.indexOf("?"))?"?":"&")+Object.toQueryString(F);var C;var H=document.createElement("script");H.type="text/javascript";H.src=A;window[G]=function(){var M=arguments[0];try{L.callback(M)}catch(N){}H.parentNode.removeChild(H);try{delete window[G]}catch(N){}};document.getElementsByTagName("HEAD")[0].appendChild(H);return L}};Package("apple");window.JSONRPC=(function(){function A(K,J){var M=document.createElement("form");M.action=K;M.method="post";var N;var I;var O={};var L=(function(){return function(R,Q,S){var P=document.createElement("input");P.name=Q;P.type="hidden";R.appendChild(P);P.value=S}})();for(N in J){I=J[N];if(J[N]===O[N]){continue}if(I instanceof Array){I.forEach(function(P){L(M,N,P)})}else{L(M,N,I)}}M.style.position="absolute";M.style.visibility="hidden";M.style.height="0px";M.style.width="0px";document.body.appendChild(M);M.submit()}function G(J,I){if(!J){return }I=Object.toQueryString(I);if(I){if(J.indexOf("?")){J+="&"}else{J+="?"}J+=I}window.location.href=J}function H(J){if(!J){return false}var O=false;var I=parseInt(J.head.status,10);switch(I){case 301:case 302:case 303:case 304:case 305:case 306:case 307:O=true;break;default:break}if(!O){return false}var M=J.head.data;var L=M.url;var N=M.method;var K=M.args;apple.metrics.onEventCompletion(function(){if("post"===N){A(L,K)}else{G(L,K)}});return true}function E(J){if(!J){return true}var I=parseInt(J.head.status,10);if(I>=400&&I<600){return true}return false}function D(J,I){var L;if(I.head&&I.head.data&&I.head.data.microEvent){L=I.head.data.microEvent}else{if(I.body&&I.body.microEvent){L=I.body.microEvent;delete I.body.microEvent}}var K;if(I.head&&I.head.data&&I.head.data.metrics){K=I.head.data.metrics}else{if(I.body&&I.body.metrics){K=I.body.metrics;delete I.body.metrics}}if(!L&&!K&&!J){return }K=Object.extend(J||{},K);apple.metrics.fireEventCollection({microEvent:L,metrics:K})}var C={sync:false,responseContentType:"application/json"};var B=[];function F(O,K,M,J){function L(P){var Q;D(J.metrics,P);if(H(P)){Q=new Error("Response redirected");Q.redirect=true}else{if(E(P)){Q=new Error("Response returned errors")}}if(Q){Q.response=P;return Q}return P.body}J=Object.applyDefaults(J,C);var N=J.protocol;var I=(N==="JSONP")?JSONP.get(K,J):XHR.request(O,K,M,J);I.addCallback(L);B.forEach(function(P){I.addCallback(P)},this);return I}F.get=function(J,K,I){return F("GET",J,K,I)};F.post=function(J,K,I){return F("POST",J,K,I)};F.__registerGlobalCallback=function(I){B.push(I)};return F})();window.DeferredJSON=Class.create(coherent.KVO,{constructor:function(A){Object.extend(this,A)},__keysToIgnore:Set("actionKey","_url","url","loading","clearOldKeys"),__factory__:function(D){var B=Array.from(arguments);var A=this;function C(){}return function(){if(D){["extractContent","extractUpdates","setCallback"].forEach(function(F){if(F in D&&"string"===typeof (D[F])){D[F]=this[D[F]].bind(this)}},this)}C.prototype=A.prototype;var E=new C();A.prototype.constructor.apply(E,B);return E}},url:function(){return this._url},setUrl:function(A){this._url=A;return A},refresh:function(){this.setValueForKey(true,"loading");var A=this.url();if(!A){return null}var B=JSONRPC.get(A,this.extraArgs,{sync:this.sync});B.addMethods(this.set.bind(this),this.failure.bind(this));return B},performAction:function(C,B){var A=Object.extend({},this.extraArgs);A=Object.extend(A,B);if(!this.actionKey){throw new Error("actionKey value not set.")}A[this.actionKey]=C;return this.sendRequest(this.url(),A)},sendRequest:function(C,B,A){A=A||{method:"post"};this.setValueForKey(true,"loading");var D=JSONRPC[A.method](C,B);D.addMethods(this.set.bind(this),this.failure.bind(this));return D},failure:function(A){if(!A.redirect){this.setValueForKey(false,"loading")}return A},hasContent:function(){return Set.toArray(this.keys()).length},keys:function(){return this.__contentKeys||new Set()},set:function(C){this.__contentKeys=this.__contentKeys||new Set();if(C.url){this.setUrl(C.url)}if(!C.content&&!C.update&&!C.replace){return this.refresh()}this.setValueForKey(false,"loading");var B=C.content||{};var D=C.update;var E=C.content?true:false;if(C.replace){for(var F in C.replace){B[F]=C.replace[F]}}if(!B.addObserverForKeyPath){B=coherent.KVO.adaptTree(B)}if(D&&this.extractUpdates){D=this.extractUpdates(D)}function A(M,J){var G=J.mutableKeys(),L,K;if(M){this.mutableKeys().forEach(function(N){if(G.indexOf(N)===-1&&this[N]){J.setValueForKey(null,N);G.push(N)}},this)}function H(N){if(!N){return }var O=(N in J&&J[N]!==null)?"add":"remove";Set[O](this.__contentKeys,N);this.willChangeValueForKey(N);this[N]=J[N]}function I(N){if(!N){return }this.didChangeValueForKey(N)}G.forEach(H,this);G.forEach(I,this);if(D&&D.data){for(L in D.data){K=D.data[L];if(typeof K=="object"&&K!==null){K=coherent.KVO.adaptTree(K)}this.setValueForKeyPath(K,L)}}if(this.setCallback){this.setCallback(J)}return J}if(this.extractContent){B=this.extractContent(B)}if(B===false){return false}else{if(B instanceof coherent.Deferred){B.addCallback(A.bind(this,E));return B}else{return A.call(this,E,B)}}}});Package("apple.behavior.metrics");apple.behavior.metrics.ClickMap=function(C){var G=metricsStorage,B=24*60*60*1000,D="data-evar1",F="data-evar30",E,A;A=function(J){var L,H,K,I=J.pathname||J.action;H=J.getAttribute(D);K=J.getAttribute(F);if(H){E=apple.metrics.getStorageKey(I);L={timestamp:(new Date()).getTime(),evar1:H,evar30:K};L=apple.data.json.stringify(L);G.set(E,L)}};this.anchorClickHandler=function(H){var J=H.target||H.srcElement,I;I=Element.locateAncestor(J,function(K){return K.tagName==="A"},C);if(I){A(I)}};this.formSubmitHandler=function(H){var I=H.target||H.srcElement;A(I)};this.cleanupStaleStorage=function(){var H=(new Date()).getTime(),K=apple.metrics.transformKey(apple.metrics.Metrics.CONSTANTS.pageLoadDataKeyPrefix),J,M,L;J=G.length();var I=J-1;for(;I>=0;I--){E=G.getKey(I);if(E&&E.indexOf(K)!==-1){M=G.get(E);M=M?apple.data.json.parse(M):{};L=M.timestamp||H;if((H-L)>=B){G.remove(E)}}}}};Event.onLoad(function(){if(!apple.metrics.evarDataNodesEnabled){return }var C=document.body,B=new apple.behavior.metrics.ClickMap(C),A;Event.observe(C,"click",B.anchorClickHandler.bind(B));A=Element.queryAll(C,"form");A.forEach(function(D){Event.observe(D,"submit",B.formSubmitHandler.bind(B))});B.cleanupStaleStorage.delay(2000)});Package("apple.behavior");apple.behavior.Striper=function(){var B=null;var D=["odd","even"];var A=5;function C(H){var F=H.getElementsByTagName("tbody");for(var E=0;E<F.length;E++){var I=F[E].getElementsByTagName("tr");for(var G=0;G<I.length;G++){var J=I[G].className.split(" ");for(var K=0;K<D.length;K++){if(J.indexOf(D[K])!=-1){J.splice(J.indexOf(D[K]),1)}}J.push(D[G%D.length]);I[G].className=J.join(" ")}}}return function(H){var G;var F;if("undefined"===typeof H){var E=document.getElementsByTagName("table");if(null!==B&&"string"===typeof B){for(F=0;F<E.length;F++){if(E[F].className.indexOf(B)!=-1){G.push(E[F])}}}else{G=E}}else{if("string"===typeof H){G=[document.getElementById(H)]}else{G=[H]}}for(F=0;F<Math.min(A,G.length);F++){C(G[F])}for(var I=10;F<G.length;F++){window.setTimeout(function(){var J=G[F];return function(){C(J)}}(),I);I+=10}}}();Event.onDomReady(apple.behavior.Striper);Package("apple.behavior");apple.behavior.TextFieldPlaceholder=(function(){if(!(coherent&&coherent.TextField)){return null}var A="placeholder";var H="field-with-placeholder";var M=Element.regexForClassName(H);var L=coherent.TextField.prototype;var B=L.init;var J=L.onkeydown;var N=L.becomeFirstResponder;var O=L.setMarkerValue;var P=L.clearMarkerValue;var E=L.presentError;var T=L.endEditing;var G=L.onkeyup;coherent.TextField.prototype.init=R;coherent.TextField.prototype.presentError=C;coherent.TextField.prototype.onkeyup=Q;coherent.TextField.prototype.endEditing=F;function S(W){var Y=W.viewElement();var X=Element.query('label[for="'+Y.id+'"].'+A);if(!X&&W.nullPlaceholder&&W.nullPlaceholder.toString()){X=document.createElement("label");X.setAttribute("for",Y.id);X.htmlFor=Y.id;X.innerHTML="<span>"+W.nullPlaceholder+"</span>";X.className=A}else{if(X){try{if(X.getElementsByTagName("span")[0]){W.nullPlaceholder=X.getElementsByTagName("span")[0].firstChild.nodeValue}else{W.nullPlaceholder=X.innerHTML}}catch(Z){return false}}else{return false}}W.label=X;var a=Y.parentNode;if(a.nodeName.toUpperCase()!="SPAN"){a=document.createElement("span");Y.parentNode.replaceChild(a,Y)}if(!M.test(a.className)){Element.addClassName(a,H)}if(Y.parentNode!=a){a.appendChild(Y)}a.insertBefore(X,Y);return true}function K(W){if(S(W)){W.onkeydown=I;W.becomeFirstResponder=D;W.setMarkerValue=V;W.clearMarkerValue=U;Event.observe(W.viewElement(),"input",W.clearMarkerValue.bind(W));Event.observe(W.viewElement(),"paste",W.clearMarkerValue.bind(W));Event.onDomReady(function(){if(W.viewElement().value&&!W.validationError){W.clearMarkerValue()}})}}function R(){B.call(this);K(this);if(this.viewElement().value){this.clearMarkerValue()}}function I(W){J.call(this,W);var X=W.keyCode;if(Event.isAlphaNumKey(X)||X==32||X==8||X==46){this.clearMarkerValue()}}function D(){Element.addClassName(this.label,"focus");return N.call(this)}function V(W){if(W=="nullPlaceholder"){this.viewElement().value="";this.label.style.display="";Element.removeClassName(this.label,"hidden");Element.removeClassName(this.label,"focus")}}function C(W){var X=this.viewElement().parentNode;Element.addClassName(X,coherent.Style.kInvalidValueClass);return E.call(this,W)}function U(){var W=this.viewElement().parentNode;Element.removeClassName(W,coherent.Style.kInvalidValueClass);Element.addClassName(this.label,"hidden")}function F(){Element.removeClassName(this.viewElement().parentNode,coherent.Style.kEditingClass);T.call(this)}function Q(W){G.call(this,W);if(this.updateTimer){Element.addClassName(this.viewElement().parentNode,coherent.Style.kEditingClass)}}return function(W){if(W instanceof coherent.TextField){if(W.markerValue){W.clearMarkerValue()}K(W)}}})();if("undefined"===typeof (window.LivePerson)){window.LivePerson={}}Object.extend(window.LivePerson,{chatButtonId:"lpChatButton",inviteId:"inviteBadge",chatInvitation:"Chat now!",animator:null,init:function(){var A=$("aos_header");if(!A){return }this.isPancakeMode=Element.hasClassName(A,"collapsed")||Element.hasClassName(A,"compact-header")},createInvitation:function(){var B=$(this.chatButtonId);if(!B){return null}var A=$(this.inviteId);if(A!==null){return null}A=document.createElement("button");A.id=this.inviteId;A.appendChild(document.createTextNode(this.chatInvitation));B.parentNode.insertBefore(A,B);if(this.isPancakeMode){var C=Element.getPositionedOffset(B);A.style.left=C.left+"px";A.style.top=C.top+"px"}else{this.originalWidth=Element.getDimensions(A).width;A.style.width="0"}A.onclick=this.inviteButtonClicked.bindAsEventListener(this);return A},showInviteButton:function(){this.animator.play(this.getInviteAnimation(),this.onShowInviteComplete.bind(this))},hideInviteButton:function(){this.animator.reverse(this.onHideInviteComplete.bind(this))},removeInviteButton:function(){var A=$(this.inviteId);A.parentNode.removeChild(A)},onShowInviteComplete:function(){window.setTimeout(this.hideInviteButton.bind(this),2500)},onHideInviteComplete:function(){if(this.inviteTimedOut===true){this.removeInviteButton()}else{window.setTimeout(this.showInviteButton.bind(this),2500)}},getInviteAnimation:function(){var B=apple.fx.easeOutSine;var A=this.originalWidth;var C=$(this.inviteId);return function(D){D=B(D);C.style.width=D*A+"px"}},oninvite:function(){var A=this.createInvitation();if(!A){return }if(this.isPancakeMode){return }this.animator=new apple.fx.Animator({duration:250});this.animator.play(this.getInviteAnimation(),this.onShowInviteComplete.bind(this))},ontimeout:function(){if(this.isPancakeMode){this.removeInviteButton();return }this.inviteTimedOut=true},inviteButtonClicked:function(A){this.invitationAccepted()}});Event.onDomReady(window.LivePerson.init.bind(window.LivePerson));(function(){if(!window.apple){window.apple={}}if(!window.apple.data){window.apple.data={}}if(!window.apple.data.xml){window.apple.data.xml={}}var D=function D(I){return !!(I.ownerDocument&&I.ownerDocument.evaluate)},B=function B(I){return !!(I.ownerDocument&&"selectNodes" in I.ownerDocument)},H="first",A="all",G=function G(K,J){var L,M=[],I;if(D(K)){L=K.ownerDocument.evaluate(J,K,null,XPathResult.ANY_TYPE,null);I=L.iterateNext();while(I){M.push(I);I=L.iterateNext()}}else{if(B(K)){M=K.selectNodes(J)}else{throw C("UserAgent does not support xPath evaluation on this node")}}return M},F=function F(K,J){var L,I;if(D(K)){L=K.ownerDocument.evaluate(J,K,null,XPathResult.ANY_TYPE,null);I=L.iterateNext()}else{if(B(K)){I=K.selectSingleNode(J)}else{throw C("UserAgent does not support xPath evaluation on this node")}}return I},E=function E(){var J=arguments[0],K=arguments[1]||J,L=arguments[2]||arguments[1],I;switch(J){case H:I=F(K,L);break;case A:I=G(K,L);break;default:I=G(K,L);break}return I},C=function C(J){J="An error occurred"||J;var I="AppleDataXmlError";return{name:I,message:J}};apple.data.xml.FIRST=H;apple.data.xml.ALL=A;apple.data.xml.find=E;apple.data.xml.error=C})();Package("apple.fx");apple.fx.Animator=function(A){this._direction=1;this.t=0;this.config=Object.applyDefaults(A,arguments.callee.DEFAULTS)};apple.fx.Animator.DEFAULTS={actions:[],duration:250,frameRate:60,callback:null};apple.fx.Animator.prototype.setDuration=function(A){this.config.duration=A};apple.fx.Animator.prototype.finishNow=function(){function A(B){B(1);if("finish" in B){B.finish(1)}}this.config.actions.forEach(A)};apple.fx.Animator.prototype.stop=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=0};apple.fx.Animator.prototype.play=function(A,B){this.stop();if("function"==typeof (A)){A=[A]}if(A&&this.config.actions!=A){if(0<this.t&&1>this.t){this.finishNow()}this.config.actions=A.filter(function(C){return null!==C&&"undefined"!=typeof (C)});this.t=0}if(1==this.t){this.t=0}this._direction=1;this._run(this.config.actions,this._direction,this.t,B||this.config.callback)};apple.fx.Animator.prototype.reverse=function(A){this.stop();this._direction=(this._direction>0)?-1:1;this._run(this.config.actions,this._direction,this.t,A||this.config.callback)};apple.fx.Animator.prototype._run=function(G,M,H,N){var O=this;var B;var E=this.config.duration;var J=G.length;var I;var F=Math.round(1000/this.config.frameRate);for(I=0;I<J;++I){if("setup" in G[I]){G[I].setup()}}function L(){O._timer=0;for(I=0;I<J;++I){if("finish" in G[I]){G[I].finish(O.t)}}if(N){N(O.t)}}function D(){var P=(new Date()).getTime()-B;if(P>E){P=E}O.t=Math.round(P/E*1000)/1000;for(I=0;I<J;++I){G[I](O.t)}if(P==E){L();return }O._timer=window.setTimeout(A,F)}function K(){var P=(new Date()).getTime()-B;if(P>E){P=E}O.t=1-P/E;for(I=0;I<J;++I){G[I](O.t)}if(P==E){L();return }O._timer=window.setTimeout(A,F)}var A=D;if(M<0){A=K;H=1-H}function C(){B=(new Date()).getTime()-E*H;A()}this._timer=window.setTimeout(C,0)};Package("apple.fx");apple.fx.ContentSwapper=function(A){A=Object.applyDefaults(A,arguments.callee.DEFAULTS);this.base("constructor")(A)};apple.util.makeSubclass(apple.fx.ContentSwapper,apple.fx.Animator);apple.fx.ContentSwapper.DEFAULTS={duration:1000,transition:"crossfade"};Class.extend(apple.fx.ContentSwapper,{fixElementDimensions:function(D){var C=$(this._measureDiv);if(!C){C=document.createElement("div");this._measureDiv=Element.assignId(C);C.style.position="relative";var B=$(this.config.id);B.appendChild(C)}D._originalWidth=D.style.width;D._originalHeight=D.style.height;if(D.style.width&&D.style.height){return }var H=D.style.display;D.style.display="block";var K=Element.getStyles(D,["width","height","paddingTop","paddingRight","paddingBottom","paddingLeft"]);function G(M){var L=M.lastChild;while(L&&L.nodeType!==1){L=L.previousSibling}return L}var J=0,E,A=G(D);while(A){E=parseFloat(Element.getStyles(A,"marginBottom")||0,10);if(E<0){J+=E}A=G(A)}var I=parseInt(K.width||0,10)-parseFloat(K.paddingLeft||0,10)-parseFloat(K.paddingRight||0,10);var F=parseInt(K.height||0,10)-parseFloat(K.paddingTop||0,10)-parseFloat(K.paddingBottom||0,10)+J;D.style.width=I+"px";D.style.height=F+"px";D.style.display=H},undoFixElementDimensions:function(A){A.style.width=A._originalWidth||"";A.style.height=A._originalHeight||""},swap:function(G,E,D,H,B){E=$(E);D=$(D);this.fixElementDimensions(E);this.fixElementDimensions(D);var F=[].concat(this._setup(G,E,D));if(B){F=F.concat(B)}var A=$(this.config.id);Element.makeClipping(A);Element.makePositioned(A);Element.makePositioned(E,"absolute");Element.makePositioned(D,"absolute");function C(){Element.undoPositioned(D);Element.undoPositioned(E);Element.undoClipping(A);Element.undoPositioned(A);this.undoFixElementDimensions(D);this.undoFixElementDimensions(E);A.style.height="";A.style.width="";if(H){H()}}this.play(F,C.bind(this))},_setup:function(G,E,B){var A=$(this.config.id);var D=A.offsetHeight-parseFloat(Element.getStyle(A,"padding-top")||0)-parseFloat(Element.getStyle(A,"padding-bottom")||0);var C=apple.fx;G=G||"crossfade";A.style.height=D+"px";var F=[];switch(G){case"fadein":F.push(new C.FadeIn(apple.fx.linearTween,B));F.push(new C.Hide(null,E));break;case"swapfade":if(E&&B){F.push(new C.FadeOutIn(apple.fx.linearTween,E,B))}else{if(E){F.push(new C.FadeOut(apple.fx.linearTween,E))}else{if(B){F.push(new C.FadeIn(apple.fx.linearTween,B))}}}break;case"left":case"right":F.push(new C.Pan(apple.fx.easeInOutSine,E,B,G=="left"?-1:1));break;case"up":case"down":F.push(new C.Scroll(apple.fx.easeInOutSine,E,B,G=="up"?-1:1));break;case"crossfade":default:if(E&&B){F.push(new C.CrossFade2(apple.fx.linearTween,E,B))}else{if(E){F.push(new C.FadeOut(apple.fx.linearTween,E))}else{if(B){F.push(new C.FadeIn(apple.fx.linearTween,B))}}}break}if(E&&B){E.style.zIndex=1;B.style.zIndex=2;F.push(new C.Resize(apple.fx.easeInOutSine,A,Element.getDimensions(B),Element.getDimensions(E)))}return new apple.fx.Chain(F)}});Package("apple.fx");apple.fx.CrossFade=function(A,B){if(!A||A<10){A=this.getDefaultSpeed()}if(!B){B=this.getDefaultIncrement()}this.fadeSpeed=A;this.fadeInc=B;this.fadeStep=0};apple.fx.CrossFade.DEFAULT_SPEED=8;apple.fx.CrossFade.DEFAULT_INCREMENT=0.05;apple.fx.CrossFade.prototype.getDefaultSpeed=function(){return apple.fx.CrossFade.DEFAULT_SPEED};apple.fx.CrossFade.prototype.getDefaultIncrement=function(){return apple.fx.CrossFade.DEFAULT_INCREMENT};apple.fx.CrossFade.prototype.fade=function(A,C,E){A=[].concat(A);C=[].concat(C);if(this.lastFromObjects){this.stopAnimation();this.lastFromObjects.forEach(Element.hide)}this.lastFromObject=A;this.fadeStep=0;function B(F){Element.setStyles(F,{top:"0px",left:"0px",opacity:1});Element.show(F)}function D(F){Element.setStyles(F,{top:"0px",left:"0px",opacity:0});Element.show(F)}A.forEach(B);C.forEach(D);this._fade(A,C,E)};apple.fx.CrossFade.prototype.swap=apple.fx.CrossFade.prototype.fade;function roundToPlaces(C,B){if(!B){return Math.round(C)}var A=Math.pow(10,B);return Math.round(C*A)/A}apple.fx.CrossFade.prototype._fade=function(B,D,G){this.stopAnimation();this.fadeStep=roundToPlaces(this.fadeStep+this.fadeInc,6);if(this.fadeStep<1){function F(H){return function(I){Element.setOpacity(I,H)}}var A=F(this.fadeStep);var E=F(roundToPlaces(1-this.fadeStep,6));(D||[]).forEach(A);(B||[]).forEach(E);var C=this;this.timer=window.setTimeout(function(){C._fade(B,D,G)},this.fadeSpeed)}else{this._finishFade(B,D,G)}};apple.fx.CrossFade.prototype._finishFade=function(A,B,D){function C(E){Element.setOpacity(E,1)}this.lastFromObject=null;this.stopAnimation();(A||[]).forEach(Element.hide);(B||[]).forEach(C);if(D){D()}};apple.fx.CrossFade.prototype.stopAnimation=function(){if(this.timer){window.clearTimeout(this.timer)}};Package("apple.fx");apple.fx.fadeShow=function(B,E,G,F){B=$(B);var A=Element.getStyle(B,"opacity");if(A<1){E=(1-A)*E}else{Element.setStyle(B,"opacity",0)}Element.show(B);var D=new apple.fx.Animator({duration:E});var C=new apple.fx.Fade(B,G,A,1);return{play:function(){D.play(C,F)}}};apple.fx.fadeHide=function(B,E,H,G){B=$(B);var A=Element.getStyle(B,"opacity");E=A*E;function F(){Element.hide(B);Element.setStyle(B,"opacity",1);if(G){G(B,D)}}var D=new apple.fx.Animator({duration:E});var C=new apple.fx.Fade(B,H,A,0);return{play:function(){D.play(C,F)}}};Package("apple.fx");apple.fx.Morph=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS)};apple.fx.Morph.prototype.DEFAULTS={duration:500,frameDelay:25,callback:function(){},style:{},easing:function(A){return 0.5+Math.sin((A+1.5)*Math.PI)/2}};apple.fx.Morph.prototype.start=function(A){if(this._timer){return }var B=$(this.config.element);if(!B){return }if(A){this.config=Object.applyDefaults(A,this.DEFAULTS)}this._animator=this.animate.bind(this);this._now=0;this._start=Object.applyDefaults(Element.getRect(B,true),Element.getDimensions(B));this._start.opacity=Element.getStyle(B,"opacity");var C=Element.getRect(B.parentNode,true);this._start.top-=C.top;this._start.left-=C.left;this._delta={};for(var D in this.config.style){this._delta[D]=this.config.style[D]-this._start[D];if(!this._delta[D]){delete this._delta[D]}}this._timer=window.setTimeout(this._animator,this.config.frameDelay)};apple.fx.Morph.prototype.stop=function(){if(!this._timer){return }window.clearTimeout(this._timer);this._timer=0;this._animator=null};apple.fx.Morph.prototype.animate=function(){var A;var B=$(this.config.element);if(!B){return }this._now+=this.config.frameDelay;for(var C in this._delta){A=this.config.easing(this._now/this.config.duration)*this._delta[C]+this._start[C];if("opacity"==C){Element.setStyle(B,"opacity",A)}else{B.style[C]=A+"px"}}if(this._now>=this.config.duration){if(this.config.callback){this.config.callback()}return }this._timer=window.setTimeout(this._animator,this.config.frameDelay)};Package("apple.fx");apple.fx.SwapFade=function(A){this.duration=A||200;this._timer=null};apple.fx.SwapFade.prototype._stopAnimation=function(){window.clearTimeout(this._timer);this._timer=null};apple.fx.SwapFade.prototype.swap=function(F,L,M){this._stopAnimation();var E=10;var C=0;var H=this.duration;var D=H/2;var B=false;function K(N){Element.setStyle(N,"top","0px");Element.setStyle(N,"left","0px");Element.setOpacity(N,1);Element.show(N)}function A(N){Element.setStyle(N,"top","0px");Element.setStyle(N,"left","0px");Element.setOpacity(N,0);Element.show(N)}function J(N){Element.hide(N);Element.setOpacity(N,1)}F.forEach(K);L.forEach(A);function I(){C+=E;function N(O){if(O<0){O=0}else{if(O>1){O=1}}O=Math.round(O*100)/100;return function(P){Element.setOpacity(P,O)}}if(C<D){F.forEach(N(1-C/D))}else{if(!B){B=true;F.forEach(J)}L.forEach(N((C-D)/D))}if(C>H){L.forEach(N(1));this._timer=null;if(M){M()}return }this._timer=window.setTimeout(G,E)}var G=I.bind(this);this._timer=window.setTimeout(G,E)};Package("apple.fx");apple.fx.Swoosh=function(C,B,A){this.viewerId=C;if(!B){B=apple.fx.Swoosh.DEFAULT_PAN_SPEED}if(!A){A=apple.fx.Swoosh.DEFAULT_PAN_INCREMENT}this.panSpeed=B;this.panIncrement=A};apple.fx.Swoosh.DEFAULT_PAN_SPEED=20;apple.fx.Swoosh.DEFAULT_PAN_INCREMENT=40;apple.fx.Swoosh.prototype.getDefaultSpeed=function(){return apple.fx.Swoosh.DEFAULT_PAN_SPEED};apple.fx.Swoosh.prototype.getDefaultIncrement=function(){return apple.fx.Swoosh.DEFAULT_PAN_INCREMENT};apple.fx.Swoosh.prototype.getViewer=function(){return $(this.viewerId)};apple.fx.Swoosh.prototype.pan=function(A,D,C,E){if(this.lastFromObject){this.stopAnimation();Element.hide(this.lastFromObject)}this.lastFromObject=D;var B=this.getViewWidth();Element.setStyles(D,{top:"0px",left:"0px"});Element.setStyles(C,{top:"0px",left:(A?B:-B)+"px"});Element.show(D);Element.show(C);this._pan(Math.PI,B,A,D,C,E)};apple.fx.Swoosh.prototype.getViewWidth=function(){return parseInt(Element.getStyle(this.getViewer(),"width"),10)};apple.fx.Swoosh.prototype._pan=function(G,D,C,F,E,H){this.stopAnimation();G+=Math.PI/this.panIncrement;if(G<=(2*Math.PI)){var A=Math.floor((D/2)*(1+Math.cos(G)));if(C){A=-A}Element.setStyle(F,"left",A+"px");Element.setStyle(E,"left",(A+(C?D:-D))+"px");var B=this;this.timer=window.setTimeout(function(){B._pan(G,D,C,F,E,H)},this.panSpeed)}else{this._finishPan(F,E,H)}};apple.fx.Swoosh.prototype._finishPan=function(B,A,C){this.lastFromObject=null;this.stopAnimation();Element.hide(B);if(C){C()}};apple.fx.Swoosh.prototype.stopAnimation=function(){if(this.timer){window.clearTimeout(this.timer);this.timer=null}};Package("apple.fx");var halfPI=Math.PI/2;var PI=Math.PI;apple.fx.linearTween=function(A){return A};apple.fx.easeInSine=function(A){return 1-Math.cos(A*halfPI)};apple.fx.easeOutSine=function(A){return Math.sin(A*halfPI)};apple.fx.easeInOutSine=function(A){return(1-Math.cos(A*PI))/2};apple.fx.easeInBack=function(A,B){if(B==undefined){B=1.70158}return A*A*((B+1)*A-B)};apple.fx.easeOutBack=function(A,B){if(B==undefined){B=1.70158}A=A-1;return(A*A*((B+1)*A+B)+1)};apple.fx.easeOutBackStrong=function(A,B){if(B==undefined){B=1.70158*1.5}A=A-1;return(A*A*((B+1)*A+B)+1)};apple.fx.Chain=function(){var C;if(1==arguments.length&&"function"==typeof (arguments[0])){return arguments[0]}if(1==arguments.length&&arguments[0] instanceof Array){C=arguments[0]}else{C=Array.from(arguments)}C=C.filter(function(J){return null!==J&&"undefined"!=typeof (J)});var F=C.length;var E=0;var B=0;var H=0;var I=[];var G=[];for(var D=0;D<F;++D){G[D]=B;if(!("duration" in C[D])){C[D].duration=1}B+=C[D].duration;I[D]=B}function A(K){if(E==F){return }var J=((K*B)-G[E])/C[E].duration;if(J>1){J=1}C[E](J);if(J<1){return }if("finish" in C[E]){C[E].finish(J)}E++;if(E==F){return }if("setup" in C[E]){C[E].setup()}A(K)}A.setup=function(){E=0;if("setup" in C[E]){C[E].setup()}};A.finish=function(J){};return A};apple.fx.Blend=function(){var D;if(1==arguments.length&&"function"==typeof (arguments[0])){return arguments[0]}if(1==arguments.length&&arguments[0] instanceof Array){D=arguments[0]}else{D=Array.from(arguments)}D=D.filter(function(E){return null!==E&&"undefined"!=typeof (E)});var A=D.length;var C;function B(E){for(C=0;C<A;++C){D[C](E)}}B.setup=function(){for(C=0;C<A;++C){if("setup" in D[C]){D[C].setup()}}};B.finish=function(E){for(C=0;C<A;++C){if("finish" in D[C]){D[C].finish(E)}}};return B};apple.fx.AdjustCurve=function(B,A,E){A=A||0;E=E||1;if(0===A&&1===E){return B}var C=E-A;var D=A/C;return function(F){return B(Math.min(1,F/C-D))}};apple.fx.Fade=function(C,B,G,F){var E=F-G;var D=(0===F)?["","none"]:["none",""];function A(H){Element.setOpacity(B,G+E*C(H))}A.setup=function(){Element.setOpacity(B,G);B.style.display=""};A.finish=function(H){H=H?1:0;B.style.display=D[H];Element.setOpacity(B,H?F:G)};return A};apple.fx.FadeIn=function(B,A){return apple.fx.Fade(B,A,0,1)};apple.fx.FadeOut=function(B,A){return apple.fx.Fade(B,A,1,0)};apple.fx.CrossFade2=function(F,D,C){var B;var E;function A(G){Element.setOpacity(D,F(1-G));Element.setOpacity(C,F(G))}A.setup=function(){B=Element.getStyle(D,"position");E=Element.getStyle(C,"position");D.style.display="";Element.setOpacity(D,1);D.style.position="absolute";Element.setOpacity(C,0);C.style.display="";C.style.position="absolute"};A.finish=function(G){C.style.display=(G?"":"none");Element.setOpacity(C,1);D.style.display=(G?"none":"");Element.setOpacity(D,1);C.style.position=E;D.style.position=B};return A};apple.fx.FadeOutIn=function(D,C,B){function A(E){E*=2;if(E<=1){Element.setOpacity(C,D(1-E));Element.setOpacity(B,0)}else{Element.setOpacity(C,0);Element.setOpacity(B,D(E-1))}}A.setup=function(){C.style.display="";Element.setOpacity(C,1);Element.setOpacity(B,0);B.style.display=""};A.finish=function(E){B.style.display=(E?"":"none");Element.setOpacity(B,1);C.style.display=(E?"none":"");Element.setOpacity(C,1)};return A};apple.fx.Pan=function(H,F,E,G){var D=F.offsetWidth;G=G||1;var C=((G>0)?-D:D);var B=G*D;function A(I){var J=Math.round(B*H(I));F.style.left=J+"px";E.style.left=C+J+"px"}A.setup=function(){F.style.display="";E.style.left=C+"px";E.style.display=""};A.finish=function(I){if(1==I){F.style.display="none";F.style.left="0"}};return A};apple.fx.Scroll=function(H,F,D,G){var A=F.offsetHeight;G=G||1;var C=((G>0)?-A:A);var E=G*A;function B(I){var J=Math.round(E*H(I));F.style.top=J+"px";D.style.top=C+J+"px"}B.setup=function(){F.style.display="";D.style.top=C+"px";D.style.display=""};B.finish=function(I){if(1==I){F.style.display="none";F.style.top="0"}};return B};apple.fx.MoveBy=function(F,D,H){var C=H.x||H.left||0;var A=H.y||H.top||0;var E;var G;function B(I){var J=F(I);D.style.left=E+Math.round(C*J)+"px";D.style.top=G+Math.round(A*J)+"px"}B.setup=function(){E=parseFloat(Element.getStyle(D,"left")||0);G=parseFloat(Element.getStyle(D,"top")||0)};return B};apple.fx.MoveTo=function(F,D,H){var C;var A;var E;var G;function B(I){var J=F(I);D.style.left=E+Math.round(C*J)+"px";D.style.top=G+Math.round(A*J)+"px"}B.setup=function(){E=parseFloat(Element.getStyle(D,"left")||0);G=parseFloat(Element.getStyle(D,"top")||0);if("x" in H||"left" in H){C=(H.x||H.left)-E}else{C=0}if("y" in H||"top" in H){A=(H.y||H.top)-G}else{A=0}};return B};apple.fx.Move=function(B,C,H,I){var F;var D;var G;var E;function A(J){var K=B(J);C.style.left=G+Math.round(F*K)+"px";C.style.top=E+Math.round(D*K)+"px"}A.setup=function(){if("x" in H||"left" in H){G=(H.x||H.left)}else{G=parseFloat(Element.getStyle(C,"left")||0)}if("y" in H||"top" in H){G=(H.y||H.top)}else{E=parseFloat(Element.getStyle(C,"top")||0)}if("x" in I||"left" in I){F=(I.x||I.left)-G}else{F=0}if("y" in I||"top" in I){D=(I.y||I.top)-E}else{D=0}};return A};apple.fx.FadeInBackgroundImage=function(F,B,E){var D=Element.assignId(B);var C=document.getElementById(D+"_fadingBackgroundImage");if("url("!=E.substr(0,4).toLowerCase()){E="url("+E+")"}if(!C){C=document.createElement("div");C.id=D+"_fadingBackgroundImage";C.style.display="none";C.style.position="absolute";C.style.top="0";C.style.left="0";C.style.zIndex="0";B.insertBefore(C,B.firstChild)}C.style.backgroundImage=E;function A(G){Element.setOpacity(C,F(G))}A.setup=function(){Element.makePositioned(B);Element.makeClipping(B);C.style.backgroundPosition=Element.getStyle(B,"backgroundPosition");C.style.backgroundRepeat=Element.getStyle(B,"backgroundRepeat");C.style.width=B.offsetWidth+"px";C.style.height=B.offsetHeight+"px";Element.setOpacity(C,0);C.style.display=""};A.finish=function(H){function G(){C.style.display="none";Element.setOpacity(C,1);Element.undoPositioned(B);Element.undoClipping(B)}window.setTimeout(G,10)};return A};apple.fx.SetClassName=function(D,C,B){function A(E){C.className=B}A.duration=0;return A};apple.fx.SetInnerHTML=function(C,B,D){function A(E){B.innerHTML=D}A.duration=0;return A};apple.fx.SetInnerText=function(D,B,C){function A(E){var F=document.createTextNode(C);B.innerHTML="";B.appendChild(F)}A.duration=0;return A};apple.fx.Resize=function(D,C,B,F){var E=null;function A(G){var H=C.style;G=D(G);H.height=Math.round(G*E.height+F.height)+"px";H.width=Math.round(G*E.width+F.width)+"px"}A.setup=function(){Element.makeClipping(C);if(!F){F=Element.getDimensions(C)}E={width:B.width-F.width,height:B.height-F.height}};A.finish=function(H){var G=C.style;if(H){G.height=Math.round(B.height)+"px";G.width=Math.round(B.width)+"px"}else{G.height=Math.round(F.height)+"px";G.width=Math.round(F.width)+"px"}Element.undoClipping(C)};return A};apple.fx.Morph=function(F,E,D,H){var G=null;var A=true;var C=true;function B(I){var J=E.style;I=F(I);if(A){J.left=Math.round(I*G.left+H.left)+"px";J.top=Math.round(I*G.top+H.top)+"px"}if(C){J.height=Math.round(I*G.height+H.height)+"px";J.width=Math.round(I*G.width+H.width)+"px"}}B.setup=function(){if(!H){H=Element.getDimensions(E)}var I=Element.getPadding(E);A=("left" in D&&"left" in H&&"top" in D&&"top" in H);C=("width" in D&&"width" in H&&"height" in D&&"height" in H);G={left:D.left-H.left-I.left,top:D.top-H.top-I.top,width:D.width-H.width-I.left-I.right,height:D.height-H.height-I.top-I.bottom}};B.finish=function(J){var I=E.style;if(J){if(A){I.top=Math.round(D.top)+"px";I.left=Math.round(D.left)+"px"}if(C){I.height=Math.round(D.height)+"px";I.width=Math.round(D.width)+"px"}}else{if(A){I.top=Math.round(H.top)+"px";I.left=Math.round(H.left)+"px"}if(C){I.height=Math.round(H.height)+"px";I.width=Math.round(H.width)+"px"}}};return B};apple.fx.Hide=function(C,B){function A(D){}A.finish=function(D){B.style.display=D?"none":""};return A};apple.fx.ResizeImage=function(D,C,B,F){var E=null;function A(H){var J=C.style;var I;var G;H=D(H);J.height=(I=Math.round(H*E.height+F.height))+"px";J.width=(G=Math.round(H*E.width+F.width))+"px";C.width=G;C.height=I}A.setup=function(){if(!F){F=Element.getDimensions(C)}E={width:B.width-F.width-(parseFloat(Element.getStyle(C,"padding-left"))||0)-(parseFloat(Element.getStyle(C,"padding-right"))||0),height:B.height-F.height-(parseFloat(Element.getStyle(C,"padding-top"))||0)-(parseFloat(Element.getStyle(C,"padding-bottom"))||0)}};A.finish=function(K){var G;var I;var H=C.style;var J=K?B:F;H.height=(I=Math.round(J.height))+"px";H.width=(G=Math.round(J.width))+"px";C.height=I;C.width=G};return A};apple.fx.ColourRgbRegex=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i;apple.fx.ColourHexRegex=/^\#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;apple.fx.ChangeColour=function(E,F,C,H,B){var I;function D(K){var L=K.match(apple.fx.ColourRgbRegex);if(L){return[Math.clamp(parseInt(L[1],10),0,255),Math.clamp(parseInt(L[2],10),0,255),Math.clamp(parseInt(L[3],10),0,255)]}L=K.match(apple.fx.ColourHexRegex);if(L){var O=L[1];var N;var M;var J;if(3==O.length){N=O.charAt(0)+O.charAt(0);M=O.charAt(1)+O.charAt(1);J=O.charAt(2)+O.charAt(2)}else{N=O.slice(0,2);M=O.slice(2,4);J=O.slice(4,6)}return[Math.clamp(parseInt(N,16),0,255),Math.clamp(parseInt(M,16),0,255),Math.clamp(parseInt(J,16),0,255)]}throw new Error("Invalid colour string: "+K)}function G(J){J=Math.round(Math.clamp(J,0,255));if(J<16){return"0"+J.toString(16)}else{return J.toString(16)}}function A(J){J=E(J);var K=["#",G(B[0]+I[0]*J),G(B[1]+I[1]*J),G(B[2]+I[2]*J)].join("");F.style[C]=K}A.setup=function(){B=D(B||Element.getStyle(F,C));H=D(H);I=[H[0]-B[0],H[1]-B[1],H[2]-B[2]]};return A};apple.fx.ChangeColor=apple.fx.ChangeColour;Package("apple.io.json");apple.io.json.invoke=function(C){var A=null;var E=C.preventCache||false;var F=C.sync||false;var B=C.method||"get";function G(J){var L;if(J.head&&J.head.data&&J.head.data.metrics){L=J.head.data.metrics}else{if(J.body&&J.body.metrics){L=J.body.metrics;delete J.body.metrics}}if(!L&&!C.metrics){return }var K=Object.extend(C.metrics||{},L);apple.metrics.fireEvent(K)}function I(J){if(apple.io.json.isRedirect(J)){if(C.redirect){C.redirect(J)}apple.io.json.redirect(J);return }if(apple.io.json.hasErrors(J)){if(C.error){C.error(J)}return }G(J);if(J.preScript){coherent.Scripts.install(J.preScript)}if(C.success){C.success(J)}if(J.postScript){coherent.Scripts.install(J.postScript)}apple.io.json.evaluateScriptKeys(J.body,C.scriptKeys)}function H(J){if(C.error){C.error(J)}}try{A=XHR.request(B,C.url,C.urlArgs,{sync:F,responseContentType:"application/json"});A.addMethods(I,H)}catch(D){if(C.error){C.error(D)}}return A};apple.io.json.redirect=function(B){var A=B.head.data;if(A&&A.url){if("post"==A.method){apple.io.json.issuePostRedirect(A.url,A.args)}else{apple.io.json.issueGetRedirect(A.url,A.args)}}};apple.io.json.issuePostRedirect=function(C,B){if(C){var E=document.createElement("form");E.action=C;E.method="post";var F;var A;var G={};function D(J,I,K){var H=document.createElement("input");J.appendChild(H);H.type="hidden";H.name=I;H.value=K}for(F in B){A=B[F];if(B[F]===G[F]){continue}if(A instanceof Array){A.forEach(function(H){D(E,F,H)})}else{D(E,F,A)}}E.style.position="absolute";E.style.visibility="hidden";E.style.height="0px";E.style.width="0px";document.body.appendChild(E);E.submit()}};apple.io.json.issueGetRedirect=function(B,A){if(B){var C=null;if(A){C=Object.toQueryString(A)}if(C){if(B.indexOf("?")<0){B+="?"+C}else{B+=C}}window.location.href=B}};apple.io.json.isRedirect=function(D){var A=false;try{if(D){var B=parseInt(D.head.status,10);switch(B){case 301:case 302:case 303:case 304:case 305:case 306:case 307:A=true;break;default:break}}}catch(C){}return A};apple.io.json.hasErrors=function(D){var A=false;try{if(D){var B=parseInt(D.head.status,10);if(B==200){A=false}else{if(B>=400&&B<600){A=true}}}else{A=true}}catch(C){}return A};apple.io.json.evaluateScriptKeys=function(D,C){if(D&&C){for(var B=0;B<C.length;B++){var E=D[C[B]];if(E){var A=coherent.Scripts.extract(E).scripts;coherent.Scripts.install(A)}}}};apple.io.json.createSimpleJsonMsg=function(A){var B={head:{status:"200"},body:{content:A}};return B};Package("apple.quicktime");apple.quicktime._initialised=false;apple.quicktime._version=undefined;apple.quicktime.DEFAULTS={activeXClassId:"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B",activeXCodebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0",mimeType:"video/quicktime",autoplay:true,cache:true,controller:false,enablejavascript:true,showlogo:false,saveembedtags:true,scale:"aspect"};apple.quicktime.mobileSafari=!!navigator.userAgent.match(/Mobile.*Safari/);apple.quicktime.isInstalled=function(){return(this.mobileSafari||this._version||this.getVersion())?true:false};apple.quicktime.getVersion=function(){if(this._version||this._initialised){return this._version}this._initialised=true;var C=window.navigator.plugins;var A=C?C.length:0;if(C&&A){var F;for(F=0;F<A;++F){var G=C[F];var D=G.name.match(/quicktime\D*([\.\d]*)/i);if(D&&D[1]){return(this._version=D[1])}}}else{try{var E=new window.ActiveXObject("QuickTimeCheckObject.QuickTimeCheck"),B=E.QuickTimeVersion.toString(16);this._version=[B.charAt(0),B.charAt(1),B.charAt(2)].join(".")}catch(H){}return this._version}return this._version};apple.quicktime.isVersionCompatible=function(B){function A(F,H){var E=parseInt(F[0],10);if(isNaN(E)){E=0}var G=parseInt(H[0],10);if(isNaN(G)){G=0}if(E===G){if(F.length>1){return A(F.slice(1),H.slice(1))}else{return true}}else{if(E<G){return true}else{return false}}}var C=String(B).split(/\./);var D=String(this.getVersion()).split(/\./);return A(C,D)};apple.quicktime.createMovie=function(B,A){var D=document.createElement("OBJECT");B=Object.applyDefaults(Object.clone(B),this.DEFAULTS);function C(F){if(!(F in B)){return }D.setAttribute(F,B[F])}function E(F){var G=document.createElement("PARAM");if(!(F in B)){return }G.setAttribute("name",F);G.setAttribute("value",B[F]);D.appendChild(G)}["width","height","name","id","class","title","bgcolor"].forEach(C);["src","autoplay","cache","controller","enablejavascript","showlogo","saveembedtags","loop"].forEach(E);if(window.ActiveXObject){D.setAttribute("classid",B.activeXClassId);D.setAttribute("codebase",B.activeXCodebase)}else{D.setAttribute("data",B.src);D.setAttribute("type",B.mimeType)}A.appendChild(D);return D};apple.quicktime.logProperties=function(A){function B(E){try{return[E,A["Get"+E]()].join(": ")}catch(D){return D.message}}var C;C=["PluginStatus","AutoPlay","ControllerVisible","Rate","Time","Volume","Mute","MovieName","MovieID","StartTime","EndTime","BgColor","IsLooping","LoopIsPalindrome","PlayEveryFrame","HREF","Target","QTNEXTUrl","URL","KioskMode","Duration","MaxTimeLoaded","TimeScale","MovieSize","MaxBytesLoaded","TrackCount","Matrix","Rectangle","Language"].map(B);console.log(C.join("\n"))};Package("apple.widget");apple.widget.AlternateProductsUpdater=function(A){this.config=A||{};Object.applyDefaults(this.config,apple.widget.AlternateProductsUpdater.DEFAULTS);Event.onDomReady(this.init.bind(this))};apple.widget.AlternateProductsUpdater.DEFAULTS={priceId:"price",shippingId:"shipping",priceClass:"price",shippingClass:"availability",labelSuffix:"-label"};apple.widget.AlternateProductsUpdater.prototype.init=function(){var B=document.getElementById(this.config.elementId);if(!B){return }var C=B.getElementsByTagName("label");if(!C){return }var D=this.selectProduct.bindAsEventListener(this);function A(G){var E=G.htmlFor;G.id=E+this.config.labelSuffix;var F=document.getElementById(E);Event.observe(F,"click",D)}Array.forEach(C,A,this)};apple.widget.AlternateProductsUpdater.prototype.selectProduct=function(A){var B=(A.srcElement||A.target);this.updateSelectedProduct(B)};apple.widget.AlternateProductsUpdater.prototype.updateSelectedProduct=function(F){var B=document.getElementById(F.id+this.config.labelSuffix);if(!B){return }var E=document.getElementById(this.config.priceId);var A=document.getElementById(this.config.shippingId);var C=Element.getElementsByClassName(this.config.priceClass,B);var D=Element.getElementsByClassName(this.config.shippingClass,B);if(E&&C&&C.length>0){E.innerHTML=C[0].innerHTML}if(A&&D&&D.length>0){A.innerHTML=D[0].innerHTML}};Package("apple.widget");apple.widget.AnimatedTextWidget=(function createAnimatedTextWidget(){var D=window.coherent,B=D.Markers,A=D.Animator,C=window.Element,G=C.getStyle,E=C.getStyles,F=C.setStyle,I=C.setStyles,H=C.undoClipping,J="px";return Class.create(D.View,{__viewClassName__:"apple.AnimatedText",animated:true,observeVisibleChange:function(S,U,M){var R=this.viewElement(),Q=E(R,["display","paddingTop","paddingBottom"]),K={width:R.scrollWidth,height:R.scrollHeight},O=Q.display,L=!!S.newValue,N=(parseFloat(Q.paddingTop)||0)+(parseFloat(Q.paddingBottom)||0),P,T;if(L===O){return }C.makeClipping(R);if(S.newValue){I(R,{height:0+J,display:""});A.setStyles(R,{height:Math.max(0,R.scrollHeight-N)},{duration:300,curve:D.easing.inOutSine,callback:function(){F(R,"height","");H(R)}})}else{F(R,"height",Math.max(R.offsetHeight-N,R.offsetHeight)+J);A.setStyles(R,{height:0},{duration:300,curve:D.easing.inOutSine,callback:function(){I(R,{display:"none",height:""});H(R)}})}},translateValue:function(N){var L=this.viewElement(),M=true,K=this.attributeOrProperty;if(this.formatter){N=this.formatter.stringFromValue(N)}switch(N){case"":case null:case undefined:if(typeof this.nullPlaceHolder==="string"||C.hasAttribute(L,"nullPlaceHolder")){N=K("nullPlaceholder")}break;case D.Markers.NoSelection:N=K("noSelectionPlaceholder");break;case D.Markers.MultipleValues:N=K("multipleValuesPlaceholder");break;default:N=String(N);M=false;break}if(M){C.addClassName(L,D.Style.kMarkerClass)}else{C.removeClassName(L,D.Style.kMarkerClass)}return N},observeTextChange:function(P,O,L){var K=this.viewElement(),M=this.translateValue(P.newValue),N;if(!this.animated||"none"===G(K,"display")){N=document.createTextNode(M);K.innerHTML="";K.appendChild(N);return }if(M===K.innerText){return }A.innerText(K,M,300)},observeHtmlChange:function(Q,P,L){var K=this.viewElement(),N=Q.newValue,M=this.translateValue(N),O;if(!this.animated||"none"===G(K,"display")){if(M!==N){O=document.createTextNode(M);K.innerHTML="";K.appendChild(O);return }K.innerHTML=M;return }if(typeof M==="string"){if(M!==N){this.observeTextChange(Q,P,L);return }if(typeof M==="string"&&M.trim()===String(K.innerHTML).trim()){return }A.innerHTML(K,M,300)}}})})();Package("apple.widget");apple.widget.AutoCompleter=function(A,C,B){this.country=C;this.field=B;this.cur=-1;this.layer=null;this.textbox=A;this.init()};Object.extend(apple.widget.AutoCompleter.prototype,{init:function(){var A=this;this.textbox.onkeyup=function(B){if(!B){B=window.event}A.handleKeyUp(B)};this.textbox.onkeydown=function(B){if(!B){B=window.event}A.handleKeyDown(B)};this.textbox.onblur=function(){A.hideSuggestions()};this.createDropDown()},autosuggest:function(B,A){if(B.length>0){if(A){this.typeAhead(B[0])}this.showSuggestions(B)}else{this.hideSuggestions()}},createDropDown:function(){var C=this;this.layer=document.createElement("div");this.layer.className="AutoCompleterResults";if(coherent.Browser.Safari){var A=/AppleWebKit\/(\d+(?:\.\d+)?)/;var B=A.exec(navigator.userAgent);if(B&&parseInt(B[1],10)>=523){this.layer.className+=" capable"}}this.layer.style.visibility="hidden";this.layer.style.left="-5000px";this.layer.style.top="0px";this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(E){E=E||window.event;var D=E.target||E.srcElement;if(E.type=="mousedown"){var F=D.firstChild.nodeValue;if(F!==null){C.textbox.value=D.firstChild.nodeValue;C.hideSuggestions()}}else{if(E.type=="mouseover"){C.highlightSuggestion(D)}else{C.textbox.focus()}}};document.body.appendChild(this.layer)},handleKeyDown:function(A){switch(A.keyCode){case 38:this.previousSuggestion();return ;case 40:this.nextSuggestion();return ;case 13:this.cancelEvent(A);this.hideSuggestions();return ;case 27:this.hideSuggestions();return ;default:return }},cancelEvent:function(A){A.cancelBubble=true;A.returnValue=false;if(A.stopPropagation){A.stopPropagation();A.preventDefault()}},handleKeyUp:function(A){var C=A.keyCode;var B;if(C==8||C==46){this.autosuggest(this.search(this.textbox.value),false)}else{if(C<32||(C>=33&&C<46)||(C>=112&&C<=123)){return }else{this.autosuggest(this.search(this.textbox.value),true)}}},showSuggestions:function(G){var A=Element.getRect(this.textbox);this.layer.style.top=(A.top+this.textbox.offsetHeight)+"px";this.layer.style.left=(A.left+this.textbox.offsetWidth/2)+"px";this.layer.style.width="";var F=null;this.layer.innerHTML="";var H=document.createElement("div");H.className="top";H.innerHTML='<span class="left"></span><span class="right"></span>';var D=document.createElement("div");D.className="middle";var C=document.createElement("div");C.className="bottom";C.innerHTML='<span class="left"></span><span class="right"></span>';var B=document.createElement("ul");for(var E=0;E<G.length;E++){F=document.createElement("li");F.appendChild(document.createTextNode(G[E]));B.appendChild(F)}D.appendChild(B);this.layer.appendChild(H);this.layer.appendChild(D);this.layer.appendChild(C);this.layer.style.visibility="visible";this.layer.style.width=D.offsetWidth+"px";this.layer.style.marginLeft=-0.5*this.layer.offsetWidth+"px"},hideSuggestions:function(){this.layer.style.visibility="hidden"},highlightSuggestion:function(B){var A=this.layer.getElementsByTagName("li");for(var C=0;C<A.length;C++){A[C].className=A[C]==B?"selected":""}},nextSuggestion:function(){var B=this.layer.getElementsByTagName("li");if(B.length>0&&this.cur<B.length-1){var A=B[++this.cur];this.highlightSuggestion(A);this.textbox.value=A.firstChild.nodeValue}},previousSuggestion:function(){var B=this.layer.getElementsByTagName("li");if(B.length>0&&this.cur>0){var A=B[--this.cur];this.highlightSuggestion(A);this.textbox.value=A.firstChild.nodeValue}},selectRange:function(A,B){if(this.textbox.createTextRange){var C=this.textbox.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-this.textbox.value.length);C.select()}else{if(this.textbox.setSelectionRange){this.textbox.setSelectionRange(A,B)}}},search:function(E){var D=[];var A=apple.widget.AutoCompleter.data[this.country][this.field];if(E.length>0){E=E.toUpperCase()+" ";while(E.length>1&&D.length===0){E=E.substring(0,E.length-1);var B=A[E.substring(0,1)];if(B){for(var C=0;C<B.length;C++){if(B[C].indexOf(E)===0){D.push(B[C])}}}}}return D},typeAhead:function(B){if(this.textbox.createTextRange||this.textbox.setSelectionRange){if(B&&this.textbox.value&&B.indexOf(this.textbox.value)===0){var A=this.textbox.value.length;this.textbox.value=B;this.selectRange(A,B.length)}}}});apple.widget.AutoCompleter.requestURL="";apple.widget.AutoCompleter.requestParams={};apple.widget.AutoCompleter.willRequest=false;apple.widget.AutoCompleter.requestTimer=null;apple.widget.AutoCompleter.requestCallback=null;apple.widget.AutoCompleter.data=null;apple.widget.AutoCompleter.registerInput=function(A,D,C){apple.widget.AutoCompleter.willRequest=true;var B=apple.widget.AutoCompleter.requestParams;if(!(D in B)){B[D]={}}if(!(C in B[D])){B[D][C]=[]}B[D][C].push(A)};apple.widget.AutoCompleter.requestData=function(){if(apple.widget.AutoCompleter.willRequest===false){return }var C={p:"apple.widget.AutoCompleter.processData"};for(var G in apple.widget.AutoCompleter.requestParams){if(!(G in C)){C[G]=[]}for(var E in apple.widget.AutoCompleter.requestParams[G]){C[G].push(E)}}var B=apple.widget.AutoCompleter.requestURL;var F=(B.indexOf("?")!=-1)?"&":"?";B+=F+Object.toQueryString(C);var A=document.createElement("script");A.src=B;function D(){apple.widget.AutoCompleter.requestCallback=function(){}}apple.widget.AutoCompleter.requestCallback=function(H){window.clearTimeout(apple.widget.AutoCompleter.requestTimer);apple.widget.AutoCompleter.requestTimer=null;apple.widget.AutoCompleter.processData(H)};apple.widget.AutoCompleter.requestTimer=window.setTimeout(D,10000);document.getElementsByTagName("HEAD")[0].appendChild(A)};apple.widget.AutoCompleter.processData=function(C){apple.widget.AutoCompleter.data=C;var D=apple.widget.AutoCompleter.requestParams;for(var E in D){for(var B in D[E]){for(var A=0;A<D[E][B].length;A++){apple.widget.AutoCompleter.create(D[E][B][A],E,B)}}}};apple.widget.AutoCompleter.create=function(E,D,C){var B=apple.widget.AutoCompleter.data;var A=document.getElementById(E);if(A){if(A.setAttribute){A.setAttribute("AUTOCOMPLETE","off")}new apple.widget.AutoCompleter(A,D,C)}};Event.onDomReady(apple.widget.AutoCompleter.requestData);Package("apple.widget");function _makePartFinder(F){var A=F.length;if(1==A){var E=F[0];function G(){return[document.getElementById(E)]}G.single=function(I){return document.getElementById(E)};G.isPart=function(I){return I.id==E};return G}var C=undefined;function B(){C={};for(var I=0;I<A;++I){C[F[I]]=true}}function H(I){return I.id in C}function D(){var I=[];for(var J=0;J<A;++J){I.push(document.getElementById(F[J]))}return I}D.single=function(I){return document.getElementById(F[I])};D.isPart=function(I){B();this.isPart=H;return H(I)};return D}apple.widget.BaseWidget=function(B,A){if(1==arguments.length){A=B||{}}else{A=A||{};if("string"!=typeof (B)){A.id=Element.assignId(B)}else{A.id=B||A.id}}this._partCache={};this._widgetId=A.id;this.setConfig(A);Event.onDomReady(this.init.bind(this))};Class.extend(apple.widget.BaseWidget,{setConfig:function(B){for(var A=this.constructor;A&&Object!==A;A=A.superclass){Object.applyDefaults(B,A.DEFAULTS||{})}this.config=B},init:function(){},widget:function(){return document.getElementById(this._widgetId)},observeParts:function(B,E,D){var F=this.parts(B);var A=F.length;var C;for(C=0;C<A;++C){Event.observe(F[C],E,D)}},observePart:function(A,D,C){var B=this.part(A);Event.observe(B,D,C)},stopObservingParts:function(B,E,D){var F=this.parts(B);var A=F.length;var C;for(C=0;C<A;++C){Event.stopObserving(F[C],E,D)}},isPart:function(A,B){if(!(A in this._partCache)){this.parts(A)}return this._partCache[A].isPart(B)},part:function(A,B){B=B||0;if(A in this._partCache){return this._partCache[A].single(B)}return this.parts(A)[B]},parts:function(I){if(I in this._partCache){return this._partCache[I]()}var F=this.widget();var K=I.split(".");var B;var H;var A=[];var E;if(0===K.length||2<K.length){return[]}if(1==K.length){B=F.getElementsByTagName(K[0]);H=A.length=B.length;for(E=0;E<H;++E){A[E]=Element.assignId(B[E])}}else{var J=[];var G=0;var C=new RegExp("(?:^|\\s+)"+K[1]+"(?:\\s+|$)");B=F.getElementsByTagName(K[0]||"*");H=J.length=A.length=B.length;for(E=0;E<H;++E){var D=B[E];if(!C.test(D.className)){continue}A[G]=Element.assignId(D);J[G]=D;++G}A.length=G;J.length=G;B=J}this._partCache[I]=_makePartFinder(A);return Array.from(B)}});Package("apple.widget");apple.widget.ColumnEqualizer=function(A){this.elementList=typeof (A)==="string"?Element.queryAll(A):A;this.calculateHeights()};apple.widget.ColumnEqualizer.prototype.calculateHeights=function(){var A=0,B=0;this.elementList.forEach(function(C){B=C.style.height;C.style.height="";A=Math.max(A,parseInt(Element.getStyles(C,"height").replace("px",""),10));C.style.height=B});this.elementList.forEach(function(C){Element.setStyle(C,"height",A+"px")})};Package("apple.widget");apple.widget.ContentSwitcher=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS);this._activateTimer=null;Event.onDomReady(this.init.bind(this))};apple.widget.ContentSwitcher.STYLE={switchOnClick:0,switchOnHover:1};apple.widget.ContentSwitcher.prototype.nodesById=function(A){switch(typeof (A)){case"string":return[$(A)];case"undefined":return[];default:if(A instanceof Array){return A.map($)}if(!A){return[]}return[A]}};apple.widget.ContentSwitcher.prototype.DEFAULTS={hoverDelay:200,activeContentClass:"active",inactiveContentClass:"inactive",activeButtonClass:"active",inactiveButtonClass:"inactive",style:apple.widget.ContentSwitcher.STYLE.switchOnClick,transition:{swap:function(D,B,E){D=[].concat(D);B=[].concat(B);function C(F){F.style.display="none"}function A(F){F.style.display=""}D.forEach(C);B.forEach(A);if(E){E()}}}};apple.widget.ContentSwitcher.prototype.init=function(){var H=apple.widget.ContentSwitcher.STYLE;var F=H.switchOnHover==(this.config.style&H.switchOnHover);var C=this.mouseOverButton.bindAsEventListener(this);var I=this.mouseOutButton.bindAsEventListener(this);var G=this.buttonClicked.bindAsEventListener(this);for(var B in this.config.buttons){var D=$(B);var E=this.config.buttons[B];if("string"==typeof (E)){this.config.buttons[B]=E.split(/\s*,\s*/g)}if(!D){continue}if(F){Event.observe(D,"mouseover",C);Event.observe(D,"mouseover",C);Event.observe(D,"mouseout",I);Event.observe(D,"click",Event.stop)}else{Event.observe(D,"click",G)}}this._activeButtonId=this.findInitialActiveButton();this._activeContentIds=this.config.buttons[this._activeButtonId]||[this.overviewId];this._initialActiveButton=this._activeButtonId;this._initialActiveContentIds=this._activeContentIds;if(!this.config.containerId){return }var A=$(this.config.containerId);Event.observe(A,"mouseout",this.mouseOutContainer.bindAsEventListener(this));Event.observe(A,"mouseover",this.mouseOverContainer.bindAsEventListener(this))};apple.widget.ContentSwitcher.prototype.findInitialActiveButton=function(){if(this.config.overviewId){return undefined}for(var E in this.config.buttons){var B=$(E);var D=this.config.buttons[E];if(!B||!D){continue}var A=Element.regexForClassName(this.config.activeContentClass);if(A.test(B.className)){return E}function C(G){var F=$(G);return A.test(B.className)}if(this.nodesById(D).some(C,this)){return E}}return undefined};apple.widget.ContentSwitcher.prototype.reset=function(){if(this._activeButtonId==this._initialActiveButton){return }this.activateButton(this._initialActiveButton);this.activateContent(this._initialActiveContentIds)};apple.widget.ContentSwitcher.prototype.activateButton=function(B){var A;if(this._activeButtonId){A=$(this._activeButtonId);Element.addClassName(A,this.config.inactiveButtonClass);Element.removeClassName(A,this.config.activeButtonClass)}this._activeButtonId=B;if(!B){return }A=$(B);Element.removeClassName(A,this.config.inactiveButtonClass);Element.addClassName(A,this.config.activeButtonClass)};apple.widget.ContentSwitcher.prototype.activateContent=function(A){var C=this._activeContentIds||[];var F=A||[];var E=this.nodesById(C);var B=this.nodesById(F);function D(H){this.beforeHideContent(H.id);Element.removeClassName(H,this.config.activeContentClass);Element.addClassName(H,this.config.inactiveContentClass)}function G(H){this.beforeShowContent(H.id);Element.removeClassName(H,this.config.inactiveContentClass);Element.addClassName(H,this.config.activeContentClass)}E.forEach(D,this);B.forEach(G,this);this._activeContentIds=(A||[]);this.config.transition.swap(E,B);C.forEach(this.afterHideContent,this);F.forEach(this.afterShowContent,this)};apple.widget.ContentSwitcher.prototype.findTarget=function(A){if(!A){return A}while(!A.id&&"body"!=A.nodeName){A=A.parentNode}if(!A.id){return null}return A};apple.widget.ContentSwitcher.prototype.mouseOverButton=function(B){var D=this.findTarget(Event.fixEvent(B).target);if(!D){return }var E=this.config.buttons[D.id];var A;if(!E||E==this._activeContentId){return }function C(){this.activateButton(D.id);this.activateContent(E)}if(this._activateTimer){window.clearTimeout(this._activateTimer)}this._activateTimer=window.setTimeout(C.bind(this),this.config.hoverDelay)};apple.widget.ContentSwitcher.prototype.mouseOutButton=function(B){B=Event.fixEvent(B);var C=this.findTarget(B.currentTarget);if(!C){return }var A=B.relatedTarget;while(A&&A!=C&&A.nodeName!="body"){A=A.parentNode}if(A==C){return }if(this._activateTimer){window.clearTimeout(this._activateTimer)}this._activateTimer=null};apple.widget.ContentSwitcher.prototype.mouseOverContainer=function(A){var B=Event.fixEvent(A).target};apple.widget.ContentSwitcher.prototype.mouseOutContainer=function(B){B=Event.fixEvent(B);var C=B.currentTarget;if(!C){return }if(!this.config.overviewId){return }var A=B.relatedTarget;while(A&&A!=C&&A.nodeName!="body"){A=A.parentNode}if(A==C){return }this.activateContent([this.config.overviewId]);this.activateButton(null)};apple.widget.ContentSwitcher.prototype.buttonClicked=function(C){var D=this.findTarget(Event.fixEvent(C).target);if(!D){return }var A=this.config.buttons[D.id];var B;if(!A||D.id==this._activeButtonId){return }if(this._activateTimer){window.clearTimeout(this._activateTimer)}this.activateButton(D.id);this.activateContent(A);Event.stop(C)};apple.widget.ContentSwitcher.prototype.beforeShowContent=function(A){};apple.widget.ContentSwitcher.prototype.beforeHideContent=function(A){};apple.widget.ContentSwitcher.prototype.afterShowContent=function(A){};apple.widget.ContentSwitcher.prototype.afterHideContent=function(A){};Package("apple.widget");apple.widget.CrossFader=Class.create(coherent.View,{exposedBindings:["locked"],paused:false,timer:null,selectedIndex:null,items:PartList("div.slide"),indicator:coherent.ListView("div.indicator",{contentBinding:"indicatorContent",selectedIndexBinding:"selectedIndex",enabledBinding:"locked(NOT)",innerHTML:"<span></span>"}),previousButton:coherent.Anchor("a.previous",{action:"showPreviousItem"}),nextButton:coherent.Anchor("a.next",{action:"showNextItem"}),init:function(){var C=this.items();var A=C.length;var B=this.viewElement();this.setValueForKey(false,"locked");this.setValueForKey(0,"selectedIndex");Element.addClassName(C[0],"faded_in");if(A<2){if(Element.query(B,"div.pagination")){Element.query(B,"div.pagination").style.display="none"}return }for(var D=1;D<A;D++){Element.addClassName(C[D],"faded_out")}if(this.indicator){var E=this.items().map(function(G,F){return{value:"Item "+(F+1)}});this.setValueForKey(coherent.KVO.adapt(E),"indicatorContent");this.addObserverForKeyPath(this,this.observeSelectedIndexChange,"selectedIndex")}Event.observe(B,"mouseover",this.pause.bindAsEventListener(this));Event.observe(B,"mouseout",this.resume.bindAsEventListener(this));this.resume()},observeSelectedIndexChange:function(A){if(this.locked){return }this.switchItems(A.oldValue,A.newValue,250)},showPreviousItem:function(D){if((typeof (D)==="undefined"&&this.paused)||this.locked){return }var C;if(typeof (D)!=="undefined"){C=250}var B=this.selectedIndex;var A;if(B===0){A=this.items().length-1}else{A=B-1}this.switchItems(B,A,C)},showNextItem:function(D){if((typeof (D)==="undefined"&&this.paused)||this.locked){return }var C;if(typeof (D)!=="undefined"){C=250}var B=this.selectedIndex;var A;if(B==this.items().length-1){A=0}else{A=B+1}this.switchItems(B,A,C)},switchItems:function(E,D,C){C=C||apple.widget.CrossFader.FADE_DURATION;if(this.timer){window.clearTimeout(this.timer);this.timer=null}var A=this;function B(){A.setValueForKey(D,"selectedIndex");A.setValueForKey(false,"locked");A.resume()}this.setValueForKey(true,"locked");Element.replaceClassName(this.items(E),"faded_in","fading_out");coherent.Animator.replaceClassName(this.items(E),"fading_out","faded_out",{duration:C,only:["opacity"],discreteTransitionPoint:1});Element.replaceClassName(this.items(D),"faded_out","fading_in");coherent.Animator.replaceClassName(this.items(D),"fading_in","faded_in",{duration:C,only:["opacity"],discreteTransitionPoint:1,callback:B})},pause:function(A){this.paused=true;if(this.timer){window.clearTimeout(this.timer)}this.timer=null},resume:function(A){if(A){this.paused=false}if(this.timer){window.clearTimeout(this.timer)}this.timer=window.setTimeout(this.showNextItem.bind(this),apple.widget.CrossFader.SLIDE_DELAY)}});apple.widget.CrossFader.SLIDE_DELAY=6000;apple.widget.CrossFader.FADE_DURATION=750;Package("apple");apple.Dialog=Class.create({constructor:function(A){this.createOverlay()},createOverlay:function(){var A=document.createElement("div");A.className="overlay";document.body.appendChild(A);this.overlay=new coherent.Overlay(A)}});Package("apple.widget");apple.widget.EmailSubscription=function(B,A){this.base("constructor")(B,A)};apple.util.makeSubclass(apple.widget.EmailSubscription,apple.widget.BaseWidget);var ServerStatus={good:"SUCCESS",bad:"ERROR",busy:"BUSY",off:"OFF",on:"ON",format:"FORMAT"};apple.widget.EmailSubscription.DEFAULTS={emailPlaceholder:"example: steve@me.com",submitUrl:"email-server-reply.txt",urlArgs:{},argName:"emailAddress",emailFieldSpec:"input.notify_email",submitButtonSpec:".notify_submit",formSpec:"form",fadeDuration:350,showForm:{SUCCESS:false,ERROR:false,BUSY:false,ON:true,OFF:false,FORMAT:true},loadingClass:"loading",rpcTimeout:10000,emailRegex:/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i};apple.widget.EmailSubscription.prototype.init=function(){var F={duration:this.config.fadeDuration};this._animator=new apple.fx.Animator(F);this.setStatus("OFF");this.setStatus("ON");var B=this.part(this.config.formSpec);var E=this.part(this.config.emailFieldSpec);var A={placeholder:this.config.emailPlaceholder};this._field=new apple.widget.TextField(E.id,A);var D=this.part(this.config.submitButtonSpec);var C=this.submitHandler.bindAsEventListener(this);Event.observe(D,"click",C);Event.observe(B,"submit",C)};apple.widget.EmailSubscription.prototype.partSpecForStatus=function(A){return"div.notify_"+(A||"").toLowerCase()};apple.widget.EmailSubscription.prototype.setStatus=function(G,J,L){G=G||"ERROR";if(G==this._status){return }var F=this.widget();var A=this.part(this.config.formSpec);var B=this.config.showForm[this._status];var K=this.config.showForm[G];var H=this.part(this.partSpecForStatus(this._status));var I=this.part(this.partSpecForStatus(G));if(!this._status){A.style.display=K?"block":"none";I.style.display="block";this._status=G;return }if(L){A.style.display=K?"block":"none";I.style.display="block";H.style.display="none";this._status=G;return }var C=new apple.fx.Fade(apple.fx.linearTween,H,1,0);var E=new apple.fx.Fade(apple.fx.linearTween,I,0,1);var M;var D=[C,E];if(B!=K){if(K){M=new apple.fx.Fade(apple.fx.linearTween,A,0,1);D=[C,new apple.fx.Blend(E,M)]}else{M=new apple.fx.Fade(apple.fx.linearTween,A,1,0);D=[new apple.fx.Blend(C,M),E]}}this._status=G;this._animator.play(new apple.fx.Chain(D),J)};apple.widget.EmailSubscription.prototype.rpc=function(D,G,C){if(-1!=D.indexOf("?")){D=D+"&"}else{D=D+"?"}D+="bustCache="+(new Date()).getTime().toString(16)+":"+Math.random();var F;var B=document.createElement("script");B.src=D;function A(){window.clearTimeout(F);F=null;if(G){G.apply(window,arguments)}}function E(){window.signalStatus=function(){};if(C){C()}}window.signalStatus=A;F=window.setTimeout(E,this.config.rpcTimeout);document.getElementsByTagName("HEAD")[0].appendChild(B)};apple.widget.EmailSubscription.prototype.submitHandler=function(E){(E.target||E.srcElement).blur();Event.stop(E);var G=this.widget();var H=this.part(this.config.emailFieldSpec);if(!H||!this.config.submitUrl){return }var F=H.value||"";if(!F.match(this.config.emailRegex)){this.setStatus("FORMAT");H.focus();H.select();return }Element.addClassName(G,this.config.loadingClass);function D(){Element.removeClassName(G,this.config.loadingClass)}function A(J){J=J.replace(/^\s*/,"").replace(/\s*$/,"").toLowerCase();var I=ServerStatus[J];this.setStatus(I,D.bind(this))}var C=Object.applyDefaults({},this.config.urlArgs);C[this.config.argName]=F;var B=[this.config.submitUrl,Object.toQueryString(C)].join("?");this.rpc(B,A.bind(this),A.bind(this,"busy"))};Package("apple.widget");apple.widget.Engraver=function(A){this.config=A;this.timer=null;this.originalMessage=null};apple.widget.Engraver.DEFAULT_DELAY=1000;apple.widget.Engraver.prototype.validateConfig=function(){if(!this.config){return false}var A=this.getTextFields();if(!A){return false}for(var B=0;B<A.length;B++){if(!A[B]){return false}}if(!this.getEngraveImage()){return false}return true};apple.widget.Engraver.prototype.connectEvents=function(){if(!this.attachedEvents){if(!this.validateConfig()){return }function A(C){var B=this.getTextFields();this.originalMessage=new Array();for(var D=0;D<B.length;D++){var E=$(B[D]);E.setAttribute("autocomplete","off");this.originalMessage[D]=E.value;Event.observe(E,"onkeyup",(function(F){this.valueChanged(F)}).bind(this));Event.observe(E,"onchange",(function(F){this.valueChanged(F)}).bind(this));Event.observe(E,"drop",(function(F){this.valueChanged(F)}).bind(this));Event.observe(E,"dragdrop",(function(F){this.valueChanged(F)}).bind(this));Event.observe(E,"onfocus",(function(F){this.valueChanged(F)}).bind(this))}}Event.onDomReady(A.bind(this));this.attachedEvents=true}};apple.widget.Engraver.prototype.valueChanged=function(A){if(this.timer){window.clearTimeout(this.timer)}this.timer=window.setTimeout(this.engrave.bind(this),this.getDelay())};apple.widget.Engraver.prototype.getTextFields=function(){return this.config.textFields};apple.widget.Engraver.prototype.getEngraveImage=function(){return this.config.engraveImageId};apple.widget.Engraver.prototype.getBaseUrl=function(){return this.config.baseUrl};apple.widget.Engraver.prototype.getDelay=function(){if(this.config.delay){return parseInt(this.config.delay,10)}return apple.widget.Engraver.DEFAULT_DELAY};apple.widget.Engraver.prototype.engrave=function(){var H=$(this.getEngraveImage()),E=this.getBaseUrl(),A=this.getTextFields(),G=E.indexOf("?"),D=G>=0,F=(E.length>G+1);if(!D){E+="?"}var B=true;for(var C=0;C<A.length;C++){if($(A[C]).value!==""){B=false;break}}for(C=0;C<A.length;C++){E+=F?"&":"";F=true;if(B){E+=this.getLineArgument(this.originalMessage[C],C)}else{E+=this.getLineArgument($(A[C]).value,C)}}if(H){H.setAttribute("src",E)}};apple.widget.Engraver.prototype.getLineArgument=function(C,B){C=this.encode(C);var A="th";if(B%2==1){A="tl"}return A+"="+C};apple.widget.Engraver.prototype.encode=function(B){try{return encodeURIComponent(B)}catch(A){return escape(B)}};Package("apple.widget");apple.widget.FormFormatter=function(A){var B=".user-form-block .field-with-placeholder > input";this.init(B)};Object.extend(apple.widget.FormFormatter.prototype,{inlineBlockCompensation:4,init:function(A){var B=this.gatherRows(A);this.parseRows(B)},gatherRows:function(A){var C=Element.queryAll(A),B=[];C.forEach(function(D){B.push(D.parentNode.parentNode)});return B.distinct()},parseRows:function(B){var A,C;B.forEach(function(D){A=Element.queryAll(D,"> *");A=this.parseChildren(A);A.adjustable=this.determineRelativeFlexFields(A.adjustable);this.formatRow(D,A)}.bind(this));return C},parseChildren:function(B){var D={adjustable:[],nonadjustable:[]},A,C;B.forEach(function(E){A=Element.getDimensions(E).width;if(A===0&&!this.isEmptyNode(E)){A=this.unhideAndCalculate(E)}if(this.isChildATextField(E)){Element.addClassName(E,"text-input")}C=(this.isChildATextField(E)&&!this.isFieldWidthDeclared(E))?D.adjustable:D.nonadjustable;C.push({node:E,width:A})}.bind(this));return D},determineRelativeFlexFields:function(F){var D=F.length,H=[],C=0,G,E=0,B=0;if(D===1){F[0].relativeWidth=1}else{F.forEach(function(I){G=Element.query(I.node,"input");C=G.maxLength;H.push(C);E=E+C});for(var A=0;A<D;A++){B=Math.round((H[A]/E)*100);B=B/100;F[A].relativeWidth=B}}return F},formatRow:function(H,D){var A=Element.getDimensions(H).width,F=0,B=0,E=0,G=0,C=0;if(A===0){A=this.unhideAndCalculate(H)}D.nonadjustable.forEach(function(I){B=B+I.width});E=A-B;D.adjustable.forEach(function(I){C=Math.round((I.relativeWidth*E)-this.inlineBlockCompensation);Element.setStyle(I.node,"width",C+"px")}.bind(this))},isChildATextField:function(C){var A=Element.query(C,"input[type=text]"),B=Element.query(C,"input[type=password]");return(A||B)?true:false},isFieldWidthDeclared:function(D){var A=Element.getDimensions(D).width,C=0,B=Element.getStyle(D,"minWidth");if(A===0){A=this.unhideAndCalculate(D)}D.style.width="auto";if(B!="0px"){D.style.minWidth=0}C=Element.getDimensions(D).width;if(C===0){C=this.unhideAndCalculate(D)}D.style.width=A+"px";if(B!="0px"){D.style.minWidth=B}return(A==C)?false:true},isEmptyNode:function(A){return(A.innerHTML==="")?true:false},unhideAndCalculate:function(C){var A=this.findHiddenParent(C),B=0;if(A){A.style.display="block";B=Element.getDimensions(C).width;A.style.display="none"}return B},findHiddenParent:function(B){var A=B.parentNode,C;if(A==document||!A){return false}if(A.style){C=A.style.display}return(C=="none")?A:this.findHiddenParent(A)}});Package("apple.widget");apple.widget.FormSubmitter=function(A){this.config=A;Event.onDomReady(this.init.bind(this))};apple.widget.FormSubmitter.prototype.init=function(){if(this._initialized){return }Event.observe(this.getForm(),"onsubmit",(function(A){this.formHandler(A)}).bind(this));Event.observe(this.getSubmit(),"onclick",(function(A){this.submitHandler(A)}).bind(this));this._initialized=true};apple.widget.FormSubmitter.prototype.getForm=function(){return $(this.config.formId)?$(this.config.formId):document.forms[this.config.formId]};apple.widget.FormSubmitter.prototype.getSubmit=function(){return $(this.config.submitId)};apple.widget.FormSubmitter.prototype.formHandler=function(A){return true};apple.widget.FormSubmitter.prototype.submitHandler=function(A){return true};apple.widget.SelectLinkFormSubmitter=apple.widget.FormSubmitter;apple.widget.SelectLinkFormSubmitter.prototype.getSelect=function(){return $(this.config.selectId)};apple.widget.SelectLinkFormSubmitter.prototype.formHandler=function(B){var C=this.getForm();var A=this.getSelect();if(C&&A&&A.options&&A.options[A.selectedIndex].value){C.action=A.options[A.selectedIndex].value}return true};Package("apple.widget");apple.widget.Gallery=function(A){this.config=A;this.index=0;if(!this.config.initial){this.config.initial=this.getTypeImage()}this.setMediaType(this.config.initial);this.setShowingAlt(false);this.setupImages();this.setupMovies();this.setupFX()};apple.widget.Gallery.FX_NONE=0;apple.widget.Gallery.FX_PAN=1;apple.widget.Gallery.FX_FADE=2;apple.widget.Gallery.TYPE_IMAGE=100;apple.widget.Gallery.TYPE_MOVIE=101;apple.widget.Gallery.prototype.getFxNone=function(){return apple.widget.Gallery.FX_NONE};apple.widget.Gallery.prototype.getFxPan=function(){return apple.widget.Gallery.FX_PAN};apple.widget.Gallery.prototype.getFxFade=function(){return apple.widget.Gallery.FX_FADE};apple.widget.Gallery.prototype.getTypeImage=function(){return apple.widget.Gallery.TYPE_IMAGE};apple.widget.Gallery.prototype.getTypeMovie=function(){return apple.widget.Gallery.TYPE_MOVIE};apple.widget.Gallery.prototype.setupImages=function(){if(!this.hasImages()){return }function D(F){C[F]++;window.setTimeout(E.bind(null,F),10)}function E(I){function H(){B[G][I+"Image"]=J;if(!L){return }window.clearTimeout(L);D(I)}function F(){L=0;window.clearTimeout(L);D(I)}var L=0;var G=C[I];if(G>=A){return }var K=B[G][I];if(!K){D(I);return }var J=new Image();J.onload=H;J.src=K;L=window.setTimeout(F,2000)}var C={thumb:0,full:0};var B=this.config.images;var A=B.length;E("thumb");E("full")};apple.widget.Gallery.prototype.setupMovies=function(){if(this.hasMovies()){if(!this.config.movie.full){this.config.movie.full={}}if(!this.config.movie.full.elementId){this.config.movie.full.elementId=Element.uniqueId()}for(var C=0;C<this.config.movies.length;C++){if(this.config.movies[C].thumb){var D=new Image();D.src=this.config.movies[C].thumb;this.config.movies[C].thumbImage=D}if(this.config.movies[C].full){var A=this.config.movies[C];var B=this.findIdName(A.full);if(!B){B=this.config.movie.full.elementId+C;A.full.push("id");A.full.push(B)}A.elementId=B;A.full.push("enablejavascript");A.full.push("true");var E=new apple.quicktime.QuickTime(A.full);A.xml=E.generateOBJECTTextXHTML()}}}};apple.widget.Gallery.prototype.setupFX=function(){if(this.config.fade){this.fader=new apple.fx.CrossFade(this.config.fade.speed,this.config.fade.increment)}if(this.config.swoosh){this.swoosher=new apple.fx.Swoosh(this.config.viewer.elementId,this.config.swoosh.speed,this.config.swoosh.increment)}};apple.widget.Gallery.prototype.next=function(){if(this.isShowingImage()){this._showImage(this.index+1,this.getFxPan())}else{this._showMovie(this.index+1,this.getFxNone())}};apple.widget.Gallery.prototype.previous=function(){if(this.isShowingImage()){this._showImage(this.index-1,this.getFxPan())}else{this._showMovie(this.index-1,this.getFxNone())}};apple.widget.Gallery.prototype.image=function(A){if(!this.isShowingImage()){this.swapMedia()}this._showImage(A,this.getFxFade())};apple.widget.Gallery.prototype.movie=function(A){if(!this.isShowingMovie()){this.swapMedia()}this._showMovie(A,this.getFxNone())};apple.widget.Gallery.prototype.hasImages=function(){return this.config.images&&this.config.images.length};apple.widget.Gallery.prototype.hasMovies=function(){return this.config.movies&&this.config.movies.length};apple.widget.Gallery.prototype.isShowingImage=function(){return(this.mediaType==this.getTypeImage())};apple.widget.Gallery.prototype.isShowingMovie=function(){return(this.mediaType==this.getTypeMovie())};apple.widget.Gallery.prototype.setMediaType=function(A){this.mediaType=A};apple.widget.Gallery.prototype.swapMedia=function(){this.stopAnimations();var A=this.getMovieElement();var B=this.getActiveImage();if(this.isShowingImage()){Element.hide(B);A.innerHTML="";Element.show(A);this.changeThumbImageState(this.getTypeImage(),this.index,-1);this.setMediaType(this.getTypeMovie())}else{Element.show(B);A.innerHTML="";Element.hide(A);this.changeThumbImageState(this.getTypeMovie(),this.index,-1);this.setMediaType(this.getTypeImage())}this.index=-1};apple.widget.Gallery.prototype._showMovie=function(A,D){if(A==this.index){return }if(!this.hasMovies()){return }var F=this.index;if(A>=this.config.movies.length){A=0}else{if(A<0){A=this.config.movies.length-1}}this.changeThumbImageState(this.getTypeMovie(),F,A);this.stopAnimations();var B=this.getMovieElement();Element.hide(B);try{var E=null;if(F>=0){E=$(this.config.movies[F].elementId)}if(E){E.Stop();Element.hide(E);while(B.hasChildNodes()){B.removeChild(B.firstChild)}B.innerHTML=""}}catch(C){B.innerHTML=""}B.innerHTML=this.config.movies[A].xml;Element.show(B);this.index=A};apple.widget.Gallery.prototype._showImage=function(A,C){if(A==this.index){return }if(!this.hasImages()){return }var D=this.index;var B=(A>=D);if(A>=this.config.images.length){A=0}else{if(A<0){A=this.config.images.length-1}}this.changeThumbImageState(this.getTypeImage(),this.index,A);this.stopAnimations();if(C==this.getFxFade()){if(this.fader){this.fadeImage(this.config.images[A])}else{this.getActiveImage().src=this.config.images[A].fullImage.src;this.getActiveImage().alt=this.config.images[A].alt}}else{if(C==this.getFxPan()){if(this.swoosher){this.panImage(B,this.config.images[A])}else{this.getActiveImage().src=this.config.images[A].fullImage.src;this.getActiveImage().src=this.config.images[A].alt}}}this.index=A};apple.widget.Gallery.prototype.getActiveImage=function(){if(this.isShowingAlt()){return this.getAltFullImage()}else{return this.getFullImage()}};apple.widget.Gallery.prototype.stopAnimations=function(){if(this.fader){this.fader.stopAnimation()}if(this.swoosher){this.swoosher.stopAnimation()}};apple.widget.Gallery.prototype.isShowingAlt=function(){return this.showingAlt};apple.widget.Gallery.prototype.setShowingAlt=function(A){return this.showingAlt=A};apple.widget.Gallery.prototype._resetImages=function(B,A){Element.setOpacity(B,1);Element.setOpacity(A,1)};apple.widget.Gallery.prototype.fadeImage=function(C){var B=!this.isShowingAlt();this.setShowingAlt(B);var D=null;var A=null;if(B){D=this.getFullImage();A=this.getAltFullImage()}else{D=this.getAltFullImage();A=this.getFullImage()}A.src=C.fullImage.src;A.alt=C.alt;this._resetImages(D,A);this.fader.fade(D,A)};apple.widget.Gallery.prototype.panImage=function(B,D){var C=!this.isShowingAlt();this.setShowingAlt(C);var E=null;var A=null;if(C){E=this.getFullImage();A=this.getAltFullImage()}else{E=this.getAltFullImage();A=this.getFullImage()}A.src=D.fullImage.src;A.alt=D.alt;this._resetImages(E,A);this.swoosher.pan(B,E,A)};apple.widget.Gallery.prototype.changeThumbImageState=function(D,C,A){var B=this.getThumbAnchor(D,C);var E=this.getThumbAnchor(D,A);if(B){B.className=this.config.image.thumb.cssClass}if(E){E.className=this.config.image.thumb.cssActiveClass}};apple.widget.Gallery.prototype.getFullImage=function(){return $(this.config.image.full.elementId)};apple.widget.Gallery.prototype.getAltFullImage=function(){var A=this.config.image.full.elementId+"Alt";var B=$(A);if(!B){var C=this.getFullImage();B=C.cloneNode(false);B.id=A;var D=this.getViewer();D.appendChild(B)}return B};apple.widget.Gallery.prototype.getMovieElement=function(){var A=this.config.movie.full.elementId;var B=$(A);if(!B){B=document.createElement("div");B.id=A;Element.setStyle(B,"position","absolute");Element.setStyle(B,"display","block");Element.setStyle(B,"left","0px");Element.setStyle(B,"top","0px");var C=this.getViewer();C.appendChild(B)}return B};apple.widget.Gallery.prototype.getViewer=function(){return $(this.config.viewer.elementId)};apple.widget.Gallery.prototype.getThumbAnchorId=function(B,A){var C=null;if(B==this.getTypeImage()){C=this.config.image.thumb.elementId+A}else{C=this.config.movie.thumb.elementId+A}return C};apple.widget.Gallery.prototype.getThumbAnchor=function(B,A){return $(this.getThumbAnchorId(B,A))};apple.widget.Gallery.prototype.getThumbImage=function(B,A){var C=null;if(B==this.getTypeImage()){C=this.config.images[A].thumbImage}else{C=this.config.movies[A].thumbImage}return C};apple.widget.Gallery.prototype.outputImageThumbs=function(){if(this.hasImages()){var B=null;B=$(this.config.image.thumb.elementId);for(var A=0;A<this.config.images.length;A++){var C=new apple.widget.Gallery.ClickWrapper(this,A,this.getTypeImage());this.createThumb(B,this.getThumbAnchorId(this.getTypeImage(),A),this.config.images[A].thumbImage.src,false,this.config.image.thumb,C)}if(this.isShowingImage()){this.index=-1;this._showImage(0,this.getFxNone())}}};apple.widget.Gallery.prototype.outputMovieThumbs=function(){if(this.hasMovies()){var B=null;B=$(this.config.movie.thumb.elementId);for(var A=0;A<this.config.movies.length;A++){var C=new apple.widget.Gallery.ClickWrapper(this,A,this.getTypeMovie());this.createThumb(B,this.getThumbAnchorId(this.getTypeMovie(),A),this.config.movies[A].thumbImage.src,false,this.config.movie.thumb,C)}if(this.isShowingMovie()){this.index=-1;this._showMovie(0,this.getFxNone())}}};apple.widget.Gallery.prototype.createThumb=function(D,H,G,C,B,E){var A=this.createAnchorNode(H,C,B.cssActiveClass,B.cssClass);A.onclick=function(){E.onClick()};var F=this.createImageNode(G,B.width,B.height);A.appendChild(F);D.appendChild(A)};apple.widget.Gallery.prototype.createImageNode=function(D,B,A){var C=document.createElement("img");Element.setStyle(C,"height",A+"px");Element.setStyle(C,"width",B+"px");C.src=D;return C};apple.widget.Gallery.prototype.createAnchorNode=function(E,C,B,D){var A=document.createElement("a");A.id=E;if(C){if(B){A.className=B}}else{if(D){A.className=D}}return A};apple.widget.Gallery.prototype.findIdName=function(B){for(var A=0;A<B.length;A+=2){var C=B[A].toLowerCase();var D=B[A+1];if("name"==C||"id"==C){return D}}return null};apple.widget.Gallery.ClickWrapper=function(A,B,C){this.gallery=A;this.index=B;this.type=C};apple.widget.Gallery.ClickWrapper.prototype.onClick=function(){if(this.type==this.gallery.getTypeImage()){this.gallery.image(this.index)}else{this.gallery.movie(this.index)}};Package("apple.widget");apple.widget.Gallery2=function(A){this.base("constructor")(A);this._groupThumbs={};this._activeGroup=0;this._imageId=[];this._activeImageIndex=0;this._quicktimeInstalled=false;this._loadedImages={};this._mediaClass=null;this._mediaType=null};apple.util.makeSubclass(apple.widget.Gallery2,apple.widget.BaseWidget);apple.widget.Gallery2.DEFAULTS={activeClass:"active",disabledClass:"disabled",imageClass:"image",mediaClass:"media",movieClass:"movie",thumbGroupClass:"thumbnails",allowWrapping:true,movieFirstFrame:{pattern:/\.m[o|4]v$/,replace:"-first.jpg"},moviePosterFrame:{pattern:/\.m[o|4]v$/,replace:".jpg"}};apple.widget.Gallery2.prototype.cssClassRegex=/css-class\((.*?)\)/;apple.widget.Gallery2.prototype.movieRegex=/\.m[o|4]v$/;apple.widget.Gallery2.prototype.jsvrRegex=/jsvr$/;apple.widget.Gallery2.RIGHT="right";apple.widget.Gallery2.LEFT="left";apple.widget.Gallery2.FADE="";apple.widget.Gallery2.prototype.init=function(){var I=$(this.config.galleryId);if(!I){return }this._quicktimeInstalled=apple.quicktime.isInstalled();this._mediaClass=this.config.imageClass;Element.addClassName(I,this.config.imageClass);Element.removeClassName(I,this.config.movieClass);var B=Element.queryAll(I,"."+this.config.mediaClass)[0];if(!B){return }this._mediaId=Element.assignId(B);var G={id:this._mediaId,duration:400};this._swapper=new apple.fx.ContentSwapper(G);function A(){var J=document.createElement("div");var K=document.createElement("img");J.appendChild(K);K.style.position="absolute";K.style.left="50%";K.style.top="50%";J.style.position="absolute";J.style.left="0";J.style.top="0";J.style.width="100%";J.style.height="100%";J.style.display="none";J.style.zIndex="2";B.appendChild(J);return J}var E=B.getElementsByTagName("img")[0];var H=E.src;E.parentNode.removeChild(E);E=A();this._imageId[0]=Element.assignId(E);this._setImage(0,H,this.config.imageClass);E.style.display="";E=A();this._imageId[1]=Element.assignId(E);if(this.config.jsvrOptions){this._createVrContainer(this.config.jsvrOptions);this._sampleVrImage(this.config.jsvrOptions)}this._createNavigation(I);var F=this.thumbClicked.bindAsEventListener(this);function D(M,L){var K=M.getElementsByTagName("a");function J(O){var P=Element.assignId(O);var N=O.href;if(N==H){this._activeThumbId=P;this._activeGroup=L;Element.addClassName(O,this.config.activeClass)}else{Element.removeClassName(O,this.config.activeClass)}O._groupIndex=L;this._groupThumbs[L].push(P);if(!N.match(this.movieRegex)){return }if(!this._quicktimeInstalled){N=N.replace(this.config.moviePosterFrame.pattern,this.config.moviePosterFrame.replace);O.href=this._movieFrameSrc(O,this.config.moviePosterFrame)}}Event.observe(M,"click",F);this._groupThumbs[L]=[];Array.forEach(K,J,this)}var C=Element.queryAll(I,"."+this.config.thumbGroupClass);Array.forEach(C,D,this);Event.observe(I,"mousedown",this.mouseDown.bindAsEventListener(this));this._updateNavigation()};apple.widget.Gallery2.prototype._setImage=function(A,G,D,H){function C(){this._mediaSize={width:F.width,height:F.height};E.width=F.width;E.height=F.height;E.src=G;E.style.marginTop=-(F.height/2)+"px";E.style.marginLeft=-(F.width/2)+"px";if(H){H.call(this)}}var B=$(this._imageId[A]);var E=B.firstChild;var F=new Image();B.className=D||"";F.onload=C.bind(this);F.src=G};apple.widget.Gallery2.prototype._updateMediaClass=function(B){if(B==this._mediaClass){return }var A=$(this.config.galleryId);Element.addClassName(A,B);Element.removeClassName(A,this._mediaClass);this._mediaClass=B};apple.widget.Gallery2.prototype._createNavigation=function(B){var A;A=document.createElement("a");A.className="prev";A.href="#";A.onclick=this.prevButtonClicked.bindAsEventListener(this);this._prevButtonId=Element.assignId(A);B.appendChild(A);A=document.createElement("a");A.className="next";A.href="#";A.onclick=this.nextButtonClicked.bindAsEventListener(this);this._nextButtonId=Element.assignId(A);B.appendChild(A)};apple.widget.Gallery2.prototype._getMovie=function(){return $(this._movieId)};apple.widget.Gallery2.prototype._hideMovie=function(){var A=this._getMovie();if(A&&!this._playingMovie&&apple.quicktime.mobileSafari){A.parentNode.removeChild(A);return }if(!this._movieController){return }A.parentNode.style.backgroundImage="";this._movieController.hideMovie();var B=A.parentNode};apple.widget.Gallery2.prototype._movieLoaded=function(B){var A=$(this.config.galleryId);this._updateMediaClass(this._mediaType);var C=$(this._imageId[this._activeImageIndex]);var D=B.parentNode;D.className=this._mediaType;B.parentNode.style.backgroundImage="url("+C.firstChild.src+")";this._movieController.showMovie(this._mediaSize.width,this._mediaSize.height);C.style.display="none";this._movieController.play()};apple.widget.Gallery2.prototype._movieFrameSrc=function(C,D){D=D||this.config.movieFirstFrame;var B=$(C);if(!B){return""}var E=this._stripFolder(B.href);var G=B.getElementsByTagName("img")[0];if(!G){return""}var F=G.src;var A=F.lastIndexOf("/");if(-1==A){return""}F=[F.substr(0,A),E].join("/");return F.replace(D.pattern,D.replace)};apple.widget.Gallery2.prototype._stripFolder=function(B){var A=B.lastIndexOf("/");if(-1==A){return B}return B.substr(A+1)};apple.widget.Gallery2.prototype._playMovie=function(C,E){var B=apple.quicktime.mobileSafari?this.config.moviePosterFrame:this.config.movieFirstFrame;var A=this._movieFrameSrc(this._activeThumbId,B);function D(){var F=this._getMovie();if(coherent.Browser.Safari||apple.quicktime.mobileSafari||!F){this._createMovie(C);return }this._movieController.hideMovie();this._movieController.loadMovie(C)}this._swapImages(A,E,D.bind(this))};apple.widget.Gallery2.prototype._showVr=function(A){if(!this.vr){this._positionVrContainer(A);this.vr=new apple.VR(A)}this.vrContainer.style.display="block";this._updateMediaClass(this._mediaType);var B=$(this._imageId[this._activeImageIndex]);B.style.display="none"};apple.widget.Gallery2.prototype._hideVr=function(A){if(this.vrContainer){this.vrContainer.style.display="none"}};apple.widget.Gallery2.prototype._createVrContainer=function(A){this.vrContainer=document.createElement("div");this.vrContainer.id=A.container;var B=$(this._mediaId);B.appendChild(this.vrContainer)};apple.widget.Gallery2.prototype._positionVrContainer=function(B){var A=(this.vrContainer.parentNode.offsetWidth-this.sampleVrImage.width)/2;var C=(this.vrContainer.parentNode.offsetHeight-this.sampleVrImage.height)/2;this.vrContainer.style.position="absolute";this.vrContainer.style.left=A+"px";this.vrContainer.style.top=C+"px";this.vrContainer.style.width=this.sampleVrImage.width+"px";this.vrContainer.style.height=this.sampleVrImage.height+"px"};apple.widget.Gallery2.prototype._sampleVrImage=function(A){var D=A.imagePath.match(/^([^#]*)(#+)([^#]*)$/);var C=D[2].length;var B="1";while(B.length<C){B="0"+B}var E=D[1]+B+D[3];this.sampleVrImage=new Image();this.sampleVrImage.src=E};apple.widget.Gallery2.prototype._createMovie=function(D){var F=$(this._mediaId);var E=document.createElement("div");var B;if(this._movieId){B=$(this._movieId);B.parentNode.removeChild(B)}F.appendChild(E);E.style.position="absolute";E.style.left="0";E.style.top="0";E.style.width="100%";E.style.height="100%";E.style.backgroundPosition="center center";E.style.backgroundRepeat="no-repeat";this._movieId=Element.uniqueId();var C={src:D,id:this._movieId,width:this.config.movieWidth,height:this.config.movieHeight,autoplay:false,bgcolor:this.config.movieBackground};B=apple.quicktime.createMovie(C,E);B.style.position="absolute";B.style.left="50%";B.style.top="50%";B.style.marginLeft=(-this._mediaSize.width/2)+"px";B.style.marginTop=(-this._mediaSize.height/2)+"px";if(apple.quicktime.mobileSafari){return $(this._movieId)}var A={movieId:this._movieId,onload:this._movieLoaded.bind(this)};this._movieController=new apple.widget.MovieController(this.config.controllerId,A);this._movieController.hideMovie();return $(this._movieId)};apple.widget.Gallery2.prototype._swapImages=function(C,F,H){var A=$(this.config.galleryId);var E=this._activeImageIndex?0:1;var D=$(this._imageId[this._activeImageIndex]);var G=$(this._imageId[E]);if(!D||!G){return }function B(){D.style.display="";this._activeImageIndex=E;this._hideVr();this._hideMovie();if(!this._playingMovie){this._updateMediaClass(this._mediaType)}this._swapper.swap(F,D,G,H)}if(this._movieController){this._movieController.stop()}G.style.display="none";this._setImage(E,C,this._mediaType,B)};apple.widget.Gallery2.prototype.showAsset=function(A,B){if(A.match(this.movieRegex)){this._playingMovie=true;this._playMovie(A,B)}else{if(A.match(this.jsvrRegex)){this._showVr(this.config.jsvrOptions)}else{this._playingMovie=false;this._swapImages(A,B)}}};apple.widget.Gallery2.prototype._updateNavigation=function(){var A=this._groupThumbs[this._activeGroup];var C=A.indexOf(this._activeThumbId);var B=$(this._prevButtonId);var D=$(this._nextButtonId);if(1==A.length){B.style.display="none";D.style.display="none";return }B.style.display="";D.style.display="";if(this.config.allowWrapping){return }if(!C){Element.addClassName(B,this.config.disabledClass)}else{Element.removeClassName(B,this.config.disabledClass)}if(A.length==C+1){Element.addClassName(D,this.config.disabledClass)}else{Element.removeClassName(D,this.config.disabledClass)}};apple.widget.Gallery2.prototype._activateThumb=function(D){var B;if(this._activeThumbId){B=$(this._activeThumbId);Element.removeClassName(B,this.config.activeClass)}this._activeThumbId=D;B=$(this._activeThumbId);Element.addClassName(B,this.config.activeClass);var C;var A=(B.rel||"");C=A.match(this.cssClassRegex);if(C&&C[1]){this._mediaType=C[1]}else{if(B.href.match(this.movieRegex)){this._mediaType=this.config.movieClass}else{this._mediaType=this.config.imageClass}}this._updateNavigation()};apple.widget.Gallery2.prototype.thumbClicked=function(C){var D=C.target||C.srcElement;var A=$(this.config.galleryId);Event.stop(C);while(D&&D!=A&&D.nodeName.toLowerCase()!="a"){D=D.parentNode}if(D==A){return }var B=D.href;if(!B){return }D.blur();if(this._activeThumbId==D.id){return }this._activeGroup=D._groupIndex;this._activateThumb(D.id);this.showAsset(B)};apple.widget.Gallery2.prototype.nextButtonClicked=function(E){var B=this._groupThumbs[this._activeGroup];var D=B.indexOf(this._activeThumbId);Event.stop(E);D++;if(!this.config.allowWrapping&&D==B.length){return }if(D==B.length){D=0}var A=B[D];var C=$(A).href;this._activateThumb(A);this.showAsset(C,apple.widget.Gallery2.LEFT)};apple.widget.Gallery2.prototype.prevButtonClicked=function(E){var B=this._groupThumbs[this._activeGroup];var D=B.indexOf(this._activeThumbId);Event.stop(E);D--;if(!this.config.allowWrapping&&D<0){return }if(D<0){D=B.length-1}var A=B[D];var C=$(A).href;this._activateThumb(A);this.showAsset(C,apple.widget.Gallery2.RIGHT)};apple.widget.Gallery2.prototype.mouseDown=function(B){var C=B.srcElement||B.target;var A=this._getMovie();if(C==A){return }Event.stop(B)};Package("apple.widget");apple.widget.HelpMessage=Class.create(coherent.Overlay,{__structure__:{},container:Part(".container"),content:Part(".content"),target:Part(".target"),innerHTML:'<div class="container"><table><tr class="t"><td class="l"><span></span></td><td class="m"><span></span></td><td class="r"><span></span></td></tr><tr class="m"><td class="l"></td><td class="msg"><div class="content"></div></td><td class="r"></td></tr><tr class="b"><td class="l"></td><td class="m"></td><td class="r"></td></tr></table><span class="target"></span></div>',containerAlign:"help-left",displaying:false,inTimeout:null,inTimeoutFor:250,shouldShow:true,helpClassName:"help-message",constructor:function(A,B,C){this.base(this.constructWrapper(A),B,C);this.__unposition()},constructWrapper:function(C){var B=("string"===typeof (C))?document.getElementById(C):C;this.srcElementId=Element.assignId(B);this.srcElement=B;var A=document.createElement("DIV");Element.assignId(A);Element.addClassName(A,this.helpClassName);document.body.appendChild(A);return A},init:function(){var B=this.getSrcElement(),C=this.viewElement(),D=this.content(),A=this.container();var E=Event.observe;E(B,"mouseover",this.__mouse.bindAsEventListener(this));E(B,"mouseout",this.__mouse.bindAsEventListener(this));E(B,"click",this.__mouse.bindAsEventListener(this));E(C,"mouseout",this.__mouse.bindAsEventListener(this));E(document.body,"touchstart",this.__touchstart.bindAsEventListener(this));E(window,"blur",this.__mouse.bindAsEventListener(this));this.transitionEndListener=this.__transitionEnd.bind(this)},getSrcElement:function(){return this.srcElement||document.getElementById(this.srcElementId)},__mouse:function(A){this.__clearDelay();this.inTimeout=this.toggle.bindAndDelay(this,this.inTimeoutFor,A.type,(A.relatedTarget||A.toTarget))},__touchstart:function(A){if(A.target.id!==this.srcElementId){this.__clearDelay();this.inTimeout=this.toggle.bindAndDelay(this,this.inTimeoutFor,A.type,A.target)}},__clearDelay:function(){window.clearTimeout(this.inTimeout);this.inTimeout=null},__loadContent:function(){var F=this.content(),B=this.container(),E=this.target(),G=document.getElementById(this.srcElementId),A,I,C,D,H;if(!this.loadedContent){I=document.getElementById(G.getAttribute("rel"));this.loadedContent="<p>This is the default help message. Maybe you need to setup the help message element?</p>";if(I){A=I.className;D=I.innerHTML;this.setContentWidth();this.shouldShow=true}else{this.shouldShow=false}F.innerHTML=D;C=G.cloneNode(true);C.id=null;C.onclick=null;C.removeAttribute("id");C.removeAttribute("onclick");E.innerHTML="";E.onclick='return apple.widget.HelpMessage.click("'+this.srcElementId+'");';E.appendChild(C);this.loadedContent=F.innerHTML}Element.addClassName(F,A);F.innerHTML=this.loadedContent;B.className="container";if(Element.hasClassName(G,"top")){Element.addClassName(B,"text-top")}else{Element.addClassName(B,"text-bottom")}if(Element.hasClassName(G,"left")){Element.addClassName(B,"text-left")}else{Element.addClassName(B,"text-right")}},setContentWidth:function(){var A=document.getElementById(this.srcElementId),B=document.getElementById(A.getAttribute("rel")),C=B.style.width;if(!C){C="200px"}Element.setStyle(this.content(),"width",C)},__position:function(){var C=this.viewElement(),E=this.container(),B=Element.getRect(E),A=document.getElementById(this.srcElementId),D=Element.getRect(A);Element.setStyles(C,{top:(Element.hasClassName(A,"top")?D.bottom:D.top)+"px",left:(Element.hasClassName(A,"left")?D.right:D.left)+"px"})},__unposition:function(){var A=this.viewElement();Element.setStyles(A,{top:"-9000em",left:"",width:"",height:""})},__transitionEnd:function(){this.container().removeEventListener("webkitTransitionEnd",this.transitionEndListener,false);this.__unposition()},toggle:function(C,A){var B=this.viewElement(),D=A;switch(C){case"click":case"mouseover":if(this.displaying===true){return }this.display();break;case"touchstart":case"mouseout":case"blur":if(this.displaying!==true){return }do{if(D===B){return }}while((D=D&&D.parentNode));this.hide();return ;break;default:break}},display:function(){var A=this.container();this.__loadContent();if(!this.shouldShow){return }this.__position();if((coherent.Browser.Safari||coherent.Browser.MobileSafari)&&typeof (WebKitTransitionEvent)!="undefined"){Element.addClassName(A,"show")}else{coherent.Animator.addClassName(A,"show",{duration:150})}apple.metrics.fireMicroEvent({feature:"help overlay",part:$(this.srcElementId).getAttribute("rel"),action:"show",eVar:"eVar21"});this.displaying=true;this.__clearDelay()},hide:function(){var B=this.viewElement(),A=this.container();if((coherent.Browser.Safari||coherent.Browser.MobileSafari)&&typeof WebKitTransitionEvent!="undefined"){A.addEventListener("webkitTransitionEnd",this.transitionEndListener,false);Element.removeClassName(A,"show")}else{coherent.Animator.removeClassName(A,"show",{duration:150,callback:this.__unposition.bind(this)})}this.displaying=false;this.__clearDelay()}});apple.widget.HelpMessage.loadAll=function(A,C){if(arguments.length<2){C=A;A=null}function B(){var F=A?Element.queryAll(A,C):Element.queryAll(A),E=F.length,D,G;for(G=0;G<E;G++){D=coherent.View.fromNode(F[G]);if(D){D.teardown()}new apple.widget.HelpMessage(F[G])}}Event.onLoad(B)};apple.widget.HelpMessage.click=function(A){return($(A)||document.body).onclick()};Package("apple.widget");apple.widget.HoverManager=function(B,A){if(apple.widget.HoverManager.sharedManager){return apple.widget.HoverManager.sharedManager}apple.widget.HoverManager.sharedManager=this;A=Object.applyDefaults(A,arguments.callee.DEFAULTS);this.configs=B||[];this.hovers=[];this.activeHover=null;this._sourceClickedHandler=this.sourceClicked.bindAsEventListener(this);this._mouseOverHandler=this.mouseOver.bindAsEventListener(this);this._mouseOutHandler=this.mouseOut.bindAsEventListener(this);this._contentClicked=this.contentClicked.bindAsEventListener(this);this._behaviour=A.behaviour;this._showDelay=A.showDelay;this._hideDelay=A.hideDelay;Event.onDomReady(this.init.bind(this));return this};apple.widget.HoverManager.sharedManager=null;apple.widget.HoverManager.BEHAVIOUR={CLICK_OUTSIDE_TO_CLOSE:1,CLICK_INSIDE_TO_CLOSE:2,MOUSE_OVER_TO_OPEN:4,MOUSE_OUT_TO_CLOSE:8,CLICK_SOURCE_TO_OPEN:16};apple.widget.HoverManager.DEFAULTS={showDelay:1000,hideDelay:1000,behaviour:(apple.widget.HoverManager.BEHAVIOUR.CLICK_OUTSIDE_TO_CLOSE|apple.widget.HoverManager.BEHAVIOUR.CLICK_SOURCE_TO_OPEN|apple.widget.HoverManager.BEHAVIOUR.MOUSE_OVER_TO_OPEN|apple.widget.HoverManager.BEHAVIOUR.MOUSE_OUT_TO_CLOSE)};apple.widget.HoverManager.prototype.init=function(){function A(B,D){var C=new apple.widget.Hover(B,this)}this.configs.forEach(A,this);if(this._behaviour&apple.widget.HoverManager.BEHAVIOUR.CLICK_OUTSIDE_TO_CLOSE){this._bodyClickedHandler=this.bodyClicked.bindAsEventListener(this);Event.observe(document.body,"onclick",this._bodyClickedHandler)}Event.onUnload(this.cleanup.bind(this))};apple.widget.HoverManager.prototype.manageHover=function(C){if(!C){return }var D=$(C.config.sourceId);var B=$(C.config.contentId);if(!D||!B){return }var A=this.hovers.length;this.hovers.push(C);D.hoverIndex=A;B.hoverIndex=A;if(this._behaviour&apple.widget.HoverManager.BEHAVIOUR.CLICK_SOURCE_TO_OPEN){Event.observe(D,"click",this._sourceClickedHandler)}if(this._behaviour&apple.widget.HoverManager.BEHAVIOUR.MOUSE_OVER_TO_OPEN){Event.observe(D,"mouseover",this._mouseOverHandler);Event.observe(B,"mouseover",this._mouseOverHandler);Event.observe(D,"mouseout",this._mouseOutHandler);Event.observe(B,"mouseout",this._mouseOutHandler)}if(this._behaviour&apple.widget.HoverManager.BEHAVIOUR.CLICK_INSIDE_TO_CLOSE){Event.observe(B,"click",this._contentClickedHandler)}};apple.widget.HoverManager.prototype.cleanup=function(){function A(B){var C=$(B.config.sourceId);B.cleanup()}this.hovers.forEach(A);this.hovers.length=0;if(this._bodyClickedHandler){Event.stopObserving(document.body,"onclick",this._bodyClickedHandler);this._bodyClickedHandler=null}this.cancelShowing();this.cancelHiding()};apple.widget.HoverManager.prototype.findHoverNode=function(A){while(A&&A.nodeName!="BODY"){if("hoverIndex" in A){return A}A=A.parentNode}return null};apple.widget.HoverManager.prototype.sourceClicked=function(A){var B=this.findHoverNode(A.target||A.srcElement);if(!B){return }this.showHover(B,true);Event.stop(A)};apple.widget.HoverManager.prototype.bodyClicked=function(A){if(!this.activeHover){return }if(Event.isMouseOverElement(A,$(this.activeHover.config.contentId))){return }this.hideHover(null,true);Event.stop(A)};apple.widget.HoverManager.prototype.mouseOver=function(A){var C=this.findHoverNode(A.srcElement||A.target);if(!C){return }var B=this.findHoverNode(A.relatedTarget||A.fromElement);if(B&&C==B){return }C.hasMouse=true;var D=C.sourceId||C.id;this.showHover(D)};apple.widget.HoverManager.prototype.mouseOut=function(B){var C=this.findHoverNode(B.srcElement||B.target);if(!C){return }var A=this.findHoverNode(B.relatedTarget||B.toElement);if(A&&C==A){return }C.hasMouse=false;var D=C.sourceId||C.id;if(this._showingSourceId==D||this._behaviour&apple.widget.HoverManager.BEHAVIOUR.MOUSE_OUT_TO_CLOSE){this.hideHover(D)}};apple.widget.HoverManager.prototype.contentClicked=function(A){var B=this.findHoverNode(A.srcElement||A.target);if(!B){return }this.hideHover(B.sourceId,true);Event.stop(A)};apple.widget.HoverManager.prototype.showHover=function(C,D){C=$(C);if(!C){return }if(C.id==this._hidingSourceId){this.cancelHiding()}if(D&&C.id==this._showingSourceId){this.cancelShowing();this.activeHover.show(true);return }var B=this.hovers[C.hoverIndex];if(B==this.activeHover){return }if(this._showing){this.cancelShowing()}if(this.activeHover){this.activeHover.hide();this.activeHover=B;B.show();this.cancelHiding();return }if(D){this.activeHover=B;B.show(true);return }function A(){this.cancelShowing();B.show(true)}this.activeHover=B;this._showingSourceId=C.id;this._showing=window.setTimeout(A.bind(this),this._showDelay)};apple.widget.HoverManager.prototype.cancelShowing=function(){window.clearTimeout(this._showing);this._showing=this._showingSourceId=0};apple.widget.HoverManager.prototype.cancelHiding=function(){window.clearTimeout(this._hiding);this._hiding=this._hidingSourceId=0};apple.widget.HoverManager.prototype.hideHover=function(C,D){C=C||(this.activeHover?this.activeHover.config.sourceId:null);C=$(C);if(!C){return }var B=this.hovers[C.hoverIndex];if(C.id==this._showingSourceId){this.cancelShowing();this.activeHover=null;return }if(this.activeHover&&B!=this.activeHover){B.hide();return }if(D){B.hide(true);this.activeHover=null;return }function A(){this.cancelHiding();B.hide(true);this.activeHover=null}this._hidingSourceId=C.id;this._hiding=window.setTimeout(A.bind(this),this._hideDelay)};apple.widget.HoverManager.prototype.beforeShowHover=function(A){};apple.widget.HoverManager.prototype.beforeHideHover=function(A){};Package("apple.widget");var STATES={hidden:0,showing:1,shown:2,hiding:3};apple.widget.Hover=function(A,B){function D(G,F){var E=[];while(E.length<F){E=E.concat(G)}E.length=F;return E}function C(F){var E=[].concat(F);function G(H){if(!(typeof H==="string"||H instanceof String)){return H}return apple.widget.Hover.LAYOUT_NAMES[H]}return E.map(G)}this.config=Object.applyDefaults(A,apple.widget.Hover.DEFAULTS);this.config.sourcePadding=D(this.config.sourcePadding,4);this.config.contentOffset=D(this.config.contentOffset,4);this.config.pointerOffset=D(this.config.pointerOffset,4);this.config.allowedLayouts=C(this.config.allowedLayout||this.config.allowedLayouts);this.manager=B||new apple.widget.HoverManager();Event.observe(window,"load",this.init.bind(this))};apple.widget.Hover.prototype.init=function(){var A=this.close.bindAsEventListener(this);this.currentLayout=apple.widget.Hover.NO_LAYOUT;var F=this._wrapContent();if(!F){return }var E=Element.getElementsByClassName("wdgt-mdl",F)[0];if(this.config.width){F.style.width=this.config.width}if(E&&this.config.height>=parseInt(Element.getStyles(E,"height"),10)){E.style.height=this.config.height}function D(J){Event.observe(J,"onclick",A)}var B=Element.getElementsByClassName("close-link",F);Array.forEach(B,D);var G=Element.queryAll(document,"#indicator_hover_content a");Array.forEach(G,D);var I=Element.getRect(F,true);function C(K){var J=Element.getDimensions(K);var L=Element.getRect(K,true);J.left=L.left-I.left;J.top=L.top-I.top;return J}var H=Element.getElementsByClassName("triangle",F);this.pointerInfo=Array.map(H,C);if(F&&(Element.getStyle(F,"display")!="none")){this._state=STATES.visible}else{this._state=STATES.hidden}this.manager.manageHover(this)};apple.widget.Hover.prototype.cleanup=function(){};apple.widget.Hover.DEFAULT_SHOW_Z_INDEX=1000;apple.widget.Hover.DEFAULT_HIDE_Z_INDEX=999;apple.widget.Hover.NO_LAYOUT=null;apple.widget.Hover.TOP_LAYOUT=0;apple.widget.Hover.RIGHT_LAYOUT=1;apple.widget.Hover.BOTTOM_LAYOUT=2;apple.widget.Hover.LEFT_LAYOUT=3;apple.widget.Hover.DEFAULTS={sourcePadding:[0,0,-2,-10],contentOffset:[20,40],pointerOffset:[8,10],fadeInDuration:300,fadeOutDuration:500,closeLink:"Close",allowedLayouts:[apple.widget.Hover.TOP_LAYOUT,apple.widget.Hover.RIGHT_LAYOUT,apple.widget.Hover.BOTTOM_LAYOUT,apple.widget.Hover.LEFT_LAYOUT]};apple.widget.Hover.POINTER_INDEX=[3,2,0,1];apple.widget.Hover.LAYOUT_NAMES={top:apple.widget.Hover.TOP_LAYOUT,bottom:apple.widget.Hover.BOTTOM_LAYOUT,left:apple.widget.Hover.LEFT_LAYOUT,right:apple.widget.Hover.RIGHT_LAYOUT};apple.widget.Hover.prototype._wrapContent=function(){var A=$(this.config.contentId);if(!A){return null}var D=A.parentNode;A.parentNode.removeChild(A);A.id="";A.className="";var C=Element.uniqueId();var E=document.createElement("div");E.id=this.config.contentId;E.sourceId=this.config.sourceId;E.className=[A.className,"popup-wdgt"].join(" ");E.innerHTML=['<div class="wdgt-top"><div></div>','<span class="triangle"></span>',"</div>",'<div class="wdgt-mdl">','<div class="wdgt-right">','<span class="triangle"></span>',"</div>",'<div class="wdgt-left">','<a class="close-link" href="#">',this.config.closeLink,"</a>",'<div id="',C,'"></div>','<span class="triangle"></span>',"</div>","</div>",'<div class="wdgt-btm">',"<div></div>",'<span class="triangle"></span>',"</div>"].join("");document.body.appendChild(E);var B=$(C);B.parentNode.replaceChild(A,B);return E};apple.widget.Hover.prototype.show=function(C){var A=$(this.config.contentId);if(!A){return }switch(this._state){case STATES.shown:return ;case STATES.showing:coherent.Animator.setStyles(A,{opacity:1},{duration:0,cleanup:true});this._state=STATES.shown;return ;default:break}A.style.visibility="hidden";A.style.display="block";this.position();this.manager.beforeShowHover(this);this.setContentZIndex(apple.widget.Hover.DEFAULT_SHOW_Z_INDEX);function B(){this._state=STATES.shown}if(!C){A.style.display="block";B.call(this);return }this._state=STATES.showing;Element.setOpacity(A,0);A.style.visibility="visible";coherent.Animator.setStyles(A,{opacity:1},{duration:this.config.fadeInDuration,callback:B.bind(this),cleanup:true})};apple.widget.Hover.prototype.hide=function(C){var B=$(this.config.contentId);if(!B){return }switch(this._state){case STATES.hidden:return ;case STATES.hiding:coherent.Animator.setStyles(B,{opacity:0},{duration:0,callback:A.bind(this),cleanup:true});this._state=STATES.hidden;return ;default:break}this.manager.beforeHideHover(this);this.setContentZIndex(apple.widget.Hover.DEFAULT_HIDE_Z_INDEX);function A(){B.style.display="none";this._state=STATES.hidden}if(!C){A.call(this);return }this._state=STATES.hiding;coherent.Animator.setStyles(B,{opacity:0},{duration:this.config.fadeOutDuration,callback:A.bind(this),cleanup:true})};apple.widget.Hover.prototype.toggle=function(){switch(this._state){case STATES.hidden:case STATES.hiding:this.show();return ;case STATES.shown:case STATES.showing:this.hide();return ;default:return }};apple.widget.Hover.prototype.close=function(A){this.manager.hideHover(this.config.sourceId,true);Event.stop(A)};apple.widget.Hover.prototype._getCurrentPointer=function(){var A=$(this.config.contentId);if(!A){return null}var B=Element.getElementsByClassName("triangle",A);if(!B){return null}return B[apple.widget.Hover.POINTER_INDEX[this.currentLayout]]};apple.widget.Hover.prototype._showPointer=function(){var A=this._getCurrentPointer();if(!A){return }A.style.display="block"};apple.widget.Hover.prototype._hidePointer=function(){var A=this._getCurrentPointer();if(!A){return }A.style.display="none"};apple.widget.Hover.prototype.setContentZIndex=function(B){var A=$(this.config.contentId);if(!A){return }A.style.zIndex=B};apple.widget.Hover.prototype._createPositionContext=function(){var A={contentElem:$(this.config.contentId),sourceElem:$(this.config.sourceId),sourcePosition:{left:0,top:0},sourceBox:{height:0,width:0},contentBox:{height:0,width:0}};if(!A.contentElem||!A.sourceElem){return null}A.contentElem.style.left="0";A.contentElem.style.top="0";A.pageOffset=Element.getRect(A.contentElem);A.sourcePosition=Element.getRect(A.sourceElem);A.sourceBox=Element.getDimensions(A.sourceElem);A.contentBox=Element.getDimensions(A.contentElem);return A};apple.widget.Hover.prototype._computeContentPosition=function(D,C){var A={left:0,top:0,pointerStyle:"",pointerOffset:0};C=C||this._createPositionContext();if(!C){return A}var B=this.pointerInfo[apple.widget.Hover.POINTER_INDEX[D]];switch(D){case apple.widget.Hover.TOP_LAYOUT:A.top=C.sourcePosition.top-C.contentBox.height-this.config.sourcePadding[D];A.left=C.sourcePosition.left-this.config.contentOffset[D];break;case apple.widget.Hover.BOTTOM_LAYOUT:A.top=C.sourcePosition.top+C.sourceBox.height+this.config.sourcePadding[D];A.left=C.sourcePosition.left-this.config.contentOffset[D];break;case apple.widget.Hover.LEFT_LAYOUT:A.left=C.sourcePosition.left-C.contentBox.width-this.config.sourcePadding[D]-B.width;A.top=C.sourcePosition.top-this.config.contentOffset[D];break;case apple.widget.Hover.RIGHT_LAYOUT:A.left=C.sourcePosition.left+C.sourceBox.width+this.config.sourcePadding[D]-B.left;A.top=C.sourcePosition.top-this.config.contentOffset[D];break;default:break}return A};apple.widget.Hover.prototype._findBestLayout=function(D){D=D||this._createPositionContext();if(!D){return null}var A=D.contentBox.width*D.contentBox.height;var B=Element.getViewport();B.bottom=B.top+B.height;B.right=B.left+B.width;var C=null;function G(L){var H=this._computeContentPosition(L,D);var O=Math.max(B.top,H.top);var J=Math.min(B.bottom,H.top+D.contentBox.height);var N=Math.max(B.left,H.left);var K=Math.min(B.right,H.left+D.contentBox.width);var I=(J-O)*(K-N);var M={layout:L,position:H,overlap:I,fits:(I>=A)};if(!C&&M.fits){C=M}return M}var E=this.config.allowedLayouts.map(G,this);if(1==E.length){return E[0]}if(C){return C}function F(H){if(!C||H.overlap>C.overlap){C=H}}E.forEach(F);return C};apple.widget.Hover.prototype.position=function(){var C=this._createPositionContext();if(!C){return }var A=Element.getElementsByClassName("triangle",C.contentElem);Array.forEach(A,function(F){F.style.display="none"});var D=this._findBestLayout(C);if(!D){return }this.currentLayout=D.layout;C.contentElem.style.position="absolute";C.contentElem.style.top=(D.position.top)+"px";C.contentElem.style.left=(D.position.left)+"px";var E=this._getCurrentPointer();if(!E){return }var B=this.pointerInfo[apple.widget.Hover.POINTER_INDEX[D.layout]];switch(D.layout){case apple.widget.Hover.TOP_LAYOUT:case apple.widget.Hover.BOTTOM_LAYOUT:E.style.left=(this.config.pointerOffset[D.layout]+this.config.contentOffset[D.layout]-B.width/2)+"px";break;case apple.widget.Hover.LEFT_LAYOUT:case apple.widget.Hover.RIGHT_LAYOUT:E.style.top=(this.config.pointerOffset[D.layout]+this.config.contentOffset[D.layout]-B.top-B.height/2)+"px";break;default:break}E.style.display="block"};Package("apple.widget");apple.widget.ImageButton=function(B,A){this.base("constructor")(B,A)};apple.util.makeSubclass(apple.widget.ImageButton,apple.widget.BaseWidget);apple.widget.ImageButton.DEFAULTS={disabledClass:"disabled",activeClass:"active"};apple.widget.ImageButton.prototype.init=function(){var A=this.widget();A._disabledClass=this.config.disabledClass;this._mousedownHandler=this.mousedown.bindAsEventListener(this);this._mouseupHandler=this.mouseup.bindAsEventListener(this);this._mouseoutHandler=this.mouseout.bindAsEventListener(this);this._mouseoverHandler=this.mouseover.bindAsEventListener(this);A.innerHTML="";Event.observe(A,"mousedown",this._mousedownHandler);apple.widget.ImageButton._checkIds.push(A.id);apple.widget.ImageButton.installDisabledChecker()};apple.widget.ImageButton.prototype.disable=function(){var A=this.widget();A.disabled=true;if(A.disabled){Element.addClassName(A,this.config.disabledClass)}else{Element.removeClassName(A,this.config.disabledClass)}};apple.widget.ImageButton.prototype.enable=function(){var A=this.widget();A.disabled=false};apple.widget.ImageButton._checkIds=[];apple.widget.ImageButton.removeDisabledChecker=function(){if(!apple.widget.ImageButton._disabledCheckerTimer){return }window.clearInterval(apple.widget.ImageButton._disabledCheckerTimer);apple.widget.ImageButton._disabledCheckerTimer=0};apple.widget.ImageButton.installDisabledChecker=function(){if(apple.widget.ImageButton._disabledCheckerTimer){return }Event.onUnload(apple.widget.ImageButton.removeDisabledChecker);apple.widget.ImageButton._disabledCheckerTimer=window.setInterval(apple.widget.ImageButton.disabledChecker,500)};apple.widget.ImageButton.disabledChecker=function(){function A(C){var B=$(C);if(!B){return }if(B.disabled){Element.addClassName(B,B._disabledClass)}else{Element.removeClassName(B,B._disabledClass)}}apple.widget.ImageButton._checkIds.forEach(A)};apple.widget.ImageButton.prototype.mousedown=function(A){var B=this.widget();Element.addClassName(B,this.config.activeClass);Event.observe(B,"mouseout",this._mouseoutHandler);Event.observe(B,"mouseover",this._mouseoverHandler);Event.observe(document,"mouseup",this._mouseupHandler);this._active=true};apple.widget.ImageButton.prototype.mouseup=function(A){var B=this.widget();Element.removeClassName(B,this.config.activeClass);Event.stopObserving(B,"mouseout",this._mouseoutHandler);Event.stopObserving(B,"mouseover",this._mouseoverHandler);Event.stopObserving(document,"mouseup",this._mouseupHandler);this._active=false};apple.widget.ImageButton.prototype.mouseover=function(A){if(!this._active){Element.addClassName(this.widget(),this.config.activeClass)}this._active=true};apple.widget.ImageButton.prototype.mouseout=function(A){if(this._active){Element.removeClassName(this.widget(),this.config.activeClass)}this._active=false};Package("apple.widget");apple.widget.ImageButtonLinks=function(A){this.config=A;Event.onDomReady(this.init.bind(this))};apple.widget.ImageButtonLinks.prototype.init=function(){if(this._initialized){return }this._initialized=true;if(this.config.buttonIds&&this.config.imageIds&&this.config.buttonIds.length==this.config.imageIds.length){for(var C=0;C<this.config.buttonIds.length&&C<this.config.imageIds.length;C++){var B=$(this.config.buttonIds[C]);var E=$(this.config.imageIds[C]);if(B&&E){var A=(function(){this.style.backgroundPosition="bottom left"}).bind(B);var D=(function(){this.style.backgroundPosition="top left"}).bind(B);Event.observe(B,"onmouseover",A);Event.observe(B,"onmouseout",D);Event.observe(E,"onmouseover",A);Event.observe(E,"onmouseout",D)}}}};Package("apple.widget");apple.widget.LinkManager=function(A){this.setConfig(A);if(coherent.Browser.IE){Event.observe(window,"load",this.init.bind(this))}Event.onDomReady(this.init.bind(this))};apple.widget.LinkManager.prototype.constructor=apple.widget.LinkManager;apple.widget.LinkManager.DEFAULTS={markerClass:"superlink",hoverClass:"superlink-hover",activeClass:"superlink-active",ignoreClass:"superlink-ignore",disclosureClass:"more",disclosureOpenClass:"open",disclosureRegex:/(?:^|\s)disclosure\(([^)]*)\)(?:$|\s)/,popupWidthRegex:(/w(\d+)(-|$)/i),popupHeightRegex:(/h(\d+)(-|$)/i),popupPrefix:"popup-",engravingGalleryRel:"engravingGallery",socialSharingRel:"social-sharing",learnMore3GUSRel:"dataPlan3G",learnMore3GRel:"dataPlan"};apple.widget.LinkManager.prototype.init=function(){window.setTimeout(this.rescanDocument.bind(this),10);Event.observe(document.body,"DOMNodeInserted",this.documentChanged.bindAsEventListener(this));if(coherent.Browser.IE){Event.observe(window,"resize",this.documentChanged.bindAsEventListener(this))}};apple.widget.LinkManager.prototype.setConfig=function(B){B=B||{};for(var A=this.constructor;A&&Object!==A;A=A.superclass){Object.applyDefaults(B,A.DEFAULTS||{})}this.config=B};apple.widget.LinkManager.prototype.rescanDocument=function(){this.manageLinks(document)};apple.widget.LinkManager.prototype.documentChanged=function(A){if(this._rescanTimer){window.clearTimeout(this._rescanTimer)}this._rescanTimer=window.setTimeout(this.rescanDocument.bind(this),250)};apple.widget.LinkManager.prototype.getPopupAttributes=function(E){var D={location:(E.indexOf("l")!=-1?"yes":"no"),menubar:(E.indexOf("m")!=-1?"yes":"no"),toolbar:(E.indexOf("t")!=-1?"yes":"no"),status:(E.indexOf("s")!=-1?"yes":"no"),scrollbars:(E.indexOf("!b")!=-1?"no":"yes"),resizable:(E.indexOf("!r")!=-1?"no":"yes")};var B=this.config.popupWidthRegex.exec(E);var F=this.config.popupHeightRegex.exec(E);if(B&&B[1]){D.width=B[1]}if(F&&F[1]){D.height=F[1]}var C=[];for(var A in D){C.push(A+"="+D[A])}return C.join(",")};apple.widget.LinkManager.prototype.manageLinks=function(N){var A=document.getElementsByTagName("a");if(!A.length){return }var B=this.config.disclosureClass;var M=this.config.disclosureRegex;var C=this.config.disclosureOpenClass;var H=this.config.markerClass;var I=this.config.popupPrefix;var K=this.config.engravingGalleryRel;var G=this.config.socialSharingRel;var S=this.config.learnMore3GUSRel;var J=this.config.learnMore3GRel;var E=document.body;var P=this.mouseOverLink.bindAsEventListener(this);var D=this.mouseOutLink.bindAsEventListener(this);var Q=this.mouseDownLink.bindAsEventListener(this);var F=this.parentClicked.bindAsEventListener(this);this.mouseUp=this.mouseUp.bindAsEventListener(this);var O=this.dragStarted.bindAsEventListener(this);function R(U){var T=U.parentNode;if(T==E){return null}while(T&&E!=T){if(Element.hasClassName(T,H)){return T}T=T.parentNode}return U.parentNode}function L(Z){var W;var b;var U;if(Z._managed){return }Z._managed=true;if(Z.target&&I==Z.target.slice(0,I.length)){W=this.getPopupAttributes(Z.target);Z.target=Z.target.replace(/[^\w]/g,"");b=this.popupLinkClicked.bindAsEventListener(this,W);Event.observe(Z,"click",b)}if(Element.hasClassName(Z,B)&&!!(U=M.exec(Z.rel))){var X=$(U[1]);var Y=document.createElement("div");var T=Element.assignId(Y);var V=Element.hasClassName(Z,C);X.parentNode.replaceChild(Y,X);Y.appendChild(X);b=this.disclosureLinkClicked.bindAsEventListener(this,T,X);Event.observe(Z,"click",b);if(!V){Element.makeClipping(Y);Y.style.height="0";X.style.height="auto"}}if(Z.rel==K){Event.observe(Z,"click",this.engravingGalleryLinkClicked)}if(Z.rel==G){Event.observe(Z,"click",this.socialSharingLinkClicked)}if(Z.rel==S||Z.rel==J){Event.observe(Z,"click",this.learnMore3GLinkClicked)}if(!Element.hasClassName(Z,H)){return }var a=R(Z);if(!a){return }Element.assignId(a);Element.addClassName(a,H);a._linkId=Element.assignId(Z);Event.observe(a,"mouseover",P);Event.observe(a,"mouseout",D);Event.observe(a,"mousedown",Q);if(W){b=this.parentClicked.bindAsEventListener(this,W);Event.observe(a,"click",b)}else{Event.observe(a,"click",F)}if(coherent.Browser.IE){Event.observe(a,"dragstart",O);Event.observe(a,"selectstart",O)}}Array.forEach(A,L,this)};apple.widget.LinkManager.prototype.findAnchor=function(B){var A=document.body;while(B&&A!=B){if("_linkId" in B){return null}if("a"==B.tagName.toLowerCase()){return B}B=B.parentNode}return null};apple.widget.LinkManager.prototype.findLink=function(B){var A=document.body;while(B&&A!=B){if(B.className.indexOf(this.config.ignoreClass)>-1){return null}if("_linkId" in B){return B}B=B.parentNode}return null};apple.widget.LinkManager.prototype.mouseOverLink=function(A){var B=this.findLink(A.target||A.srcElement);if(!B){return }if(this._activeLinkId&&this._activeLinkId!=B.id){return }if(this._activeLinkId==B.id){Element.addClassName(B,this.config.activeClass)}else{Element.addClassName(B,this.config.hoverClass)}};apple.widget.LinkManager.prototype.mouseOutLink=function(A){var B=this.findLink(A.target||A.srcElement);if(!B){return }if(this._activeLinkId&&this._activeLinkId!=B.id){return }if(this._activeLinkId==B.id){Element.removeClassName(B,this.config.activeClass);Element.addClassName(B,this.config.hoverClass)}else{Element.removeClassName(B,this.config.hoverClass)}};apple.widget.LinkManager.prototype.mouseDownLink=function(A){if(A.which==Event.LEFT_MOUSE&&!Event.isModifiedKey(A)){var B=this.findLink(A.target||A.srcElement);if(!B){return }Event.observe(document,"mouseup",this.mouseUp);this._activeLinkId=B.id;Element.addClassName(B,this.config.activeClass);Element.removeClassName(B,this.config.hoverClass);Event.stop(A)}};apple.widget.LinkManager.prototype.mouseUp=function(A){Event.stopObserving(document,"mouseup",this.mouseUp);var C=$(this._activeLinkId);var B=this.findLink(A.target||A.srcElement);this._activeLinkId=undefined;if(C){Element.removeClassName(C,this.config.activeClass);Element.removeClassName(C,this.config.hoverClass)}this.mouseOverLink(A)};apple.widget.LinkManager.prototype.popupLinkClicked=function(D,C){if(this._sendingClick){return }var B=this.findAnchor(D.target||D.srcElement);var A=window.open(B.href,B.target||"_blank",C||"");A.focus();Event.preventDefault(D)};apple.widget.LinkManager.prototype.parentClicked=function(F,E){if(!Event.isModifiedKey(F)){if(this._sendingClick){return }var G=F.target||F.srcElement;var D=this.findLink(G);if(!D){return }var C=this.findAnchor(G);if(C&&C.id!=D._linkId){return }C=C||$(D._linkId);if(!C){return }Event.stop(F);try{this._sendingClick=true;var A=Event.sendMouseEvent(C,"click",true,true);if(!A){return }if(!coherent.Browser.Safari){var B=window.open(C.href,C.target||"_self",E||"");B.focus()}Event.stop(F)}finally{this._sendingClick=false}}};apple.widget.LinkManager.prototype.dragStarted=function(A){Event.stop(A);return false};apple.widget.LinkManager.prototype.disclosureLinkClicked=function(B,I,G){function K(L){L=parseInt(L||0,10);if(isNaN(L)){return 0}return L}var E=K(Element.getStyle(G,"border-left-width"))+K(Element.getStyle(G,"border-right-width"));var J=K(Element.getStyle(G,"border-top-width"))+K(Element.getStyle(G,"border-bottom-width"));var A={width:G.scrollWidth+E,height:G.scrollHeight+J};var H=this.findAnchor(B.target||B.srcElement);var D=Element.hasClassName(H,this.config.disclosureOpenClass);var F=$(I);var C;if(this.disclosureAnimator){this.disclosureAnimator.stop()}this.disclosureAnimator=new apple.fx.Animator();if(D){C=new apple.fx.Resize(apple.fx.easeInOutSine,F,{width:A.width,height:0},A);Element.removeClassName(H,this.config.disclosureOpenClass)}else{this.trackDisclosureClick(F);C=new apple.fx.Resize(apple.fx.easeInOutSine,F,A,{width:A.width,height:0});Element.addClassName(H,this.config.disclosureOpenClass)}this.disclosureAnimator.play(C);Event.stop(B)};apple.widget.LinkManager.prototype.trackDisclosureClick=function(E){var A=E.getElementsByTagName("div");if(!A){return }if(A.count===0){return }var D=A[0].id;var G=window.state;var F=window.s||null;if(!F){return }var C=apple.metrics.Metrics.getProductSubstring(F.products);var B={slot:"",feature:"Learn More",action:"Selected: "+D};if(typeof (G)!="undefined"){B.part=G.summary.part}else{B.part=C}apple.metrics.fireMicroEventNoDuplicates(B)};apple.widget.LinkManager.prototype.engravingGalleryLinkClicked=function(A){var D=window.s||null;if(!D){return }var B=apple.metrics.Metrics.getProductSubstring(D.products);var C={slot:"",feature:"Engraving-Gallery",part:B,action:"Selected"};apple.metrics.fireMicroEventNoDuplicates(C)};apple.widget.LinkManager.prototype.socialSharingLinkClicked=function(B){var A=B.target.className;var E=window.s||null;if(!E){return }var C=apple.metrics.Metrics.getProductSubstring(E.products);var D={slot:"",feature:A,part:C,action:""};apple.metrics.fireMicroEventNoDuplicates(D);apple.metrics.fireEvent({events:"event7"})};apple.widget.LinkManager.prototype.learnMore3GLinkClicked=function(A){var D=window.s||null;if(!D){return }var B=apple.metrics.Metrics.getProductSubstring(D.products);var C={slot:"",feature:"Learn More 3G",part:B,action:"Selected"};apple.metrics.fireMicroEventNoDuplicates(C)};window.gLinkManager=new apple.widget.LinkManager();Package("apple.widget");apple.widget.Movie=function(B,A){this.base("constructor")(B,A)};apple.util.makeSubclass(apple.widget.Movie,apple.widget.BaseWidget);apple.widget.Movie.DEFAULTS={autoplay:true,loop:false,wrapperClass:"movieWrapper"};apple.widget.Movie.prototype.init=function(){if(!apple.quicktime.isInstalled()){return }var A;var F=this.widget();var D;if(!F){return }switch(F.tagName.toLowerCase()){case"a":this.config.src=F.href;A=F.parentNode;D=F.getElementsByTagName("img")[0];D=F.removeChild(D);A.replaceChild(D,F);break;case"img":D=F;A=D.parentNode;break;default:console.log("Movie cannot initialise from "+F.tagName+"#"+this.config.id);return }this._posterId=this.config.id+"_poster";this._movieId=this.config.id+"_movie";this.config=Object.applyDefaults(this.config,{width:D.width,height:D.height});var C=document.createElement("div");C.style.visibility="hidden";C.style.position="relative";C.className=this.config.wrapperClass;C.id=F.id;D=A.replaceChild(C,D);D.id=this._posterId;C.appendChild(D);var E={autoplay:false,id:this._movieId};E=Object.applyDefaults(E,this.config);apple.quicktime.createMovie(E,C);var B={movieId:this._movieId,onload:this.movieLoaded.bind(this)};this.controller=new apple.widget.MovieController(this.config.controllerId,B);this.controller.hideMovie();C.style.visibility="visible"};apple.widget.Movie.prototype.movieLoaded=function(D){var F=document.getElementById(this._posterId);var G=this.config.width;var A=this.config.height;var H=this.config.autoplay;var C=this.controller;C.hideMovie();var E=this;function B(){F.style.display="none";C.showMovie(G,A);if(H){D.Play()}}coherent.Animator.setStyles(F,{opacity:0},{duration:500,callback:B,cleanup:true})};Package("apple.widget");apple.widget.MovieController=function(B,A){this.base("constructor")(B,A)};apple.util.makeSubclass(apple.widget.MovieController,apple.widget.BaseWidget);apple.widget.MovieController.DEFAULTS={create:false,disabledClass:"disabled",activeClass:"active",loadingClass:"loading",errorClass:"error",playingClass:"playing",pausedClass:"paused",onload:function(){},monitorInterval:500,playButtonSpec:"button"};apple.widget.MovieController.prototype.init=function(){this._duration=0;this._loading=true;this.monitorProgress();var A=this.widget();if(!A){return }A.style.display="none";Element.addClassName(A,this.config.pausedClass);Element.removeClassName(A,this.config.playingClass);var D=this.part(this.config.playButtonSpec);new apple.widget.ImageButton(D);Event.observe(D,"click",this.playButtonClicked.bind(this));var C=A.getElementsByTagName("div")[0];this._meterId=Element.assignId(C);this._meterWidth=C.offsetWidth;Event.observe(C,"mousedown",this.meterMouseDown.bind(this));var B=C.getElementsByTagName("span")[0];this._barId=Element.assignId(B)};apple.widget.MovieController.prototype._getMovie=function(){return $(this.config.movieId)};apple.widget.MovieController.prototype._updateMeter=function(B){var A=this.widget();if(!A||this._vr){return }B=B||this._getMovie();if(!B){return }try{var C=B.GetRate()}catch(G){return }if(C&&!this._playing){this._playing=true;Element.addClassName(A,this.config.playingClass);Element.removeClassName(A,this.config.pausedClass)}else{if(!C&&this._playing){this._playing=false;Element.addClassName(A,this.config.pausedClass);Element.removeClassName(A,this.config.playingClass)}}if(!this._duration){this._duration=B.GetDuration()}if(!this._duration){return }var E=$(this._meterId);this._meterWidth=E.offsetWidth-4;var D=$(this._barId);if(!D||this._meterWidth<0){return }var F=(B.GetTime()*this._meterWidth/this._duration);if(this._lastLeft==F){return }this._lastLeft=F;D.style.left=F+"px";D.style.width=(this._meterWidth-F+2)+"px"};apple.widget.MovieController.prototype.monitorProgress=function(){if(apple.quicktime.mobileSafari){return }var B=this.widget();function C(){var D=this._getMovie();if(!D){return }this._duration=D.GetDuration();this.config.onload(D);this._vr=D.GetIsVRMovie();if(!B){return }if(this._vr){coherent.Animator.setStyles(B,{opacity:0},{duration:250,callback:function(){B.style.display="none"},cleanup:true})}else{Element.setOpacity(B,0);B.style.display="";coherent.Animator.setStyles(B,{opacity:1},{duration:250,cleanup:true})}}function A(){var E=this._getMovie();if(!E){return }try{var D=(E.GetPluginStatus()||"").split(":")[0].toLowerCase();this._updateMeter(E);switch(D){case"playable":case"complete":if(!this._loading){break}this._loading=false;if(B){Element.removeClassName(B,this.config.loadingClass)}window.setTimeout(C.bind(this),10);break;case"error":if(B){Element.removeClassName(B,this.config.loadingClass);Element.addClassName(B,this.config.errorClass)}break;default:break}}catch(F){}}this._monitor=window.setInterval(A.bind(this),this.config.monitorInterval)};apple.widget.MovieController.prototype.playButtonClicked=function(B){this.part(this.config.playButtonSpec).blur();var A=this._getMovie();if(!A){return }if(A.GetRate()){A.Stop()}else{A.Play()}};apple.widget.MovieController.prototype._updateTimeoutExpired=function(A){this._updateTimeFromPosition(this._lastPos)};apple.widget.MovieController.prototype._updateTimeFromPosition=function(D){var A=this._getMovie();if(!A){return }D-=this._baseX;if(D<0){D=0}else{if(D>this._meterWidth){D=this._meterWidth}}var C=$(this._barId);if(C){C.style.left=D+"px";C.style.width=(this._meterWidth-D+2)+"px"}var B=A.GetDuration()*D/this._meterWidth;A.SetTime(B);this._moveTimeout=0};apple.widget.MovieController.prototype.meterMouseUp=function(B){Event.stopObserving(document,"mouseup",this._mouseUpHandler);Event.stopObserving(document,"mousemove",this._mouseMoveHandler);this._updateTimeFromPosition((B||window.event).clientX);var A=this._getMovie();if(!A){return }if(this._previousRate){A.Play()}};apple.widget.MovieController.prototype.meterMouseMoved=function(A){this._lastPos=(A||window.event).clientX;this._moveTimeout=this._moveTimeout||window.setTimeout(this._updateHandler,10)};apple.widget.MovieController.prototype.meterMouseDown=function(B){B=B||window.event;var A=this._getMovie();var C=$(this._meterId);if(!A){return }this._previousRate=A.GetRate();A.Stop();this._baseX=Element.getRect(C,true).left-document.body.scrollLeft-document.documentElement.scrollLeft;this._updateHandler=this._updateTimeoutExpired.bind(this);this._mouseMoveHandler=this.meterMouseMoved.bind(this);this._mouseUpHandler=this.meterMouseUp.bind(this);Event.observe(document,"mousemove",this._mouseMoveHandler);Event.observe(document,"mouseup",this._mouseUpHandler);Event.stop(B);this._updateTimeFromPosition(B.clientX)};apple.widget.MovieController.prototype.hideMovie=function(){var B=this._getMovie();if(!B){return }B.width=1;B.height=1;B.style.width="1px";B.style.height="1px";var A=this.widget();if(!A){return }A.style.display="none"};apple.widget.MovieController.prototype.showMovie=function(C,D){var B=this._getMovie();if(!B){return }B.width=C;B.height=D;B.style.width=C+"px";B.style.height=D+"px";var A=this.widget();if(!A){return }A.style.display=""};apple.widget.MovieController.prototype.stop=function(){var A=this._getMovie();if(!A){return }A.Stop()};apple.widget.MovieController.prototype.play=function(){var A=this._getMovie();if(!A){return }A.Play()};apple.widget.MovieController.prototype.loadMovie=function(D){var B=this._getMovie();if(!B){return }var A=this.widget();if(A){Element.addClassName(A,this.config.loadingClass)}this._loading=true;try{B.Stop();B.SetURL(D);B.SetAutoPlay(false);B.SetControllerVisible(false)}catch(C){console.log("SetURL: "+C.message)}};Package("apple.widget");apple.widget.ProductCluster=function(A){this.config=A;this.resetPages();function B(){window.clearInterval(this._firefoxTimer)}function C(){Event.onUnload(B.bind(this));this._firefoxTimer=window.setInterval(this.checkScroll.bind(this),2000)}if(coherent.Browser.Mozilla){Event.onDomReady(C.bind(this))}Event.observe(window,"scroll",this.checkScroll.bind(this));Event.observe(window,"load",this.checkScroll.bind(this))};apple.widget.ProductCluster.prototype.encodeURL=function(D,A){if(!A){A=this.config.baseURL}for(var B in D){var C=D[B];if(C&&C.length){if(A.indexOf("?")>0){A+="&"+B+"="+C}else{A+="?"+B+"="+C}}}return A};apple.widget.ProductCluster.prototype.gotoPage=function(F,E,D,C){var B=this.encodeURL({p:F,f:E,s:D,n:C});var A=this;apple.io.json.invoke({url:B,success:function(G){A.switchContent(A.config.contentId,G)}});return false};apple.widget.ProductCluster.prototype.sort=function(E,D,C){var B=this.encodeURL({f:E,s:D,n:C});var F=$("product-loading-sort");if(F){F.style.display="inline"}var A=this;apple.io.json.invoke({url:B,success:function(G){A.config.sort=D;A.switchContent(A.config.contentId,G);if(F){F.style.display="none"}}});return false};apple.widget.ProductCluster.prototype.gotoNode=function(D,C){var B=this.encodeURL({n:D,s:C});var E=$("product-loading-filter");if(E){E.style.display="inline"}var A=this;apple.io.json.invoke({url:B,success:function(F){A.config.childNode=D;A.config.sort=C;A.switchContent(A.config.contentId,F);if(E){E.style.display="none"}}});return false};apple.widget.ProductCluster.prototype.gotoFilter=function(E,D,C){var B=this.encodeURL({f:E,s:C,n:D});var A=this;apple.io.json.invoke({url:B,success:function(F){A.config.filter=E;A.config.sort=C;A.config.childNode=D;A.switchContent(A.config.contentId,F)}});return false};apple.widget.ProductCluster.prototype.resetPages=function(){this.checkingScroll=false;this.pagePositions=new Array();this.loadedPages=new Array()};apple.widget.ProductCluster.prototype.loadPage=function(C){if(this.loadedPages[C]){return }this.loadedPages[C]=1;var B=this.encodeURL({p:""+C,f:this.config.filter,s:this.config.sort,n:this.config.childNode},this.config.pageURL);var A=this;apple.io.json.invoke({url:B,success:function(F){var D=A.config.pageIdPrefix+C+A.config.pageIdSuffix;var E=A.config.pageIdPrefix+C;A.switchContent(D,F);C=$(E);var H=$(D);var G=function(){if(Element.getMarginBox(C).height<Element.getMarginBox(H).height){var I=Element.getMarginBox(H);I.height++;Element.setMarginBox(C,I)}};Element.setOpacity(H,0);H.style.display="";coherent.Animator.setStyles(H,{opacity:1},{duration:600,cleanup:true,callback:G})}})};apple.widget.ProductCluster.prototype.checkScroll=function(){if(this.checkingScroll){return }this.checkingScroll=true;var B=Element.getViewport().top;var E=B+Element.getViewport().height;var D=E+this.config.scrollBuffer;var C=B-this.config.scrollBuffer;for(var F=this.config.pages-1;F>=1;F--){var A=this.config.pageIdPrefix+F;if(!this.pagePositions[F]){var H=$(A);if(H){this.pagePositions[F]=Element.getRect(H).top}}var G=Element.getMarginBox($(A));if(C<=this.pagePositions[F]+G.height&&D>=this.pagePositions[F]){this.loadPage(F)}}this.checkingScroll=false};apple.widget.ProductCluster.prototype.setupEmptyPages=function(O,D,E,C,G,I){this.config.pages=D;this.resetPages();var H="";if(this.config.loadingIconUrl){H='<img class="product-loading-tile" src="'+this.config.loadingIconUrl+'">'}var L="";for(var B=1;B<this.config.pages;B++){L+='<div class="product-page" id="'+this.config.pageIdPrefix+B+'">\n';L+='<div class="product-page-grid hidden" id="'+this.config.pageIdPrefix+B+this.config.pageIdSuffix+'"></div>\n';var J=C;if(B==this.config.pages-1){J=G}var K;for(var A=0;A<J;A++){K=(((B-1)*C+A) in I);if(A==J-1&&B==this.config.pages-1){L+='<ul class="product-row last-row'}else{L+='<ul class="product-row'}L+=K?' has-specials">':'">';L+='<li class="product first-tile">'+H+"</li>";for(var M=1;M<E-1;M++){L+='<li class="product">'+H+"</li>"}L+='<li class="product last-tile">'+H+"</li>";L+="</ul>\n"}L+="</div>\n"}var N=$(O);N.innerHTML=L;if(coherent.Browser.MobileSafari){for(var F=1;F<D;F++){this.loadPage(F)}}};apple.widget.ProductCluster.prototype.switchContent=function(A,C){if(C.body.content){var B=$(A);B.innerHTML=C.body.content}};Package("apple.widget");apple.widget.ProductDetailsContentMenu=Class.create(coherent.View,{init:function(){var A=Element.queryAll("#contents ul li a");Array.forEach(A,function(B){var C=B.getAttribute("href");if(Element.query(C)===null){B.parentNode.style.display="none"}})}});Package("apple.widget");apple.widget.ProductFilter=function(B,A){this.base("constructor")(B,A);this._expanded=false;this._filters=[];this._selectionIndex=-1};apple.util.makeSubclass(apple.widget.ProductFilter,apple.widget.BaseWidget);apple.widget.ProductFilter.DEFAULTS={expandedClass:"expanded",controlSpec:"ul.filter-controls",expandLinkSpec:".expand-link",secondaryFilterClass:"secondary",contractLinkSpec:".contract-link",selectedClass:"selected",filterListSpec:"ul.filter-items",animateDuration:50};apple.widget.ProductFilter.prototype.init=function(){var F=this.widget();var E=this.part(this.config.filterListSpec);var B=this.part(this.config.controlSpec);if(!F||!E||!B){return }B.style.display="block";this._expanded=Element.hasClassName(F,this.config.expandedClass);this._animator=new apple.fx.Animator;var A=this.part(this.config.expandLinkSpec);var C=this.part(this.config.contractLinkSpec);if(!A||!C){return }Event.observe(A,"click",this.expandLinkClicked.bindAsEventListener(this));Event.observe(C,"click",this.contractLinkClicked.bindAsEventListener(this));var D=this.filterClicked.bindAsEventListener(this);Event.observe(E,"click",D);function G(I,H){this._filters.push(Element.assignId(I));if(Element.hasClassName(I,this.config.selectedClass)){this._selectionIndex=H}I.filterIndex=H;if(this._expanded||Element.hasClassName(I,this.config.selectedClass)||!Element.hasClassName(I,this.config.secondaryFilterClass)){return }I.style.display="none"}Array.forEach(E.getElementsByTagName("li"),G,this);F.style.display="none";F.style.display="block"};apple.widget.ProductFilter.prototype.expandFilters=function(I){var D=[];var E=this.widget();var G=this.part(this.config.filterListSpec);var B=G.getElementsByTagName("li")[0].offsetWidth;function H(J,L){var N=$(J);if(L==this._selectionIndex||Element.hasClassName(N,this.config.selectedClass)||!Element.hasClassName(N,this.config.secondaryFilterClass)){return }N.style.width=B+"px";N.style.height="auto";var M=Element.getDimensions(N);N.style.width="";var K=new apple.fx.Resize(apple.fx.easeInOutSine,N,M,{width:B,height:0});var O=new apple.fx.Fade(apple.fx.linearTween,N,0,1);D.push(new apple.fx.Blend(K,O))}var A=this.part(this.config.expandLinkSpec);var F=this.part(this.config.contractLinkSpec);A.style.visibility="hidden";F.style.visibility="hidden";this._filters.forEach(H,this);if(!D.length){return }function C(){A.style.visibility="";F.style.visibility="";Element.addClassName(E,this.config.expandedClass);this._expanded=true;if(I){I()}}this._animator.setDuration(D.length*this.config.animateDuration);this._animator.play(new apple.fx.Chain(D),C.bind(this))};apple.widget.ProductFilter.prototype.contractFilters=function(I){var D=[];var E=this.widget();var G=this.part(this.config.filterListSpec);var B=G.getElementsByTagName("li")[0].clientWidth;function H(J,L){var N=$(J);if(L==this._selectionIndex||Element.hasClassName(N,this.config.selectedClass)||!Element.hasClassName(N,this.config.secondaryFilterClass)){return }N.style.width=B+"px";var M=Element.getDimensions(N);N.style.width="";var K=new apple.fx.Resize(apple.fx.easeInOutSine,N,{width:B,height:0},M);var O=new apple.fx.Fade(apple.fx.linearTween,N,1,0);D.push(new apple.fx.Blend(K,O))}var A=this.part(this.config.expandLinkSpec);var F=this.part(this.config.contractLinkSpec);A.style.visibility="hidden";F.style.visibility="hidden";this._filters.forEach(H,this);if(!D.length){return }function C(){A.style.visibility="";F.style.visibility="";Element.removeClassName(E,this.config.expandedClass);this._expanded=false;if(I){I()}}this._animator.setDuration(D.length*this.config.animateDuration);this._animator.play(new apple.fx.Chain(D),C.bind(this))};apple.widget.ProductFilter.prototype.selectFilter=function(A){if(A==this._selectionIndex){return }var B=this._filters[this._selectionIndex];var C=this._filters[A];this._selectionIndex=A;if(B){Element.removeClassName($(B),this.config.selectedClass)}if(C){Element.addClassName($(C),this.config.selectedClass)}};apple.widget.ProductFilter.prototype.expandLinkClicked=function(A){var B=A.target||A.srcElement;B.blur();Event.stop(A);this.expandFilters()};apple.widget.ProductFilter.prototype.contractLinkClicked=function(A){var B=A.target||A.srcElement;B.blur();Event.stop(A);this.contractFilters()};apple.widget.ProductFilter.prototype.findFilterNode=function(A){var B=this.widget();while(A!=B&&!("filterIndex" in A)){A=A.parentNode}if(!("filterIndex" in A)){return null}return A};apple.widget.ProductFilter.prototype.filterClicked=function(A){var C=A.target||A.srcElement;C.blur();Event.stop(A);var B=this.findFilterNode(C);if(!B){return }this.selectFilter(B.filterIndex);if(this._expanded){this.contractFilters(this.filterContent.bind(this))}else{this.filterContent()}};apple.widget.ProductFilter.prototype.filterContent=function(){var B=$(this._filters[this._selectionIndex]);if(!B){return }var A=B.getElementsByTagName("a")[0];if(!A){return }window.open(A.href,"_self")};Package("apple.widget");apple.widget.ProductTrailer=Class.create(coherent.View,{__structure__:{"a.video-trailer":coherent.Anchor({action:"createOverlay"})},trailerInnerHTML:'<div class="trailer-overlay"><div class="video"><a href="">Placeholder</a></div></div>',init:function(){},createOverlay:function(){var A=document.getElementById("trailerOverlay"),B=Element.query("a.video-trailer").href;if(!this.trailerOverlay){this.trailerOverlay=new coherent.Overlay(A)}this.trailerOverlay.display({classname:"overlay",html:this.trailerInnerHTML});this.videoSource=Element.query(".video a");this.videoSource.setAttribute("href",B);this.videoController()},videoController:function(){if(this.videoPlayer){return }console.log(this);var A=Element.query(".trailer-overlay .video");var C=this.videoSource.href;var B={autoplay:"true",width:320,height:240};delete coherent.View.viewLookup["volume-track"];delete coherent.View.viewLookup["control-track"];this.videoPlayer=Media.create(A,C,B);if(this.videoPlayer){if(!coherent.Browser.MobileSafari){this.videoControls=new Media.ControlsWidget(A);this.videoPlayer.setControlPanel(this.videoControls)}var E=function(){D.parentNode.removeChild(D);A.appendChild(this.videoPlayer.video().object());A.appendChild(this.videoControls.element);this.videoControls.play()}.bind(this);var D=document.createElement("div");Element.addClassName(D,"endstate");Event.observe(D,"click",E);this.videoPlayer.setDelegate({didEnd:function(){this.videoControls.pause();this.videoPlayer.setTime(0);this.videoPlayer.reset();A.appendChild(D);A.removeChild(this.videoControls.element);A.removeChild(this.videoPlayer.video().object())}.bind(this)})}},overlayVisibleChange:function(C,A,B){if(!C.newValue){this.videoControls.pause()}}});Package("apple.widget");apple.widget.SchoolFinder=Class.create(coherent.View,{events:{searchPerformed:{eVar1:"",eVar5:"${pageName} | | find your school | ${query} | searched | ${results}"},schoolChosen:{eVar1:"",eVar5:"${pageName} | | find your school | ${school} | chosen | ${query}"}},__structure__:{"#loading":coherent.View({visibleBinding:"loading"}),"div#instructions":coherent.View({visibleBinding:"lastQuery(not)"}),"div#no-results":coherent.View({visibleBinding:"noResults"}),"table#schools-table":coherent.ListView({contentBinding:"results.schools",visibleBinding:"schoolCount",selectedObjectBinding:"school"}),"table#schools-table td.name":coherent.View({htmlBinding:"*.name"}),"table#schools-table td.location":coherent.View({htmlBinding:"*.location"}),"table#schools-table td.level":coherent.View({htmlBinding:"*.type"}),"#filter-HiEd":coherent.ToggleButton({selectionBinding:"filterSelection"}),"#filter-K12":coherent.ToggleButton({selectionBinding:"filterSelection"}),"#schoolQuery":coherent.TextField({valueBinding:"query",action:"submitQuery",sendsActionOnEndEditing:false}),"#schoolSearch":coherent.Button({action:"submitQuery",visibleBinding:"loading(not)"}),"#resultCount ":coherent.View({visibleBinding:"schoolCount"}),"#resultCount span":coherent.View({htmlBinding:"schoolCount"}),"div.more-information":coherent.View({visibleBinding:"lastQuery",animated:true}),"#school-submit":coherent.Button({animated:true,visibleBinding:"school",action:"goToSchool"})},keyDependencies:{schoolCount:["results"],noResults:["results","loading","lastQuery"]},init:function(){if(coherent.Browser.IE){Event.onDomReady(function(){$("filter-HiEd").checked=true;$("filter-K12").checked=false})}this.lastType="HiEd";this.setValueForKey("HiEd","filterSelection");this.addObserverForKeyPath(this,this.resultsChanged,"results");this.addObserverForKeyPath(this,this.submitQuery,"filterSelection");Event.observe($("schoolQuery"),"click",this.textFieldClicked.bind(this));Event.observe(window,"load",function(){$("schoolQuery").focus()});if(coherent.Browser.MobileSafari){var A=Element.query("div.search-results");Element.addClassName(A,"flexible")}},textFieldClicked:function(){if($("schoolQuery").value===""){this.setValueForKey(null,"query");this.setValueForKey(null,"lastQuery");this.setValueForKey(coherent.KVO.adaptTree({schools:[]}),"results")}},schoolCount:function(){if(this._results&&"schools" in this._results){return this._results.schools.length}else{return 0}},noResults:function(){return(this.schoolCount()===0&&this.lastQuery&&!this.loading)},resultsChanged:function(C,A,B){this.setValueForKey(null,"school");apple.behavior.Striper.delay(0,$("schools-table"))},getResults:function(){return this._results},setResults:function(B){if(B.schools){B.schools.forEach(function(C){C.setValueForKey(C.city+", "+C.state+" "+C.zipcode,"location")})}this._results=B;var A=Element.query(this.viewElement(),"div.search-results td");if(A){A.scrollIntoView()}},submitQuery:function(){var C=this.query;var B=this.valueForKey("filterSelection");if(C===this.lastQuery&&B===this.lastType){return }if(C){var E={query:C,type:B},D=this.queryReturned.bind(this),A=this.queryFailed.bind(this);this.setValueForKey(true,"loading");JSONRPC.get(this.queryURL,E).addMethods(D,A);this.lastType=B;this.setValueForKey(C,"lastQuery")}},queryReturned:function(A){var C={query:this.lastQuery+" - "+this.valueForKey("filterSelection"),pageName:window.s?window.s.pageName:null,results:(A&&A.schools)?A.schools.length:0};this.setValueForKey(false,"loading");var B=this.getEventData("searchPerformed",C);apple.metrics.fireEvent(B);this.setValueForKey(coherent.KVO.adaptTree(A),"results")},queryFailed:function(){this.setValueForKey(false,"loading");this.setValueForKey(coherent.KVO.adaptTree({schools:[]}),"results")},goToSchool:function(){var B={school:this.school.name,pageName:window.s?window.s.pageName:null,query:this.lastQuery};var A=this.getEventData("schoolChosen",B);apple.metrics.fireEvent(A);window.location=this.school.url},getEventData:function(B,D){var A=this.events[B];if(!A){return null}var C={};var E;for(E in A){C[E]=(A[E]||"").expand(D,"No Value")}return C}});Package("apple");apple.SiteSearch=Class.create(coherent.Form,{defaultOptions:{suggestionsEnabled:false,suggestionsUrl:null,dropDownMenuClassName:"search-auto-complete",selectedClassName:coherent.Browser.MobileSafari?"iosHighlight":"selected",initialKeypressDelay:50,keypressDelay:250,showDelay:200,closeDelay:500,requestTimeOut:5000,text:{searchHeading:"Búsquedas",productHeading:"Productos",categoryHeading:"Categorías"}},dataBinding:[],markupTemplate:"<ul></ul>",searchFieldset:coherent.View("fieldset",{}),searchField:coherent.TextField('input[type="text"]',{valueBinding:"searchValue"}),__structure__:{".search-reset":coherent.Anchor({visibleBinding:"showReset",action:"resetSearchField"}),".search-spinner":coherent.View({visibleBinding:"showSpinner"})},dropDownItemMaxWidth:undefined,formSubmissionStarted:false,onsubmit:function(A){Event.stop(A);if(!this.options.suggestionsEnabled){this.fireMetricsAndSubmit()}},init:function(){this.base();this.options=Object.applyDefaults(this.options,this.defaultOptions);this.setupSearchField();if(this.options.suggestionsEnabled){this.enableKeyboardObservers();this.buildDropDownMenu()}this.toggleResetButton();this.requestCounter=0;this._hiddenParams=this._hiddenParamQueryString()},setupSearchField:function(){if(this.viewElement().id!=="site-search"){this.searchField.nullPlaceholder=this.searchField.viewElement().getAttribute("placeholder");apple.behavior.TextFieldPlaceholder(this.searchField)}this.searchField.viewElement().removeAttribute("placeholder");Event.observe(this.searchField.viewElement(),"focus",this.focus.bind(this));Event.observe(this.searchField.viewElement(),"blur",this.blur.bind(this));var B=Element.query(this.viewElement(),"button[type=submit]");if(B&&this.options.suggestionsEnabled){var A=this;Event.observe(B,"click",function(C){if(C&&C.clientX!==0&&C.clientY!==0){A.select()}})}},enableKeyboardObservers:function(){Event.observe(this.searchField.viewElement(),"keydown",this.keydown.bind(this));Event.observe(this.searchField.viewElement(),"keypress",this.keypress.bind(this));Event.observe(this.searchField.viewElement(),"keyup",this.keyup.bind(this));Event.observe(this.searchField.viewElement(),"paste",this.paste.bind(this));Event.observe(this.searchField.viewElement(),"text",this.keyup.bind(this))},buildDropDownMenu:function(){var B=document.createElement("div");this.dropDownMenuId=Element.assignId(B);B.className=this.options.dropDownMenuClassName;Element.setStyle(B,"display","none");B.innerHTML=this.markupTemplate;this.searchFieldset.viewElement().appendChild(B);var A=B.getElementsByTagName("ul")[0];this.resultsListId=Element.assignId(A);Event.observe(A,"mousedown",this.selectOnClick.bindAsEventListener(this));Event.observe(A,"mouseover",this.selectMenuItem.bindAsEventListener(this))},focus:function(A){Element.addClassName(this.searchFieldset.viewElement(),"focused")},blur:function(A){this.hide();Element.removeClassName(this.searchFieldset.viewElement(),"focused")},keydown:function(A){switch(A.keyCode){case Event.KEY_UP:case Event.KEY_DOWN:if(this.resultsVisible){switch(A.keyCode){case Event.KEY_UP:this.activatePrev();break;case Event.KEY_DOWN:this.activateNext();break;default:break}Event.stop(A)}break;default:break}},keyup:function(A){switch(A.keyCode){case Event.KEY_ESC:case Event.KEY_RETURN:switch(A.keyCode){case Event.KEY_ESC:this.hide();break;case Event.KEY_RETURN:if(!this.formSubmissionStarted){this.preprocessRequest()}break;default:break}Event.stop(A);break;default:if(!Event.isMetaKey(A)){this.preprocessRequest()}break}this.toggleResetButton()},keypress:function(A){switch(A.keyCode){case Event.KEY_RETURN:this.select();break;default:break}},paste:function(C){var B=this;function A(){B.preprocessRequest()}A.delay(10)},toggleResetButton:function(){if(this.searchField.viewElement().value.length>0){this.setValueForKey(true,"showReset")}else{this.setValueForKey(false,"showReset")}},resetSearchField:function(){this.setValueForKey("","searchValue");this.toggleResetButton();this.searchField.viewElement().focus();this.hide()},preprocessRequest:function(){var A;(this.requestCounter<3)?A=this.options.initialKeypressDelay:A=this.options.keypressDelay;this.setValueForKey(this.searchField.viewElement().value.replace(/^\s+$/,""),"searchValue");if(this.searchValue.length<1){this.processNoResults()}else{if(this.keyupTimeout){window.clearTimeout(this.keyupTimeout);this.keyupTimeout=null}this.keyupTimeout=this.requestSuggestionsFor.bindAndDelay(this,A,this.searchValue)}},requestSuggestionsFor:function(F){var E,D,A,C;this.cancelOutstanding();if(!window.navigator.onLine){return }this.requestCounter=this.requestCounter+1;this.setValueForKey(true,"showSpinner");C={query:F};var B={params:C,callbackParamName:"method",enableCache:true,protocol:"JSONP"};this.jsonpresponse=JSONRPC.get(this.options.suggestionsUrl,null,B);this.jsonpresponse.addCallback(this.processJSONPResponse.bind(this));this.__waitingTimer=this.cancelOutstanding.bindAndDelay(this,this.options.requestTimeOut)},processJSONPResponse:function(){this.resetSelection();if(this.__waitingTimer){window.clearTimeout(this.__waitingTimer)}if(this.searchValue.length>0&&this.jsonpresponse&&this.jsonpresponse._result){var A=this.jsonpresponse._result;this.query=A.query.toLowerCase();if(A&&A.results&&((A.results.category&&A.results.category.length)||(A.results.product&&A.results.product.length)||(A.results.search&&A.results.search.length))){this.changeData(A.results)}else{this.processNoResults()}}else{this.processNoResults()}},cancelOutstanding:function(){try{if(this.jsonpresponse){this.jsonpresponse.cancel()}}catch(A){}if(this.__waitingTimer){window.clearTimeout(this.__waitingTimer)}this.processNoResults()},addSectionList:function(F,E){var C={},H=-1,B='<li class="section"><p>'+this.options.text[F+"Heading"]+"</p></li>";this.dataBinding.push({});for(var A=0,G=E.length;A<G;A++){var D=Object.applyDefaults(E[A],{section:F,rank:A+1,resultCount:G});this.dataBinding.push(D);C.display=C.original=this.sanitizeHtml(E[A].term);C.title=C.original.replace(/\"/g,"&quot;");if(F==="search"){B+='<li><span title="'+C.title+'">'+C.display+"</span></li>"}else{B+='<li><span title="'+C.title+'"><a>'+C.display+"</a></span></li>"}}return B},changeData:function(C){var B=$(this.resultsListId);var D=B.innerHTML="";this.dataBinding=[];if(C.search.length>0){D+=this.addSectionList("search",C.search)}if(C.product.length>0){D+=this.addSectionList("product",C.product)}if(C.category.length>0){D+=this.addSectionList("category",C.category)}if(D){B.innerHTML=D;this.changeSelectedIndex(null);var A=$(this.dropDownMenuId);Element.setStyle(A,"display","");this.resultsVisible=true;this.truncateAndHighlight(B);this.setValueForKey(false,"showSpinner")}},sanitizeHtml:function(B){var A=document.createElement("textarea");A.innerHTML=B;return A.value},truncateAndHighlight:function(D){var I,O,A,R,H=this.dropDownItemMaxWidth,F,G,P,B,E,C;var N=document.documentElement.style,M=("textOverflow" in N||"OTextOverflow" in N);for(var L=0,J=D.childNodes.length;L<J;L++){if(D.childNodes[L].className!=="section"){I=D.childNodes[L];I.setAttribute("menuIndex",L);O=I.getElementsByTagName("span");if(O&&O.length>0){R=O[0];if(H===undefined){H=parseInt(Element.getStyle(R,"width"),10);this.dropDownItemMaxWidth=H=isNaN(H)?0:H}A=R.getElementsByTagName("a");if(A&&A.length>0){R=A[0]}}if(!M){apple.util.addOverflowEllipsis(R,H)}G=(R.textContent||R.innerText);B=this.dataBinding[L].highlights;var K="",Q;for(Q=B.length-1;Q>=0;Q--){E=B[Q][0];C=B[Q][1];if(E<G.length){K="<strong>"+G.substring(E,C)+"</strong>"+G.substring(C)+K;G=G.substring(0,E)}}R.innerHTML=G+K}}},selectMenuItem:function(B){var C=B.target||B.srcElement,A=Element.locateAncestor(C,function(D){return D.tagName==="LI"});if(A){this.changeSelectedIndex(A.getAttribute("menuIndex"));Event.stop(B)}},changeSelectedIndex:function(E){var A;var D=$(this.resultsListId),B=D.childNodes,F=(E!==null&&!isNaN(E)&&E<0)?B.length-1:E,G=this.selectedIndex,C=this.options.selectedClassName;if(G!==null&&!isNaN(G)&&G>=0){Element.removeClassName(B[G],C);forceRedraw(B[G])}if(F!==null&&!isNaN(F)){A=B[F%B.length];if(this.listItemHasHeading(A)){this.skipSectionHeading(G,F)}else{Element.addClassName(B[F%B.length],C);forceRedraw(B[F%B.length]);this.selectedIndex=(F%B.length)}}else{this.selectedIndex=F}},skipSectionHeading:function(B,A){if(B===null||A>B){this.changeSelectedIndex(A+1)}else{this.changeSelectedIndex(A-1)}},listItemHasHeading:function(A){return(A.getElementsByTagName("p").length===1)},updateSearchFieldValue:function(A){this.searchField.viewElement().value=A},activatePrev:function(){if(this.selectedIndex===null||isNaN(this.selectedIndex)){this.selectedIndex=1}this.changeSelectedIndex(this.selectedIndex-1)},activateNext:function(){if(this.selectedIndex===null||isNaN(this.selectedIndex)){this.selectedIndex=-1}this.changeSelectedIndex(this.selectedIndex+1)},hide:function(){this.hideImpl();this.resetSelection()},hideImpl:function(){if(this.options.suggestionsEnabled){var A=$(this.dropDownMenuId);Element.setStyle(A,"display","none");this.resultsVisible=false}},processNoResults:function(){this.hide();this.setValueForKey(false,"showSpinner")},selectOnClick:function(A){Event.stop(A);this.select()},reset:function(){this.setValueForKey(false,"showSpinner");this.setValueForKey(false,"showReset");this.hide()},resetSelection:function(){delete this.selectedIndex},select:function(){this.hideImpl.bindAndDelay(this,100);this.searchField.viewElement().focus();this.fireMetricsAndSubmit();this.formSubmissionStarted=true},_hiddenParamQueryString:function(){var C=this.viewElement(),E=Element.queryAll(C,"input[type=hidden]"),B={};if(E){for(var A=0,D=E.length;A<D;A++){B[E[A].name]=E[A].value}}return Object.toQueryString(B)},fireMetricsAndSubmit:function(){var B;if(this.selectedIndex){B=this.dataBinding[this.selectedIndex]}var A=function(){if(B&&B.path){B.path+=(B.path.indexOf("?")===-1)?"?":"&";B.path+=this._hiddenParams;window.location.href=B.path}else{if(B){this.updateSearchFieldValue(B.term)}this.viewElement().submit()}};this.getSearchConfig();this.fireMetricsEvent(B);this.action=null;A.bindAndDelay(this,500)},getSearchConfig:function(){var A=new apple.metrics.Metrics({});var B=A.getObjectCookie()||{};if(B.searchConfig){this.addSearchConfigValueToForm(B.searchConfig)}},addSearchConfigValueToForm:function(B){var A=document.createElement("input");A.setAttribute("type","hidden");A.setAttribute("name","searchConfig");A.setAttribute("value",B);this.viewElement().appendChild(A)},fireMetricsEvent:function(A){var B={};B.events="event8";if(!A){B.eVar2=this.viewElement().find.value}else{if(A.section==="search"){B.eVar2=A.term}}if(A){B.eVar23=[this.viewElement().find.value,A.section,A.resultCount,A.term,A.rank].join(" | ")}apple.metrics.fireEvent(B)}});var forceRedraw=(function(){var A;if(coherent.Browser.IE===8){A=function(C){var B=C.paddingLeft;C.paddingLeft="1px";window.setTimeout(function(){C.paddingLeft=B},1)}}else{A=function(B){}}return A})();Package("apple.widget");apple.widget.SlidingTrackStack=function(B,A,C){C=C||{};this.narrow=false;this.trackStack=[];this.settings=Object.applyDefaults(C,{animated:true,trackFloatSelector:null,stackFloatSelector:null,minHeight:655,hasStack:true,floatingClassName:"floating",offscreenClassName:"offscreen",lastClassName:"last",narrowClassName:"narrow"});this.buildTrackStack(B,A)};apple.widget.SlidingTrackStack.prototype.buildTrackStack=function(C,B){var F=A(C)?Element.query(C):C,E,D;this.trackStack.push({track:F,trackId:F.id,floater:this.getFloater(F)});if(this.settings.hasStack){E=A(B)?Element.queryAll(B):B;E.forEach(function(G){D=this.getFloater(G);this.trackStack.push({track:G,trackId:G.id,floater:this.getFloater(G)})},this)}function A(G){return typeof G==="string"}this.setScrollInfo();Event.observe(window,"scroll",this.viewportScrolled.bind(this));Event.observe(window,"resize",this.viewportResized.bind(this));Event.observe(F,"click",this.scrollToCoords.bind(this))};apple.widget.SlidingTrackStack.prototype.getFloater=function(B,A){return A?Element.query(A):B.children[0]};apple.widget.SlidingTrackStack.prototype.setScrollInfo=function(){var D=0,B=0,A=this.trackStack.length,C;for(B;B<A;B++){C=this.trackStack[B];if(C.floating){this.unsetFloating(C)}C.offset=D;C.trackRect=Element.getRect(C.track);C.floatRect=Element.getRect(C.floater);if(C.floating){this.setFloating(C)}D=D+C.floatRect.height}this.viewportResized()};apple.widget.SlidingTrackStack.prototype.scrollToCoords=function(A){if(this.narrow||!A){return }var H=Element.getViewport(),G=A.target||A.srcElement,C=Element.locateAncestor(G,function(J){return J.tagName.toLowerCase()=="div"}),F=C.className.replace(/\s.*/,""),I=0,B=this.trackStack.length,D,E;for(I;I<B;I++){if(C.className==this.trackStack[I].track.className){D=this.trackStack[I];break}}if(!D){return }E=D.floatRect.top-D.offset;if(E==Element.getViewport().top){D=this.trackStack[I+1];if(!D){return }E=D.floatRect.top-D.offset}if(this.settings.animated){coherent.Animator.scrollTo([0,E])}else{window.scrollTo(0,E)}};apple.widget.SlidingTrackStack.prototype.setFloating=function(A){Element.addClassName(A.track,this.settings.floatingClassName);Element.removeClassName(A.track,this.settings.lastClassName);Element.setStyle(A.floater,"position","fixed");Element.setStyle(A.floater,"top",A.offset+"px")};apple.widget.SlidingTrackStack.prototype.unsetFloating=function(A){Element.removeClassName(A.track,this.settings.floatingClassName);Element.removeClassName(A.track,this.settings.lastClassName);Element.removeClassName(A.track,this.settings.offscreenClassName);Element.setStyle(A.floater,"position","");Element.setStyle(A.floater,"top","")};apple.widget.SlidingTrackStack.prototype.viewportScrolled=function(){var A=Element.getViewport(),F=0,D=0,C=0,B=this.trackStack.length,E;if(this.narrow){return }for(C;C<B;C++){E=this.trackStack[C];if(E.trackRect.top<=A.top+E.offset){this.setFloating(E);E.floating=true;F=C}else{this.unsetFloating(E);E.floating=false}D=A.top+E.offset+E.floatRect.height;if(D>=E.trackRect.bottom){Element.addClassName(E.track,this.settings.offscreenClassName)}else{Element.removeClassName(E.track,this.settings.offscreenClassName)}}Element.addClassName(this.trackStack[F].track,this.settings.lastClassName)};apple.widget.SlidingTrackStack.prototype.viewportResized=function(){var E=document.documentElement.clientWidth,B=document.documentElement.clientHeight,C=coherent.Browser.IE?document.body.scrollWidth:document.documentElement.scrollWidth,A=this.trackStack.length,D=0;if(coherent.Browser.MobileSafari||E<C||B<this.settings.minHeight){this.narrow=true}else{this.narrow=false}if(this.narrow){for(D;D<A;D++){this.unsetFloating(this.trackStack[D])}Element.addClassName(this.trackStack[0].track,this.settings.narrowClassName)}else{this.viewportScrolled();Element.removeClassName(this.trackStack[0].track,this.settings.narrowClassName)}};Package("apple.widget");apple.widget.SlidingTrackView=Class.create((function(){var I={PINNED_TOP:"pinned_top",FLOATING:"floating",PINNED_BOTTOM:"pinned_bottom"};var C="load";var G="touchstart";var E="touchmove";var A="touchend";var F="touchcancel";var H="scroll";var J="resize";var D=coherent.Browser.MobileSafari?-121:0;var B={pinned_top:function(){if(!this.isFloatingDisabled&&this._trackFrame.top<D&&this._viewport.height>=this._itemFrame.height){if(this._trackFrame.bottom<this._itemFrame.height){return this.setState(I.PINNED_BOTTOM)}return this.setState(I.FLOATING)}},floating:function(){if(this.isFloatingDisabled||this._trackFrame.top>0){return this.setState(I.PINNED_TOP)}if(this._trackFrame.bottom<=this._itemFrame.bottom){return this.setState(I.PINNED_BOTTOM)}},pinned_bottom:function(){if(this.isFloatingDisabled||this._trackFrame.bottom>=this._itemFrame.bottom){return this.setState(I.PINNED_TOP)}if(this._itemFrame.top>D){return this.setState(I.FLOATING)}}};return{constructor:function(K,N){var M=coherent.Browser.IE!==6&&Element.isFixedPositionSupported();if(M){var Q=[C,G,E,A,F,H,J];var O=Q.length;var L=Array.from(K.childNodes);var R;var P;this.view=K;while((P=L.shift())){if(P.nodeType==1&&!R){R=P;continue}if(N==undefined){N=""}if(!!N.cleanup){K.removeChild(P)}}this.isFloatingDisabled=false;this.shouldHideFloating=coherent.Browser.MobileSafari;this._item=coherent.View.fromNode(R);if(this._item===null){this._item=new coherent.View(R)}this._viewport=Element.getViewport();this._trackFrame=Element.getRect(K,true);this._itemFrame=Element.getRect(R,true);this.setState(I.PINNED_TOP);this.updateItemPosition();this._item.addObserverForKeyPath(this,this.itemFrameChanged,"frame");if(window.addEventListener){while(O--){window.addEventListener(Q[O],this,false)}}else{this.boundHandleEvent=this.handleEvent.bindAsEventListener(this);while(O--){Event.observe(window,Q[O],this.boundHandleEvent)}}}},hideItem:function(){if(!this.hidingItem){this.hidingItem=true;Element.hide(this._item.viewElement())}},showItem:function(){if(this.hidingItem){Element.show(this._item.viewElement());this.hidingItem=false}},handleEvent:function(K){switch(K.type){case C:case J:this.viewportResized();break;default:if(this.shouldHideFloating){switch(K.type){case E:this.hideItem();break;case F:case H:this.showItem();break;default:break}}this.viewportScrolled();break}},viewportResized:function(L){var K=this._viewport?this._viewport.width:0;this._viewport=Element.getViewport();if(coherent.Browser.Safari){this.setState(I.PINNED_TOP)}if(coherent.Browser.IE){this.isFloatingDisabled=document.documentElement.clientWidth<document.body.scrollWidth}else{this.isFloatingDisabled=document.documentElement.clientWidth<document.documentElement.scrollWidth}this.viewportScrolled()},viewportScrolled:function(){this._trackFrame=Element.getRect(this.view,true);this._itemFrame=Element.getRect(this._item.viewElement(),true);this.updateItemPosition()},updateItemPosition:function(){if("willResizeFrame" in this._item){var K=Object.applyDefaults({},this._itemFrame);K.top=Math.max(0,this._trackFrame.top);K.bottom=Math.min(this._trackFrame.bottom,this._viewport.height);K.height=K.bottom-K.top;if(this._viewport.height>this._itemFrame.height&&this._item.willResizeFrame(K)){this._itemFrame=this._item.resizeFrame(K)}}this._stateSwitcher()},itemFrameChanged:function(M,K,L){this._itemFrame=M.newValue;this.updateItemPosition()},setState:function(L){if(this._currentState==L){return }var K=this.view;Element.removeClassName(K,this._currentState);Element.addClassName(K,L);this._currentState=L;this._stateSwitcher=B[L]}}})());Package("apple.widget");apple.widget.SmartTextField=function(A){this.textAreaNodeId=A.textAreaElementId;this.errNodeId=A.errDivElementId;this.checkServerURL=A.checkServerURL;this.sid=A.sid;this.partNumber=A.partNumber;this.inFlight=false;this.resubmit=false;this.serverError="";this.wrappedText="";this.previewDivId="";this.timer=-1;this.cancelledRequest=false;$(this.textAreaNodeId).stf=this;Event.onDomReady(this.init.bind(this))};apple.widget.SmartTextField.prototype.init=function(){var A=$(this.textAreaNodeId);var C=null;var B=(function(D){if(C){window.clearTimeout(C)}C=this.afterKeypress.bindAndDelay(this,1000,D)}).bind(this);Event.observe(A,"keyup",B)};apple.widget.SmartTextField.prototype.checkServer=function(){this.timer=-1;this.inFlight=true;this.resubmit=false;var E=this;if(this.checkServerURL){var D=function(F){if(!E.cancelledRequest){if(F!="BAD REQUEST"&&F.substring(0,6)!="<html>"){E.inFlight=false;E.serverError="";if(E.resubmit){E.resubmit=false;E.checkServerSoon()}if(F.substr(0,2)!="OK"){E.serverError=F}if(F.substr(0,3)=="OK:"){E.wrappedText=F.substring(3);if(E.previewDivId){$(E.previewDivId).innerHTML=E.wrappedText}}E.showError()}}};var A=function(F){return };var C={mt:$(E.textAreaNodeId).value,pn:this.partNumber,wosid:this.sid};var B=XHR.post(this.checkServerURL,C);B.addMethods(D,A)}};apple.widget.SmartTextField.prototype.checkServerSoon=function(){this.cancelledRequest=false;if(!this.inFlight){if(this.timer!=-1){window.clearTimeout(this.timer)}var A=this;this.timer=window.setTimeout(function(){A.checkServer()},500)}else{this.resubmit=true}};apple.widget.SmartTextField.prototype.afterKeypress=function(A){this.checkServerSoon();return };apple.widget.SmartTextField.prototype.showError=function(){var A=$(this.errNodeId);A.innerHTML=this.serverError.replace(/</,"&lt;")};apple.widget.SmartTextField.prototype.setPreviewDivId=function(A){this.previewDivId=A};apple.widget.SmartTextField.prototype.cancelRequest=function(){this.cancelledRequest=true;this.inFlight=false;this.resubmit=false};Package("apple.widget");apple.widget.SuggestViewController=Class.create(coherent.ViewController,{__structure__:{},init:function(){}});Package("apple.widget");apple.widget.SyncContent=function(A){this.config=A;this.change()};apple.widget.SyncContent.prototype.getContent=function(){var A=null;var B=(function(C){if(C.body&&C.body.content){A=C.body.content}}).bind(this);apple.io.json.invoke({url:this.getUrl(),sync:true,success:B,scriptKeys:["content"]});return A};apple.widget.SyncContent.prototype.change=function(){var A=this.getContent();if(A){document.write(A)}};apple.widget.SyncContent.prototype.getUrl=function(){return this.config.url};Package("apple.widget");apple.widget.TabController=function(A){this.base("constructor")(A)};apple.util.makeSubclass(apple.widget.TabController,apple.widget.BaseWidget);apple.widget.TabController.DEFAULTS={activeClass:"active",inactiveClass:"inactive",transition:"crossfade",animate:false,autoRotate:false,advanceInterval:8000,transitionDuration:1000};apple.widget.TabController.prototype.init=function(){var B=document.getElementById(this.config.contentId);var A=this.tabContentIdFromTabId(this.config.selectedTabId);if(!document.getElementById(A)){var G=document.createElement("div");G.id=this.config.contentId;G.className=B.className;B.id=A;B.className="";B=B.parentNode.replaceChild(G,B);G.appendChild(B)}var F={id:this.config.contentId,duration:this.config.transitionDuration,transition:this.config.transition};this._swapper=new apple.fx.ContentSwapper(F);var E=window.location.hash.match(/^#tab(\d+)$/);var C;this.getTabIds();this.setupWrapperEvents();if(E&&E[1]){E=parseInt(E[1],10)-1;for(var D in this.config.tabs){C=D.match(/(\d+)$/);if(!C||C[1]!=E){continue}this.selectTab(D);break}}this.resume()};apple.widget.TabController.prototype.calculateTabHeights=function(G){var B=document.getElementById(G);var A=document.createElement("li");A.innerHTML='<a href="#"><strong>one line</strong></a>';B.appendChild(A);var D=parseInt(Element.getStyles(A.getElementsByTagName("strong")[0],"height"),10);B.removeChild(A);var I=B.getElementsByTagName("strong");var E=I.length;for(var C=0,F,H;C<E;C++){F=I[C];H=parseInt(Element.getStyles(F,"height"),10);if(H>D){Element.addClassName(F.parentNode.parentNode,"two-line")}}};apple.widget.TabController.prototype.getTabIds=function(){this.config.tabIds=[];for(var A in this.config.tabs){this.config.tabIds.push(A)}return this.config.tabIds};apple.widget.TabController.prototype.setupWrapperEvents=function(){if(!this.config.wrapperId){return }var A=document.getElementById(this.config.wrapperId);if(A){Event.observe(A,"mouseover",this.pause.bindAsEventListener(this));Event.observe(A,"mouseout",this.resume.bindAsEventListener(this))}};apple.widget.TabController.prototype.pause=function(A){if(!this.config.autoRotate){return }this.paused=true;if(this.timer){window.clearTimeout(this.timer)}this.timer=null};apple.widget.TabController.prototype.resume=function(A){if(!this.config.autoRotate){return }if(A){this.paused=false}if(this.timer){window.clearTimeout(this.timer)}this.timer=this.showNextTab.bindAndDelay(this,this.config.advanceInterval)};apple.widget.TabController.prototype.showNextTab=function(){if(this.paused||this.locked){return }var A=this.config.selectedTabId;var C=this.config.tabIds||this.getTabIds();var B=C.indexOf(A);if(B==C.length-1){B=0}else{B++}this.selectTab(C[B],"advance")};apple.widget.TabController.prototype.preloadNextTab=function(){var A=this.config.selectedTabId;var G=this.config.tabIds||this.getTabIds();var D=G.indexOf(A);if(D==G.length-1){D=0}else{D++}var C=G[D];if(document.getElementById(this.tabContentIdFromTabId(C))){return }function F(I){if(!I||!I.body){return }var H=coherent.Scripts.extract(I.body.content);this.insertTabContent(C,H)}var B=this.config.tabContentUrl||this.config.tabs[C];B=B.url||B;B=apple.util.expandTemplate(B,{tabId:C});var E={url:B,success:F.bind(this),scriptKeys:["content"]};apple.io.json.invoke(E)};apple.widget.TabController.prototype.tabContentIdFromTabId=function(A){return[this.config.contentId,A].join("_")};apple.widget.TabController.prototype.insertTabContent=function(B,C){if(document.getElementById(this.tabContentIdFromTabId(B))){return null}var A=document.getElementById(this.config.contentId);var D=document.createElement("div");D.id=this.tabContentIdFromTabId(B);Element.setInnerHTML(D,C);D.style.display="none";A.appendChild(D);return D};apple.widget.TabController.prototype.activateTab=function(B){var E;var D;var A;if(this.config.selectedTabId){E=document.getElementById(this.config.selectedTabId);if(!this.config.animate){Element.removeClassName(E,this.config.activeClass);Element.removeClassName(E.parentNode,this.config.activeClass);Element.addClassName(E,this.config.inactiveClass);Element.addClassName(E.parentNode,this.config.inactiveClass)}D=this.tabContentIdFromTabId(this.config.selectedTabId)}this.config.selectedTabId=B;if(B){E=document.getElementById(B);if(this.config.animate){coherent.Animator.replaceClassName(E,this.config.inactiveClass,this.config.activeClass,{duration:250,curve:coherent.easing.outSine});coherent.Animator.replaceClassName(E.parentNode,this.config.inactiveClass,this.config.activeClass,{duration:250,curve:coherent.easing.outSine})}else{Element.removeClassName(E,this.config.inactiveClass);Element.removeClassName(E.parentNode,this.config.inactiveClass);Element.addClassName(E,this.config.activeClass);Element.addClassName(E.parentNode,this.config.activeClass)}A=this.tabContentIdFromTabId(B)}var F=this;function C(){F.locked=false;F.resume();document.getElementById(A).style.zoom=1;if(F.config.autoRotate){F.preloadNextTab()}}this._swapper.swap(this.config.transition,D,A,C)};apple.widget.TabController.prototype.selectTab=function(D,G){if(G===undefined){G="click"}if(this.locked){return }if(this.config.selectedTabId==D){return }if(G=="click"){this.config.autoRotate=false}var J=this.tabContentIdFromTabId(D);if(this.timer){window.clearTimeout(this.timer);this.timer=null}this.locked=true;var C=this.config.baseMetrics;if(typeof (C)!=="undefined"&&C&&G==="click"){var H=this.config.tabs[D].displayName;var B=apple.util.expandTemplate(C,{index:H});apple.metrics.Metrics.reportCustomLink(null,B)}if(this.config.selectedTabId){var E=document.getElementById(this.config.selectedTabId);if(this.config.animate){coherent.Animator.replaceClassName(E,this.config.activeClass,this.config.inactiveClass,{duration:250,curve:coherent.easing.inSine});coherent.Animator.replaceClassName(E.parentNode,this.config.activeClass,this.config.inactiveClass,{duration:250,curve:coherent.easing.inSine})}}if(document.getElementById(J)){this.activateTab(D);return }function F(L){if(this.config.selectedTabId==D){return }if(!L||!L.body){return }var K=coherent.Scripts.extract(L.body.content);this.insertTabContent(D,K);this.activateTab(D)}var A=this.config.tabContentUrl||this.config.tabs[D];A=A.url||A;A=apple.util.expandTemplate(A,{tabId:D});var I={url:A,success:F.bind(this),scriptKeys:["content"]};apple.io.json.invoke(I)};Package("apple.widget");apple.widget.TextField=function(B,A){this.base("constructor")(B,A)};apple.util.makeSubclass(apple.widget.TextField,apple.widget.BaseWidget);apple.widget.TextField.DEFAULTS={placeholder:"No Value",placeholderClass:"placeholder"};apple.widget.TextField.prototype.init=function(){var B=this.widget();Event.observe(B,"focus",this.fieldReceivedFocus.bindAsEventListener(this));Event.observe(B,"blur",this.fieldLostFocus.bindAsEventListener(this));this._maxLength=B.maxLength||-1;var A=(B.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(""!==A&&this.config.placeholder!==A){return }B.maxLength=this.config.placeholder.length;B.value=this.config.placeholder;Element.addClassName(B,this.config.placeholderClass)};apple.widget.TextField.prototype.fieldReceivedFocus=function(A){var C=this.widget();var B=(C.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(this.config.placeholder===B){C.value=""}if(-1!=this._maxLength){C.maxLength=this._maxLength}else{C.removeAttribute("maxLength")}Element.removeClassName(C,this.config.placeholderClass)};apple.widget.TextField.prototype.fieldLostFocus=function(A){var C=this.widget();var B=(C.value||"").replace(/^\s+/,"").replace(/\s+$/,"");if(""!==B){return }Element.addClassName(C,this.config.placeholderClass);this._maxLength=C.maxLength||-1;C.maxLength=this.config.placeholder.length;C.value=this.config.placeholder};Package("apple.widget");apple.widget.VoteController=function(A){this.config=Object.applyDefaults(A,this.DEFAULTS);Event.onDomReady(this.init.bind(this))};apple.widget.VoteController.prototype.DEFAULTS={voteYesValue:1,voteNoValue:0,voteClass:"vote",voteYesClass:"yes",voteNoClass:"no",messageClass:"useful",voteIdRegex:/-(\w+)$/,fadeDuration:200};apple.widget.VoteController.prototype.init=function(){var A=document.getElementById(this.config.elementId);if(!A){return }this.attachVoteEvents(Element.getElementsByClassName(this.config.voteYesClass,A),this.voteYes.bindAsEventListener(this));this.attachVoteEvents(Element.getElementsByClassName(this.config.voteNoClass,A),this.voteNo.bindAsEventListener(this))};apple.widget.VoteController.prototype.attachVoteEvents=function(B,C){function A(D){Event.observe(D,"click",C)}Array.forEach(B,A)};apple.widget.VoteController.prototype.voteYes=function(A){var B=(A.srcElement||A.target);Event.stop(A);this.sendVote(B,this.config.voteYesValue)};apple.widget.VoteController.prototype.voteNo=function(A){var B=(A.srcElement||A.target);Event.stop(A);this.sendVote(B,this.config.voteNoValue)};apple.widget.VoteController.prototype.sendVote=function(C,A){var B=this.getVoteElem(C);var D=this.getVoteId(B);if(D){apple.io.json.invoke({url:this.config.requestUrl,urlArgs:{voteId:D,vote:A}})}if(this.config.type=="answer"){this.reportEvent(A)}this.displayFeedbackMessage(C)};apple.widget.VoteController.prototype.displayFeedbackMessage=function(F){var D=this.getMessageElem(F);var E=this.getVoteElem(F);var G=this.config.feedbackMessage;var B=this.config.fadeDuration;var C=function(){D.innerHTML=G;D.parentNode.removeChild(D);E.innerHTML="";E.appendChild(D);Element.setOpacity(E,0);coherent.Animator.setStyles(E,{opacity:1},{duration:B,cleanup:true})};var A=parseInt(Element.getStyles(E,"height"),10);if(!isNaN(A)){E.style.height=Math.max(A,0)+"px"}coherent.Animator.setStyles(E,{opacity:0},{duration:B,callback:C})};apple.widget.VoteController.prototype.getVoteElem=function(B){var C=this.config.voteClass;var A=B.parentNode;while(A&&A!=document.body){if(A.className==C){return A}A=A.parentNode}return null};apple.widget.VoteController.prototype.getMessageElem=function(C){var A=null;var B=this.getVoteElem(C);var D=Element.getElementsByClassName(this.config.messageClass,B);if(D&&D.length>0){A=D[0]}return A};apple.widget.VoteController.prototype.getVoteId=function(B){if(!B||!B.id){return null}var C=null;var A=this.config.voteIdRegex.exec(B.id);if(A&&A.length>1){C=A[1]}return C};apple.widget.VoteController.prototype.reportEvent=function(A){var B=(A==1)?"Useful":"Not Useful";apple.metrics.fireMicroEvent({page:window.s.pageName,feature:"Useful Vote",part:"Product Answers - "+window.s.prop25,action:B})};Package("apple.widget");apple.widget.EngravedPod=Class.create(coherent.View,{exposedBindings:["engravingText","productId","picassoUrl","backgroundImage"],innerHTML:'<img class="engraving" src="">',__structure__:{"img.background":coherent.ImageView({srcBinding:"backgroundImage"}),"img.engraving":coherent.ImageView({srcBinding:"engravedImage",visibleBinding:"pending(not)"})},keyDependencies:{prepareEngravedImage:["picassoUrl","productId","backgroundImage","engravingText"]},productId:"",backgroundImage:"",picassoUrl:"",init:function(){},prepareEngravedImage:function(){if(!this.picassoUrl||!this.productId||!this.backgroundImage||!this.engravingText){return }if(this.__imageTimer){window.clearTimeout(this.__imageTimer);this.__imageTimer=null}var A=(this.engravingText||"").split("\n"),C={th:A[0]||"",tl:A[1]||"",i:this.backgroundImage},B=this.picassoUrl,D=[B,Object.toQueryString(C)].join((B.indexOf("?")>=0)?"&":"?");this.setValueForKey(true,"pending");this.__imageTimer=window.setTimeout(function(){this.setValueForKey(D,"engravedImage");this.setValueForKey(false,"pending")}.bind(this),50)}});Package("apple");apple.EngravingGalleryController=Class.create(coherent.ViewController,{__structure__:{"div.tabs ul":coherent.ListView({selectedIndexBinding:"selectedTabIndex",enabledBinding:"waiting(not)",animated:"true",action:"noop"}),"div.preview":apple.widget.EngravedPod({picassoUrlBinding:"selectedVariation.picassoUrl",classBinding:"viewClass",productIdBinding:"selectedProduct.productId",backgroundImageBinding:"selectedVariation.backer",engravingTextBinding:"engravingText"}),"ul.ipod-list":coherent.ListView({contentBinding:"products",selectedObjectBinding:"selectedProduct",visibleBinding:"showProducts",action:"noop"}),"ul.ipod-list a":coherent.Anchor({titleBinding:"*.title"}),"ul.ipod-list img":coherent.ImageView({altBinding:"*.productId",srcBinding:"*.productImage"}),"ul.variations":coherent.ListView({contentBinding:"productVariations",selectedObjectBinding:"selectedVariation",visibleBinding:"showVariations",action:"noop"}),"ul.variations a":coherent.Anchor({titleBinding:"*.label",classBinding:"selectedProduct.productId"}),"ul.variations span":coherent.Anchor({textBinding:"*.label",classBinding:"*.swatch"}),"div.engravings":coherent.ListView({contentBinding:"engravings",selectedIndexBinding:"selectedTabIndex",animated:"true",action:"noop"}),"div.engravings ul":coherent.ListView({contentBinding:"*.content",selectedObjectBinding:"*.selectedEngraving",action:"noop"}),"div.engravings ul a":coherent.View({htmlBinding:"*.text"})},keyDependencies:{viewClass:["selectedVariation","selectedProduct","engravings"],showVariations:["productVariations"],engravingText:["selectedTabIndex"]},init:function(){this.view.superview().addObserverForKeyPath(this,this.overlayVisibleChange,"visible");Array.forEach(Element.queryAll("div.engravings ul"),function(B){Array.forEach(B.getElementsByTagName("li"),function(C,D){Element.addClassName(C,"item"+(D+1))})});this.shuffleTab=Element.query(this.viewElement(),"ul.shuffle");if(this.shuffleTab){var A=Element.query(this.viewElement(),"ul.ipod-list li");if(A){A.style.display="none"}}this.addObserverForKeyPath(this,"observeSelectedEngravingChange","engravings.selectedEngraving")},videoController:function(){if(this.videoPlayer){return }var A=document.getElementById("video-container");var C=document.getElementById("video-href").getAttribute("href");var B={autoplay:"true",width:640,height:360};delete coherent.View.viewLookup["volume-track"];delete coherent.View.viewLookup["control-track"];this.videoPlayer=Media.create(A,C,B);if(this.videoPlayer){if(!coherent.Browser.MobileSafari){this.videoControls=new Media.ControlsWidget(A);this.videoPlayer.setControlPanel(this.videoControls)}var E=function(){D.parentNode.removeChild(D);A.appendChild(this.videoPlayer.video().object());A.appendChild(this.videoControls.element);this.videoControls.play()}.bind(this);var D=document.createElement("div");Element.addClassName(D,"endstate");Event.observe(D,"click",E);this.videoPlayer.setDelegate({didEnd:function(){this.videoControls.pause();this.videoPlayer.setTime(0);this.videoPlayer.reset();A.appendChild(D);A.removeChild(this.videoControls.element);A.removeChild(this.videoPlayer.video().object())}.bind(this)})}},selectedTabIndex:function(){return this.__selectedTabIndex},setSelectedTabIndex:function(D){if(!this.engravings){return(this.__selectedTabIndex=D)}this.setValueForKey(true,"waiting");var G=this.engravings;var F=D==G.length-2;var B=this.__selectedTabIndex==G.length-2;var H=D==G.length-1;var A=this.__selectedTabIndex==G.length-1;var C=Element.query(this.viewElement(),"#video-container");this.__selectedTabIndex=D;if(H&&C){if(C.firstChild){if(this.videoControls){this.videoControls.show()}this.setSelectedProduct(this.products[4])}else{this.videoController.bindAndDelay(this,500)}this.setSelectedProduct(this.products[4])}else{if(A&&C){if(C.firstChild){if(this.videoControls){this.videoControls.pause()}this.setSelectedProduct(this.products[1])}else{this.setSelectedProduct(this.products[1])}}}if(F&&this.shuffleTab){this.setSelectedProduct(this.products[0])}else{if((B&&this.shuffleTab)&&!H){this.setSelectedProduct(this.products[1])}}var E=G[this.__selectedTabIndex];if(!E.selectedEngraving){E.setValueForKey(E.content[0],"selectedEngraving")}else{this.updateEngravingText(E.selectedEngraving)}(function(){this.setValueForKey(false,"waiting")}).bindAndDelay(this,500);return D},selectedProduct:function(){return this.__selectedProduct},setSelectedProduct:function(B){this.willChangeValueForKey("productVariations");this.__selectedProduct=B;this.didChangeValueForKey("productVariations");var A;this.shuffleTab?A=!(B==this.products[0]||B==this.prod):A=!(B==this.prod);this.setValueForKey(A,"showProducts");var C=this.productVariations();this.setValueForKey(C[0],"selectedVariation");return B},updateEngravingText:function(C){var A=C.text||"";var B=A.split(/<\s*br\s*\/?>/i).map(function(D){return D.trim()}).join("\n");this.setValueForKey(B,"engravingText")},observeSelectedEngravingChange:function(A){if(1!==A.indexes.length){return }this.updateEngravingText(A.newValue[0])},viewClass:function(){if(!this.__selectedProduct){return"preview"}if(!this.selectedVariation){return"preview "+this.__selectedProduct.productId}var A=this.__selectedProduct.productId+"_"+this.selectedVariation.swatch;return["preview",this.__selectedProduct.productId,A].join(" ")},showVariations:function(){var A=this.productVariations();return A.length>1},productVariations:function(){if(!this.__selectedProduct||!this.productData){return[]}var A=this.__selectedProduct.productId;return this.productData[A]||[]},noop:function(A,B){Event.stop(B)},overlayVisibleChange:function(C,A,B){if(!C.newValue&&this.videoPlayer){this.videoControls.pause()}},setInitialSelections:function(B){this.setValueForKey(true,"waiting");var A=this.products[B.selectedProduct||0];this.setSelectedProduct(A);var C=this.productVariations();this.setValueForKey(C[B.selectedVariationIndex||0],"selectedVariation");this.setSelectedTabIndex.bindAndDelay(this,10,B.selectedTab)}});Package("apple");apple.EngravingViewController=Class.create(coherent.ViewController,{__structure__:{".one-click":coherent.View({visibleBinding:"showOneClickButtons"}),'input[type="checkbox"]':coherent.ToggleButton({checkedBinding:"thisIsGift"}),".outline_box .close":coherent.Anchor({action:"hide"}),"p.toggle":coherent.View({visibleBinding:"overlayHidden",animated:true}),"p.toggle a":coherent.Anchor({action:"show"})},engravingOverlay:coherent.View(".outline_box"),init:function(){this.checkOneClickSettings();this.addObserverForKeyPath(this,this.observeThisIsGiftCheckbox,"thisIsGift");this.observeThisIsGiftCheckbox();this.productImage=Element.query(this.viewElement(),"#EngraveDynamicImage");var B=Element.queryAll(this.viewElement(),"#engraving_form button[type=submit]");if(B&&-1!==B.length){for(var A=B.length;A>0;A--){B[A-1].clicked=false;Event.observe(B[A-1],"click",this.handleClick.bind(this));Event.stopObserving(B[A-1],"click",this.handleClick.bind(this))}}if(document.getElementById("gift-checkbox")){Event.observe(document.getElementById("gift-checkbox"),"focus",this.showGiftPopup);Event.observe(document.getElementById("gift-checkbox"),"blur",this.hideGiftPopup);Event.observe(document.getElementById("gift-checkbox"),"keyup",this.handleGiftCheckboxKeyUp);Event.observe(document.getElementById("gift-checkbox"),"keypress",this.handleGiftCheckboxKeypress)}},showGiftPopup:function(A){var B=new apple.widget.HoverManager(),C=B.findHoverNode(A.target||A.srcElement);if(!C){return }B.showHover(C,true)},hideGiftPopup:function(A){var B=new apple.widget.HoverManager(),C=B.findHoverNode(A.target||A.srcElement);if(!C){return }B.hideHover(C,true)},handleGiftCheckboxKeypress:function(A){if(A.keyCode===Event.KEY_RETURN){Event.stop(A)}},handleGiftCheckboxKeyUp:function(B){if(B.keyCode===Event.KEY_ESC){Event.stop(B);var C=new apple.widget.HoverManager(),A=B.target||B.srcElement,D=C.findHoverNode(A);if(!D){return }C.hideHover(D,true)}},checkOneClickSettings:function(){var A=apple.cookie("appleconfig3");if(A===null){A=apple.cookie("AppleConfig3")}this.oneClickEnabled=(A!==null)?true:false},observeThisIsGiftCheckbox:function(A){if(this.oneClickEnabled){this.hideOneClickButtonsIfThisIsGift()}},hideOneClickButtonsIfThisIsGift:function(){if(this.valueForKey("thisIsGift")){this.setValueForKey(false,"showOneClickButtons")}else{this.setValueForKey(true,"showOneClickButtons")}},show:function(B){var A=this.engravingOverlay.viewElement();A.style.display="block";coherent.Animator.setStyles(A,{opacity:1},{duration:200});this.setValueForKey(false,"overlayHidden");this.disableShowObserver()},hide:function(B){var A=this.engravingOverlay.viewElement();coherent.Animator.setStyles(A,{opacity:0},{duration:200,callback:function(){A.style.display="none"}});this.setValueForKey(true,"overlayHidden");this.enableShowObserver()},enableShowObserver:function(){Event.observe(this.productImage,"click",this.observeClick.bind(this))},disableShowObserver:function(){Event.stopObserving(this.productImage,"click",this.observeClick.bind(this))},observeClick:function(A){if(this.overlayHidden){this.show()}},handleClick:function(C){var B=Element.queryAll(this.viewElement(),"#engraving_form button[type=submit]");for(var A=B.length;A>0;A--){if(B[A-1].clicked){B[A-1].disabled=true;Event.stop(C)}Element.addClassName(B[A-1],"disabled");B[A-1].clicked=true}}});Package("apple.utilitynav");(function(){var B=Class.create(coherent.ViewController,{__structure__:{"#utility-nav":coherent.View({visibleBinding:"visibleSection"}),"#utility-nav-loading":coherent.View({visibleBinding:"showSpinner"}),"#unav-help":coherent.View({visibleBinding:"helpVisible"}),"#unav-account":coherent.View({visibleBinding:"accountVisible"}),"#unav-cart":coherent.View({visibleBinding:"cartVisible"}),"#utility-nav-btm":coherent.View({visibleBinding:"visibleSection"}),"#unav-cart p.view-link a":coherent.Anchor({hrefBinding:"data.cart.viewAllUrl"}),".checkout a":coherent.Anchor({visibleBinding:"data.cart.items.@count",hrefBinding:"data.cart.checkOutUrl"}),"#unav-your-cart .empty-cart-message":coherent.View({visibleBinding:"data.cart.items.@count(not)"}),"#unav-your-cart ul":coherent.ListView({contentBinding:"data.cart.items",visibleBinding:"data.cart.items.@count",template:coherent.View({__structure__:{a:coherent.Anchor({hrefBinding:"*.productDetailsUrl"}),img:coherent.ImageView({srcBinding:"*.imageUrl"}),span:coherent.View({htmlBinding:"*.description"})}})})},helpLink:coherent.Anchor("#u_help a"),accountLink:coherent.Anchor("#u_account a"),cartLink:coherent.Anchor("#u_cart a"),keyDependencies:{helpVisible:["visibleSection","dataLoaded"],accountVisible:["visibleSection","dataLoaded"],cartVisible:["visibleSection","dataLoaded"],showSpinner:["visibleSection","dataLoaded"]},init:function(){this.setValueForKey(null,"visibleSection");this.setValueForKey(false,"dataLoaded");var E={owner:this,onmouseenter:this.onmouseenter,onmouseleave:this.onmouseleave};this.addTrackingInfo("u_help",E);this.addTrackingInfo("u_account",E);this.addTrackingInfo("u_cart",E);this.addTrackingInfo("unav-help",E);this.addTrackingInfo("unav-account",E);this.addTrackingInfo("unav-cart",E);var D=Element.query("#unav-cart .checkout a");if(coherent.Browser.IE===6&&D){Event.observe(D,"click",this.unsupportedCheckoutCheck.bind(this))}if(this.surveyData){var F=window.apple.survey;F.surveyButton(this)}this.unavHelp=coherent.View.viewLookup["unav-help"];this.unavAccount=coherent.View.viewLookup["unav-account"];this.unavCart=coherent.View.viewLookup["unav-cart"];Event.observe(this.helpLink.viewElement(),"focus",this.keyboardShow.bindAsEventListener(this));if(this.accountLink){Event.observe(this.accountLink.viewElement(),"focus",this.keyboardShow.bindAsEventListener(this))}Event.observe(this.cartLink.viewElement(),"focus",this.keyboardShow.bindAsEventListener(this));Event.observe(document.getElementById("guide_wrap"),"keydown",this.keydown.bindAsEventListener(this));Event.observe(document.getElementById("guide_wrap"),"touchend",this.touchEndMenu.bindAsEventListener(this));Event.observe(document.getElementById("guide_wrap"),"click",this.clickHandler.bindAsEventListener(this));Event.observe(document.getElementById("guide_wrap"),"touchstart",this.touchStartMenu.bindAsEventListener(this));this.preventClick=false;Event.observe(document.body,"click",this.closeMenu.bindAsEventListener(this));Event.observe(document.body,"touchend",this.closeMenu.bindAsEventListener(this));this.ariaInit()},ariaInit:function(){function D(F,E,G){if(E){F.setAttribute("aria-haspopup","true")}if(G){F.setAttribute("aria-owns",G)}return F}D(this.helpLink.viewElement(),true,"unav-help");if(this.accountLink){D(this.accountLink.viewElement(),true,"unav-account")}D(this.cartLink.viewElement(),true,"unav-cart");this.addObserverForKeyPath(this,this.ariaObserveVisible,"helpVisible");this.addObserverForKeyPath(this,this.ariaObserveVisible,"accountVisible");this.addObserverForKeyPath(this,this.ariaObserveVisible,"cartVisible");document.getElementById("utility-nav-content").setAttribute("aria-live","polite")},removeAriaAlert:function(){var E=document.getElementById("ariaLoadingAlert");if(E){var D=E.parentElement||E.parentNode;D.removeChild(E)}},createAriaAlert:function(G,D){this.removeAriaAlert();var E=document.createElement("p");var F=document.createTextNode(G);E.appendChild(F);E.setAttribute("role","alert");E.setAttribute("aria-live",(D||"polite"));E.setAttribute("id","ariaLoadingAlert");E.setAttribute("style","border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;");document.body.appendChild(E)},ariaObserveVisible:function(G,H){var F=this;var E=(function D(I){switch(I){case ("helpVisible"):return F.unavHelp.viewElement();case ("accountVisible"):return F.unavAccount.viewElement();case ("cartVisible"):return F.unavCart.viewElement();default:return undefined}})(H);if(E){E.setAttribute("aria-hidden",!G.newValue)}},clickHandler:function(D){if(coherent.Browser.MobileSafari){if(this.preventClick){this.touchHandler(D,false);this.preventClick=false}this.touchHandler(D,true)}},touchEndMenu:function(D){this.touchHandler(D,true)},touchStartMenu:function(D){if(D.touches&&D.touches.length===1){this.touchHandler(D,false)}},touchHandler:function(D,E){var F=(D.target||D.srcElement).parentNode.id||false;if(F&&!~F.indexOf("u_")){F=D.srcElement.parentNode.parentNode&&D.srcElement.parentNode.parentNode.id}if(F&&~F.indexOf("u_")){this.preventClick=true;Event.stop(D);if(E){this.setValueForKey(F,"visibleSection")}}},keyboardShow:function(D){var E=(D.target||D.srcElement).parentNode.id||false;if(E&&~E.indexOf("u_")){this.menuLink=E}else{this.lockedToNav=false;this.menuLink=undefined}},closeMenu:function(D){var E=D.target||D.srcElement;do{if(E&&E.id==="utility-nav"||E.id==="user_nav"){return }E=E.parentNode}while(E&&E!==document.body);this.setValueForKey(null,"visibleSection")},keyboardNavDataLoadCallback:function(){if(this.lockedToNav){this.currentNavEls=this.getVisibleNavContents();this.currentNavEls[0].focus()}},getNodeFromNav:function(D){switch(D){case"u_help":return this.unavHelp.viewElement();case"u_account":return this.unavAccount.viewElement();case"u_cart":return this.unavCart.viewElement();default:return""}},getVisibleNavContents:function(){var G=Element.queryAll(this.getNodeFromNav(this.menuLink),"a"),F=[];for(var E=0,D=G.length;E<D;E++){if(G[E]&&G[E].style.display!=="none"){F.push(G[E])}}return F},keydown:function(D){var F=D.keyCode;if(F===Event.KEY_ESC&&this.lockedToNav){Event.stop(D);Element.query("#"+this.valueForKey("visibleSection")+" a").focus();this.setValueForKey(null,"visibleSection");this.lockedToNav=false}if(this.lockedToNav&&F===Event.KEY_TAB){var E=D.target||D.srcElement;if(!D.shiftKey&&E===this.currentNavEls[this.currentNavEls.length-1]){Event.stop(D);this.currentNavEls[0].focus()}if(D.shiftKey&&E===this.currentNavEls[0]){Event.stop(D);this.currentNavEls[this.currentNavEls.length-1].focus()}}if(F===Event.KEY_RETURN){if(this.menuLink&&!this.lockedToNav){Event.stop(D);this.setValueForKey(this.menuLink,"visibleSection");this.lockedToNav=true;this.currentNavEls=this.getVisibleNavContents();this.currentNavEls[0].focus()}}},getSurveyData:function(){return this.surveyData},surveyFeature:function(){return"Survey"},surveyEVar:function(){return"eVar5"},surveyElement:function(){var D=this.surveyData;var H=unescape(D.surveyURL);var G=window.s;function I(K){K+="=";var J=document.cookie.split(";");for(var L=0;L<J.length;L++){var M=J[L];while(M.charAt(0)===" "){M=M.substring(1,M.length)}if(M.indexOf(K)===0){return M.substring(K.length,M.length)}}return null}var E=new Date();H+=(H.indexOf("?")===-1?"?":"&")+"Pagename="+escape(G.pageName)+"&visitorID="+escape(I("s_vi"))+"&hit_time_gmt="+escape(E.toGMTString())+"&OS="+escape(G.n.oscpu);var F=document.createElement("li");Element.setInnerHTML(F,'<a target="_blank" href="'+H+'"><span>'+D.surveyButtonText+"</span></a>");Element.setStyle(F,"opacity",0);this.surveyElementId=Element.assignId(F);return F},surveyCallback:function(G){if(G){var D=$(this.surveyElementId);var F=Element.query(document.body,"#user_nav ul, #guide_wrap ul");if(F){if(!(this.surveyElementId&&D)){var E=F.getElementsByTagName("li")[0];E.parentNode.insertBefore(G,E);D=$(this.surveyElementId)}Element.setStyle(D,"display","inline");coherent.Animator.setStyles(D,{opacity:1});apple.metrics.fireMicroEvent({feature:"Survey",action:"displayed"})}}},surveyCallbackHide:function(E){E.alreadyShown=false;var D=$(this.surveyElementId);if(D){coherent.Animator.setStyles(D,{opacity:0},{callback:function(){Element.setStyle(D,"display","none")}})}},discardCartData:function(){this.dataLoaded=false},visibleSection:function(){return this.__visibleSection},dataFinishedLoading:function(D){this.removeAriaAlert();this.setValueForKey(true,"dataLoaded")},setVisibleSection:function(E){var F;var D=this.__visibleSection;if(D&&!!(F=$(D))&&F){Element.removeClassName(F,"open")}if(E&&!!(F=$(E))&&F){Element.addClassName(F,"open")}if(E&&!this.dataLoaded&&E==="u_cart"){this.createAriaAlert(document.createTextNode(Element.query("#utility-nav-loading .replaced").innerHTML||"Loading ..."));var G=this.data.refresh();G.addCallback(this.dataFinishedLoading.bind(this));G.addCallback(this.keyboardNavDataLoadCallback.bind(this))}this.__visibleSection=E},helpVisible:function(){return"u_help"===this.__visibleSection},accountVisible:function(){return"u_account"===this.__visibleSection},cartVisible:function(){return this.dataLoaded&&"u_cart"===this.__visibleSection},showSpinner:function(){return !this.dataLoaded&&"u_cart"===this.__visibleSection},data:DeferredJSON(),unsupportedCheckoutCheck:function(E){var D=this.valueForKeyPath("data.cart.unsupportedMessage");if(D){Event.stop(E);alert(D)}},onmouseenter:function(E){if(coherent.Browser.MobileSafari){return }var F="";if(this.__timer){window.clearTimeout(this.__timer);this.__timer=null}function D(){this.__timer=null;this.setValueForKey(F,"visibleSection")}switch(E.id){case"u_help":case"unav-help":F="u_help";break;case"u_account":case"unav-account":F="u_account";break;case"u_cart":case"unav-cart":F="u_cart";break;default:console.log("node= ",E);throw new Error("Invalid node ID")}if(F){this.__timer=D.bindAndDelay(this,150)}this.hoverNodeId=E.id},onmouseleave:function(E){if(E.id!==this.hoverNodeId){return }if(this.__timer){window.clearTimeout(this.__timer);this.__timer=null}function D(){this.__timer=null;this.lockedToNav=false;this.setValueForKey(null,"visibleSection")}this.__timer=D.bindAndDelay(this,600);this.hoverNodeId=""}}),A;function C(){if(!A){if(arguments.length>0){A=(B.apply(A,arguments))()}}return A}apple.utilitynav.UtilityNavViewController=B;apple.utilitynav.UtilityNavViewController.singleton=C})();Package("apple.widget");apple.widget.CountrySelector=Class.create(coherent.View,{mouseoverDelay:150,showDuration:250,mouseoutDelay:50,hideDuration:250,contentLoaded:false,trigger:coherent.Anchor("a.trigger",{action:"show"}),triggeredByKeyboard:false,potentialTriggeredByKeyboard:false,init:function(){this.getPreviousAndNextSiblings();var A=Element.query(".country-selector");if(A){var B=Element.assignId(A);this.viewElement().appendChild(A);this.countrySelector=new coherent.View(B)}this.positionCountrySelector();Event.observe(this.previousFocussableElement,"focus",this.hide.bind(this));Event.observe(this.nextFocussableElement,"focus",this.hide.bind(this));Event.observe(this.viewElement(),"mouseover",this.mouseover.bind(this));Event.observe(this.viewElement(),"mouseout",this.mouseout.bind(this));Event.observe(this.countrySelector.viewElement(),"click",this.selectCountry.bind(this));Event.observe(this.trigger.viewElement(),"focus",this.focusTriggeredByKeyboard.bind(this));Event.observe(this.trigger.viewElement(),"blur",this.blurTriggeredByKeyboard.bind(this));this.preloadCountrySelectorSprite.bindAndDelay(this,3000);this._touchstart=this.touchstart.bind(this);this.keyDownObserver=this.observeKeyDown.bind(this);if(this.countrySelector.viewElement().innerHTML.trim().length>0){this.contentLoaded=true}this.trigger.viewElement().setAttribute("aria-haspopup","true");this.trigger.viewElement().setAttribute("aria-owns","change-country-list");this.countrySelector.viewElement().setAttribute("aria-hidden","true");this.listOfCountries=Element.queryAll(".country-selector a");this.listOfCountriesLength=this.listOfCountries.length;this.lastCountryLink=this.listOfCountries[this.listOfCountriesLength-1];this.firstCountryLink=this.listOfCountries[0]},getPreviousAndNextSiblings:function(){var C=this.trigger.viewElement();var D=Element.queryAll(".apple-footer a");for(var B=0,A=D.length;B<A;B++){if(D[B]==C){this.previousFocussableElement=D[B-1];this.nextFocussableElement=D[B+1];return }}},positionCountrySelector:function(){var E=119;var D=this.trigger.viewElement().offsetWidth;var B=this.viewElement().previousSibling;while(B.nodeType!=1){B=B.previousSibling}var A=B.getElementsByTagName("a")[0].offsetWidth;var C=Math.round(D/2)+A-E;this.countrySelector.viewElement().style.left=C+"px"},preloadCountrySelectorSprite:function(){var A=this.trigger.viewElement();Element.addClassName(A,"preload-country-selector-sprite")},mouseover:function(){if(coherent.Browser.MobileSafari){return }this.showTimer=this.show.bindAndDelay(this,this.mouseoverDelay);if(this.hideTimer){window.clearTimeout(this.hideTimer);this.hideTimer=null}},mouseout:function(){if(coherent.Browser.MobileSafari){return }this.hideTimer=this.hide.bindAndDelay(this,this.mouseoutDelay);if(this.showTimer){window.clearTimeout(this.showTimer);this.showTimer=null}},touchstart:function(C){var A=Element.query(".apple-footer .country-selector");if(A.style.display=="block"){var B=C.target;do{if(B&&B===Element.query(".country-selector")){return }B=B.parentNode}while(B&&B!==document.body);this.hide()}},show:function(){this.countrySelector.viewElement().style.display="block";coherent.Animator.setStyles(this.countrySelector.viewElement(),{opacity:1},{duration:this.showDuration});this.enableCloseObservers();this.countrySelector.viewElement().setAttribute("aria-hidden","false");if(this.potentialTriggeredByKeyboard===true){this.triggeredByKeyboard=true;this.firstCountryLink.focus()}},hide:function(){var A=this.countrySelector.viewElement();coherent.Animator.setStyles(A,{opacity:0},{duration:this.hideDuration,callback:function(){A.style.display="none"}});if(this.triggeredByKeyboard){this.triggeredByKeyboard=false}this.disableCloseObservers();this.countrySelector.viewElement().setAttribute("aria-hidden","true")},focusTriggeredByKeyboard:function(){this.potentialTriggeredByKeyboard=true},blurTriggeredByKeyboard:function(){this.potentialTriggeredByKeyboard=false},enableCloseObservers:function(){Event.observe(document.body,"keydown",this.keyDownObserver);Event.observe(document.body,"touchstart",this._touchstart)},disableCloseObservers:function(){Event.stopObserving(document.body,"keydown",this.keyDownObserver);Event.stopObserving(document.body,"touchstart",this._touchstart)},observeKeyDown:function(B){var E=B.keyCode||B.which,A=B.shiftKey,C=Element.query("a.trigger"),D=B.target||B.srcElement;if(E==Event.KEY_ESC){this.hide();C.focus();if(D===C){this.triggeredByKeyboard=true}}if(E==Event.KEY_TAB&&D===this.firstCountryLink&&A===true){Event.stop(B);this.lastCountryLink.focus()}if(E==Event.KEY_TAB&&D===this.lastCountryLink&&A===false){Event.stop(B);this.firstCountryLink.focus()}},selectCountry:function(A){Event.stop(A);var B=A.target||A.srcElement;if(B.nodeName==="A"){this.country=B;this.reportEvent();this.redirect.bindAndDelay(this,500)}},reportEvent:function(){apple.metrics.fireMicroEvent({feature:"Country",action:"Selected: "+this.country.title})},redirect:function(){window.location=this.country.href}});Package("apple.widget");apple.widget.FooterView=Class.create(coherent.View,{mouseoverDelay:150,showDuration:250,mouseoutDelay:50,hideDuration:250,triggeredByKeyboard:false,potentialTriggeredByKeyboard:false,countrySelector:coherent.View(".country-selector"),countryListItem:coherent.View("#change-country"),__structure__:{"#mobile":coherent.Anchor({action:"deleteFormatCookie"}),"#format-switcher":coherent.View({visibleBinding:"showSwitcher"})},trigger:coherent.Anchor("a.trigger",{action:"show"}),init:function(){if(this.countrySelector!==null){this.initCountrySelector()}this.checkFormatCookie()},getPreviousAndNextSiblings:function(){var C=this.trigger.viewElement();var D=Element.queryAll(".apple-footer a");for(var B=0,A=D.length;B<A;B++){if(D[B]==C){this.previousFocussableElement=D[B-1];this.nextFocussableElement=D[B+1];return }}},initCountrySelector:function(){this.getPreviousAndNextSiblings();var A=Element.query(".country-selector");this.countryListItem.viewElement().appendChild(A);this.positionCountrySelector();Event.observe(this.previousFocussableElement,"focus",this.hide.bind(this));Event.observe(this.nextFocussableElement,"focus",this.hide.bind(this));Event.observe(this.countryListItem.viewElement(),"mouseover",this.mouseover.bind(this));Event.observe(this.countryListItem.viewElement(),"mouseout",this.mouseout.bind(this));Event.observe(document.body,"click",this.hide.bindAsEventListener(this));Event.observe(this.countrySelector.viewElement(),"click",this.selectCountry.bind(this));Event.observe(this.trigger.viewElement(),"focus",this.focusTriggeredByKeyboard.bind(this));Event.observe(this.trigger.viewElement(),"blur",this.blurTriggeredByKeyboard.bind(this));this.preloadCountrySelectorSprite.bindAndDelay(this,3000);this._touchstart=this.touchstart.bind(this);this.trigger.viewElement().setAttribute("aria-haspop","true");this.trigger.viewElement().setAttribute("aria-owns","change-country-list");this.countrySelector.viewElement().setAttribute("aria-hidden","true");this.listOfCountries=Element.queryAll(".country-selector a");this.listOfCountriesLength=this.listOfCountries.length;this.lastCountryLink=this.listOfCountries[this.listOfCountriesLength-1];this.firstCountryLink=this.listOfCountries[0]},positionCountrySelector:function(){var E=119;var D=this.trigger.viewElement().offsetWidth;var B=this.countryListItem.viewElement().previousSibling;while(B.nodeType!=1){B=B.previousSibling}var A=B.getElementsByTagName("a")[0].offsetWidth;var C=Math.round(D/2)+A-E;this.countrySelector.viewElement().style.left=C+"px"},preloadCountrySelectorSprite:function(){var A=this.trigger.viewElement();Element.addClassName(A,"preload-country-selector-sprite")},mouseover:function(){if(coherent.Browser.MobileSafari){return }this.showTimer=this.show.bindAndDelay(this,this.mouseoverDelay);if(this.hideTimer){window.clearTimeout(this.hideTimer);this.hideTimer=null}},mouseout:function(){if(coherent.Browser.MobileSafari){return }this.hideTimer=this.hide.bindAndDelay(this,this.mouseoutDelay);if(this.showTimer){window.clearTimeout(this.showTimer);this.showTimer=null}},touchstart:function(C){var A=Element.query(".apple-footer .country-selector");if(A.style.display=="block"){var B=C.target;do{if(B&&B===Element.query(".country-selector")){return }B=B.parentNode}while(B&&B!==document.body);this.hide()}},show:function(){this.countrySelector.viewElement().style.display="block";coherent.Animator.setStyles(this.countrySelector.viewElement(),{opacity:1},{duration:this.showDuration});this.enableCloseObservers();this.countrySelector.viewElement().setAttribute("aria-hidden","false");if(this.potentialTriggeredByKeyboard===true){this.triggeredByKeyboard=true;this.firstCountryLink.focus()}},hide:function(B){var C=B?(B.target||B.srcElement):undefined;if(C&&C===this.countrySelector.viewElement()||C===this.trigger.viewElement()){return }var A=this.countrySelector.viewElement();coherent.Animator.setStyles(A,{opacity:0},{duration:this.hideDuration,callback:function(){A.style.display="none"}});if(this.triggeredByKeyboard){this.triggeredByKeyboard=false}this.disableCloseObservers();this.countrySelector.viewElement().setAttribute("aria-hidden","true")},focusTriggeredByKeyboard:function(){this.potentialTriggeredByKeyboard=true},blurTriggeredByKeyboard:function(){this.potentialTriggeredByKeyboard=false},enableCloseObservers:function(){Event.observe(document.body,"keydown",this.observeKeyDown.bindAsEventListener(this));Event.observe(document.body,"touchstart",this._touchstart)},disableCloseObservers:function(){Event.stopObserving(document.body,"keydown",this.observeKeyDown.bindAsEventListener(this));Event.stopObserving(document.body,"touchstart",this._touchstart)},observeKeyDown:function(B){var E=B.keyCode,A=B.shiftKey,C=Element.query("a.trigger"),D=B.target||B.srcElement;if(E==Event.KEY_ESC){this.hide();C.focus();if(D===C){this.triggeredByKeyboard=true}}if(E==Event.KEY_TAB&&D===this.firstCountryLink&&A===true){Event.stop(B);this.lastCountryLink.focus()}if(E==Event.KEY_TAB&&D===this.lastCountryLink&&A===false){Event.stop(B);this.firstCountryLink.focus()}},selectCountry:function(A){Event.stop(A);var B=A.target||A.srcElement;if(B.nodeName==="A"){this.country=B;this.reportEvent();this.redirect.bindAndDelay(this,500)}},reportEvent:function(){apple.metrics.fireMicroEvent({feature:"Country",action:"Selected: "+this.country.title})},redirect:function(){window.location=this.country.href},deleteFormatCookie:function(A){var B=new Date();B.setDate(B.getDate()-1);document.cookie="mobile_oo=''; expires="+B.toUTCString()+"; path=/; domain=.apple.com";window.location.reload()},checkFormatCookie:function(){if(document.cookie.match("mobile_oo=")){this.setValueForKey(true,"showSwitcher")}else{this.setValueForKey(false,"showSwitcher")}}});window.apple.survey={alreadyShown:false,defaults:{trafficPercentage:15,surveyDelay:0},surveyButton:function(C){var A=C.getSurveyData();if(!A){return false}if(!A.cartValue||(!$("sidebar-summary-total")&&!$("cart-summary-order-total"))){this.surveyButtonBuild(C)}else{var B=Element.hasClassName(document.getElementsByTagName("body")[0],"checkout");var E=Element.hasClassName(document.getElementsByTagName("body")[0],"thankyou");function D(){if((B&&!E)||($("sidebar-summary-total")&&coherent.View.fromNode($("sidebar-summary-total"))&&$("sidebar-summary-total").innerHTML!=="")||($("cart-summary-order-total")&&coherent.View.fromNode($("cart-summary-order-total"))&&$("cart-summary-order-total").innerHTML!=="")){if(window.controller){window.controller.addObserverForKeyPath(window.apple.survey,null,"content.cart.summary.total",C)}window.apple.survey.surveyButtonBuild(C)}else{window.setTimeout(D,50)}}D()}return true},observeChangeForKeyPath:function(B,C,A){this.surveyButtonBuild(A)},surveyButtonBuild:function(C){var K=C.getSurveyData();var W=Storage();var B=new Date();var V=W.get("csat_last_surveyed_date");if(V){V=new Date(V);var A=180*1000*60*60*24;if(Math.ceil((B.getTime()-V.getTime())/A)>=1){C.surveyCallbackHide(this);return false}}var M=new Date(K.startDate);var F=new Date(K.endDate);if(B<M||B>F){C.surveyCallbackHide(this);return false}var O=K.surveyStart.split(":");var X=K.surveyEnd.split(":");var E=B.getHours();var b=B.getMinutes();if(E<O[0]||E>X[0]){C.surveyCallbackHide(this);return false}if((E==O[0])&&(b<O[1]||b>X[1])){C.surveyCallbackHide(this);return false}var L=["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"];var Y=L[B.getDay()];var G={};for(var T=0,R=K.activeDays.length;T<R;T++){G[K.activeDays[T]]=""}if(!Y in G){C.surveyCallbackHide(this);return false}if(K.operatingSystem.length){var I="windows";if(navigator.appVersion.indexOf("Mac")!=-1){I="macosx"}if(navigator.appVersion.indexOf("X11")!=-1){I="linux"}if(navigator.appVersion.indexOf("Linux")!=-1){I="linux"}if(navigator.appVersion.indexOf("SunOS")!=-1){I="sunos"}var a={};for(T=0,R=K.operatingSystem.length;T<R;T++){a[K.operatingSystem[T]]=""}if(!I in a){C.surveyCallbackHide(this);return false}}var N;if(K.trafficPercentage){N=parseInt(K.trafficPercentage,10)}else{N=window.apple.survey.defaults.trafficPercentage}var H=Math.ceil(Math.random()*100);if(H>N&&!this.alreadyShown){C.surveyCallbackHide(this);return false}if(K.referrer){if(document.referrer.indexOf(K.referrer)===-1){C.surveyCallbackHide(this);return false}}var J;var P=Element.hasClassName(document.getElementsByTagName("body")[0],"checkout");var Q=Element.hasClassName(document.getElementsByTagName("body")[0],"thankyou");var U=Element.hasClassName(document.getElementsByTagName("body")[0],"cart");if(K.cartValue&&K.cartActualValue){J=parseFloat(K.cartActualValue.replace(/[^\d.]/g,""));if(parseFloat(K.cartValue)>J){C.surveyCallbackHide(this);return false}}else{if(K.cartValue&&(P||Q||U)){J=parseFloat(window.controller.valueForKeyPath("content.cart.summary.total").replace(/[^\d.]/g,""));if(parseFloat(K.cartValue)>J){C.surveyCallbackHide(this);return false}}}function Z(){var c=window.s;var d;if(C.surveyElementId&&$(C.surveyElementId)){d=$(C.surveyElementId)}else{d=C.surveyElement();Event.observe(d.getElementsByTagName("a")[0],"click",function(){S(C)})}return d}function S(c){apple.metrics.fireMicroEvent({eVar:c.surveyEVar(),feature:c.surveyFeature(),action:"selected"});W.set("csat_last_surveyed_date",B);c.surveyCallbackHide(this)}var D;if(K.timeSpentOnPage){D=1000*K.timeSpentOnPage}else{D=window.apple.survey.defaults.surveyDelay}window.setTimeout(function(){C.surveyCallback(Z(C))},D);this.alreadyShown=true;return true}};coherent.DynamicMenu=Class.create(coherent.View,{exposedBindings:["model"],init:function(){this.addObserverForKeyPath(this,this.updateState,"model.open")},updateState:function(B){var A=this.valueForKeyPath("model.open");if(A){this.openMenu()}else{this.closeMenu()}this.setValueForKeyPath(A,"model.contentUpdated");this.setValueForKeyPath(A,"model.isOpen")},closeMenu:function(A){Element.removeClassName(this.viewElement(),"visible");if(this.model.manager){this.model.manager.clear()}},openMenu:function(C){Element.addClassName(this.viewElement(),"visible");if(this.model.contentURL&&!this.model.response){this.addObserverForKeyPath(this,this.model.contentResponse,"model.response");var B=XHR.get(this.model.contentURL);B.addMethods(this.getResponseDelegate(),this.getResponseDelegate());this.viewElement().innerHTML="<div class='spinner'></div>"}if(this.model.manager){var A=this.model.manager.getLastView();if(A){A.setValueForKeyPath(false,"model.open")}this.model.manager.setNextView(this)}},getResponseDelegate:function(){var A=this;return function(B){A.setValueForKeyPath(B,"model.response");A.setValueForKeyPath(B,"model.contentUpdated")}}});coherent.DynamicMenuManager=Class.create({lastId:null,setNextView:function(A){this.lastId=A.viewElement().id},clear:function(){this.lastId=null},getLastId:function(){return this.lastId},getLastElem:function(){return $(this.getLastId())},getLastView:function(){if(this.getLastElem()){return coherent.View.fromNode(this.getLastElem())}}});coherent.CompoundLink=Class.create(coherent.View,{exposedBindings:["menuModel"],__structure__:{".dynamic-menu":coherent.DynamicMenu({modelBinding:"*.menuModel"}),"a[target!=_blank]":coherent.Anchor({action:"resetMenu"}),".handle a":coherent.Anchor({action:"click"})},init:function(){Event.observe(this.viewElement(),"mouseover",this.viewOver.bindAsEventListener(this));Event.observe(this.viewElement(),"mouseout",this.viewOut.bindAsEventListener(this))},getMenu:function(){return Element.query(this.viewElement(),".dynamic-menu")},viewOver:function(){window.clearTimeout(this.valueForKey("viewOverTimeout"))},viewOut:function(){var A=this;var B=window.setTimeout(function(){A.setValueForKeyPath(false,"menuModel.open")},250);this.setValueForKey(B,"viewOverTimeout")},click:function(B,A){Event.stop(A);if(this.valueForKeyPath("menuModel.open")){this.setValueForKeyPath(false,"menuModel.open");Element.setStyles(this.viewElement(),{"z-index":"auto"})}else{this.setValueForKeyPath(true,"menuModel.open");Element.setStyles(this.viewElement(),{"z-index":2000})}},resetMenu:function(){var A=this;var B=window.setTimeout(function(){A.setValueForKeyPath(false,"menuModel.open");Element.setStyles(A.viewElement(),{"z-index":"auto"})},350);this.setValueForKey(B,"viewOverTimeout");this.setValueForKeyPath(false,"handleDown")}});coherent.CompoundButton=Class.create(coherent.View,{exposedBindings:["menuModel"],__structure__:{".handle":coherent.View({action:"click"}),".dynamic-menu":coherent.DynamicMenu({modelBinding:"*.menuModel"})},getPrimaryButton:Part(".button"),getHandle:Part(".handle"),getMenu:Part(".dynamic-menu"),init:function(){if(this.getHandle()){coherent.page.addTrackingInfo(this.viewElement().id,{owner:this,onmouseenter:this.onmouseenter,onmouseleave:this.onmouseleave});this.addObserverForKeyPath(this,this.updateHandle,"menuModel.open");this.addObserverForKeyPath(this,this.reposition,"menuModel.contentUpdated");this.addObserverForKeyPath(this,this.updateHandle,"handleDown");Element.addClassName(this.viewElement(),"init");Element.addClassName(this.getPrimaryButton(),"init");Element.addClassName(this.getHandle(),"init")}},onmouseenter:function(A){window.clearTimeout(this.valueForKey("viewOverTimeout"));this.setValueForKeyPath(true,"handleDown")},onmouseleave:function(A){this.resetMenu()},resetMenu:function(){var A=this;var B=window.setTimeout(function(){A.setValueForKeyPath(false,"menuModel.open");Element.setStyles(A.viewElement(),{"z-index":"auto"})},350);this.setValueForKey(B,"viewOverTimeout");this.setValueForKeyPath(false,"handleDown")},updateHandle:function(A){if(this.getHandle()){if(this.valueForKeyPath("menuModel.open")||this.valueForKeyPath("handleDown")){Element.addClassName(this.getHandle(),"hover")}else{Element.removeClassName(this.getHandle(),"hover")}}},click:function(B,A){Event.stop(A);if(this.valueForKeyPath("menuModel.open")){this.setValueForKeyPath(false,"menuModel.open");Element.setStyles(this.viewElement(),{"z-index":"auto"})}else{this.setValueForKeyPath(true,"menuModel.open");Element.setStyles(this.viewElement(),{"z-index":20000})}},reposition:function(E){if(E.newValue){Element.setStyles(this.getMenu(),{width:"auto"});var B=Element.getRect(this.getPrimaryButton());var A=Element.getRect(this.getHandle());var D=Element.getRect(this.getMenu());var C=B.width;Element.setStyles(this.getMenu(),{width:(D.width>C?D.width:C)+"px",top:(A.height+1)+"px"})}},findFormFromElement:function(B){var A=B.parentElement||B.parentNode;if(A.tagName=="FORM"){return A}else{return this.findFormFromElement(A)}},teardown:function(){if(this.getHandle()){coherent.View.fromNode(this.getHandle()).teardown();coherent.View.fromNode(this.getMenu()).teardown()}this.base()}});apple.SocialSharingCompoundLink=Class.create(coherent.CompoundLink,{__structure__:{"a[target]":coherent.Anchor({action:"linkClicked"})},linkClicked:function(E,A){var D="";var B=new coherent.URL(document.location.href);if(B){var C=B.path.match(/(\w{5,7}\/\w)$/);if(C.length>1){D=C[1]}}apple.metrics.fireMicroEvent({eVar:"eVar6",part:D,feature:"Sharing",action:E.viewElement().className+" post"});this.resetMenu()}});apple.initSocialSharingCompoundLinks=function(){var D=new coherent.DynamicMenuManager();var A=Element.queryAll(".compound-link.social-sharing");for(var C=0;C<A.length;C++){var B={menuModel:{manager:D}};new apple.SocialSharingCompoundLink(A[C],B,{menuModelBinding:"*.menuModel"})}};Event.onLoad(apple.initSocialSharingCompoundLinks);coherent.FormField=Class.create(coherent.View,{exposedBindings:["value","name"],observeValueChange:function(B){var A=this.viewElement();A.value=B.newValue},observeNameChange:function(D,C,B){var A=this.viewElement();A.name=D.newValue}});apple.AddToCartCompoundButton=Class.create(coherent.CompoundButton,{exposedBindings:["model","modes"],__structure__:{"a[target]":coherent.Anchor({action:"linkClicked"}),"button.button":coherent.FormField({nameBinding:"$modes.$model.primaryButtonMode$.name",titleBinding:"$modes.$model.primaryButtonMode$.title",classBinding:"$modes.$model.primaryButtonMode$.buttonClass"}),".handle":coherent.View({classBinding:"$modes.$model.primaryButtonMode$.handleClass",action:"click"}),"button.button .label":coherent.View({textBinding:"$modes.$model.primaryButtonMode$.html"}),".BuyNow":coherent.View({visibleBinding:"model.buyNowEnabled",enabledBinding:"model.buyNowAvailable"}),".BuyNow button":coherent.FormField({nameBinding:"$modes.$model.buyNowButtonMode$.name",titleBinding:"$modes.$model.buyNowButtonMode$.title",textBinding:"$modes.$model.buyNowButtonMode$.html",enabledBinding:"model.buyNowAvailable"}),".BuyNow-SignUp":coherent.View({visibleBinding:"model.buyNowEnabled(not)",enabledBinding:"model.buyNowAvailable"})},init:function(){this.base();var A=$("gift-checkbox");if(A){Event.observe(A,"click",this.giftStateChanged.bind(this))}},giftStateChanged:function(A){var B=A.target?A.target.checked:A.srcElement.checked;this.setValueForKeyPath(!B,"model.buyNowAvailable");if(this.model.buyNowEnabled){if(!this.model.buyNowAvailable){this.setValueForKeyPath("default","model.primaryButtonMode");this.setValueForKeyPath("buynow","model.buyNowButtonMode")}else{this.setValueForKeyPath("buynow","model.primaryButtonMode");this.setValueForKeyPath("default","model.buyNowButtonMode")}}},linkClicked:function(D,A){var B=this.findFormFromElement(D.viewElement())["product"];var C=B?B.value:"";apple.metrics.fireMicroEvent({eVar:"eVar6",part:C,feature:"Sharing",action:D.viewElement().className+" post"});this.resetMenu();if(coherent.Browser.IE&&coherent.Browser.IE==7){this.base()}}});apple.initAddToCartCompoundButtons=function(){var J=new coherent.DynamicMenuManager();var H=Element.queryAll(".compound-button.add-to-cart");for(var E=0;E<H.length;E++){var D=coherent.View.fromNode(H[E]);if(D){D.teardown()}var B=Element.query(H[E],"button.button");var A=Element.query(H[E],"button.handle");var G=Element.query(B,".label");var K=$("gift-checkbox");var C=apple.cookie("aosqbe");var F={menuModel:{manager:J},buttonModel:{buyNowAvailable:K?!K.checked:true,buyNowEnabled:C?true:false,primaryButtonMode:"default"},buttonModes:{"default":{name:B.name,title:B.title,value:B.value,html:G.textContent||G.innerText,buttonClass:B?B.className:"",handleClass:A?A.className:""}}};var I=Element.query(H[E],".BuyNow button");if(I){F.buttonModel.buyNowButtonMode="buynow";F.buttonModes.buynow={name:I.name,title:I.title,value:I.value,html:I.textContent||I.innerText,buttonClass:"button transactional",handleClass:"handle transactional"}}if(C&&I&&F.buttonModel.buyNowAvailable){F.buttonModel.primaryButtonMode="buynow";F.buttonModel.buyNowButtonMode="default"}new apple.AddToCartCompoundButton(H[E],F,{modelBinding:"*.buttonModel",modesBinding:"*.buttonModes",menuModelBinding:"*.menuModel"})}};Event.onLoad(apple.initAddToCartCompoundButtons);
