jQuery.ui||function(a){var i=a.fn.remove,f=a.browser.mozilla&&parseFloat(a.browser.version)<1.9;a.ui={version:"1.7.2",plugin:{add:function(e,f,d){var c=a.ui[e].prototype;for(var b in d){c.plugins[b]=c.plugins[b]||[];c.plugins[b].push([f,d[b]])}},call:function(a,e,d){var c=a.plugins[e];if(!c||!a.element[0].parentNode)return;for(var b=0;b<c.length;b++)a.options[c[b][0]]&&c[b][1].apply(a.element,d)}},contains:function(b,a){return document.compareDocumentPosition?b.compareDocumentPosition(a)&16:b!==a&&b.contains(a)},hasScroll:function(b,d){if(a(b).css("overflow")=="hidden")return false;var c=d&&d=="left"?"scrollLeft":"scrollTop",e=false;if(b[c]>0)return true;b[c]=1;e=b[c]>0;b[c]=0;return e},isOverAxis:function(b,a,c){return b>a&&b<a+c},isOver:function(g,c,f,e,b,d){return a.ui.isOverAxis(g,f,b)&&a.ui.isOverAxis(c,e,d)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(f){var c=a.attr,g=a.fn.removeAttr,d="http://www.w3.org/2005/07/aaa",b=/^aria-/,e=/^wairole:/;a.attr=function(f,a,g){var h=g!==undefined;return a=="role"?h?c.call(this,f,a,"wairole:"+g):(c.apply(this,arguments)||"").replace(e,""):b.test(a)?h?f.setAttributeNS(d,a.replace(b,"aaa:"),g):c.call(this,f,a.replace(b,"aaa:")):c.apply(this,arguments)};a.fn.removeAttr=function(a){return b.test(a)?this.each(function(){this.removeAttributeNS(d,a.replace(b,""))}):g.call(this,a)}}a.fn.extend({remove:function(){a("*",this).add(this).each(function(){a(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var b;if(a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position")))b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);else b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b}});a.extend(a.expr[":"],{data:function(c,d,b){return!!a.data(c,b[3])},focusable:function(b){var c=b.nodeName.toLowerCase(),d=a.attr(b,"tabindex");return(/input|select|textarea|button|object/.test(c)?!b.disabled:"a"==c||"area"==c?b.href||!isNaN(d):!isNaN(d))&&!a(b)["area"==c?"parents":"closest"](":hidden").length},tabbable:function(c){var b=a.attr(c,"tabindex");return(isNaN(b)||b>=0)&&a(c).is(":focusable")}});function h(e,f,g,d){function c(c){var b=a[e][f][c]||[];return typeof b=="string"?b.split(/,?\s+/):b}var b=c("getter");if(d.length==1&&typeof d[0]=="string")b=b.concat(c("getterSetter"));return a.inArray(g,b)!=-1}a.widget=function(b,d){var c=b.split(".")[0];b=b.split(".")[1];a.fn[b]=function(d){var e=typeof d=="string",g=Array.prototype.slice.call(arguments,1);if(e&&d.substring(0,1)=="_")return this;if(e&&h(c,b,d,g)){var f=a.data(this[0],b);return f?f[d].apply(f,g):undefined}return this.each(function(){var f=a.data(this,b);!f&&!e&&a.data(this,b,new a[c][b](this,d))._init();f&&e&&a.isFunction(f[d])&&f[d].apply(f,g)})};a[c]=a[c]||{};a[c][b]=function(d,f){var e=this;this.namespace=c;this.widgetName=b;this.widgetEventPrefix=a[c][b].eventPrefix||b;this.widgetBaseClass=c+"-"+b;this.options=a.extend({},a.widget.defaults,a[c][b].defaults,a.metadata&&a.metadata.get(d)[b],f);this.element=a(d).bind("setData."+b,function(b,a,c){if(b.target==d)return e._setData(a,c)}).bind("getData."+b,function(b,a){if(b.target==d)return e._getData(a)}).bind("remove",function(){return e.destroy()})};a[c][b].prototype=a.extend({},a.widget.prototype,d);a[c][b].getterSetter="option"};a.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(b,d){var c=b,e=this;if(typeof b=="string"){if(d===undefined)return this._getData(b);c={};c[b]=d}a.each(c,function(a,b){e._setData(a,b)})},_getData:function(a){return this.options[a]},_setData:function(b,a){this.options[b]=a;b=="disabled"&&this.element[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",a)},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(c,b,f){var g=this.options[c],h=c==this.widgetEventPrefix?c:this.widgetEventPrefix+c;b=a.Event(b);b.type=h;if(b.originalEvent)for(var e=a.event.props.length,d;e;){d=a.event.props[--e];b[d]=b.originalEvent[d]}this.element.trigger(b,f);return!(a.isFunction(g)&&g.call(this.element[0],b,f)===false||b.isDefaultPrevented())}};a.widget.defaults={disabled:false};a.ui.mouse={_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(a){if(b._preventClickEvent){b._preventClickEvent=false;a.stopImmediatePropagation();return false}});if(a.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);a.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(b){b.originalEvent=b.originalEvent||{};if(b.originalEvent.mouseHandled)return;this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var c=this,e=b.which==1,d=typeof this.options.cancel=="string"?a(b.target).parents().add(b.target).filter(this.options.cancel).length:false;if(!e||d||!this._mouseCapture(b))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==false;if(!this._mouseStarted){b.preventDefault();return true}}this._mouseMoveDelegate=function(a){return c._mouseMove(a)};this._mouseUpDelegate=function(a){return c._mouseUp(a)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.browser.safari||b.preventDefault();b.originalEvent.mouseHandled=true;return true},_mouseMove:function(b){if(a.browser.msie&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false;this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)}return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=b.target==this._mouseDownEvent.target;this._mouseStop(b)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}};a.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery);(function(a){a.widget("ui.accordion",{_init:function(){var b=this.options,d=this;this.running=0;if(b.collapsible==a.ui.accordion.defaults.collapsible&&b.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen)b.collapsible=!b.alwaysOpen;if(b.navigation){var c=this.element.find("a").filter(b.navigationFilter);if(c.length)if(c.filter(b.header).length)this.active=c;else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");this.element[0].nodeName=="UL"&&this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||b.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+b.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected);a.browser.msie&&this.element.find("a").css("zoom","1");this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(a){return d._keydown(a)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length)this.headers.eq(0).attr("tabIndex","0");else this.active.attr("aria-expanded","true").attr("tabIndex","0");!a.browser.safari&&this.headers.find("a").attr("tabIndex","-1");b.event&&this.headers.bind(b.event+".accordion",function(a){return d._clickHandler.call(d,a,this)})},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");(a.autoHeight||a.fillHeight)&&b.css("height","")},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(b){var g=this.options,c=a.ui.keyCode;if(g.disabled||b.altKey||b.ctrlKey)return;var e=this.headers.length,f=this.headers.index(b.target),d=false;switch(b.keyCode){case c.RIGHT:case c.DOWN:d=this.headers[(f+1)%e];break;case c.LEFT:case c.UP:d=this.headers[(f-1+e)%e];break;case c.SPACE:case c.ENTER:return this._clickHandler({target:b.target},b.target)}if(d){a(b.target).attr("tabIndex","-1");a(d).attr("tabIndex","0");d.focus();return false}return true},resize:function(){var d=this.options,b;if(d.fillSpace){if(a.browser.msie){var e=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",e);this.headers.each(function(){b-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,b-c)).css("overflow","auto")}else if(d.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,a(this).outerHeight())}).height(b)}},activate:function(b){var a=this._findActive(b)[0];this._clickHandler({target:a},a)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(g,i){var b=this.options;if(b.disabled)return false;if(!g.target&&b.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(b.icons.headerSelected).addClass(b.icons.header);this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),h={options:b,newHeader:a([]),oldHeader:b.active,newContent:a([]),oldContent:e},f=this.active=a([]);this._toggle(f,e,h);return false}var c=a(g.currentTarget||i),d=c[0]==this.active[0];if(this.running||!b.collapsible&&d)return false;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(b.icons.headerSelected).addClass(b.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!d){c.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(b.icons.header).addClass(b.icons.headerSelected);c.next().addClass("ui-accordion-content-active")}var f=c.next(),e=this.active.next(),h={options:b,newHeader:d&&b.collapsible?a([]):c,oldHeader:this.active,newContent:d&&b.collapsible?a([]):f.find("> *"),oldContent:e.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(c[0]);this.active=d?a([]):c;this._toggle(f,e,h,d,j);return false},_toggle:function(d,c,m,j,k){var b=this.options,i=this;this.toShow=d;this.toHide=c;this.data=m;var g=function(){return!i?void 0:i._completed.apply(i,arguments)};this._trigger("changestart",null,this.data);this.running=c.size()===0?d.size():c.size();if(b.animated){var e={};if(b.collapsible&&j)e={toShow:a([]),toHide:c,complete:g,down:k,autoHeight:b.autoHeight||b.fillSpace};else e={toShow:d,toHide:c,complete:g,down:k,autoHeight:b.autoHeight||b.fillSpace};if(!b.proxied)b.proxied=b.animated;if(!b.proxiedDuration)b.proxiedDuration=b.duration;b.animated=a.isFunction(b.proxied)?b.proxied(e):b.proxied;b.duration=a.isFunction(b.proxiedDuration)?b.proxiedDuration(e):b.proxiedDuration;var h=a.ui.accordion.animations,l=b.duration,f=b.animated;if(!h[f])h[f]=function(a){this.slide(a,{easing:f,duration:l||700})};h[f](e)}else{if(b.collapsible&&j)d.toggle();else{c.hide();d.show()}g(true)}c.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();d.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(a){var b=this.options;this.running=a?0:--this.running;if(this.running)return;b.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(b,j){b=a.extend({easing:"swing",duration:300},b,j);if(!b.toHide.size()){b.toShow.animate({height:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide"},b);return}var h=b.toShow.css("overflow"),g,d={},f={},i=["height","paddingTop","paddingBottom"],e,c=b.toShow;e=c[0].style.width;c.width(parseInt(c.parent().width(),10)-parseInt(c.css("paddingLeft"),10)-parseInt(c.css("paddingRight"),10)-(parseInt(c.css("borderLeftWidth"),10)||0)-(parseInt(c.css("borderRightWidth"),10)||0));a.each(i,function(g,c){f[c]="hide";var e=(""+a.css(b.toShow[0],c)).match(/^([\d+-.]+)(.*)$/);d[c]={value:e[1],unit:e[2]||"px"}});b.toShow.css({height:0,overflow:"hidden"}).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(f,{step:function(c,a){if(a.prop=="height")g=(a.now-a.start)/(a.end-a.start);b.toShow[0].style[a.prop]=g*d[a.prop].value+d[a.prop].unit},duration:b.duration,easing:b.easing,complete:function(){!b.autoHeight&&b.toShow.css("height","");b.toShow.css("width",e);b.toShow.css({overflow:h});b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})},easeslide:function(a){this.slide(a,{easing:"easeinout",duration:700})}}})})(jQuery);function getBaseUrl(){var a=location.href.split("/"),b=a[0]+"//"+a[2];if(a[3].indexOf("Arsenic")==0)b+="/"+a[3];return b}function getSearchUrl(){var b=document.getElementById("txtSearch"),a=document.getElementById("hdnSearchBase");return a!=null?a.value+"?q="+b.value:getBaseUrl()+"/search.aspx?q="+b.value}function doSearchOnReturn(b){var a;if(window.event)a=window.event.keyCode;else a=b.keyCode;if(a==13){location.href=getSearchUrl();g_IsSearch=true;return false}else return true}function doSearch(){location.href=getSearchUrl()}function doProd(a){g_SpotlightRotationEnabled=false;location.href=a}function doCart(a,f){g_IsCart=true;var c=1,d=$(".addQty");if(d!=null){var b=d.val();if(b!=undefined&&b!="undefined")c=b}var e=getBaseUrl()+"/webservices/cartservice.aspx";document.body.style.cursor="wait";a.style.cursor="default";a.className+=" btnNoHover";if(a.tagName=="input"||a.tagName=="INPUT")$(a).val("Adding...");else $(a).text("Adding...");$.post(e,{action:"add",id:f,qty:c},function(){location.href=getBaseUrl()+"/cart.aspx"})}function $get(a){return document.all?document.all(a):document.getElementById(a)}function GetProductDisplayGroup(b,a){$.get(a,function(a){var c=new ProductDisplayGroup(a);ProcessDisplayGroup(b,c)})}function InitializeGroups(){var a=[];$(".rotationGroup").each(function(c,b){a[a.length]=b.getAttribute("data-prefix")});$.post("webservices/getInitialDisplayGroup.aspx?prefixList="+a.join(","),"",function(l){var c=$(l),j=c.find("StatusInfo");UpdateUserElements($(j));for(var k=c.find("ProductDisplayGroups").attr("XmlBasePath"),d=0;d<a.length;d++){var b=a[d],h=$(".rotationGroup[data-prefix='"+b+"']"),f=parseInt(h.attr("data-count")),g=h.attr("data-speed"),e=c.find("ProductDisplayGroup[GroupPrefix='"+b+"']"),n=parseInt(e.attr("SequenceNbr")),i=new ProductRotator(k,b,n-f+1,f);if(g!=null)i.SpeedFactor=g;var m=new ProductDisplayGroup(e);ProcessDisplayGroup(i,m)}})}function ProductRotator(c,a,d,b){this.GroupPrefix=a;this.BasePath=c;this.SequenceNbr=d;this.GroupsRetrieved=0;this.GroupIndex=0;this.GroupCount=b;this.SpeedFactor=1;this.Iterations=0;this.MaxIterations=1e3;this.RotationGroups=[]}function GetXmlPath(c){var a=c.SequenceNbr.toString();a="000".substr(0,4-a.length)+a;var b=c.BasePath+"/"+c.GroupPrefix+"_"+a+".xml";if(location.href.indexOf("https")==0)b=b.replace("http:","https:");return b}function ProductDisplayGroup(b){this.ImagePath=$("ImagePath",b).text();this.ItemIndex=parseInt($("ItemIndex",b).text());this.Items=[];for(var c=$("ProductDisplayItem",b),a=0;a<c.length;a++)this.Items[a]=new ProductDisplayItem(c[a])}function ProductDisplayItem(a){this.TargetControlID=$("TargetControlID",a).text();this.ImageOffset=$("ImageOffset",a).text();this.TargetUrl=$("TargetUrl",a).text();this.Name=$("Name",a).text();this.Width=$("Width",a).text();this.Height=$("Height",a).text()}function adjustHeaderVisibility(){for(var b=document.getElementsByTagName("THEAD"),a=0;a<b.length;a++)b[a].style.display=null}function ProcessDisplayGroup(a,b){a.RotationGroups[a.RotationGroups.length]=b;a.GroupsRetrieved++;a.RotationGroup=b;a.TimerID=setInterval(function(){ReplaceItem(a)},Math.round(a.SpeedFactor*5e4/(a.GroupCount*a.RotationGroup.Items.length)))}function ReplaceItem(a){var b=a.RotationGroup.Items[a.RotationGroup.ItemIndex];if(b==null)return;a.RotationGroup.ItemIndex++;var c=b.TargetControlID;if(b.ImageOffset!=-1){var d=$get(c);UpdateItem(b,d,a.RotationGroup.ImagePath)}if(a.RotationGroup.ItemIndex==a.RotationGroup.Items.length){a.RotationGroup.ItemIndex=0;if(a.GroupsRetrieved<a.GroupCount){clearInterval(a.TimerID);a.SequenceNbr++;var e=GetXmlPath(a);GetProductDisplayGroup(a,e)}else{a.GroupIndex=(a.GroupIndex+1)%a.GroupCount;a.RotationGroup=a.RotationGroups[a.GroupIndex];++a.Iterations==a.MaxIterations&&clearInterval(a.TimerID)}}}function UpdateItem(a,f,l){if(f!=null){var d=null,m=null,o=null;if(f.tagName=="TABLE"){var n=findChild(f,"TBODY"),h;if(n!=null){h=findChild(n,"TR");o=findNthChild(n,"TR",2)}else{h=findChild(f,"TR");o=findNthChild(f,"TR",2)}var e=findChild(h,"TD"),b=findChild(e,"DIV");if(b!=null&&b.className.indexOf("prg")==0){b.style.backgroundPosition=a.ImageOffset+"px 0px";b.style.backgroundImage="url("+l+")";b.style.width=a.Width+"px";b.style.height=a.Height+"px";b.style.top=(b.parentNode.offsetHeight-a.Height)/2+"px";b.style.left=(b.parentNode.offsetWidth-a.Width)/2+"px"}else{var r=findNthChild(h,"TD",3),g;if(r!=null)g=findChild(r,"DIV");if(g!=null&&g.className.indexOf("prg")==0){g.style.backgroundPosition=a.ImageOffset+"px 0px";g.style.backgroundImage="url("+l+")";g.style.width=a.Width+"px";g.style.height=a.Height+"px";g.style.top=(g.parentNode.offsetHeight-a.Height)/2+"px";g.style.left=(g.parentNode.offsetWidth-a.Width)/2+"px"}else{d=findChild(e,"A");if(d==null||findChild(d,"DIV")==null){h=findNthChild(n,"TR",2);if(h!=null){e=findChild(h,"TD");d=findChild(e,"A")}}var q=findNthChild(h,"TD",2);if(q!=null)m=findChild(q,"A");if(d!=null){var k=findChild(d,"DIV");k.style.backgroundPosition=a.ImageOffset+"px 0px";k.style.backgroundImage="url("+l+")";k.style.width=a.Width+"px";k.style.height=a.Height+"px";k.style.top=(k.parentNode.offsetHeight-a.Height)/2+"px";k.style.left=(k.parentNode.offsetWidth-a.Width)/2+"px"}}}}else{var p=findChild(f,"TABLE");if(p!=null){var e=p.rows[0].cells[0],i=findChild(e,"DIV");if(i!=null&&i.className.indexOf("prg")==0){i.style.backgroundPosition=a.ImageOffset+"px 0px";i.style.backgroundImage="url("+l+")";i.style.width=a.Width+"px";i.style.height=a.Height+"px";i.style.top=(i.parentNode.offsetHeight-a.Height)/2+"px";i.style.left=(i.parentNode.offsetWidth-a.Width)/2+"px"}else{e.style.backgroundPosition=a.ImageOffset+"px 0px";e.style.backgroundImage="url("+l+")";e.style.width=a.Width+"px";e.style.height=a.Height+"px";e.style.top=(e.parentNode.offsetHeight-a.Height)/2+"px";e.style.left=(e.parentNode.offsetWidth-a.Width)/2+"px"}}else{var b=findChild(f,"DIV");if(b!=null&&b.className.indexOf("prg")==0){b.style.backgroundPosition=a.ImageOffset+"px 0px";b.style.backgroundImage="url("+l+")";b.style.width=a.Width+"px";b.style.height=a.Height+"px";b.style.top=(b.parentNode.offsetHeight-a.Height)/2+"px";b.style.left=(b.parentNode.offsetWidth-a.Width)/2+"px"}}d=findChild(f,"A");if(d==null){var t=findChild(f,"H2");if(t!=null)d=findChild(t,"A")}}var c=findChild(d,"SPAN");if(c==null)c=findChild(f,"SPAN");if(c==null&&m!=null){c=findChild(m,"SPAN");if(c==null)c=findChild(m,"H2")}if(c==null){var u=findChild(f,"THEAD");if(u!=null){var h=findChild(u,"TR");if(h!=null)c=findChild(h,"TD")}}if(c==null&&o!=null)c=findChild(h,"TD");if(c==null&&a.Name!="-"&&(a.TargetUrl==null||a.TargetUrl==""))c=f;if(a.TargetUrl!="-"){if(d!=null)d.href=a.TargetUrl;if(m!=null)m.href=a.TargetUrl}if(a.Name!="-"&&a.Name!=""&&c!=null){c.innerHTML=a.Name;var j=a.Name;if(j.charAt(0)=="(")j=j.substr(1,j.length-2);var s=j.indexOf("<br");if(s>=0)j=j.substr(0,s);if(d!=null)d.title=j}}}function findChild(a,c){if(a!=null&&a.childNodes!=null)for(ci=0;ci<a.childNodes.length;ci++){var b=a.childNodes[ci];if(b.tagName==c)return b}return null}function findNthChild(a,c,d){if(a!=null&&a.childNodes!=null)for(ci=0;ci<a.childNodes.length;ci++){var b=a.childNodes[ci];if(b.tagName==c&&--d==0)return b}return null}function showSignIn(){var a=parseInt($("#IsAuthenticated").val());if(a==0){$("#trExistingPassword").show();$("#trRememberMe").show();$("#trResetInstructions").hide();$("#trPasswordReset").show();$("[id$=btnSignIn]").show();$("[id$=btnResetPassword]").hide();$("#trNewUserCheckoutInstructions").hide();$("#trNewUserInstructions").show();$("[id$=btnSignInContinue]").hide();$("#btnSignInSignUp").show();$("[id$=hdnIsRequiredSignIn]").val("0");$("#SignInDialog").overlay().load();$("[id$=lblFailureText]").text("");$("[id$=txtExistingUserName]").focus();return false}else return true}function showCheckoutSignIn(){var a=parseInt($("#IsAuthenticated").val()),b=parseInt($("#NewUserContinue").val());if(a==0&&b==0){$("#trExistingPassword").show();$("#trRememberMe").show();$("#trResetInstructions").hide();$("#trPasswordReset").show();$("[id$=btnSignIn]").show();$("[id$=btnResetPassword]").hide();$("#trNewUserCheckoutInstructions").show();$("#trNewUserInstructions").hide();$("[id$=btnSignInContinue]").show();$("#btnSignInSignUp").hide();$("[id$=hdnIsRequiredSignIn]").val("1");$("#SignInDialog").overlay().load();return false}else return true}function showResetPassword(){$("[id$=lblFailureText]").text("");$("#trExistingPassword").hide();$("#trRememberMe").hide();$("#trResetInstructions").show();$("#trPasswordReset").hide();$("[id$=btnSignIn]").hide();$("[id$=btnResetPassword]").show();var a=$("[id$=txtExistingUserName]"),b=$("[id$=btnResetPassword]");setButtonState(b,a);a.focus().keypress(function(c){var d=a.val().length;if(c.keyCode=="13"){c.preventDefault();c.stopPropagation();d>0&&b.click()}}).keyup(function(){setButtonState(b,a)})}function setButtonState(a,b){if(b.val().length)a.removeClass("ButtonDisabled");else a.addClass("ButtonDisabled")}function checkSignInParameters(){return $("[id$=txtExistingUserName]").val().length>0&&$("[id$=txtExistingPassword]").val().length>0}function checkResetParameters(){return $("[id$=txtExistingUserName]").val().length>0}var g_ClickedButtons=[];function alreadyClicked(a,b){if(g_ClickedButtons[a.id]=="true")return true;else{g_ClickedButtons[a.id]="true";a.style.cursor="default";a.style.filter="alpha(style=0,opacity=80)";a.style.opacity="0.8";a.className+=" btnNoHover";if(b!=undefined&&b!="undefined")a.value=b;return false}}function doSignInIfReturn(c){var b;if(window.event)b=window.event.keyCode;else b=c.keyCode;if(b==13){var a=$("[id$=btnSignIn]");if(a.css("display")=="none")a=$("[id$=btnResetPassword]");a.css("display")!="none"&&a.click();return false}else return true}function tabOnReturn(d,c){var a;if(window.event)a=window.event.keyCode;else a=d.keyCode;if(a==13){var b=$("[id$="+c+"]");if(b.length){b.focus();b.select()}return false}else return true}function doSignUp(a){var b=$("#SignInDialog");b.disabled=true;var c=getBaseUrl()+"/"+a+".aspx";if(a=="userprofile")c+="?ReturnUrl="+location.href;location.href=getBaseUrl()+"/"+a+".aspx"}function LoadMessageDialog(b,a){$("#MessageBoxTitle").append(b);$("#MessageBoxBody").append(a);$("#MessageBox").overlay({top:"center",left:"center",effect:"default",expose:{color:"#000",loadSpeed:50,opacity:.7},close:"#MessageBoxOKButton",closeOnClick:false,closeOnEsc:true,load:true,speed:50})}function InitSignInDialog(){var b=$("#FailedSignIn").val();if(b=="PR0"){var c=$("#FailureText").val();$("#FailureText").val("");LoadMessageDialog("Password Reset",c);return}$("[id$=lblFailureText]").text($("#FailureText").val());var a=b=="1"||b=="2"||location.href.indexOf("signin.aspx")>=0;if(a){$("#FailedSignIn").val("0");$("#FailureText").val("");$("[id$=btnSignInContinue]").hide()}$("#SignInDialog").overlay({top:"center",left:"center",effect:a?"default":"apple",expose:{color:"#000",loadSpeed:a?0:200,opacity:.7},closeOnClick:false,closeOnEsc:true,fixed:false,load:a,speed:a?0:"normal",onLoad:function(){$("[id$=txtExistingUserName]").focus()}});a&&$("[id$=txtExistingUserName]").focus()}function UpdateUserElements(a){var c=parseInt(a.find("CartItems").text());$("#CartItemCount").text(c.toString());var b=a.find("IsAuthenticated").text();$("#IsAuthenticated").val(b);if(b=="1"){$("#SignInText").text(a.find("LoginText").text());$("#SignInLink").text(" [Sign Out]")}else{$("#SignInText").text("");$("#SignInLink").text("Sign In")}$("#UserMenuItems").html(a.find("MenuItems").text())}function NSRandom(){var c=0,a=[],b=0;function d(d){if(a.length>=b-1){var e=a[a.length-1];a=[];a[0]=e}for(var c=0;c<a.length;c++)if(a[c]==d)return true;a[a.length]=d;return false}this.Next=function(f){if(f==1)return 0;b=f;var h=0;while(true){var e=Math.floor(Math.random()*f),i=Math.abs(e-c)%f,g=Math.floor((f+3)/4);if(i>=g&&!d(e)){c=e;return e}if(++h==b*3){a=[];d(e);return e}}}}function TileRotator(c){var d=c,e=0,b=new NSRandom,a=new NSRandom;this.Rotate=function(){var j=$("#rotationList",d);if(j.length){var l=j.size(),c=0;if(l>1)c=b.Next(l);var r=c,m=j.eq(c),k=m.val().split(",");c=a.Next(k.length);var i=k[c].split(":"),n=i[0],p=i[1],o=i[2],e=m.next("img"),h=e.next("img");if(h.length){h.show();e.remove();e=h}var f=e.attr("src");c=f.lastIndexOf("/");var q=f.lastIndexOf(".");f=f.substr(0,c+1)+n+f.substr(q);var g=e.clone();g.attr("style","width:"+p+"px;height:"+o+"px");g.attr("src",f);g.hide();g.insertAfter(e)}}}function tileSelected(c){var b=$("h2",c).text(),a=$(".ui-accordion-header").index($("h2:contains('"+b+"')"));if(a<0)a=0;$("#CurrentDepartmentSelector").val(a)}function preloadImages(g){if(document.images){var a=0,c=g.split(","),e=new Image,d=location.href,a=d.indexOf(":"),f=d.substr(0,a),b;if(f=="http")b="http://s.arsenic.com/";else b="https://www.arsenic.com/";for(var a=0;a<c.length;a++)e.src=b+c[a]}}function checkSearch(){var a=g_IsSearch;g_IsSearch=false;return!a}function homePageReady(){g_IsReady=true;SetupHeaderImages();loadSpotlights();InitSignInDialog();$("#DepartmentCategoryMenu").accordion({header:"h2",autoHeight:false,collapsible:true,active:null});$("#DepartmentCategoryMenu").accordion("activate",false);$(".TileList").each(function(){var a=$(this),b=new TileRotator(a);setInterval(b.Rotate,400)});$("#SpotlightPanel.tilePanel").each(function(c,a){var b=new TileRotator(a);setInterval(b.Rotate,4e3)});$(".FB_SERVER_IFRAME").css("visibility","visible").show();$(".cTile > .tileContent").click(function(){tileSelected(this);location.href=$(this).find("a").attr("href")});$(".hpsidepanel h1 a").each(function(){var a=$(this).attr("href");$(this).parent().css("cursor","pointer").click(function(){location.href=a})});SetupButtons()}function SetupButtons(){$("[class $= 'Button']").mousedown(function(){$(this).css("border-style","inset")}).mouseup(function(){$(this).css("border-style","outset")})}var g_HeaderImagePairs=null,g_HeaderImageIndex=-1;function SetupHeaderImages(){g_HeaderImagePairs=$.parseJSON($("#HeaderImages").val());LoadHeaderImages();setInterval(function(){LoadHeaderImages()},8e3)}function LoadHeaderImages(){if(g_HeaderImagePairs!=null){if(++g_HeaderImageIndex==g_HeaderImagePairs.length)g_HeaderImageIndex=0;var a=g_HeaderImagePairs[g_HeaderImageIndex];loadImage("#leftLogoImage div",a.Left);loadImage("#rightLogoImage div",a.Right)}}function loadImage(a,b){var c=new Image;$(c).load(function(){$(this).hide();$(a).empty().append(this);var d=$(this).parent(),c=$(this).width(),b=$(this).height(),h=d.width(),g=d.height(),f=125/75,e=c/b;if(e>f){c=125;b=c/e;$(this).css("width",c).css("height",b)}else{b=75;c=b*e;$(this).css("height",b).css("width",c)}d.css("left",Math.floor((125-$(this).width())/2));d.css("top",Math.floor((75-$(this).height())/2));$(this).fadeIn("slow")}).attr("src","http://s.arsenic.com/"+b)}function trace(b){var a=$("#debugLog");if(!a.length){a=$("<div id='#debugLog'></div>");$("#HomePage").parent().append(a)}a.append("<div>"+(new Date).toTimeString()+": "+b+"</div>")}function setupCollectionBrowsers(){$(".scrollable").scrollable({circular:true}).each(function(){$(".items img",this).click(function(){if($(this).hasClass("active"))return;var b=$(this).attr("rel"),a=$(this).parents(".otherProductsPanel").prev();a.load(b+" #ProductContent");$(".items img").removeClass("active");$(this).addClass("active")});var a=$(this);setInterval(function(){var c=a.data("scrollable"),e=c.getItems().eq(c.getIndex()).children(),d=e.filter(".active").removeClass("active");if(!d.length)d=e.eq(0);var b=d.next();if(!b.length)b=c.next().getItems().eq(c.getIndex()).children().eq(0);b.addClass("active");var g=b.attr("rel"),f=e.parents(".otherProductsPanel").prev();f.load(g+" #ProductContent")},5e3)})}function getProductGroups(d,b){for(var e=d.Products.length/b,c=[],a=0;a<e;a++)c[a]={Products:d.Products.slice(a*b,(a+1)*b)};return c}function getSpotlightImageStyle(a,b){var d=b/Math.max(a.Width,a.Height),e=Math.floor(a.Width*d),c=Math.floor(a.Height*d),f=(b-e)/2,g=(b-c)/2;return"width: "+e+"px; height: "+c+"px; padding-left: "+f+"px; padding-right: "+f+"px; padding-top: "+g+"px; padding-bottom: "+g+"px"}function showSpotlightProduct(d,a){var c=d.find("img"),f=a.attr("src"),j=f.indexOf("/icons");c.attr("src",f.substr(0,j+1)+a.attr("imgName"));c.attr("title",a.attr("title"));var g=1.3,e=a.width()*g,b=a.height()*g;if(e==0)e=130;if(b==0)b=130;var h=(130-b)/2+5;c.css({width:e,height:b,"margin-top":h+10,"margin-bottom":h});c.click(function(){doProd(a.attr("path").substr(1))});var i=d.find(".productDescWrapper");i.find("h2 div").text(a.attr("title"));i.find(".productDesc").html(a.attr("desc"));d.next().find(".items img").removeClass("active");a.addClass("active")}var g_SpotlightRotationEnabled=true;function loadSpotlights(){for(var g=getBaseUrl()+"/webservices/getSpotlights.aspx",b=$("[id ^= Spotlight]"),c=[],a=0;a<b.length;a++){var e=b.eq(a),d=e.find("img").attr("rel");d!=undefined&&c.push(e.attr("id")+"="+d)}var f=c.join("&");$.get(g,f,function(a){$.each(a,function(b,a){loadSpotlightItem(b,a)})})}function loadSpotlightItem(f,e){var b=$("#Spotlight"+e.SpotlightSequence);if(b.length){$.tmpl($("#itemTemplate",b).html(),getProductGroups(e,4)).appendTo($(".items",b));var a=$(".scrollable",b);a.scrollable({circular:true});var d=b.find("#ProductContentWrapper"),c=d.next().find(".overlayMask");d.hover(function(){a.addClass("disabled");c.show();c.parent().find(".paused").toggleClass("hidden")},function(){a.removeClass("disabled");c.hide();c.parent().find(".paused").toggleClass("hidden")});$(".items img",a).hover(function(){if($(this).hasClass("active"))return;showSpotlightProduct(d,$(this));$(".items img").removeClass("active");$(this).addClass("active");a.addClass("disabled")},function(){a.removeClass("disabled")}).click(function(){doProd($(this).attr("path").substr(1))});setInterval(function(){if(!g_SpotlightRotationEnabled||a.hasClass("disabled"))return;var b=a.data("scrollable"),d=b.getItems().eq(b.getIndex()).children(),c=d.filter(".active").removeClass("active");if(!c.length)c=d.eq(0);var e=c.next();if(!e.length)e=b.next().getItems().eq(b.getIndex()).children().eq(0);var f=d.parents(".otherProductsPanel").prev();showSpotlightProduct(f,e)},3e3)}}function loadSignInDialog(a){var b=getBaseUrl()+"/signindialog.aspx";$("#loginPopup").load(b,function(){$("#SignInDialog").overlay({top:"10%",left:"center",effect:"apple",expose:{color:"#000",loadSpeed:200,opacity:.7},closeOnClick:false,closeOnEsc:true,speed:"normal",fixed:false,load:true});a!=undefined&&a()})}
