var StringBuilder;String.prototype.stripSpaces=function(){return this.replace(/\s/g,"")},String.prototype.stripNonAlphaNumeric=function(){return this.replace(/\W/g,"")},String.prototype.formatter=function(){return String.formatter(this,arguments.length==1?arguments[0]:arguments)},String.prototype.sanitise=function(){return String.sanitise(this)},String.prototype.toImageUrl=function(){return String.toImageUrl(this,arguments.length==1?arguments[0]:arguments)},String.sanitise=function(n){return n.replace(/\W/g,"").replace(/\s/g,"")},String.toImageUrl=function(n,t){var o="",i=new StringBuilder,e,s,f;i.append(n.toString().toLowerCase()),e=0;for(s in t)t.hasOwnProperty(s)&&e++;e>0&&i.append("?");var r="",h=!1,u="";try{u=sol.config.settings.getSetting("max").imageResizerPrefix}catch(c){}for(f in t){r=f.toLowerCase();switch(r){case"prefix":u=t[f];break;case"404":h=!0;default:i.appendFormat("&{0}={1}",r,t[f])}}return h||i.append("&404=default.jpg"),o=u.length>0?"{0}{1}".formatter(u,i.toString()):i.toString(),r=null,o},String.formatter=function(n,t){var i=function(n,t){var u=function(n){return typeof n=="number"?Number:typeof n=="boolean"?Boolean:typeof n=="string"?String:n.constructor}(n),i=u.prototype,r=typeof n!="string"?i?i.formatter||i.toString:n.format||n.toString:n.toString;return r?typeof t=="undefined"||t==""?r.call(n):r.call(n,t):""};return arguments.length==1?function(){return String.formatter.apply(null,[n].concat(Array.prototype.slice.call(arguments,0)))}:(arguments.length==2&&typeof t!="object"&&typeof t!="array"&&(t=[t]),arguments.length>2&&(t=Array.prototype.slice.call(arguments,1)),n=n.replace(/\{\{|\}\}|\{([^}: ]+?)(?::([^}]*?))?\}/g,function(n,r,u){return n=="{{"?"{":n=="}}"?"}":typeof t[r]!="undefined"&&t[r]!==null?i(t[r],u):""}))},StringBuilder=function(){this.buffer=[]},StringBuilder=function(){this.buffer=[]},StringBuilder.prototype={append:function(n){return this.buffer.push(n),this},appendLine:function(n){return this.buffer.push("\n"),this.buffer.push(n),this},appendN:function(n,t){for(var i=0;i>>0,i,u,t,r;if(typeof n!="function")throw new TypeError;for(i=[],u=arguments[1],t=0;t0&&arguments[0].enabler||function(){return!0},this.updateState=function(){},this.isEnabled=!0,this.validationRules=[],this.displayValidationError=function(n){this.removeValidationError(),this.element.after(String.format('{0}<\/span><\/span>',n))},this.removeValidationError=function(){var n=this.element.next();n.hasClass("field-validation-error")&&n.remove()},this.isValid=function(){for(var t="",n=0;n0?(this.displayValidationError(t),!1):(this.removeValidationError(),!0)}}}),sol.controls.ControlBase.prototype=new sol.events.Eventable,String.prototype.stripSpaces=function(){return this.replace(/\s/g,"")},String.prototype.stripNonAlphaNumeric=function(){return this.replace(/\W/g,"")},String.prototype.formatter=function(){return String.formatter(this,arguments.length==1?arguments[0]:arguments)},String.prototype.sanitise=function(){return String.sanitise(this)},String.prototype.toImageUrl=function(){return String.toImageUrl(this,arguments.length==1?arguments[0]:arguments)},String.sanitise=function(n){return n.replace(/\W/g,"").replace(/\s/g,"")},String.toImageUrl=function(n,t){var o="",i=new StringBuilder,e,s,f;i.append(n.toString().toLowerCase()),e=0;for(s in t)t.hasOwnProperty(s)&&e++;e>0&&i.append("?");var r="",h=!1,u="";try{u=sol.config.settings.getSetting("max").imageResizerPrefix}catch(c){}for(f in t){r=f.toLowerCase();switch(r){case"prefix":u=t[f];break;case"404":h=!0;default:i.appendFormat("&{0}={1}",r,t[f])}}return h||i.append("&404=default.jpg"),o=u.length>0?"{0}{1}".formatter(u,i.toString()):i.toString(),r=null,o},String.formatter=function(n,t){var i=function(n,t){var u=function(n){return typeof n=="number"?Number:typeof n=="boolean"?Boolean:typeof n=="string"?String:n.constructor}(n),i=u.prototype,r=typeof n!="string"?i?i.formatter||i.toString:n.format||n.toString:n.toString;return r?typeof t=="undefined"||t==""?r.call(n):r.call(n,t):""};return arguments.length==1?function(){return String.formatter.apply(null,[n].concat(Array.prototype.slice.call(arguments,0)))}:(arguments.length==2&&typeof t!="object"&&typeof t!="array"&&(t=[t]),arguments.length>2&&(t=Array.prototype.slice.call(arguments,1)),n=n.replace(/\{\{|\}\}|\{([^}: ]+?)(?::([^}]*?))?\}/g,function(n,r,u){return n=="{{"?"{":n=="}}"?"}":typeof t[r]!="undefined"&&t[r]!==null?i(t[r],u):""}))},StringBuilder=function(){this.buffer=[]},StringBuilder=function(){this.buffer=[]},StringBuilder.prototype={append:function(n){return this.buffer.push(n),this},appendLine:function(n){return this.buffer.push("\n"),this.buffer.push(n),this},appendN:function(n,t){for(var i=0;i>>0,i,u,t,r;if(typeof n!="function")throw new TypeError;for(i=[],u=arguments[1],t=0;t]+)>)/gi;return n.replace(t,"")},getQueryStringArgs:function(n){for(var u=$("a.url").data("name").toLowerCase(),f=u.indexOf("?")+1,h=f>0?u.substring(f):"",i={},e=h.split("&"),r=null,o=null,s=null,t=0;t0?i[n]||"":i},getLinksStringArgs:function(){var n;if(location.hash.length<=1)return"";var e=location.hash.length>0?location.hash.substring(1):"",r={},t=e.split("&"),i=null,u=null,f=null;for(n=0;n0&&(i=t[n].split("="),u=decodeURIComponent(i[0]),f=decodeURIComponent(i[1]),r[u]=f);return r},updateHashStringParameter:function(n){var t="",o;if(typeof arguments[0]=="object"){for(i=0;i<=n.length-1;i++)n[i].value.length>0&&(t+=n[i].name+"="+n[i].value+"&");t.length>0&&(t=t.substring(0,t.length-1))}else{var r=location.hash,f=arguments[0],u=arguments[1],e=new RegExp("([#|&])"+f+"=.*?(&|$)","i"),s=r.indexOf("#")!==-1?"&":"#";r.match(e)?(t=r.replace(e,"$1"+f+"="+u+"$2"),(u.length==0||u==0)&&(t=r.replace(e,"&"))):t=r+s+f+"="+u}o=new RegExp("&$","i"),location.hash=t.match(o)?t.replace(o,""):t.length>0?t:""},createCookie:function(n){var t,i;n=$.extend({name:"",value:"",days:30,callback:""},n||{}),n.days>0?(t=new Date,t.setTime(t.getTime()+n.days*864e5),i="; expires="+t.toGMTString()):i="",document.cookie=n.name+"="+n.value+i+"; path=/"},readCookie:function(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;iRRP {0}<\/div>
BUY 2 SAVE {1}<\/div>
BUY 3 SAVE {2}<\/div>
BUY 4-9 SAVE {3}<\/div>
BUY 10+ SAVE {4}<\/div>'.formatter(t(i),t(u),t(w),t(k),t(g))}else if(n.PromoCategoryId==f[1]){$(".related_{0} .badge, .p{0} .badge".formatter(n.ProductId)).addClass("special-badge");var i=n.MaxRRP,r=n.MinPrice,u=i-r;u<0&&(r=i,u=0),e='
RRP {0}<\/div>
OUR PRICE {1} each<\/div>
SAVE {2}'.formatter(t(i),t(r),t(u))}else if(n.PromoCategoryId==f[0]){$(".related_{0} .badge, .p{0} .badge".formatter(n.ProductId)).addClass("deal-badge");var i=n.MaxRRP,r=n.MinPrice,u=i-r;u<0&&(r=i,u=0),e='
RRP {0}<\/div>
OUR PRICE {1} each<\/div>
SAVE {2}'.formatter(t(i),t(r),t(u))}else if(n.PromoCategoryId==f[2]){$(".related_{0} .badge, .p{0} .badge".formatter(n.ProductId)).addClass("gift-badge");var i=n.MaxRRP,r=n.MinPrice,u=i-r;u<0&&(r=i,u=0),e=u<=0?'
RRP {0} <\/div>
{1}'.formatter(t(i),n.MerchandisingMessage):'
RRP {0} <\/div>
OUR PRICE {1}<\/div>
{2}'.formatter(t(i),t(r),n.MerchandisingMessage)}}else if(n=$.extend({MaxRRP:0,MaxPrice:0,MinPrice:0,MinRRP:0,Sale:0,Short:!1,Increaser:1},n||{}),n.MinPrice*=c,n.MaxPrice*=c,n.MinRRP*=c,n.MaxRRP*=c,n.Short)e=n.Sale&&n.MaxRRP!=n.MinPrice?v.formatter(t(n.MaxRRP),t(n.MinPrice)):t(n.MaxRRP);else if(n.Sale)if(s=n.MaxRRP>n.MinRRP?h.formatter(t(n.MinRRP),t(n.MaxRRP)):t(n.MaxRRP),n.isOnPromotion){switch(n.ShowOnListingId){case l.CALCULATED_PRICE_NO_MESSAGE:o=n.MinPriceRRP {0} EACH <\/div>
BUY 2 FOR {1} EACH - SAVE {2}<\/div>
BUY 3 FOR {3} EACH - SAVE {4}<\/div>
BUY 4-9 FOR {5} EACH - SAVE {6}<\/div>
BUY 10+ FOR {7} EACH - SAVE {8}<\/div>'.formatter(t(i),t(u),t(e),t(c),t(y),t(l),t(p),t(a),t(w))}else if(n.PromoCategoryId==r[1]){$(".images .main").addClass("SpecialBadge");var i=n.RRP,u=n.CalculatedPrice,e=i-u;f='
RRP {0}<\/div>
OUR PRICE {1} each<\/div>
SAVE {2}'.formatter(t(i),t(u),t(e))}else if(n.PromoCategoryId==r[0]){$(".images .main").addClass("DealBadge");var i=n.RRP,u=n.CalculatedPrice,e=i-u;f='
RRP {0}<\/div>
OUR PRICE {1} each<\/div>
SAVE {2}'.formatter(t(i),t(u),t(e))}else if(n.PromoCategoryId==r[2]){$(".images .main").addClass("GiftBadge");var i=n.RRP,u=n.CalculatedPrice,e=i-u;e<0&&(u=i,e=0),f=e<=0?'
RRP {0}<\/div>
{1}'.formatter(t(i),n.MerchandisingMessage):'
RRP {0}<\/div>
OUR PRICE {1}<\/div>
{2}'.formatter(t(i),t(u),n.MerchandisingMessage)}}else if(n.isOnPromotion)switch(n.ShowOnListingId){case o.CALCULATED_PRICE_NO_MESSAGE:f=h.formatter(t(n.RRP),t(n.CalculatedPrice));break;case o.RRP_AND_MESSAGE:f=t(n.RRP);break;case o.CALCULATED_PRICE_WITH_MESSAGE:f=h.formatter(t(n.RRP),t(n.CalculatedPrice));break;case o.RRP_ONLY:f=t(n.RRP);break;default:f=t(n.RRP)}else f=n.Sale&&n.CalculatedPrice0?n.productId:settings("product").productId,n.categoryId=n.categoryId>0?n.categoryId:settings("product").categoryId,t="{0}?categoryId={1}&productId={2}".formatter(sol.config.settings.getSetting("max").productPage,n.categoryId,n.productId),n.link&&(t=i.link.formatter("productLink",t,n.text)),t},formatPrice:function(n){return accounting.formatMoney(n,sol.config.settings.getSetting("max").formatCurrencyShort.formatter(""))}}}),Namespace("sol.aws.format",{formatStrings:{button:"{1}<\/span><\/a>",hyperlink:"{3}<\/a>",img:"{0}?height={2}&width={1}&404=default.jpg",link:"{2}<\/span><\/a>",p:"

{1}<\/p>",span:"{1}<\/span>",error:"

{1}<\/p>"}}),Namespace("sol.aws.format",{templates:{wishListPopup:function(n){n=$.extend({id:"WishListPop",title:"Popup",content:"

content<\/p>",footer:"",width:400,height:400},n||{});var t=['