/*

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

Package("apple.controller");if(coherent.Browser.Safari2){coherent.View.createViewsForNodeTree=function(A){};coherent.View.prototype.__postConstruct=function(){};document.write("<style>\n");document.write("ul.purchase-info li.xs-js { display: list-item; }\n");document.write("#product-specifications .summary { display: none; }\n");document.write("</style>")}function fixBrokenForms(){var A=document.getElementsByTagName("form");if(!A||!A.length){return }function B(C){C.reset()}Array.forEach(A,B)}Event.onDomReady(fixBrokenForms);function ctoOptionButtonObserver(B,A){apple.metrics.fireMicroEventNoDuplicates(A)}function registerCtoOptionButtonObserver(J,E,H){var D=window.state;var A={slot:"",feature:"Radio-Button",part:D.summary.part,action:"Selected: "+J+" - "+H};var G=null;var F=document.getElementById("feature-list").getElementsByTagName("input");for(var C=F.length;C>0;){var B=F[--C];if(B.name==J&&B.value==E){G=B;break}}if(!G){return }var I=ctoOptionButtonObserver.bindAsEventListener(this,A);Event.observe(G,"click",I)}var upgradeTransformer=new coherent.transformer.Generic([true,false],["upgrade",""]);coherent.registerTransformerWithName(upgradeTransformer,"Upgrade");apple.controller.CTOStateController=Class.create(coherent.ModelController,{exposedBindings:["summary"],blockQueries:true,constructor:function(C,B){this.base(C,B);Event.onDomReady(this.enableQueries.bind(this));this.addObserverForKeyPath(this,this.observeSummaryChange,"summary");this.setSelection(new coherent.KVOTable());var A=(this.url||"").split("?");if(2==A.length){this.extraArgs=Object.fromQueryString(A[1]);this.url=A[0]}},enableQueries:function(){this.blockQueries=false},selection:function(){return this.__selection},setSelection:function(A){this.willChangeValueForKey("selection");this.__selection=A;this.didChangeValueForKey("selection")},performQuery:function(G){if(!this.url||this.blockQueries){return }var H=this.valueForKey("selection");var B=H.mutableKeys();var E=B.length;var I;var A=this.valueForKeyPath("summary.part");var F={};if(!A){return }if(this._query){this._query.cancel()}if(this.extraArgs){Object.applyDefaults(F,this.extraArgs)}if("part"!=G){for(var D=0;D<E;++D){I=B[D];F[I]=H.valueForKey(I)}}var C={url:this.url+"/"+A,urlArgs:F,success:this.querySucceeded.bind(this),error:this.queryFailed.bind(this)};this._query=apple.io.json.invoke(C)},querySucceeded:function(C){this._query=null;var A=C.body;if(!A){return }if(!A.summary||!A.priceDeltas||!A.summary.options||!A.summary.prices){console.log("Response isn't correctly formatted.");return }for(var D in A){var B=A[D];var E=coherent.typeOf(B);if("function"===E){continue}if(!(E in coherent.KVO.typesOfKeyValuesToIgnore)){B=coherent.KVO.adaptTree(B)}this.setValueForKey(B,D)}},queryFailed:function(A){this._query=null;console.log("query failed...")},observeChildObjectChangeForKeyPath:function(C,B,A){if("selection"===A||("summary"===A&&"part"===B)){this.performQuery(B)}this.base(C,B,A)},observeSummaryChange:function(E,G,A){var H=new coherent.KVOTable();var D=E.newValue;var K=D.valueForKey("options");var C=K.length;var B;for(B=0;B<C;++B){var J=K[B];var I=J.valueForKey("option");var F=J.valueForKey("value");H.setValueForKey(F,I)}this.setSelection(H)}});Package("apple.widget");apple.widget.CTOSummaryWidget=Class.create(coherent.View,{exposedBindings:["content"],keyDependencies:{allItemsAreVisible:["numberOfVisibleItems","totalNumberOfItems"],numberOfHiddenItems:["numberOfVisibleItems","totalNumberOfItems","open"]},bounceDuration:2000,openDuration:300,closeDuration:500,minViewportHeight:620,productOptions:Part("ul.specs-list"),productSpecs:Part("div.product-specifications"),summary:Part("div.summary"),gradient:Part("div.transition"),updateButtons:PartList(".update-details"),updateTexts:PartList(".update-details-instructions"),init:function(){this.base();var E=this.viewElement();var B=this.productSpecs();E.style.zIndex="199";this._animator=new apple.fx.Animator({duration:150});this._viewport=Element.getViewport();this._enabled=true;Event.observe(B,"click",this.widgetClicked.bindAsEventListener(this));var G=Element.getRect(E,true);this._verticalOffset=G.top;var F=this.productOptions();this._itemWidth=F.offsetWidth;F.style.position="relative";this._chromeWidth=B.offsetWidth-F.offsetWidth;var D=this._enabled;function A(){var I=document.getElementById("product-summary-secondary");if(!I){A.delay(300);return }var H=Element.queryAll(document,".update-details");H.forEach(function(J){J.style.display="none"});H=Element.queryAll(document,".update-details-instructions");H.forEach(function(J){J.style.display="none"})}A.delay(300);var C=this.summary();if(this._enabled){C.style.display="block"}coherent.View.createViewsForNodeTree(C,this);Event.observe(C.getElementsByTagName("a")[0],"click",this.widgetClicked.bindAsEventListener(this))},willResizeFrame:function(){return coherent.Browser.IE!=6},resizeFrame:function(H){var C=this.productOptions();var G=this.productSpecs();var F=H.height;var E=Element.getRect(C,true);var B=this.viewElement().offsetHeight;var A=B-E.height;var D=Element.getStyles(C,["paddingTop","paddingBottom"]);D=parseInt(D.paddingTop,10)+parseInt(D.paddingBottom,10);this._maxHeight=Math.max(100,F-A-D);C.style.maxHeight=this._maxHeight+"px";H=Element.getRect(this.viewElement(),true);H.height=this._maxHeight+D+A;this.clipItems();if(this.open){this.closeWidget(true)}return H},allItemsAreVisible:function(){return this.numberOfVisibleItems==this.totalNumberOfItems},numberOfHiddenItems:function(){return this.totalNumberOfItems-this.numberOfVisibleItems},observeContentChange:function(G,H,C){var A=G.oldValue;var B=G.newValue;var I=false;var E;var F;if(coherent.ChangeType.setting!==G.changeType){this._changeIndexes=[].concat(G.indexes);F=this._changeIndexes.length;for(E=0;E<F;++E){if(this._changeIndexes[E]>this.indexOfLastVisibleItem){I=true;break}}}else{if(this.open){this.openWidget()}if(!A||!B){return }var D=[];F=Math.max(A.length,B.length);for(E=0;E<F;++E){if(E>=A.length||E>=B.length){if(E>this.indexOfLastVisibleItem){I=true}if(E<B.length){D.push(E)}continue}if(A[E].value===B[E].value){continue}if(E>this.numberOfVisibleItems){I=true}D.push(E)}this._changeIndexes=D}this.clipItems();if(I){this.bounceWidget.bindAndDelay(this)}else{this.showChanges.bindAndDelay(this)}},clipItems:function(F){var A=this.productOptions();if(!A){return }var H=A.getElementsByTagName("li");var G=H.length;var E;var L;if(!H||!H.length){return }var K=this._maxHeight;var C=8;var B=H[0].offsetTop;var I=0;var J=0;var M=0;var D=0;if(!this._enabled){for(E=0;E<G;++E){L=H[E];L.style.position="static";L.style.width="";L.style.top="";L.style.left="";L.style.visibility=""}this.setValueForKey(G-1,"indexOfLastVisibleItem");this.setValueForKey(G,"numberOfVisibleItems");this.setValueForKey(G,"totalNumberOfItems");return }A.style.overflow="hidden";for(E=0;E<G;++E){L=H[E];if(F){L.style.position="static";L.style.width="";L.style.top="";L.style.left=""}if(!L.offsetHeight){continue}++M;I=L.offsetTop-B;if(I>K){continue}if(I+L.offsetHeight<K){D=E;++J;L.style.visibility="";continue}}this.setValueForKey(D,"indexOfLastVisibleItem");this.setValueForKey(J,"numberOfVisibleItems");this.setValueForKey(M,"totalNumberOfItems")},showChanges:function(G){if(!this._changeIndexes||!this._changeIndexes.length){if(G){G()}return }var F=this.productOptions();var D=F.getElementsByTagName("li");var E;var B=this._changeIndexes.length;var A;var C=new apple.fx.Animator({duration:1000});var H=[];for(E=0;E<B;++E){A=D[this._changeIndexes[E]];A.style.backgroundColor="#bde8ff";H.push(new apple.fx.ChangeColour(apple.fx.linearTween,A,"backgroundColor","#ffffff","#bde8ff"))}this._changeIndexes=null;if(H.length){window.setTimeout(C.play.bind(C,H,G),1000)}},bounceWidget:function(){function A(){this.showChanges();this.closeWidget.bindAndDelay(this,this.bounceDuration)}this.openWidget(A.bind(this))},closeWidget:function(M){var H=this.viewElement();var F=this.productSpecs();var C=this.productOptions();if(!H||!F){return }var B=H.offsetWidth;var L=F.offsetHeight;var I=C.getElementsByTagName("li");var J=this.gradient();var E=this._fadedItemIndex?I[this._fadedItemIndex]:null;function D(){C.style.width="";C.style.height="";F.style.height="";if(E){Element.setOpacity(E,0);this._animator.setDuration(100);this._animator.play(new apple.fx.FadeIn(apple.fx.linearTween,E))}this.clipItems(true)}var A={width:B,height:L,marginLeft:0};if(!this.open){D.call(this);return }this.setValueForKey(false,"open");coherent.Animator.setStyles(F,A,{duration:this.closeDuration,curve:coherent.easing.inOutSine,callback:D.bind(this)});var K=new apple.fx.FadeIn(apple.fx.linearTween,J);var G=new apple.fx.Resize(apple.fx.easeInOutSine,F,A);this._animator.setDuration(this.closeDuration);this._animator.play(K)},openWidget:function(K){var P=this.productOptions();if(!P){return }if(P.offsetHeight<this._maxHeight||!this._enabled){if(K){K()}return }this._animator.stop();var B=false;var O=this.productSpecs();var T=O.offsetHeight;var U=P.getElementsByTagName("li");var b=U.length;var Z;var R;if(!U||!U.length){return }var W=this._maxHeight+U[0].offsetTop;var H=this._itemWidth;var d=8;var F=0;var L=U[0].offsetTop;var S=L;var I=0;var D=1;var E=0;var V=0;var a=null;var c=null;this._fadedItemIndex=0;for(Z=0;Z<b;++Z){R=U[Z];if(!B){var Y=parseInt(Element.getStyle(R,"margin-left")||0,10);var J=parseInt(Element.getStyle(R,"margin-right")||0,10);var e=parseInt(Element.getStyle(R,"padding-left")||0,10);var A=parseInt(Element.getStyle(R,"padding-right")||0,10);var G=parseInt(Element.getStyle(R,"margin-top")||0,10);var M=parseInt(Element.getStyle(R,"margin-bottom")||0,10);S=L=L+G;F=G+M;d=Math.max(Y,J);H-=Y+J+e+A;B=true}if(!R.offsetHeight){continue}++V;++E;R.style.position="absolute";R.style.width=H+"px";R.style.visibility="";if(S+R.offsetHeight+F<=W){R.style.top=S+"px";R.style.left=I+"px"}else{if(!c){R.style.top=S+"px";R.style.left=I+"px";S=L;I+=H+d;this._fadedItemIndex=Z;c=R;a=I;++D}else{S=L;I+=H+d;R.style.top=S+"px";R.style.left=I+"px";++D}}S+=R.offsetHeight+F}this._columns=D;P.style.width=(I+H+d)+"px";P.style.height=T+"px";var X=Math.min(980,this._chromeWidth+I+H+Y+J+e+A);var N={width:X,height:T,marginLeft:-(X-this._itemWidth)};this.setValueForKey(true,"open");coherent.Animator.setStyles(O,N,{duration:this.openDuration*0.66,delay:this.openDuration*0.33,curve:coherent.easing.inOutSine,callback:K});var C=this.gradient();function Q(f){Element.setOpacity(C,1-f);if(c){Element.setOpacity(c,1-f)}}Q.finish=function(f){if(!c){return }c.style.top=L+"px";c.style.left=a+"px";Element.setOpacity(c,1)};this._animator.setDuration(this.openDuration*0.33);this._animator.play(Q)},widgetClicked:function(A){Event.stop(A);if(this.open){this.closeWidget()}else{this.openWidget()}}});Package("apple.widget");apple.widget.PopularConfigsWidget=Class.create(coherent.View,{exposedBindings:["part"],selectedClass:"selected",constructor:function(B,A,C){this.base(B,A,C);this.__partsToLinks={}},init:function(){this.base();var C=this.links();var B=this;var D=this.selectedClass;function A(H){var F=H.getElementsByTagName("a")[0];if(!F){return }F.style.outline="none";var E=(F.rel||"").match(/(?:^|\s)part\((.*?)\)(?:$|\s)/);if(!E){return }var G=B.linkClicked.bindAsEventListener(B,E[1],F);Event.observe(F,"click",G);B.__partsToLinks[E[1]]=H.id;if(Element.hasClassName(H,D)){B.part=E[1]}}C.forEach(A)},changePart:function(A){var C=this.__partsToLinks[this.part];var B=this.__partsToLinks[A];this.part=A;if(C){Element.removeClassName($(C),this.selectedClass)}if(B){Element.addClassName($(B),this.selectedClass)}},observePartChange:function(C,B,A){this.changePart(C.newValue)},links:PartList("li"),linkClicked:function(D,A,C){Event.stop(D);if(A==this.part){return }this.changePart(A);if(this.bindings.part){this.bindings.part.setValue(A)}if(typeof (this.isFirstInteraction)==="undefined"||this.isFirstInteraction){var B=C.rev;if(B.length){try{apple.metrics.Metrics.reportCustomLink(A,B)}catch(E){}}}this.isFirstInteraction=false}});Package("apple");apple.RetailStoreLocatorTrigger=Class.create(coherent.Anchor,{enabled:false,init:function(){this.checkConfiguration()},checkConfiguration:function(){if(window.retailStoreLocatorTextStrings&&window.retailStoreLocatorUrls){this.enabled=true}},onclick:function(A){if(this.enabled){Event.stop(A);this.showOverlay()}else{return }},showOverlay:function(){if(this.overlay){this.displayOverlay();window.retailStoreLocatorViewController.reopen()}else{this.setupOverlay();this.overlay=new coherent.Overlay("retailStoreLocatorOverlay");this.overlay.setNextResponder(this);if(!this.overlay){return }this.displayOverlay()}},setupOverlay:function(){this.div=document.createElement("div");this.div.id="retail-store-locator";this.div.className="retail-store-locator";var A="";A+='<div class="locator-header">';A+="	<h3>title</h3>";A+='	<form class="clearfix">';A+="		<fieldset>";A+='			<input class="query" type="text" autosave="AppleRetailStoreLocator" results="10" name="query" maxlength="32" autocomplete="off" />';A+='			<a class="store-locator-form-reset"></a>';A+='			<span class="store-locator-spinner"></span>';A+="		</fieldset>";A+='		<a class="submit-button" href="#"><img src="" /></a>';A+="		<p>searchLabel</p>";A+="	</form>";A+="</div>";A+='<ul class="stores"></ul>';A+='<div class="locator-pagination">';A+='	<a href="#" class="pagination-link previous">previous</a>';A+='	<a href="#" class="pagination-link next">next</a>';A+="</div>";A+='<div class="details">';A+='	<div class="vcard">';A+='		<span class="photo-wrapper"><img class="photo" src="" /></span>';A+='		<h4 class="org">storeDisplayName</h4>';A+='		<div class="adr">';A+='			<div class="street-address">address.address2</div>';A+='			<span class="locality">city</span>, ';A+='			<span class="region">state</span>';A+='			<span class="postal-code">address.postalCode</span>';A+="		</div>";A+='		<div class="tel">phoneNumber</div>';A+="	</div><!-- /.vcard -->";A+='	<div class="links">';A+='		<p><a class="hours" href="#" target="_blank">hours</a></p>';A+='		<p><a class="directions" href="#" target="_blank">directions</a></p>';A+='		<p><a class="reservation" href="#" target="_blank">reservation</a></p>';A+="	</div><!-- /.links -->";A+="</div><!-- /.details -->";A+='<div class="error-message">';A+='<div class="error-text"></div>';A+='<a class="close-link" href="#"><img src="" /></a>';A+="</div>";this.div.innerHTML=A;document.body.appendChild(this.div);window.retailStoreLocatorViewController=new apple.RetailStoreLocatorViewController($("retail-store-locator"),this,{textStrings:window.retailStoreLocatorTextStrings,urls:window.retailStoreLocatorUrls})},displayOverlay:function(){this.overlay.display({sourceId:this.div.id,classname:"overlay"})}});Package("apple");apple.RetailStoreLocatorViewController=Class.create(coherent.View,{resultsPerPage:5,locationField:coherent.TextField("form input.query",{valueBinding:"searchLocation",action:"submitForm",sendsActionOnEndEditing:false}),storeListView:coherent.View("ul.stores",{visibleBinding:"showStoreList",htmlBinding:"storeList"}),__structure__:{form:coherent.Form({visibleBinding:"showForm",htmlBinding:"form"}),h3:coherent.View({textBinding:"headingText"}),".store-locator-form-reset":coherent.Anchor({visibleBinding:"showSearchFieldReset",action:"resetSearchField"}),".store-locator-spinner":coherent.View({visibleBinding:"showSearchFieldSpinner"}),"a.submit-button":coherent.Anchor({action:"submitForm"}),"a.submit-button img":coherent.ImageView({srcBinding:"submitButtonUrl"}),"form p":coherent.View({textBinding:"searchLabelText"}),".locator-pagination":coherent.View({visibleBinding:"showPagination"}),".previous":coherent.View({visibleBinding:"showPreviousLink",textBinding:"previousText",action:"showPreviousPage"}),".next":coherent.View({visibleBinding:"showNextLink",textBinding:"nextText",action:"showNextPage"}),".details":coherent.View({visibleBinding:"showDetails"}),".error-message":coherent.View({visibleBinding:"showError"}),".error-text":coherent.View({htmlBinding:"errorText"}),"a.close-link":coherent.Anchor({visibleBinding:"showCloseLink",action:"closeOverlay"}),"a.close-link img":coherent.ImageView({srcBinding:"okButtonUrl"}),".vcard .photo":coherent.ImageView({srcBinding:"vCard.storeImageUrl"}),".vcard .org":coherent.View({htmlBinding:"vCard.storeDisplayName"}),".vcard .street-address":coherent.View({htmlBinding:"vCard.address.address2"}),".vcard .locality":coherent.View({htmlBinding:"vCard.city"}),".vcard .region":coherent.View({htmlBinding:"vCard.state"}),".vcard .postal-code":coherent.View({htmlBinding:"vCard.address.postalCode"}),".vcard .tel":coherent.View({htmlBinding:"vCard.phoneNumber"}),".links .hours":coherent.Anchor({textBinding:"hoursText",hrefBinding:"vCard.hoursUrl"}),".links .directions":coherent.Anchor({textBinding:"directionsText",hrefBinding:"vCard.directionsUrl"}),".links .reservation":coherent.Anchor({textBinding:"reservationText",hrefBinding:"vCard.reservationUrl"})},init:function(){this.vCard=new coherent.KVO();this.localize();this.setupLocationField();this.reset()},addStructureProperty:function(B,A){if(A&&"function"==typeof (A)&&(A=A.valueOf()).__factoryFn__){return A.call(this,B,false)}return null},localize:function(){this.setValueForKey(this.textStrings.title,"headingText");this.setValueForKey(this.textStrings.searchLabel,"searchLabelText");this.setValueForKey(this.textStrings.previous,"previousText");this.setValueForKey(this.textStrings.next,"nextText");this.setValueForKey(this.textStrings.hours,"hoursText");this.setValueForKey(this.textStrings.directions,"directionsText");this.setValueForKey(this.textStrings.reservation,"reservationText");this.setValueForKey(this.urls.searchButton,"submitButtonUrl");this.setValueForKey(this.urls.okButton,"okButtonUrl")},setupLocationField:function(){this.locationField.nullPlaceholder=this.textStrings.searchPlaceholder;apple.behavior.TextFieldPlaceholder(this.locationField);this.addObserverForKeyPath(this,this.observeLocationFieldChange,"searchLocation");this.focusLocationField.bindAndDelay(this,500)},focusLocationField:function(){this.locationField.focus()},observeLocationFieldChange:function(A){if(A.newValue.length>0){this.setValueForKey(true,"showSearchFieldReset")}else{this.setValueForKey(false,"showSearchFieldReset")}},updateSearchResultLabel:function(){var A=this.valueForKey("searchLocation");var B=this.textStrings.searchResultLabel;var D=new RegExp("{location}","ig");var C=B.replace(D,A);this.setValueForKey(C,"searchLabelText")},submitForm:function(){this.formatLocationField();if(!this.locationFieldIsBlank()){this.submitViaAjax()}},formatLocationField:function(){if(!this.valueForKey("searchLocation")){this.setValueForKey("","searchLocation")}var A=this.valueForKey("searchLocation");A=A.replace(/^\s*/,"");A=A.replace(/\s*$/,"");this.setValueForKey(A,"searchLocation")},locationFieldIsBlank:function(){if(this.valueForKey("searchLocation").length<1){return true}return false},submitViaAjax:function(){this.setValueForKey(true,"showSearchFieldSpinner");this.prepareRequestParameters();this.ajaxResponse=JSONRPC.get(this.urls.locate,this.query);this.ajaxResponse.addCallback(this.processAjaxResponse.bind(this))},prepareRequestParameters:function(){this.query={location:this.valueForKey("searchLocation")}},processAjaxResponse:function(){this.reset();if(this.ajaxResponse._result.success===true){this.stores=coherent.KVO.adaptTree(this.ajaxResponse._result.stores);if(this.stores.length<1){this.showNoResultsFoundError()}else{this.updateSearchResultLabel();this.setupPagination();this.displayFirstStoreAfterSearch();this.showStoresForCurrentPage()}}else{this.displayServiceUnavailable()}},showStoresForCurrentPage:function(){this.storeListView.viewElement().innerHTML="";var B;var A=(this.currentPage-1)*this.resultsPerPage;var C=this.currentPage*this.resultsPerPage-1;if(C>(this.stores.length-1)){C=this.stores.length-1}for(B=A;B<=C;B++){this.createStoreListItem(this.stores[B])}this.createStructure()},createStoreListItem:function(B){var D=(this.currentStore==B.storeNumber)?'class="selected"':"";var A=document.createElement("li");var C="";C+='<a href="#" id="'+B.storeNumber+'" '+D+">";C+="<h4>"+B.storeDisplayName+"</h4>";C+="<p>"+B.city+", "+B.state+"</p>";C+="</a>";A.innerHTML=C;this.storeListView.viewElement().appendChild(A)},createStructure:function(){var A="ul.stores li a";var B=coherent.Anchor({action:"changeStore"});this.addStructureProperty(A,B)},setupPagination:function(){this.currentPage=1;this.pageCount=Math.ceil(this.stores.length/this.resultsPerPage);this.updatePaginationLinks()},updatePaginationLinks:function(){if(this.currentPage==1){this.setValueForKey(false,"showPreviousLink")}else{this.setValueForKey(true,"showPreviousLink")}if(this.currentPage==this.pageCount){this.setValueForKey(false,"showNextLink")}else{this.setValueForKey(true,"showNextLink")}},showPreviousPage:function(){this.currentPage=this.currentPage-1;if(this.currentPage<1){this.currentPage=1}this.updatePaginationLinks();this.showStoresForCurrentPage()},showNextPage:function(){this.currentPage=this.currentPage+1;if(this.currentPage>this.pageCount){this.currentPage=this.pageCount}this.updatePaginationLinks();this.showStoresForCurrentPage()},displayFirstStoreAfterSearch:function(){this.displayStore(this.stores[0])},changeStore:function(B){var A;for(A=0;A<this.storeListView.viewElement().childNodes.length;A++){this.storeListView.viewElement().childNodes[A].childNodes[0].className=""}for(A=0;A<this.stores.length;A++){if(this.stores[A].storeNumber==B.viewElement().id){B.viewElement().className="selected";this.displayStore(this.stores[A])}}},displayStore:function(A){this.setValueForKeyPath(A.storeNumber,"currentStore");this.setValueForKey(false,"showDetails");this.setValueForKeyPath(A,"vCard");this.setValueForKey(true,"showDetails")},displayServiceUnavailable:function(){this.setValueForKey(false,"showForm");this.setValueForKey(false,"showStoreList");this.setValueForKey(false,"showPagination");this.setValueForKey(true,"showError");this.setValueForKey(this.textStrings.searchError,"errorText");this.setValueForKey(true,"showCloseLink")},showNoResultsFoundError:function(){this.setValueForKey(false,"showStoreList");this.setValueForKey(false,"showPagination");this.setValueForKey(true,"showError");this.setValueForKey(this.textStrings.searchNoResults,"errorText");this.setValueForKey(this.textStrings.searchLabel,"searchLabelText")},resetSearchField:function(){this.setValueForKey("","searchLocation");this.locationField.focus()},resetPagination:function(){this.setValueForKey(false,"showPreviousLink");this.setValueForKey(false,"showNextLink")},closeOverlay:function(){this.sendActionToView("hide",FIRST_RESPONDER)},reopen:function(){if(this.showError){this.reset();this.resetPagination();this.resetSearchField();this.setValueForKey(this.textStrings.searchLabel,"searchLabelText")}this.focusLocationField.bindAndDelay(this,500)},reset:function(){this.setValueForKey(true,"showForm");this.setValueForKey(true,"showStoreList");this.setValueForKey(true,"showPagination");this.setValueForKey(false,"showError");this.setValueForKey(false,"showCloseLink");this.setValueForKey(false,"showSearchFieldSpinner");this.setValueForKey(false,"showDetails");this.currentPage=1;this.stores=[];this.storeListView.viewElement().innerHTML=""}});