dojo.require("dojo.cookie"),PhysicalStoreCookieJS={storeArray:null,arrayMaxSize:5,getStoreIdsFromCookie:function(){var a=dojo.cookie("WC_physicalStores");if(this.storeArray=new Array,null!=a){var b="",c=a,d=a.length,e=c.indexOf(",");if(e>0){for(;e>=0;)b=c.substring(0,e),this.addToStoreArray(b),c=c.substring(e+1,d),d=c.length,e=c.indexOf(",");b=c,this.addToStoreArray(b)}else d>0&&this.addToStoreArray(c)}return this.storeArray},isAddOneStoreIdExceedMax:function(){var a=!1;return this.getNumStores()+1>this.arrayMaxSize&&(a=!0),a},setStoreIdsToCookie:function(){var a="";for(i=0;i<this.storeArray.length;i++)a+=this.storeArray[i],i<this.storeArray.length-1&&(a+=",");0==a.length?dojo.cookie("WC_physicalStores",null,{path:"/",expires:-1}):dojo.cookie("WC_physicalStores",a,{path:"/"})},addToStoreArray:function(a){for(null==this.storeArray&&this.getStoreIdsFromCookie(),i=0;i<this.storeArray.length;i++)if(this.storeArray[i]==a)return;this.storeArray.length<this.arrayMaxSize&&this.storeArray.push(a)},addToCookie:function(a){this.addToStoreArray(a),this.setStoreIdsToCookie()},removeFromStoreArray:function(a){null==this.storeArray&&this.getStoreIdsFromCookie();var b=-1;for(i=0;i<this.storeArray.length;i++)this.storeArray[i]==a&&(b=i,i=this.storeArray.length);this.storeArray.splice(b,1)},removeFromCookie:function(a){this.removeFromStoreArray(a),this.setStoreIdsToCookie()},clearStoreArray:function(){this.storeArray=new Array},clearCookie:function(){this.clearStoreArray(),this.setStoreIdsToCookie()},getNumStores:function(){return null==this.storeArray&&this.getStoreIdsFromCookie(),this.storeArray.length},getPickUpStoreIdFromCookie:function(){return dojo.cookie("WC_pickUpStore")},setPickUpStoreIdToCookie:function(a){var b=a;if(null!=b&&"undefined"!=b&&""!=b){b!=this.getPickUpStoreIdFromCookie()&&(dojo.cookie("WC_pickUpStore",null,{path:"/",expires:-1}),dojo.cookie("WC_pickUpStore",b,{path:"/"}))}},clearPickUpStoreIdFromCookie:function(a){var b=a;if(null!=b&&"undefined"!=b&&""!=b){b==this.getPickUpStoreIdFromCookie()&&dojo.cookie("WC_pickUpStore",null,{path:"/",expires:-1})}},getValueFromCookie:function(a){return dojo.cookie(a)},setValueToCookie:function(a,b){var c=b;if(null!=c&&"undefined"!=c&&""!=c){c!=this.getValueFromCookie(a)&&(dojo.cookie(a,null,{path:"/",expires:-1}),dojo.cookie(a,c,{path:"/"}))}},clearValueFromCookie:function(a){var b=this.getValueFromCookie(a);null!=b&&"undefined"!=b&&dojo.cookie(a,null,{path:"/",expires:-1})}};