﻿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() { if (!i) return; return 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 doSearch() { location.href = getSearchUrl() } function checkReturn(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 doCart(c) { g_IsCart = true; var b = getCartUrl(c), a = $(".addQty"); if (a != null) b += "&qty=" + a.val(); location.href = b } function doProd(a) { if (!g_IsSearch && !g_IsCart) location.href = a } 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 a = document.getElementById("txtSearch"); return getBaseUrl() + "/store/search/index.aspx?q=" + a.value } function getCartUrl(a) { return getBaseUrl() + "/basket.aspx?id=" + a } function getMaxHeight(a, g, d) { var b = 0; if (d == -1) d = a.length; var c = g + d; if (c > a.length) c = a.length; for (var e = g; e < c; e++) { var f = a[e].offsetHeight; if (f > b) b = f } return b } function adjustHeights() { jQuery(".tileContent").mousedown(function() { $(this).toggleClass("pressed") }).mouseup(function() { $(this).toggleClass("pressed") }); for (var c = $(".tileImage img"), e = $(".tileImage"), a = 0; a < c.length; a += 4) { maxHeight = getMaxHeight(c, a, 4); if (maxHeight > 0) for (var j = Math.min(c.length, a + 4), b = a; b < j; b++) { var i = c[b].offsetHeight; offset = (maxHeight - i) / 2; var k = maxHeight - offset; e[b].style.paddingTop = offset + "px"; e[b].style.height = maxHeight - offset + "px" } } for (var h = $(".tileHeader h2"), d = $(".tileHeader"), a = 0; a < h.length; a += 4) { maxHeight = getMaxHeight(h, a, 4); maxHeight > 0 && d.slice(a, Math.min(a + 4, d.length)).height(maxHeight) } for (var f = $(".tileText span"), g = $(".tileText"), a = 0; a < f.length; a += 4) { maxHeight = getMaxHeight(f, a, 4); maxHeight > 0 && g.slice(a, Math.min(a + 4, g.length)).height(maxHeight) } } function setupPage() { var a = $get("NoJavaScriptNote"); if (a != null) a.style.display = "none" } function $get(a) { if (document.all) return document.all(a); else return document.getElementById(a) } function ajaxRequest() { var b = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"]; if (window.ActiveXObject) for (var a = 0; a < b.length; a++) try { return new ActiveXObject(b[a]) } catch (c) { } else if (window.XMLHttpRequest) return new XMLHttpRequest; else return false } 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(k) { var i = $(k); var si = i.find("StatusInfo"); UpdateUserElements($(si)); for (var j = i.find("ProductDisplayGroups").attr("XmlBasePath"), c = 0; c < a.length; c++) { var b = a[c], g = $(".rotationGroup[data-prefix='" + b + "']"), e = parseInt(g.attr("data-count")), f = g.attr("data-speed"), d = i.find("ProductDisplayGroup[GroupPrefix='" + b + "']"), m = parseInt(d.attr("SequenceNbr")), h = new ProductRotator(j, b, m - e + 1, e); if (f != null) h.SpeedFactor = f; var l = new ProductDisplayGroup(d); ProcessDisplayGroup(h, l) } }) } 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 } var firstpdg = true; 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, d) { a.RotationGroups[a.RotationGroups.length] = d; a.GroupsRetrieved++; a.RotationGroup = d; if (a.GroupsRetrieved == 1) for (i = 0; i < a.RotationGroup.Items.length; i++) { var c = a.RotationGroup.Items[i], b = $get(c.TargetControlID); if (b != null) { if (b.onmouseover == undefined || b.onmouseover == null) { b.onmouseover = function() { selectTile(this) }; b.onmouseout = function() { unselectTile() } } UpdateItem(c, b, a.RotationGroup.ImagePath) } } 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]; a.RotationGroup.ItemIndex++; var c = b.TargetControlID; if (c != g_CurrentItemID && 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 OnFailed(a) { a !== null && alert("An error occurred: " + a.get_message()) } 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 } var g_CurrentItemID, g_CurrentTile = null; function selectTile(a) { g_CurrentItemID = a.id; g_CurrentTile = a } function unselectTile() { g_CurrentItemID = null; g_CurrentTile = null } function UpdateStatus(a) { var b = $get("statusBar"); b.innerHTML = a } function initTilePanel(a) { a.onmouseover = 'this.className="tilePanel tilePanel-hover"'; a.onmouseout = 'this.className="tilePanel"'; a.onmousedown = "this.style.borderStyle='inset'"; a.onmouseup = "this.style.borderStyle='outset'" } typeof Sys !== "undefined" && Sys.Application.notifyScriptLoaded()

