/*

    Copyright © 1998-2008 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]}}})();if("undefined"!==typeof dojo){dojo.__require=dojo.require;dojo.__provide=dojo.provide;dojo.require=function(a){if(a.indexOf("apple")===0){return}else{dojo.__require(a)}};dojo.provide=function(a){if(a.indexOf("apple")===0){return}else{dojo.__provide(a)}};dojo.byId=$}else{dojo={require:function(){return},provide:function(){return},byId:$}}coherent.strings["marker.image.placeholder"]="/rs/img/block1px.gif";Package("apple.util");Math.clamp=function(c,b,a){return Math.min(Math.max(b,c),a)};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.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)}});if(coherent.Browser.IE){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},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(!coherent.Browser.IE){return function(f,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 f.dispatchEvent(d)}}else{return function(f,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 f.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}});Package("apple.metrics");apple.metrics.Metrics=function(a){this.config=a;this.cookieProps=Object.applyDefaults({},apple.metrics.Metrics.CONSTANTS.cookieDefaults);this.metrics=this.getObjectCookie()||{};this.initStore()};apple.metrics.Metrics.CONSTANTS={cookieDefaults:{name:"asmetrics",path:"/",domain:window.location.host,expires:0.0208333333,secure:false}};apple.metrics.Metrics.prototype.setObjectCookie=function(a){apple.cookie.objectCookie(this.cookieProps.name,a,this.cookieProps)};apple.metrics.Metrics.prototype.getObjectCookie=function(){return apple.cookie.objectCookie(this.cookieProps.name)};apple.metrics.Metrics.prototype.pageName=function(a){return a+(this.pageSuffix()||"")};apple.metrics.Metrics.prototype.mark=function(){if(this.config.isHome){this.getStore().vh=true}this.setObjectCookie(this.metrics)};apple.metrics.Metrics.prototype.hasReturnedHome=function(){return this.getStore().vh};apple.metrics.Metrics.prototype.pageSuffix=function(){if(this.config.isHome){return" - "+(this.hasReturnedHome()?"Return":"First")}else{return null}};apple.metrics.Metrics.prototype.getStore=function(){if(!this.metrics.store){this.initStore()}return this.metrics.store};apple.metrics.Metrics.prototype.initStore=function(){var a=this.metrics.store;if(a&&a.sid!=this.config.storeId){a=null}if(!a){a={sid:this.config.storeId};this.metrics.store=a}return a};apple.metrics.Metrics.reportCustomLink=function(f,e){var c=window.s;if(!c){return}try{var d=c.linkTrackVars;var b=c.linkTrackEvents;var a=c.eVar5;if(e.indexOf("AOS:")!==0){e="AOS:"+e}c.linkTrackVars="eVar5";c.linkTrackEvents="None";c.eVar5=e;c.tl(f,"o",apple.metrics.Metrics.getCustomLinkName(e))}finally{c.linkTrackVars=d;c.linkTrackEvents=b;c.eVar5=a}};apple.metrics.Metrics.getCustomLinkName=function(b){var a=b.split("|");if(a.length<=4){return b}return b.substring(b.indexOf(a[2]))};apple.metrics.fireMicroEvent=function(c){var f=window.s||null;if(!f){return}if(!c.feature||!c.action){throw new Error("Microevents require a feature and an action.")}c=Object.applyDefaults(c,{page:f.pageName,slot:"",part:""});var b=[c.page,c.slot,c.feature,c.part,c.action].join(" | ");var a=[c.feature,c.part,c.action].join(" | ");var e={lnk:f.lnk,linkType:f.linkType,linkName:f.linkName,linkTrackVars:f.linkTrackVars,linkTrackEvents:f.linkTrackEvents,eVar5:f.eVar5};f.linkTrackVars="eVar5";f.linkTrackEvents="None";f.eVar5=b;f.tl(c.node||null,"o",a);for(var d in c){f[d]=e[d]}};apple.metrics.fireEvent=function(a){var d=window.s||null;var c={};var b;if(!d){return}for(b in a){c[b]=d[b];d[b]=a[b]}d.t();for(b in a){d[b]=c[b]}};Package("apple");window.JSONRPC=(function(){function a(j,i){var l=document.createElement("form");l.action=j;l.method="post";var m;var h;var n={};function k(q,p,r){var o=document.createElement("input");q.appendChild(o);o.type="hidden";o.name=p;o.value=r}for(m in i){h=i[m];if(i[m]===n[m]){continue}if(h instanceof Array){h.forEach(function(o){k(l,m,o)})}else{k(l,m,h)}}l.style.position="absolute";l.style.visibility="hidden";l.style.height="0px";l.style.width="0px";document.body.appendChild(l);l.submit()}function f(i,h){if(!i){return}h=Object.toQueryString(h);if(h){if(i.indexOf("?")){i+="&"}else{i+="?"}i+=h}window.open(i,"_top")}function g(i){if(!i){return false}var n=false;var h=parseInt(i.head.status,10);switch(h){case 301:case 302:case 303:case 304:case 305:case 306:case 307:n=true;break;default:break}if(!n){return false}var l=i.head.data;var k=l.url;var m=l.method;var j=l.args;if("post"===m){a(k,j)}else{f(k,j)}return true}function d(i){if(!i){return true}var h=parseInt(i.head.status,10);if(h>=400&&h<600){return true}return false}function c(i,h){var k;if(h.head&&h.head.data&&h.head.data.metrics){k=h.head.data.metrics}else{if(h.body&&h.body.metrics){k=h.body.metrics;delete h.body.metrics}}if(!k&&!i){return}var j=Object.extend(i||{},k);apple.metrics.fireEvent(j)}var b={sync:false,responseContentType:"application/json"};function e(m,j,l,i){function k(n){if(g(n)){return new Error("Response redirected")}if(d(n)){var o=new Error("Response returned errors");o.response=n;return o}c(i.metrics,n);return n.body}i=Object.applyDefaults(i,b);var h=XHR.request(m,j,l,i);h.addCallback(k);return h}e.get=function(i,j,h){return e("GET",i,j,h)};e.post=function(i,j,h){return e("POST",i,j,h)};return e})();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));Package("apple.cookie");apple.cookie=function(a,j,i){var h=document.cookie;if(arguments.length==1){if(a){var k=h.lastIndexOf(a+"=");if(k==-1){return null}var b=k+a.length+1;var f=h.indexOf(";",k+a.length+1);if(f==-1){f=h.length}return decodeURIComponent(h.substring(b,f))}else{return null}}else{if(a&&j){i=i||{};j=encodeURIComponent(j);var e=i.expires;if(typeof(e)=="number"){var g=new Date();g.setTime(g.getTime()+(e*24*60*60*1000));e=g}document.cookie=a+"="+j+(e?"; expires="+e.toUTCString():"")+(i.path?"; path="+i.path:"")+(i.domain?"; domain="+i.domain:"")+(i.secure?"; secure":"")}return null}};apple.cookie.deleteCookie=function(a){if(a){apple.cookie(a,null,{expires:0})}};apple.cookie.objectCookie=function(a,e,c){if(arguments.length==1){var b=apple.cookie(a);return apple.cookie.decodeObject(b)}var d=apple.cookie.encodeObject(e);apple.cookie(a,d,c);return null};apple.cookie.encodeObject=function(a){if(!a){return null}return escape(apple.data.json.stringify(a))};apple.cookie.decodeObject=function(a){if(!a){return null}try{return apple.data.json.parse(unescape(a))}catch(b){return null}};window.DeferredJSON=Class.create(coherent.KVO,{constructor:function(a){Object.extend(this,a)},__factory__:function(d){var b=Array.from(arguments);var a=this;function c(){}return function(){if(d){var e;if("extractContent" in d&&"string"===typeof(d.extractContent)){e=this[d.extractContent];d.extractContent=e.bind(this)}if("setCallback" in d&&"string"===typeof(d.setCallback)){e=this[d.setCallback];d.setCallback=e.bind(this)}}c.prototype=a.prototype;var f=new c();a.prototype.constructor.apply(f,b);return f}},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;this.setValueForKey(true,"loading");var e=JSONRPC.post(this.url(),a);e.addMethods(this.set.bind(this),this.failure.bind(this));return e},failure:function(a){this.setValueForKey(false,"loading");return a},set:function(e){if(!e.url){throw new Error("Invalid DeferredJSON format: missing url key")}this.setUrl(e.url);if(!e.content&&!e.updates){return this.refresh()}this.setValueForKey(false,"loading");var c=e.content||this.__originalContent||{};if(!c.addObserverForKeyPath){c=coherent.KVO.adaptTree(c)}if(e.updates){var a;var g;var f;var d;for(a in e.updates){g=e.updates[a];d=g.value;if("object"===coherent.typeOf(d)&&!d.addObserverForKeyPath){d=coherent.KVO.adaptTree(d)}switch(g.type){case"set":c.setValueForKeyPath(d,a);break;case"insert":f=c.valueForKeyPath(a);f.insertObjectsAtIndexes(d,g.indexes);break;case"delete":f=c.valueForKeyPath(a);f.deleteObjectsAtIndexes(g.indexes);break;case"update":f=c.valueForKeyPath(a);f.replaceObjectsAtIndexes(d,g.indexes);break;default:throw new Error("Invalid update type ("+g.type+") for keypath: "+a)}}return e}function b(l){this.__originalContent=l;var h=l.mutableKeys();var j;var m;function i(n){this.willChangeValueForKey(n);this[n]=l[n]}function k(n){this.didChangeValueForKey(n)}h.forEach(i,this);h.forEach(k,this);if(this.setCallback){this.setCallback(l)}return l}if(this.extractContent){c=this.extractContent(c)}if(c instanceof coherent.Deferred){c.addCallback(b.bind(this));return c}else{return b.call(this,c)}}});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 b=window.navigator.plugins;var a=b?b.length:0;if(b&&a){var f;for(f=0;f<a;++f){var g=b[f];var c=g.name.match(/quicktime\D*([\.\d]*)/i);if(c&&c[1]){return(this._version=c[1])}}}else{try{var d=new window.ActiveXObject("QuickTimeCheckObject.QuickTimeCheck");this._version=Number(d.QuickTimeVersion.toString(16).charAt(0))}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){return true}if(e>g){return false}return a(f.slice(1),h.slice(1))}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(f){try{return[f,a["Get"+f]()].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.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 j=10;f<g.length;f++){window.setTimeout(function(){var i=g[f];return function(){c(i)}}(),j);j+=10}}}();Event.onDomReady(apple.behavior.Striper);Package("apple.behavior");apple.behavior.TextFieldPlaceholder=(function(){if(!(coherent&&coherent.TextField)){return null}var a="placeholder";var d="field-with-placeholder";var k=Element.regexForClassName(d);var j=coherent.TextField.prototype;var b=j.init;var f=j.onkeydown;var l=j.becomeFirstResponder;var h=j.resignFirstResponder;var m=j.setMarkerValue;var n=j.clearMarkerValue;coherent.TextField.prototype.init=o;function q(p){var u=p.viewElement();var t=Element.query('label[for="'+u.id+'"].'+a);if(!t&&p.nullPlaceholder&&p.nullPlaceholder.toString()){t=document.createElement("label");t.setAttribute("for",u.id);t.htmlFor=u.id;t.innerHTML="<span>"+p.nullPlaceholder+"</span>";t.className=a}else{if(t){p.nullPlaceholder=t.getElementsByTagName("span")[0].firstChild.nodeValue}else{return false}}p.label=t;var v=u.parentNode;if(v.nodeName.toUpperCase()!="SPAN"){v=document.createElement("span");u.parentNode.replaceChild(v,u)}if(!k.test(v.className)){Element.addClassName(v,d)}v.appendChild(t);v.appendChild(u);return true}function g(p){if(q(p)){p.onkeydown=e;p.becomeFirstResponder=c;p.resignFirstResponder=i;p.setMarkerValue=s;p.clearMarkerValue=r;Event.observe(window,"load",function(){if(p.viewElement().value){p.clearMarkerValue()}(function(){if(p.viewElement().value){p.clearMarkerValue()}}).delay(100)})}}function o(){b.call(this);g(this);if(this.viewElement().value){this.clearMarkerValue()}}function e(p){f.call(this,p);var t=p.keyCode;if(Event.isAlphaNumKey(t)||t==32){this.clearMarkerValue()}}function c(){coherent.Animator.addClassName(this.label,"focus",{duration:200});return l.call(this)}function i(p){this.setMarkerValue("nullPlaceholder");return h.call(this,p)}function s(p){if(p=="nullPlaceholder"){if(!this.viewElement().value){this.label.style.display=""}coherent.Animator.setClassName(this.label,"placeholder",{duration:200})}}function r(){this.label.style.display="none";Element.addClassName(this.label,"hidden")}return function(p){if(p instanceof coherent.TextField){g(p)}}})();Package("apple.data");apple.data.json=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}if(typeof value.toJSON==="function"){return stringify(value.toJSON())}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||"null")}return"["+a.join(",")+"]"}if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}";default:return"null"}}return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n}}}}return filter(k,v)}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof filter==="function"?walk("",j):j}throw new SyntaxError("parseJSON")}}}();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,n,h,o){var p=this;var b;var e=this.config.duration;var k=g.length;var j;var f=Math.round(1000/this.config.frameRate);for(j=0;j<k;++j){if("setup" in g[j]){g[j].setup()}}function m(){p._timer=0;for(j=0;j<k;++j){if("finish" in g[j]){g[j].finish(p.t)}}if(o){o(p.t)}}function d(){var i=(new Date()).getTime()-b;if(i>e){i=e}p.t=Math.round(i/e*1000)/1000;for(j=0;j<k;++j){g[j](p.t)}if(i==e){m();return}p._timer=window.setTimeout(a,f)}function l(){var i=(new Date()).getTime()-b;if(i>e){i=e}p.t=1-i/e;for(j=0;j<k;++j){g[j](p.t)}if(i==e){m();return}p._timer=window.setTimeout(a,f)}var a=d;if(n<0){a=l;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(c){var b=$(this._measureDiv);if(!b){b=document.createElement("div");this._measureDiv=Element.assignId(b);b.style.position="relative";var a=$(this.config.id);a.appendChild(b)}c._originalWidth=c.style.width;c._originalHeight=c.style.height;if(c.style.width&&c.style.height){return}var g=Element.getStyle(c,"display");var d=("none"==g);var f=c.parentNode;if(d){f.removeChild(c);b.appendChild(c);var i=c.style.display;c.style.display="block"}var k=Element.getStyles(c,["width","height","paddingTop","paddingRight","paddingBottom","paddingLeft"]);var j=parseInt(k.width||0,10)-parseFloat(k.paddingLeft||0,10)-parseFloat(k.paddingRight||0,10);var e=parseInt(k.height||0,10)-parseFloat(k.paddingTop||0,10)-parseFloat(k.paddingBottom||0,10);c.style.width=j+"px";c.style.height=e+"px";if(d){c.style.display=i;b.removeChild(c);f.appendChild(c)}},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");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(i){return null!==i&&"undefined"!=typeof(i)});var f=c.length;var e=0;var b=0;var h=0;var j=[];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;j[d]=b}function a(k){if(e==f){return}var i=((k*b)-g[e])/c[e].duration;if(i>1){i=1}c[e](i);if(i<1){return}if("finish" in c[e]){c[e].finish(i)}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(i){};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(i){var k=c.style;var j;var g;i=d(i);k.height=(j=Math.round(i*e.height+f.height))+"px";k.width=(g=Math.round(i*e.width+f.width))+"px";c.width=g;c.height=j}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(l){var g;var j;var i=c.style;var k=l?b:f;i.height=(j=Math.round(k.height))+"px";i.width=(g=Math.round(k.width))+"px";c.height=j;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.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(p){if(p<0){p=0}else{if(p>1){p=1}}p=Math.round(p*100)/100;return function(o){Element.setOpacity(o,p)}}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.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.open(b,"_top")}};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.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=Class.create(coherent.View,{__viewClassName__:"apple.AnimatedText",animated:true,observeVisibleChange:function(h,j,c){var g=this.viewElement();var a={width:g.scrollWidth,height:g.scrollHeight};var f;var i;var e=("none"!==Element.getStyle(g,"display"));var b=!!h.newValue;var d=(parseFloat(Element.getStyle(g,"padding-top"))||0)+(parseFloat(Element.getStyle(g,"padding-bottom"))||0);if(b===e){return}Element.makeClipping(g);if(h.newValue){g.style.height="0px";g.style.display="";coherent.Animator.setStyles(g,{height:g.scrollHeight-d},{duration:300,curve:coherent.easing.inOutSine,callback:function(){g.style.height="";Element.undoClipping(g)}})}else{g.style.height=(g.scrollHeight-d)+"px";coherent.Animator.setStyles(g,{height:0},{duration:300,curve:coherent.easing.inOutSine,callback:function(){g.style.display="none";g.style.height="";Element.undoClipping(g)}})}},translateValue:function(c){var a=this.viewElement();var b=true;if(this.formatter){c=this.formatter.stringFromValue(c)}switch(c){case"":case null:case undefined:c=this.attributeOrProperty("nullPlaceholder");break;case coherent.Markers.NoSelection:c=this.attributeOrProperty("noSelectionPlaceholder");break;case coherent.Markers.MultipleValues:c=this.attributeOrProperty("multipleValuesPlaceholder");break;default:c=String(c);b=false;break}if(b){Element.addClassName(a,coherent.Style.kMarkerClass)}else{Element.removeClassName(a,coherent.Style.kMarkerClass)}return c},observeTextChange:function(f,e,b){var a=this.viewElement();var c=this.translateValue(f.newValue);if(!this.animated||"none"===Element.getStyle(a,"display")){var d=document.createTextNode(c);a.innerHTML="";a.appendChild(d);return}if(c===a.innerText){return}coherent.Animator.innerText(a,c,300)},observeHtmlChange:function(f,e,b){var a=this.viewElement();var c=this.translateValue(f.newValue);if(!this.animated||"none"===Element.getStyle(a,"display")){if(c!==f.newValue){var d=document.createTextNode(c);a.innerHTML="";a.appendChild(d);return}a.innerHTML=c;return}if(c!=f.newValue){this.observeTextChange(f,e,b);return}if(c.trim()===String(a.innerHTML).trim()){return}coherent.Animator.innerHTML(a,c,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 d={p:"apple.widget.AutoCompleter.processData"};for(var i in apple.widget.AutoCompleter.requestParams){if(!(i in d)){d[i]=[]}for(var g in apple.widget.AutoCompleter.requestParams[i]){d[i].push(g)}}var b=apple.widget.AutoCompleter.requestURL;var h=(b.indexOf("?")!=-1)?"&":"?";b+=h+Object.toQueryString(d);var a=document.createElement("script");a.src=b;function e(){apple.widget.AutoCompleter.requestCallback=function(){}}apple.widget.AutoCompleter.requestCallback=function(c){window.clearTimeout(apple.widget.AutoCompleter.requestTimer);apple.widget.AutoCompleter.requestTimer=null;apple.widget.AutoCompleter.processData(c)};apple.widget.AutoCompleter.requestTimer=window.setTimeout(e,10000);document.getElementsByTagName("HEAD")[0].appendChild(a)};apple.widget.AutoCompleter.processData=function(d){apple.widget.AutoCompleter.data=d;var e=apple.widget.AutoCompleter.requestParams;for(var g in e){for(var b in e[g]){for(var a=0;a<e[g][b].length;a++){apple.widget.AutoCompleter.create(e[g][b][a],g,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 j=0;j<a;++j){c[f[j]]=true}}function h(i){return i.id in c}function d(){var j=[];for(var k=0;k<a;++k){j.push(document.getElementById(f[k]))}return j}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(j){if(j in this._partCache){return this._partCache[j]()}var f=this.widget();var l=j.split(".");var b;var h;var a=[];var e;if(0===l.length||2<l.length){return[]}if(1==l.length){b=f.getElementsByTagName(l[0]);h=a.length=b.length;for(e=0;e<h;++e){a[e]=Element.assignId(b[e])}}else{var k=[];var g=0;var c=new RegExp("(?:^|\\s+)"+l[1]+"(?:\\s+|$)");b=f.getElementsByTagName(l[0]||"*");h=k.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);k[g]=d;++g}a.length=g;k.length=g;b=k}this._partCache[j]=_makePartFinder(a);return Array.from(b)}});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><img src="/rs/img/block1px.gif" alt=""></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.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@mac.com",submitUrl:"email-server-reply.txt",statusUrl:"email-server-status.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.checkStatus();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.checkStatus=function(){function a(b){this.setStatus(ServerStatus[b],null,true)}this.rpc(this.config.statusUrl,a.bind(this))};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};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();for(var d=0;d<b.length;d++){var e=$(b[d]);e.setAttribute("autocomplete","off");Event.observe(e,"onkeyup",(function(f){this.valueChanged(f)}).bind(this));Event.observe(e,"onchange",(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 e=$(this.getEngraveImage());var c=this.getBaseUrl();var a=this.getTextFields();for(var b=0;b<a.length;b++){var d=$(a[b]);c+=this.getLineArgument(d.value,b)}if(e){e.setAttribute("src",c)}};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.FooterCountrySelector=Class.create(coherent.View,{__structure__:{"#f_country > a":coherent.Anchor({action:function(){}})},init:function(){Event.observe($("f_country"),"mouseover",this.countryShow.bind(this));Event.observe($("f_country"),"mouseout",this.countryFade.bind(this))},countryShow:function(){var b=$("choose_country");function a(){if(b.style.display!==""){Element.addClassName(b,"invisible");b.style.display=""}coherent.Animator.removeClassName(b,"invisible",{duration:300})}this.showTimer=a.bindAndDelay(this,150);if(this.hideTimer){window.clearTimeout(this.hideTimer);this.hideTimer=null}},countryFade:function(){var a=$("choose_country");function b(){function c(){a.style.display="none";Element.removeClassName(a,"invisible")}coherent.Animator.addClassName(a,"invisible",{duration:400,callback:c})}this.hideTimer=b.bindAndDelay(this,50);if(this.showTimer){window.clearTimeout(this.showTimer);this.showTimer=null}}});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].fullImage.src)}else{this.getActiveImage().src=this.config.images[a].fullImage.src}}else{if(c==this.getFxPan()){if(this.swoosher){this.panImage(b,this.config.images[a].fullImage.src)}else{this.getActiveImage().src=this.config.images[a].fullImage.src}}}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;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;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.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);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(c){var b;b=document.createElement("a");b.className="prev";b.href="#";b.onclick=this.prevButtonClicked.bindAsEventListener(this);this._prevButtonId=Element.assignId(b);c.appendChild(b);b=document.createElement("a");b.className="next";b.href="#";b.onclick=this.nextButtonClicked.bindAsEventListener(this);this._nextButtonId=Element.assignId(b);c.appendChild(b)};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._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._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{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.Gifting={};apple.widget.Gifting.selectGiftCheckbox=function(a,d){var c=$(a);var b=$(d);if(c&&b){if(c.checked){Element.hide(b)}else{Element.show(b)}}};apple.widget.Gifting.selectLearnMoreCheckboxes=function(){apple.widget.Gifting.selectGiftCheckbox("giftmessage-checkbox","oneclick-button")};apple.widget.Gifting.selectEngravingGiftCheckbox=function(){var a=apple.cookie("appleconfig3");if(a===null){a=apple.cookie("AppleConfig3")}if(a!==null){apple.widget.Gifting.selectGiftCheckbox("gift-checkbox","oneclick-button-engrave");apple.widget.Gifting.selectGiftCheckbox("gift-checkbox","oneclick-button-skip")}};apple.widget.Gifting.selectIPodEngravePlainCheckbox=function(){apple.widget.Gifting.selectGiftCheckbox("gift-checkbox-plain","oneclick-button-plain");apple.widget.Gifting.selectGiftCheckbox("gift-checkbox-plain","or-string-plain")};apple.widget.Gifting.selectIPodEngraveEngravedCheckbox=function(){apple.widget.Gifting.selectGiftCheckbox("gift-checkbox-engraved","oneclick-button-engraved");apple.widget.Gifting.selectGiftCheckbox("gift-checkbox-engraved","or-string-engraved")};apple.widget.Gifting.selectIPodEngraveCheckboxes=function(){apple.widget.Gifting.selectIPodEngravePlainCheckbox();apple.widget.Gifting.selectIPodEngraveEngravedCheckbox()};Event.onDomReady(apple.widget.Gifting.selectLearnMoreCheckboxes);Event.onDomReady(apple.widget.Gifting.selectEngravingGiftCheckbox);Event.onDomReady(apple.widget.Gifting.selectIPodEngraveCheckboxes);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 g=this.close.bindAsEventListener(this);this.currentLayout=apple.widget.Hover.NO_LAYOUT;var a=this._wrapContent();if(!a){return}var f=Element.getElementsByClassName("wdgt-mdl",a)[0];if(this.config.width){a.style.width=this.config.width}if(f&&this.config.height>=parseInt(Element.getStyles(f,"height"),10)){f.style.height=this.config.height}function h(i){Event.observe(i,"onclick",g)}var d=Element.getElementsByClassName("close-link",a);Array.forEach(d,h);var e=Element.getRect(a,true);function b(j){var i=Element.getDimensions(j);var k=Element.getRect(j,true);i.left=k.left-e.left;i.top=k.top-e.top;return i}var c=Element.getElementsByClassName("triangle",a);this.pointerInfo=Array.map(c,b);if(a&&(Element.getStyle(a,"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 e=a.parentNode;a.parentNode.removeChild(a);a.id="";a.className="";var c=Element.uniqueId();var f=document.createElement("div");f.id=this.config.contentId;f.sourceId=this.config.sourceId;f.className=[a.className,"popup-wdgt"].join(" ");f.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(f);var b=$(c);b.parentNode.replaceChild(a,b);return f};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",disclosureClass:"more",disclosureOpenClass:"open",disclosureRegex:/(?:^|\s)disclosure\(([^)]*)\)(?:$|\s)/,popupWidthRegex:(/w(\d+)(-|$)/i),popupHeightRegex:(/h(\d+)(-|$)/i),popupPrefix:"popup-"};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(f){var e={location:(f.indexOf("l")!=-1?"yes":"no"),menubar:(f.indexOf("m")!=-1?"yes":"no"),toolbar:(f.indexOf("t")!=-1?"yes":"no"),status:(f.indexOf("s")!=-1?"yes":"no"),scrollbars:(f.indexOf("!b")!=-1?"no":"yes"),resizable:(f.indexOf("!r")!=-1?"no":"yes")};var c=this.config.popupWidthRegex.exec(f);var g=this.config.popupHeightRegex.exec(f);if(c&&c[1]){e.width=c[1]}if(g&&g[1]){e.height=g[1]}var d=[];for(var b in e){d.push(b+"="+e[b])}return d.join(",")};apple.widget.LinkManager.prototype.manageLinks=function(k){var p=document.getElementsByTagName("a");if(!p.length){return}var o=this.config.disclosureClass;var d=this.config.disclosureRegex;var m=this.config.disclosureOpenClass;var f=this.config.markerClass;var c=this.config.popupPrefix;var i=document.body;var j=this.mouseOverLink.bindAsEventListener(this);var h=this.mouseOutLink.bindAsEventListener(this);var g=this.mouseDownLink.bindAsEventListener(this);var b=this.parentClicked.bindAsEventListener(this);this.mouseUp=this.mouseUp.bindAsEventListener(this);var n=this.dragStarted.bindAsEventListener(this);function a(r){var q=r.parentNode;if(q==i){return null}while(q&&i!=q){if(Element.hasClassName(q,f)){return q}q=q.parentNode}return r.parentNode}function l(v){var s;var x;var q;if(v._managed){return}v._managed=true;if(v.target&&c==v.target.slice(0,c.length)){s=this.getPopupAttributes(v.target);v.target=v.target.replace(/[^\w]/g,"");x=this.popupLinkClicked.bindAsEventListener(this,s);Event.observe(v,"click",x)}if(Element.hasClassName(v,o)&&!!(q=d.exec(v.rel))){var t=$(q[1]);var u=document.createElement("div");var e=Element.assignId(u);var r=Element.hasClassName(v,m);t.parentNode.replaceChild(u,t);u.appendChild(t);x=this.disclosureLinkClicked.bindAsEventListener(this,e,t);Event.observe(v,"click",x);if(!r){Element.makeClipping(u);u.style.height="0";t.style.height="auto"}}if(!Element.hasClassName(v,f)){return}var w=a(v);if(!w){return}Element.assignId(w);Element.addClassName(w,f);w._linkId=Element.assignId(v);Event.observe(w,"mouseover",j);Event.observe(w,"mouseout",h);Event.observe(w,"mousedown",g);if(s){x=this.parentClicked.bindAsEventListener(this,s);Event.observe(w,"click",x)}else{Event.observe(w,"click",b)}if(coherent.Browser.IE){Event.observe(w,"dragstart",n);Event.observe(w,"selectstart",n)}}Array.forEach(p,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("_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){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.stop(d)};apple.widget.LinkManager.prototype.parentClicked=function(f,e){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{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);h.blur();Event.stop(b)};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(h){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 f=$(this._meterId);this._meterWidth=f.offsetWidth-4;var d=$(this._barId);if(!d||this._meterWidth<0){return}var g=(b.GetTime()*this._meterWidth/this._duration);if(this._lastLeft==g){return}this._lastLeft=g;d.style.left=g+"px";d.style.width=(this._meterWidth-g+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 f=this._getMovie();if(!f){return}try{var d=(f.GetPluginStatus()||"").split(":")[0].toLowerCase();this._updateMeter(f);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(g){}}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.PrettySearchField=function(a){this.config=a;if(this.getInput()){this.init()}else{Event.onDomReady(this.init.bind(this))}};apple.widget.PrettySearchField.prototype.init=function(){if(this.initialized){return}this.initialized=true;if(coherent.Browser.Safari&&navigator.userAgent.indexOf("Chrome")===-1){this.setSafariSearchAttributes();return}var g=this.getInput();g.style.outline="none";var d=this.getResetIconContainer();var e=this.focusHandler.bind(this);var c=this.blurHandler.bind(this);var a=this.keyDownHandler.bind(this);var b=this.keyUpHandler.bind(this);var i=this.mouseUpHandler.bind(this);var f=this.mouseDownHandler.bind(this);var h=this.mouseOutHandler.bind(this);Event.observe(g,"onfocus",e);Event.observe(g,"onblur",c);Event.observe(g,"onkeydown",a);Event.observe(g,"onkeyup",b);Event.observe(d,"onmousedown",f);Event.observe(d,"onmouseup",i);Event.observe(d,"onmouseout",h);this.setSearchAttributes()};apple.widget.PrettySearchField.prototype.focusHandler=function(b){var a=this.getInput();Element.addClassName(this.getContainer(),"focused");if(a.value==this.getPlaceholder()){a.value=""}if(coherent.Browser.IE){a.setAttribute("maxLength",this.getMaxLength())}else{a.setAttribute("maxlength",this.getMaxLength())}};apple.widget.PrettySearchField.prototype.blurHandler=function(b){var a=this.getInput();Element.removeClassName(this.getContainer(),"focused");if(coherent.Browser.IE){a.setAttribute("maxLength","")}else{a.setAttribute("maxlength","")}if(!a.value.length){a.value=this.getPlaceholder()}};apple.widget.PrettySearchField.prototype.keyDownHandler=function(b){var a=this.getInput();if(Event.isAlphaNumKey(b.keyCode)){this.show(this.getResetIconContainer())}};apple.widget.PrettySearchField.prototype.keyUpHandler=function(b){var a=this.getInput();if(b.keyCode==Event.KEY_ESC){a.value=""}if(!a.value.length){this.hide(this.getResetIconContainer())}};apple.widget.PrettySearchField.prototype.mouseDownHandler=function(a){Element.addClassName(this.getResetIconContainer(),"down")};apple.widget.PrettySearchField.prototype.mouseUpHandler=function(c){var b=this.getResetIconContainer();var a=this.getInput();this.hide(b);Element.removeClassName(b,"down");a.blur();a.value="";a.focus()};apple.widget.PrettySearchField.prototype.mouseOutHandler=function(a){Element.removeClassName(this.getResetIconContainer(),"down")};apple.widget.PrettySearchField.prototype.setSafariSearchAttributes=function(){var b=this.config.results;var a=this.getInput();var c=this.getPlaceholder();if(b){a.setAttribute("results",b)}a.setAttribute("maxlength",this.getMaxLength());a.setAttribute("type","search");a.setAttribute("placeholder",c);a.setAttribute("autosave",this.getAutosave());Element.addClassName(a,"safari");Element.addClassName(this.getContainer(),"safari");if(a.getAttribute("value")==c){a.setAttribute("value","");a.value=""}};apple.widget.PrettySearchField.prototype.setSearchAttributes=function(){var a=this.getInput();a.setAttribute("maxlength","");a.value=this.getPlaceholder();if(a.value!=this.getPlaceholder()){this.show(this.getResetIconContainer())}Element.addClassName(a,"nonsafari");Element.addClassName(this.getContainer(),"nonsafari")};apple.widget.PrettySearchField.prototype.getMaxLength=function(){return this.config.maxLength};apple.widget.PrettySearchField.prototype.getPlaceholder=function(){return this.config.placeholder};apple.widget.PrettySearchField.prototype.getAutosave=function(){return this.config.autosave};apple.widget.PrettySearchField.prototype.getContainer=function(){return $(this.config.containerId)};apple.widget.PrettySearchField.prototype.getInput=function(){return $(this.config.inputId)};apple.widget.PrettySearchField.prototype.getResetIconContainer=function(){return $(this.config.resetIconId)};apple.widget.PrettySearchField.prototype.hide=function(a){$(a).style.display="none"};apple.widget.PrettySearchField.prototype.show=function(a){$(a).style.display="block"};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,e,f,d,g,i){this.config.pages=e;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=d;if(b==this.config.pages-1){j=g}var k;for(var a=0;a<j;a++){k=(((b-1)*d+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<f-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};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.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:".controls",expandLinkSpec:".expand_link",secondaryFilterClass:"secondary",contractLinkSpec:".contract_link",selectedClass:"selected",filterListSpec:"ul.filterItems",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)};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.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__:{"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"}),"#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()})},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($("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()}this.setValueForKey(false,"loading")},submitQuery:function(){var b=this.query;var a=this.valueForKey("filterSelection");if(b===this.lastQuery&&a===this.lastType){return}if(b){this.setValueForKey(true,"loading");var c={query:b,type:a};JSONRPC.get(this.queryURL,c).addMethods(this.queryReturned.bind(this));this.lastType=a;this.setValueForKey(b,"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};var b=this.getEventData("searchPerformed",c);apple.metrics.fireEvent(b);this.setValueForKey(coherent.KVO.adaptTree(a),"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.widget");apple.widget.SlidingTrackView=Class.create((function(){var a={PINNED_TOP:"pinned_top",FLOATING:"floating",PINNED_BOTTOM:"pinned_bottom"};var b={pinned_top:function(){if(this._trackFrame.top<0&&this._viewport.height>=this._itemFrame.height){if(this._trackFrame.bottom<this._itemFrame.height){return this.setState(a.PINNED_BOTTOM)}return this.setState(a.FLOATING)}},floating:function(){if(this._narrow||this._viewport.height<this._itemFrame.height||this._trackFrame.top>0){return this.setState(a.PINNED_TOP)}if(this._trackFrame.bottom<=this._itemFrame.bottom){return this.setState(a.PINNED_BOTTOM)}},pinned_bottom:function(){if(this._narrow||this._viewport.height<this._itemFrame.height){return this.setState(a.PINNED_TOP)}if(this._itemFrame.top>0){return this.setState(a.FLOATING)}}};return{constructor:function(c,e){if(coherent.Browser.IE==6){return}this.view=c;var d=Array.from(c.childNodes);var g;var f;while((f=d.shift())){if(f.nodeType==1&&!g){g=f;continue}if(e==undefined){e=""}if(!!e.cleanup){c.removeChild(f)}}this._item=coherent.View.fromNode(g);if(this._item===null){this._item=new coherent.View(g)}this._viewport=Element.getViewport();this._trackFrame=Element.getRect(c,true);this._itemFrame=Element.getRect(g,true);this.setState(a.PINNED_TOP);this.updateItemPosition();if(coherent.Browser.IE==6){return}this._item.addObserverForKeyPath(this,this.itemFrameChanged,"frame");Event.observe(window,"resize",this.viewportResized.bind(this));Event.observe(window,"scroll",this.viewportScrolled.bind(this));Event.observe(window,"load",this.viewportResized.bind(this))},viewportResized:function(d){var c=this._viewport?this._viewport.width:0;this._viewport=Element.getViewport();if(coherent.Browser.Safari){this.setState(a.PINNED_TOP)}if(coherent.Browser.IE){this._narrow=document.documentElement.clientWidth<document.body.scrollWidth}else{this._narrow=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 c=Object.applyDefaults({},this._itemFrame);c.top=Math.max(0,this._trackFrame.top);c.bottom=Math.min(this._trackFrame.bottom,this._viewport.height);c.height=c.bottom-c.top;if(this._item.willResizeFrame(c)){this._itemFrame=this._item.resizeFrame(c)}}this._stateSwitcher()},itemFrameChanged:function(e,c,d){this._itemFrame=e.newValue;this.updateItemPosition()},setState:function(d){if(this._currentState==d){return}var c=this.view;Element.removeClassName(c,this._currentState);Element.addClassName(c,d);this._currentState=d;this._stateSwitcher=b[d]}}})());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.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:"swapfade",animate:false,autoAdvance:false};apple.widget.TabController.ADVANCE_DELAY=6000;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 h=document.createElement("div");h.id=this.config.contentId;h.className=b.className;b.id=a;b.className="";b=b.parentNode.replaceChild(h,b);h.appendChild(b)}var g={id:this.config.contentId,duration:500,transition:this.config.transition};this._swapper=new apple.fx.ContentSwapper(g);var f=window.location.hash.match(/^#tab(\d+)$/);var d;this.config.tabIds=[];for(var c in this.config.tabs){this.config.tabIds.push(c)}if(f&&f[1]){f=parseInt(f[1],10)-1;for(var e in this.config.tabs){d=e.match(/(\d+)$/);if(!d||d[1]!=f){continue}this.selectTab(e);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 j=b.getElementsByTagName("strong");var e=j.length;for(var c=0,f,h;c<e;c++){f=j[c];h=parseInt(Element.getStyles(f,"height"),10);if(h>d){Element.addClassName(f.parentNode.parentNode,"two-line")}}};apple.widget.TabController.prototype.assignWrapper=function(a){this.config.wrapperId=a;var b=document.getElementById(a);if(b){Event.observe(b,"mouseover",this.pause.bindAsEventListener(this));Event.observe(b,"mouseout",this.resume.bindAsEventListener(this))}};apple.widget.TabController.prototype.pause=function(a){if(!this.config.autoAdvance){return}this.paused=true;if(this.timer){window.clearTimeout(this.timer)}this.timer=null};apple.widget.TabController.prototype.resume=function(a){if(!this.config.autoAdvance){return}if(a){this.paused=false}if(this.timer){window.clearTimeout(this.timer)}this.timer=this.showNextTab.bindAndDelay(this,apple.widget.TabController.ADVANCE_DELAY)};apple.widget.TabController.prototype.showNextTab=function(){if(this.paused||this.locked){return}var a=this.config.selectedTabId;var c=this.config.tabIds;var b=c.indexOf(a);if(b==c.length-1){b=0}else{b++}this.selectTab(c[b])};apple.widget.TabController.prototype.preloadNextTab=function(){var a=this.config.selectedTabId;var g=this.config.tabIds;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=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);d.innerHTML=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.addClassName(e,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})}else{Element.removeClassName(e,this.config.inactiveClass);Element.addClassName(e,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.autoAdvance){f.preloadNextTab()}}this._swapper.swap(this.config.transition,d,a,c)};apple.widget.TabController.prototype.selectTab=function(c){if(this.locked){return}if(this.config.selectedTabId==c){return}var a=this.tabContentIdFromTabId(c);if(this.timer){window.clearTimeout(this.timer);this.timer=null}this.locked=true;if(this.config.selectedTabId){var d=document.getElementById(this.config.selectedTabId);if(this.config.animate){coherent.Animator.replaceClassName(d,this.config.activeClass,this.config.inactiveClass,{duration:250,curve:coherent.easing.inSine})}}if(document.getElementById(a)){this.activateTab(c);return}function f(h){if(this.config.selectedTabId==c){return}if(!h||!h.body){return}var g=coherent.Scripts.extract(h.body.content);this.insertTabContent(c,g);this.activateTab(c)}var b=this.config.tabContentUrl||this.config.tabs[c];b=apple.util.expandTemplate(b,{tabId:c});var e={url:b,success:f.bind(this),scriptKeys:["content"]};apple.io.json.invoke(e)};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){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",reviewIdRegex:/-(\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(d,b){var c=this.getVoteElem(d);var a=this.getReviewId(c);if(a){apple.io.json.invoke({url:this.config.requestUrl,urlArgs:{reviewId:a,vote:b}})}this.displayFeedbackMessage(d)};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.getReviewId=function(b){if(!b||!b.id){return null}var a=null;var c=this.config.reviewIdRegex.exec(b.id);if(c&&c.length>1){a=c[1]}return a};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","language","productId","encoding","backgroundImage","engravingText"]},language:"en",c:"d",productId:"",encoding:"UTF8",backgroundImage:"",init:function(){},prepareEngravedImage:function(){if(!this.backgroundImage||!this.productId||!this.encoding||!this.language){return}if(this.__imageTimer){window.clearTimeout(this.__imageTimer);this.__imageTimer=null}var c=this.backgroundImage.match(/(http:\/\/.*?apple\.com)?(\/.*)$/);var e=this.picassoUrl.match(/(http:\/\/.*?apple\.com)(\/.*)$/);var a=(this.engravingText||"").split("\n");var b={l:this.language,c:this.c,r:this.productId,i:c&&c[2],p:this.encoding,th:a[0]||"",tl:a[1]||""};this.setValueForKey(true,"pending");var d=[(c[1]||"")+e[2],Object.toQueryString(b)].join("?");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",animated:"true",action:"noop"}),"div.preview":apple.widget.EngravedPod({picassoUrlBinding:"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(){Array.forEach(Element.queryAll("div.engravings ul"),function(b){Array.forEach(b.getElementsByTagName("li"),function(c,d){Element.addClassName(c,"item"+(d+1))})});var a=Element.query(this.viewElement(),"ul.ipod-list li");if(a){a.style.display="none"}this.addObserverForKeyPath(this,"observeSelectedEngravingChange","engravings.selectedEngraving")},selectedTabIndex:function(){return this.__selectedTabIndex},setSelectedTabIndex:function(b){if(!this.engravings){return(this.__selectedTabIndex=b)}var d=this.engravings;var a=b==d.length-1;var e=this.__selectedTabIndex==d.length-1;this.__selectedTabIndex=b;if(a){this.setSelectedProduct(this.products[0])}else{if(e){this.setSelectedProduct(this.products[1])}}var c=d[this.__selectedTabIndex];if(!c.selectedEngraving){c.setValueForKey(c.content[0],"selectedEngraving")}else{this.updateEngravingText(c.selectedEngraving)}return b},selectedProduct:function(){return this.__selectedProduct},setSelectedProduct:function(b){this.willChangeValueForKey("productVariations");this.__selectedProduct=b;this.didChangeValueForKey("productVariations");var a=!(b==this.products[0]);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)},setInitialSelections:function(b){var a=this.products[b.selectedProduct||1];this.setSelectedProduct(a);var c=this.productVariations();this.setValueForKey(c[b.selectedVariationIndex||0],"selectedVariation");this.setSelectedTabIndex.bindAndDelay(this,1000,b.selectedTab)}});Package("apple.utilitynav");apple.utilitynav.UtilityNavViewController=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"}),"#cart-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"}),"#unav-your-cart ul li img.product-shot":coherent.ImageView({srcBinding:"*.imageUrl"}),"#unav-your-cart ul li p.product-summary a":coherent.Anchor({htmlBinding:"*.description",hrefBinding:"*.productDetailsUrl"})},keyDependencies:{helpVisible:["visibleSection","dataLoaded"],accountVisible:["visibleSection","dataLoaded"],cartVisible:["visibleSection","dataLoaded"],showSpinner:["visibleSection","dataLoaded"]},init:function(){this.setValueForKey(null,"visibleSection");this.setValueForKey(false,"dataLoaded");var a={owner:this,onmouseenter:this.onmouseenter,onmouseleave:this.onmouseleave};this.addTrackingInfo("u_help",a);this.addTrackingInfo("u_account",a);this.addTrackingInfo("u_cart",a);this.addTrackingInfo("unav-help",a);this.addTrackingInfo("unav-account",a);this.addTrackingInfo("unav-cart",a)},discardCartData:function(){this.dataLoaded=false},visibleSection:function(){return this.__visibleSection},dataFinishedLoading:function(a){this.setValueForKey(true,"dataLoaded")},setVisibleSection:function(c){var e;var a=this.__visibleSection;if(a&&null!==(e=$(a))){Element.removeClassName(e,"open")}if(c&&null!==(e=$(c))){Element.addClassName(e,"open")}if(c&&!this.dataLoaded){var f=this.data.refresh();f.addCallback(this.dataFinishedLoading.bind(this))}var b=$("guide_wrap_btm");if(b){if(c){Element.addClassName(b,"unav_open")}else{Element.removeClassName(b,"unav_open")}}this.__visibleSection=c},guideBottomClass:function(){if(!!this.__visibleSection){return"unav_open"}else{return""}},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(),onmouseenter:function(b){var c="";if(this.__timer){window.clearTimeout(this.__timer);this.__timer=null}function a(){this.__timer=null;this.setValueForKey(c,"visibleSection")}switch(b.id){case"u_help":case"unav-help":c="u_help";break;case"u_account":case"unav-account":c="u_account";break;case"u_cart":case"unav-cart":c="u_cart";break;default:console.log("node= ",b);throw new Error("Invalid node ID")}if(c){this.__timer=a.bindAndDelay(this,150)}this.hoverNodeId=b.id},onmouseleave:function(b){if(b.id!==this.hoverNodeId){return}if(this.__timer){window.clearTimeout(this.__timer);this.__timer=null}function a(){this.__timer=null;this.setValueForKey(null,"visibleSection")}this.__timer=a.bindAndDelay(this,600);this.hoverNodeId=""}});