var Wat={apply:function(C,D,B){if(B){Wat.apply(C,B)}if(C&&D&&typeof D=="object"){for(var A in D){C[A]=D[A]}}return C},applyIf:function(B,C){if(B&&C){for(var A in C){if(typeof B[A]=="undefined"){B[A]=C[A]}}}return B},addClass:function(A,B){A.className=A.className+" "+B},findChildren:function(D,A){var E=[],C;for(var B=0;B<D.childNodes.length;B++){C=D.childNodes[B];if(A.tag){if(!C.tagName){continue}if(A.tag.toLowerCase()!=C.tagName.toLowerCase()){continue}}E[E.length]=C}return E},findChild:function(C,A){var B=this.findChildren(C,A);if(B&&B.length>0){return B[0]}return null},insertFirst:function(A,B){if(A.hasChildNodes()){A.insertBefore(B,A.childNodes[0])}else{A.appendChild(B)}},addEvent:function(C,B,A){B["on"+C]=A;if(B.captureEvents){B.captureEvents(Event[C.toUpperCase()])}}};Wat.TabBar=function(A){A=A||{};this.cfg=A;this._init(A)};Wat.TabBar.prototype={_init:function(A){this._tabsHeader=jQuery("#"+A.containerId+">div>.x-tab");this._tabsContent=jQuery("#"+A.containerId+">.x-box");for(var B=0;B<this._tabsHeader.length;B++){this._addClickEvent(this._tabsHeader[B],B)}},_addClickEvent:function(A,B){Wat.addEvent("click",A,this.activateTab.createDelegate(this,[B],0))},activateTab:function(E,D){var C,B;for(var A=0;A<this._tabsHeader.length;A++){B=this._tabsHeader[A];C=this._tabsContent[A];if(A==E){C.style.display="block";B.style.zIndex=2;if(this.cfg.changeTabAppearanceOnActivate){B.style.color="#FFFFFF";B.style.fontWeight="bold"}}else{C.style.display="none";B.style.zIndex=0;if(this.cfg.changeTabAppearanceOnActivate){B.style.color="#CCCCCC";B.style.fontWeight="normal"}}}}};Function.prototype.createDelegate=function(C,B,A){var D=this;return function(){var F=B||arguments;if(A===true){F=Array.prototype.slice.call(arguments,0);F=F.concat(B)}else{if(typeof A=="number"){F=Array.prototype.slice.call(arguments,0);var E=[A,0].concat(B);Array.prototype.splice.apply(F,E)}}return D.apply(C||window,F)}};Function.prototype.defer=function(C,E,B,A){var D=this.createDelegate(E,B,A);if(C){return setTimeout(D,C)}D();return 0};function watShowProgressFeedback(){document.getElementById("watProgressFeedbackWrapper").style.display="block"}function watHideProgressFeedback(){document.getElementById("watProgressFeedbackWrapper").style.display="none"}function watShowMyCartIcon(){document.getElementById("myCartLink").style.display="block"}function watHideMyCartIcon(){document.getElementById("myCartLink").style.display="none"}