if (typeof window.Hp == "undefined") window.Hp = {}; Hp.VPivot = function(b) { var a = { Id: "controlid", MinTileExpand: 20, PrefetchEnabled: !0, Slowdown: 1, PivotAdvanceTime: 1e3, LoadingFadeTime: 400, TileNudgeTime_Show: 200, TileNudgeTime_Hide: 150, Entry: 0, Exit: 0, Padding: 0, DataErrorMessage: "There was a problem getting the proper data." }, c = { BodyAnimationInProgress: !1, BaseWidth: 887 }; $.extend(a, b); $.extend(this, c); this.Control = $("#" + a.Id); this.LTR = document.documentElement.dir != "rtl"; this.BodyAnimationInProgress = !1; this.MinTileExpand = a.MinTileExpand >= 0 ? a.MinTileExpand: 20; this.PrefetchEnabled = a.PrefetchEnabled; a.Slowdown = a.Slowdown >= 0 ? a.Slowdown: 1; this.PivotAdvanceTime = a.PivotAdvanceTime * a.Slowdown; this.LoadingFadeTime = a.LoadingFadeTime * a.Slowdown; this.TileNudgeTime_Show = a.TileNudgeTime_Show * a.Slowdown; this.TileNudgeTime_Hide = a.TileNudgeTime_Hide * a.Slowdown; if (!this.LTR && $.browser.msie && parseInt($.browser.version) < 8) this.PivotAdvanceTime = 1; this.Entry = 130 >= a.Entry && a.Entry >= -10 ? a.Entry: 0; this.Exit = 0 >= a.Exit && a.Exit >= -20 ? a.Exit: 0; this.Padding = 130 >= a.Padding && a.Padding >= -10 ? a.Padding: 0; this.DataErrorMessage = a.DataErrorMessage; $($.proxy(this.Ready, this)) }; Hp.VPivot.prototype = { Ready: function() { this.TilePanel = this.Control.find(".hpVpv_TilePanel"); this.BodyVisibleWindow = this.Control.find(".hpVpv_BodyWindow"); this.BodyPanel = this.Control.find(".hpVpv_BodyPanel"); this.TilePanelChildren = this.TilePanel.find("li"); this.BodyPanelChildren = this.BodyPanel.find(".hpVpv_BodyUnit"); this.AdvanceDistance = this.BaseWidth + this.Padding; this.TileHeight = this.TilePanel.find("ul").height(); this.DefaultTileWidth = this.TilePanel.find("ul").width(); var c = $.proxy(this.AdvancePivot, this), b = $.proxy(this.ShowPeekFeedback, this), a = $.proxy(this.HidePeekFeedback, this), d = this; this.TilePanel.find("li a").focusin(b).focusout(a).live("click", c); this.TilePanel.find("li .hpVpv_TileItemWrap").live("mouseenter", b).live("mouseleave", a); this.GetSelectedPivot().data("biview", 1); $(window).load($.proxy(this.PrefetchContent, this)); this.BaseMaxWidth = this.Control.width(); this.ExitPadding = this.BaseWidth + this.Entry > this.BaseMaxWidth ? this.BaseWidth + this.Entry - this.BaseMaxWidth: 0; this.BodyVisibleWindow.width(this.BaseWidth + this.Entry - this.ExitPadding); this.SetBodyMinHeight() }, AdvancePivot: function(b) { if (!this.BodyAnimationInProgress) { var d = this.PivotAdvanceTime, a = $(b.target).closest("li"), c = a.index(); if (!a.hasClass("hpVpv_SelectedPivot")) { this.AdvanceBody(c, d); a.addClass("hpVpv_SelectedPivot").siblings(".hpVpv_SelectedPivot").removeClass("hpVpv_SelectedPivot") } } b.preventDefault() }, AdvanceBody: function(l, i) { var e = !1, d = 0, b; function h() { if (++d >= 2) { var b; b = this.LTR ? { position: "", left: "" }: { position: "", right: "" }; f.hide().addClass("hpVpv_BodyOffScreen").removeClass("hpVpv_Selected").trigger("PivotHide").css(b); a.removeClass("hpVpv_BodyOffScreen").addClass("hpVpv_Selected").css(b); b = this.LTR ? { "margin-left": 0 }: { "margin-right": 0 }; this.BodyPanel.css(b); b = this.LTR ? { position: "relative", "padding-left": "", "padding-right": "", left: "0" }: { position: "relative", "padding-left": "", "padding-right": "", right: "0" }; this.BodyVisibleWindow.css(b); this.SetBodyMinHeight(a); this.Control.css({ height: "", overflow: "hidden" }); if (e) { this.PivotTrack(["pivotclick", "view"], a); window.setTimeout($.proxy(function() { a.find(".hpVpv_Body").trigger("PivotShow") }, this), 500) } ! this.LTR && $.browser.msie && parseInt($.browser.version) == 7 && $(".hpAcc").css("position", "static"); $.browser.msie && parseInt($.browser.version) < 7 && a.find("*").each(function(e, d) { var a = $(d), b = a.css("float"), c = a.attr("style"); if (b && b !== "none") { a.css("float", b); (!c || c.indexOf("float:") == -1) && a.css("float", "") } }); this.BodyAnimationInProgress = !1 } } var a = this.BodyPanel.children(".hpVpv_BodyUnit:eq(" + l + ")"), f = this.BodyPanel.children(".hpVpv_Selected"), k = this.Control.height(); this.ShowPivot(a, $.proxy(function() { e = !0; if (d >= 2) { this.PivotTrack(["pivotclick", "view"], a); window.setTimeout($.proxy(function() { a.find(".hpVpv_Body").trigger("PivotShow") }, this), 500) } }, this)); this.Control.css("height", k); b = this.LTR ? { position: "absolute", left: 0 }: { position: "absolute", right: 0 }; f.css(b); b = this.LTR ? { position: "absolute", left: this.BaseWidth + this.Padding }: { position: "absolute", right: this.BaseWidth + this.Padding }; a.show().css(b).find(".hpVpv_Body").show(); if (a.find(".hpVpv_DynLoadPlaceholder").length) a.find(".hpVpv_LoadingPanel").show(); else a.find(".hpVpv_Body").trigger("PivotShow"); ! this.LTR && $.browser.msie && parseInt($.browser.version) == 7 && $(".hpAcc").css("position", "relative"); b = this.LTR ? { "margin-left": -this.AdvanceDistance }: { "margin-right": -this.AdvanceDistance }; this.BodyAnimationInProgress = !0; this.BodyPanel.animate(b, { duration: i, complete: $.proxy(h, this) }); var c = a.find(".hpVpv_LoadingPanel"), g = a.outerHeight(), j = parseInt(c.css("min-height"), 10) + parseInt(c.css("margin-top"), 10) + parseInt(c.css("border-top-width"), 10) + parseInt(c.css("border-bottom-width"), 10), g = Math.max(g, j, this.TileHeight); this.Control.animate({ height: Math.max(this.ComputeControlHeight(g), this.TileHeight) }, { duration: i, complete: $.proxy(h, this) }); b = this.LTR ? { position: "absolute", "padding-left": Math.abs(this.Exit) + "px", "padding-right": this.ExitPadding + "px", left: this.Exit + "px", top: 0 }: { position: "absolute", "padding-right": Math.abs(this.Exit) + "px", "padding-left": this.ExitPadding + "px", right: this.Exit + "px", top: 0 }; this.BodyVisibleWindow.css(b); this.Control.css("overflow", "visible") }, ShowPeekFeedback: function(g) { var b, a, d, c, e, f; b = $(g.currentTarget); a = b.closest(".hpVpv_TileItemWrap"); if (a.hasClass("hpVpv_Nudge")) return ! 1; a.addClass("hpVpv_Nudge"); d = b.closest("li"); c = this.ComputePeekExpandAmount(b); e = c > this.MinTileExpand ? c: this.MinTileExpand; d.css({ height: a.height() }); //f = this.LTR ? { // position: "absolute", // right: parseInt(this.TilePanel.css("padding-right")) + "px", // }: { // position: "absolute", // left: parseInt(this.TilePanel.css("padding-left")) + "px", // }; // a.css(f).stop(!0); a.animate({ width: this.DefaultTileWidth }, { duration: this.TileNudgeTime_Show }); a.find("a").addClass("hpVpv_Hover") }, ComputePeekExpandAmount: function(d) { var f, a; f = d.find(".hpVpv_Title"); a = d.closest(".hpVpv_TileItemWrap"); if (a.data("width") != undefined && parseInt(a.data("timestored")) + 3e4 > +new Date) { a.data("timestored", +new Date); return a.data("width") } var b, e, c; b = d.find(".hpVpv_Title span:visible"); a.css("height", a.height()); e = b.css("position"); c = b.css({ position: "absolute" }).width() + 10 - this.DefaultTileWidth; c += this.LTR ? parseInt(b.css("margin-left"), 10) : parseInt(b.css("margin-right"), 10); b.css({ position: e }); a.css("height", ""); a.data("width", c); a.data("timestored", +new Date); return c }, HidePeekFeedback: function(g) { var b, a, c, f, e, d; b = $(g.currentTarget); a = b.closest(".hpVpv_TileItemWrap"); if (!a.hasClass("hpVpv_Nudge")) return ! 1; c = b.closest("li"); f = b.find(".hpVpv_Title"); e = b.find(".hpVpv_Title span"); d = this.LTR ? { position: "absolute", right: parseInt(this.TilePanel.css("padding-right")) + "px" }: { position: "absolute", left: parseInt(this.TilePanel.css("padding-left")) + "px" }; a.css(d); a.stop(!0).animate({ width: this.DefaultTileWidth }, { duration: this.TileNudgeTime_Hide, complete: $.proxy(function() { var b = this.LTR ? { position: "relative", right: "" }: { position: "relative", left: "" }; a.css(b).removeClass("hpVpv_Nudge"); c.css({ height: "" }) }, this) }); a.find("a").removeClass("hpVpv_Hover") }, SetBodyMinHeight: function(c) { var a = c || this.BodyPanel.find(".hpVpv_Selected"), b = $.browser.msie && parseInt($.browser.version) < 7 ? "height": "min-height"; a.css(b, ""); var d = a.height() <= this.TileHeight ? this.TileHeight + "px": ""; a.css(b, d) }, ComputeControlHeight: function(a) { var b = parseInt(this.BodyPanel.css("margin-top"), 10); return b + a }, ShowPivot: function(b, c) { var e = b.find(".hpVpv_DynLoadPlaceholder"), a = b.find(".hpVpv_LoadingPanel"), d = b.find(".hpVpv_Body"), f = this; if (e.length) { a.css("height", this.BodyPanel.find(".hpVpv_Selected").outerHeight() - parseInt(a.css("border-top-width"), 10) - parseInt(a.css("border-bottom-width"), 10)); a.show(); this.LoadDynamic(e, 0, function(a) { f.ShowDynamicContent(e, a); c && c(b) }) } else { var g = this.GetSelectionIndexFromTile(), h = this.BodyPanelChildren.index(b); if (h != g) { a.hide(); d.show(); c && c(b) } else { this.Control.animate({ height: this.ComputeControlHeight(d.height(), !0) }, { duration: this.LoadingFadeTime, complete: function() { f.Control.css("height", "") } }); a.css({ "z-index": 0, position: "absolute" }); d.css({ "z-index": 500, position: "absolute" }); d.fadeIn(this.LoadingFadeTime, function() { d.css({ "z-index": "", position: "" }); d.trigger("PivotShow"); c && c(b) }); a.filter(":visible").length && a.fadeOut(this.LoadingFadeTime) } } }, LoadDynamic: function(a, d, c) { if (a && a.length) { var b = a.attr("data-component"); b += (b.indexOf("?") != -1 ? "&uid=": "?uid=") + a.parent().attr("id"); b += window.MSCOM && MSCOM.DynamicHtmlHelper ? "&m=true": ""; if (d === 0) { if (!a.filter(".hpVpv_Requested").length || MSCOM.Helper.Content.unregister(b)) { $.get(b, c); a.addClass("hpVpv_Requested") } } else { var e = { path: b, priority: d, callback: c }; MSCOM.Helper.Content.registerDoc(e) && a.addClass("hpVpv_Requested") } } }, GetSelectionIndexFromTile: function() { return this.TilePanelChildren.length ? this.TilePanelChildren.index(this.TilePanelChildren.filter(".hpVpv_SelectedPivot")) : 0 }, GetSelectedPivot: function() { return this.BodyPanelChildren.eq(this.GetSelectionIndexFromTile()) }, ShowDynamicContent: function(b, c) { var d = this.GetSelectionIndexFromTile(), e = this.BodyPanelChildren.index(b.closest(".hpVpv_BodyUnit")), a = b.parent(); a.hide(); b.remove(); if (window.MSCOM && MSCOM.DynamicHtmlHelper) ! MSCOM.DynamicHtmlHelper.AddHtmlToContainer(c, a) && a.append(this.DataErrorMessage); else a.append(c); window.setTimeout(function() { a.trigger("PivotShow") }, 500); e === d && this.ShowPivot(a.closest(".hpVpv_BodyUnit")); window.setTimeout($.proxy(this.PrefetchContent, this), 1) }, PrefetchContent: function(a) { var b = this; a = typeof a == "number" ? a: 1; if (!this.PrefetchEnabled || window.location.hash.indexOf("noprefetch") > 0) return ! 1; var c = b.BodyPanel.find(".hpVpv_Body .hpVpv_DynLoadPlaceholder:not(.hpVpv_Requested)").slice(0, a); c.each(function(e, d) { if (e >= a) return ! 1; var c = $(d); b.LoadDynamic(c, 30, function(a) { b.ShowDynamicContent(c, a) }) }) }, PivotTrack: function(j, a) { if ($.bi == undefined || $.bi.dataRetrievers.structure == undefined) return ! 1; var d = this.TilePanel.find("li.hpVpv_SelectedPivot"), g = d.attr("bi:index"), i = a.find(".hpVpv_HiddenTitle").text(), c = $.extend(c, $.bi.baseData(), $.bi.dataRetrievers.structure.getIndexGridTypeStructure(d)); if ($.inArray("pivotclick", j) > -1) { var k = $.extend({}, c, $.bi.getAttrData(d.find(".hpBi_Custom .hpBi_Action-click")), { initial: a.data("pivotclick") !== undefined ? a.data("pivotclick") : 0, interactiontype: 4, title: i, parenttitlestructure: "", index: g, parentindexstructure: "", "-bi-description-ignore-": "bi-pivot-click" }); $.bi.queue.push(k); a.data("pivotclick", 1) } if ($.inArray("view", j) > -1) { var b, h, e, f; b = a.find("area").not(".hpHro area,.hpHro map area").filter(function() { return $(this).parents(".hpHro").length == 0 && $(this).parents("map").siblings("img").is(":visible") }); e = a.find(".hpHro").find(".hpHro_Item:first area").filter(function() { return $(this).parents("map").siblings("img").is(":visible") }); h = a.find("a:visible").not(".hpHro a,.hpHro .hpHro_Item a"); f = a.find(".hpHro").find(".hpHro_Item:first a"); b = b.add(e).add(h).add(f); var l = $.extend({}, c, $.bi.getAttrData(b), { initial: a.data("biview") !== undefined ? a.data("biview") : 0, interactiontype: 1, triggertype: 4, index: "", parentindexstructure: g, title: "", parenttitlestructure: i, "-bi-description-ignore-": "bi-pivot-view" }); $.bi.queue.push(l); a.data("biview", 1) } } }; if (window.Hp === undefined) window.Hp = {}; if (typeof window.Hp.Grid == "undefined") window.Hp.Grid = { logenabled: !1, isInitialized: !1, alignmentSwitch: { hpHro: !0 }, controlDelegate: {}, init: function() { if (Hp.Grid.isInitialized) return; Hp.Grid.isInitialized = !0; var a = this; $(".hpGrd_Row").live("GridResize", Hp.Grid.gridResizeHandler); $(".hpGrd_Row:visible").each(function() { Hp.Grid.rowContentResize($(this), $(this).height()) }); $(".hpPvt_body,.hpVpv_Body,.hpGrid_ResizeListener").live("PivotShow", Hp.Grid.pivotShowHandler); if ($.browser.msie && parseInt($.browser.version) == 7) $.fx.interval = 45; if (window.location.hash.indexOf("anilog") > 0) { $("body").prepend('
- +
'); $("#JquerySettings a").live("click", function() { $.fx.interval = $(this).hasClass("add") ? $.fx.interval + 5: $.fx.interval - 5; $("#JquerySettings .currentInt").html($.fx.interval) }) } }, log: function(a) { if (this.logenabled) try { console.log(a) } catch(b) {} }, _ignoreWrapper: [], ignoreWrapper: function(a) { if (typeof a == "string" && $.trim(a) != "") $.inArray(a, this._ignoreWrapper) == -1 && this._ignoreWrapper.push(a); else if (typeof attr == "object") for (var b = 0; b < a.length; b++) { a[b] = $.trim(a[b]); $.inArray(a[b], this._ignoreWrapper) == -1 && this._ignoreWrapper.push(a[b]) } }, excludeIgnoredWrapper: function(a) { if (this._ignoreWrapper.length == 0) return a; var c = "." + this._ignoreWrapper.join(",."), b = a.not(c); if (b.length == a.length) return a; a.filter(c).each($.proxy(function(c, a) { b = b.add($(a).children("[nodeName!='SCRIPT']:not(.hpGrd_Filler)")) }, this)); return b }, gridResizeHandler: function(d, b, g) { var c = $(d.target).closest(".hpGrd_Row"), f = $(d.target).closest(".hpGrd_Cell"), e = f.siblings(".hpGrd_Cell"), a = 0; e.each(function() { var b = Hp.Grid.getHeight($(this), c); if (a < b) a = b }); a = b < a ? a: b; Hp.Grid.rowContentResize(c, a, g) }, pivotShowHandler: function(a) { try { $(a.target).find(".hpGrd_Row").each(function() { Hp.Grid.rowContentResize($(this), $(this).height()) }) } catch(a) {} }, rowContentResize: function(c, b, a) { c.attr("rowheight", b); c.find(".hpGrd_Cell").each($.proxy(function(g, e) { var c = $(e).children("[nodeName!='SCRIPT']:not(.hpGrd_Filler)"); c = this.excludeIgnoredWrapper(c); if (c.length > 1) { var d = 0, f = c.length; c.each(function(g, c) { var e = Hp.Grid.getItemHeight($(c)); d += e; if (g == f - 1) Hp.Grid.controlResize($(c), e + (b - d), a); else Hp.Grid.controlResize($(c), e, a) }) } else Hp.Grid.controlResize(c.first(), b, a) }, this)) }, getHeight: function(c, d) { var b = 0, a = c.children("[nodeName!='SCRIPT']:not(.hpGrd_Filler)"); a = this.excludeIgnoredWrapper(a); a.each(function() { b += Hp.Grid.getItemHeight($(this), d) }); return b }, getDelegateName: function(a) { if (!a) return ! 1; for (var b in this.controlDelegate) if (a.hasClass(b)) return b; return ! 1 }, getItemHeight: function(a) { var b = 0; if (!a) return b; a = $(a); var d = "", c = this.getDelegateName(a); if (this.controlDelegate[c] && this.controlDelegate[c].getItemHeight != undefined) try { b = this.controlDelegate[c].getItemHeight(a) } catch(e) { b = a.innerHeight(); this.log(e) } else b = a.innerHeight(); this.log("grid:getItemHeight height[" + b + "] type[" + c + "]"); return b }, getSiblingMaxHeight: function(b) { var e = $(b).closest(".hpGrd_Row"), d = $(b).closest(".hpGrd_Cell"), c = d.siblings(".hpGrd_Cell"), a = 0; c.each(function() { var b = Hp.Grid.getHeight($(this), e); if (a < b) a = b }); return a }, controlResize: function(d, c, b) { var e = ""; b = b || 200; if ($.browser.msie && parseInt($.browser.version) == 6) b = 0; var a = this.getDelegateName(d); if (this.controlDelegate[a] && this.controlDelegate[a].resize != undefined) try { this.controlDelegate[a].resize(d, c, b) } catch(f) { this.log(f) } this.log("grid:resize height[" + c + "] type[" + a + "]") } }; Hp.Grid.controlDelegate.hpHro = { getItemHeight: function(i) { var g; if (Hp.Grid.alignmentSwitch && Hp.Grid.alignmentSwitch.hpHro) { var d = 0, a, h, b, f, e, c; i.find(".hpHro_Item").each($.proxy(function(j, i) { b = $(i); h = b.css("min-height"); b.css("min-height", ""); a = Math.round(parseFloat(b.outerHeight())); b.css("min-height", h); var g = b.find(".hpHro_Resize"); f = b.find(".hpHro_ImgWrap"); e = f.height() || 320; c = parseInt(f.attr("rel")) || 320; a = g.length > 0 ? a - g.height() : a; a = e > c ? a - (e - c) : a; if (a > d) d = a }, this)); g = d } else g = i.innerHeight(); return g }, _getHeightAdj: function(a) { var b = a.find(".hpHro_Resize"); if (!b.length) { var c = a.find(".hpHro_Text"); if (c.length > 0) c.append('
'); else a.append('
'); b = a.find(".hpHro_Resize") } return b }, resize: function(b, c, a) { if (!b.hasClass("init")) return ! 1; Hp.Grid.alignmentSwitch && Hp.Grid.alignmentSwitch.hpHro && b.find(".hpHro_Item").each($.proxy(function(q, p) { var i, l, b, e, m, k, g, j, f, d, n, o, h = $(p); h.css("min-height", ""); o = Math.round(parseFloat(h.outerHeight())); n = Math.round(parseFloat(h.innerHeight())); $heightAdj = this._getHeightAdj($(p)); i = h.find(".hpHro_ImgWrap"); l = i.children(".hpImage_Img,.hpImage_Clip").first().height(); b = parseInt(i.attr("rel")) || 320; e = l > b ? l - b: 0; m = $heightAdj.height(); k = i.height() || 320; g = m + (k - b); h.css("min-height", n - g + "px"); d = c - (o - g); if (d != g) { if (e > d) { f = b + d; j = 0 } else { f = b + e; j = d - e } f != k && i.animate({ height: f }, a); j != m && $heightAdj.animate({ height: j }, a) } Hp.Grid.log("Grid:Hero:resize: oldHAdjTotal[" + g + "]oldHAdj[" + m + "]oldImageWrapH[" + k + "]newHAdjTotal[" + d + "]newHAdj[" + j + "]newImageWrapH[" + f + "]imageClipHeight[" + b + "]imageWrapSpace[" + e + "]imageHeight[" + l + "]") }, this)) } }; Hp.Grid.controlDelegate.hpAcc = { getItemHeight: function(b) { var a = 0; if (Hp.Accordion.getContainerHeightData) a = Hp.Accordion.getContainerHeightData(b).height; return a }, resize: function(c, b, a) { Hp.Accordion.resize && Hp.Accordion.resize(c, b, a) } }; Hp.Grid.controlDelegate.hpLst = { getItemHeight: function(c) { var a = 0, b = c.find(".hpLst_Resize").innerHeight(); b = b ? b: 0; a = c.outerHeight(); a = a - b; return a }, resize: function(b, f, d) { var a = b.find(".hpLst_Resize"); if (!a.length) { b.find(".hpLst_body").after('
'); a = b.find(".hpLst_Resize") } var e = a.height(), g = this.getItemHeight(b), c = f - g; c != e && a.animate({ height: c }, d) } }; Hp.Grid.controlDelegate.hpCrs = { getItemHeight: function(a) { return a.innerHeight() }, resize: function() {} }; if (typeof window.Hp == "undefined") window.Hp = {}; Hp.Hero = function(e, d, b, a, c) { this.Control = $("#" + e); this.LTR = document.documentElement.dir != "rtl"; this.Left = this.LTR ? "left": "right"; this._AnimateSpeed; this._SwitchDelay = 7e3; this.Items = []; this.BiData = {}; this.InitialItem; this.CurrentItem; this._FeedUrl = d; this._BiCommonParams; this.SkirtBgSrc = b || ""; this.GradBgImageSrc = a || ""; this.PrefetchEnabled = !0; this.ImagesPrefetched = !1; this.AlignmentSwitch = !0; this.DeferEnabled = !0; this.HeightAdjustment = !0; this.AutoRotate = !0; this.ImageClipSize = c || 320; this.HeroItemWidth = this.Control.width(); $($.proxy(this.Ready, this)) }; Hp.Hero.prototype = { logenabled: !1, log: function(a) { if (this.logenabled) try { console.log(a) } catch(b) {} }, DeferredNextSlide: !1, Ready: function() { this.CurrentItem = parseInt("0"); if (isNaN(this.CurrentItem)) this.CurrentItem = 0; this.InitialItem = this.CurrentItem; this.Slide = this.Control.find(".hpHro_slide"); this.HpControls = this.Control.find(".hpHro_Controls"); $.ajax({ url: this._FeedUrl, success: $.proxy(this.DataLoaded, this), cache: !0, dataType: "json" }); window.MSCOM.Helper.Content.log(["Hero Init", this.Control]); this.BiData[this.CurrentItem] = { next: !1, prev: !1, view: !0, autonext: !0 } }, DataLoaded: function(a) { if (a != null && a.Items != null) { this.Items = a.Items; this.Init() } }, PrefetchImages: function() { if (this.ImagesPrefetched || !this.PrefetchEnabled) return ! 1; this.ImagesPrefetched = !0; for (var a = 0; a < this.Items.length; a++) if (this.Items[a].Image && this.Items[a].Image.Src) if (!MSCOM.Helper.Content.registerImage({ path: this.Items[a].Image.Src, priority: 20 })) return ! 1 }, Init: function() { this._AnimateSpeed = this.Control.width(); this.HeroItemWidth = this.Control.width(); var a = this.Control.find(".hpHro_Item:first"); this.HeroItemWidth = parseFloat(a.css("border-right-width")) ? this.HeroItemWidth - Math.round(parseFloat(a.css("border-right-width"))) : this.HeroItemWidth; this.HeroItemWidth = parseFloat(a.css("border-left-width")) ? this.HeroItemWidth - Math.round(parseFloat(a.css("border-left-width"))) : this.HeroItemWidth; this.Control.find("a.hpHro_Stop").show(); if (this.Items.length > 1) { this.BindButtonEvents(); if (this.AutoRotate == !0) { this.BindAutoPauseEvents(); this.Start() } } else this.HpControls.hide(); this._BiCommonParams = {}; try { var b = this.Control.children(":first"); $.extend(this._BiCommonParams, $.bi.baseData(), $.bi.dataRetrievers.structure.getData(b)) } catch(c) {} this.IsHeroVisible() && this.PrefetchImages() }, Next: function(h) { this.PreventClick(h); if (this.Control.find(":animated").length > 0) return ! 1; this.UnbindButtonEvents(); this.FreezeHeight(); var j = h == undefined; ! this.ImagesPrefetched && this.IsHeroVisible() && this.PrefetchImages(); var b = this.CurrentItem + 1; if (b >= this.Items.length) b = 0; var e = this.InsertItem(b, !1), i = this.Control.closest(".hpGrd_Cell").find(":animated").length > 0, c = function() { this.RemoveItemsFromStart(1); this.CurrentItem = b; this.Control.find(".hpHro_Item:first").height(""); this.UnfreezeHeight(); this.BiTrack(h != undefined ? "next": "autonext", this.CurrentItem); GridHeight = 0; if (Hp.Grid) GridHeight = Hp.Grid.getSiblingMaxHeight(this.Control); if (i) { var a = this.AdjustHeight(this.Control.find(".hpHro_Item:first"), GridHeight); this.Control.trigger("GridResize", [a, 200]) } }, d = this._AnimateSpeed, a = this, f = function() { if (a.DeferredNextSlide) { a.FreezeHeight(); $(e).css({ position: "", left: "" }) } GridHeight = 0; if (Hp.Grid) GridHeight = Hp.Grid.getSiblingMaxHeight(a.Control); var g = a.AdjustUpcomingHeight("end", GridHeight), f = a.GetHeightAdjustment("end", 1); a.Control.trigger("GridResize", [g, a._AnimateSpeed]); if (a.Items[b].IsDark) a.HpControls.removeClass("dark"); else a.HpControls.addClass("dark"); a.Control.find(".hpHro_Controls_Paging div").removeClass("current"); a.Control.find(".hpHro_Controls_Paging div:eq(" + b + ")").addClass("current"); arguments.length > 0 && a.log("hero:next(autonext):deferredslide: Moving slide now since the image has been loaded"); if (a.HeightAdjustment && f != "-=0") if (a.LTR) a.Slide.animate({ left: "-=" + d, height: f }, a._AnimateSpeed, $.proxy(c, a)); else a.Slide.animate({ right: "-=" + d, height: f }, a._AnimateSpeed, $.proxy(c, a)); else if (a.LTR) a.Slide.animate({ left: "-=" + d }, a._AnimateSpeed, $.proxy(c, a)); else a.Slide.animate({ right: "-=" + d }, a._AnimateSpeed, $.proxy(c, a)); a.DeferredNextSlide = !1 }, g = $(e).find("img:first"); if (this.DeferEnabled && g.length && !g[0].complete && j) { this.log("hero:next(autonext):-deferring slide till the image loads"); this.UnfreezeHeight(); $(e).css({ position: "absolute", left: this.HeroItemWidth + "px" }); g.load(f).error(f); this.DeferredNextSlide = !0 } else f() }, Prev: function(g) { this.PreventClick(g); this.UnbindButtonEvents(); this.FreezeHeight(); if (this.Control.find(":animated").length > 0) return ! 1; ! this.ImagesPrefetched && this.IsHeroVisible() && this.PrefetchImages(); var a = this.CurrentItem - 1; if (a < 0) a = this.Items.length - 1; var h = this.InsertItem(a, !0), e = this.Control.closest(".hpGrd_Cell").find(":animated").length > 0, b = function() { this.RemoveItemsFromEnd(1); this.CurrentItem = a; if (this.Items[a].IsDark) this.HpControls.removeClass("dark"); else this.HpControls.addClass("dark"); this.Control.find(".hpHro_Controls_Paging div").removeClass("current"); this.Control.find(".hpHro_Controls_Paging div:eq(" + a + ")").addClass("current"); this.Control.find(".hpHro_Item:first").height(""); this.BiTrack("prev", this.CurrentItem); GridHeight = 0; if (Hp.Grid) GridHeight = Hp.Grid.getSiblingMaxHeight(this.Control); if (e) { var b = this.AdjustHeight(this.Control.find(".hpHro_Item:first"), GridHeight); this.Control.trigger("GridResize", [b, 200]) } }; GridHeight = 0; if (Hp.Grid) GridHeight = Hp.Grid.getSiblingMaxHeight(this.Control); var f = this.AdjustUpcomingHeight("start", GridHeight), d = this.GetHeightAdjustment("start", 1), c = this._AnimateSpeed; this.Control.trigger("GridResize", [f, this._AnimateSpeed]); if (this.HeightAdjustment && d != "-=0") if (this.LTR) this.Slide.animate({ left: "+=" + c, height: d }, this._AnimateSpeed, $.proxy(b, this)); else this.Slide.animate({ right: "+=" + c, height: d }, this._AnimateSpeed, $.proxy(b, this)); else if (this.LTR) this.Slide.animate({ left: "+=" + c }, this._AnimateSpeed, $.proxy(b, this)); else this.Slide.animate({ right: "+=" + c }, this._AnimateSpeed, $.proxy(b, this)) }, Play: function() { this.Start(); this.Control.live("mouseleave", $.proxy(this.BindAutoPauseEvents, this)); this.Control.find(".hpHro_Stop").show(); this.Control.find(".hpHro_Play").hide(); this.BiTrack("play", this.CurrentItem) }, Stop: function() { this.ClearSwitchTimer(); this.UnbindAutoPauseEvents(); this.Control.find(".hpHro_Stop").hide(); this.Control.find(".hpHro_Play").show(); this.BiTrack("stop", this.CurrentItem) }, Pause: function() { this.Unpause(); this.ClearSwitchTimer() }, Unpause: function() { this.Start() }, IsHeroVisible: function() { return this.Control.closest(":hidden").length == 0 }, Switch: function() { this.ClearSwitchTimer(); if (this.DeferredNextSlide) this.log("switch:skiping next since slide is still deferred loading"); else this.IsHeroVisible() && this.Next(); this.Start() }, Start: function() { this.StartSwitchTimer() }, ClearSwitchTimer: function() { window.clearTimeout(this._SwitchTimerId); this._SwitchTimerId = null }, StartSwitchTimer: function() { this.ClearSwitchTimer(); this._SwitchTimerId = window.setTimeout($.proxy(this.Switch, this), this._SwitchDelay) }, UnbindAutoPauseEvents: function() { this.Control.die("mouseover").die("mouseout"); this.Control.find("a, area").die("focus").die("keydown") }, BindAutoPauseEvents: function() { this.UnbindAutoPauseEvents(); this.Control.live("mouseover", $.proxy(this.Pause, this)).live("mouseout", $.proxy(this.Unpause, this)); var a = this.Control.find("a, area"); a.live("focus", $.proxy(this.Pause, this)); a.live("keydown", $.proxy(this.LinkKeyDown, this)) }, LinkKeyDown: function(a) { if (a.which == 9) { var b = this.Control.find("a, area"); (a.target === b.first()[0] && a.shiftKey || a.target === b.last()[0] && !a.shiftKey) && this.Unpause() } }, UnbindButtonEvents: function() { this.Control.find(".hpHro_Controls a").unbind("click").click($.proxy(this.PreventClick, this)) }, BindButtonEvents: function() { this.Control.find(".hpHro_Controls a").unbind("click"); this.Control.find(".hpHro_Controls a.hpHro_Next").click($.proxy(this.Next, this)); this.Control.find(".hpHro_Controls a.hpHro_Prev").click($.proxy(this.Prev, this)); this.Control.find(".hpHro_Controls a.hpHro_Play").click($.proxy(this.Play, this)); this.Control.find(".hpHro_Controls a.hpHro_Stop").click($.proxy(this.Stop, this)) }, PreventClick: function(a) { a && a.preventDefault() }, FreezeHeight: function() { this.Slide.css("height", this.Slide.height()) }, UnfreezeHeight: function() { this.Slide.css("height", "auto") }, RemoveItemsFromStart: function(b) { for (var a = 0; a < b; a++) this.RemoveItem(0, "start"); this.Slide.css(this.Left, 0); this.UnfreezeHeight(); this.BindButtonEvents() }, RemoveItemsFromEnd: function(b) { for (var a = 0; a < b; a++) this.RemoveItem(1, "end"); this.Slide.css(this.Left, 0); this.UnfreezeHeight(); this.BindButtonEvents() }, RemoveItem: function(c) { var b = this.Control.find(".hpHro_Item:eq(" + c + ")"), a = this.Slide.position().left; a = a + b.outerWidth(!0); this.Slide.css("left", a); b.remove() }, SetMinHeights: function(a) { var d = $.browser.msie && $.browser.version == 6 ? "height": "min-height"; if (a.length > 1) { a.find(".hpHro_TextContent").css(d, 0).css("height", "auto"); var b = 0, c, i = ""; a.each(function() { i += $(this).find(".hpHro_TextContent").text(); c = $(this).find(".hpHro_TextContent").innerHeight(); if (c > b) b = c }); if (i.length == 0) a.find(".hpHro_TextContent").css("height", 0); else a.find(".hpHro_TextContent").css(d, b); a.find(".hpHro_Text h4").css(d, 0); var b = 0, c; a.each(function() { c = $(this).find(".hpHro_Text h4").height(); if (c > b) b = c }); a.find(".hpHro_Text h4").css(d, b); a.find(".hpHro_Incent").css(d, 0); var b = 0, c; a.each(function() { c = $(this).find(".hpHro_Incent").height(); if (c > b) b = c }); a.find(".hpHro_Incent").css(d, b) } a.css(d, ""); var f = 0, h = 0, g, e; a.each(function() { g = Math.round(parseFloat($(this).height())); if (g > f) f = g; e = Math.round(parseFloat($(this).outerHeight())); if (e > h) h = e }); a.css(d, f); return e }, GetItemActualHeight: function(c) { var a = Math.round(parseFloat($(c).outerHeight())), d = $(c).find(".hpHro_Resize"), b = $(c).find(".hpHro_ImgWrap").height(); a = d.length > 0 ? a - d.height() : a; if (b > this.ImageClipSize) { a -= b - this.ImageClipSize; this.log("GetItemActualHeight:subtracting excess adjustment form wrap height " + (b - this.ImageClipSize)) } return a }, AdjustUpcomingHeight: function(c, a) { var d = c == "end" ? ":gt(0)": ":lt(1)", b = this.Control.find(".hpHro_Item" + d); return this.AdjustHeight(b, a) }, AdjustHeight: function(a, f) { var g = this.GetItemActualHeight(a), e = a.find(".hpHro_Resize"); if (!e.length) { var h = a.find(".hpHro_Text"); if (h.length > 0) a.find(".hpHro_Text").append('
'); else a.append('
'); e = a.find(".hpHro_Resize") } var b = f > g ? f - g: 0; if (this.AlignmentSwitch) { var d = a.find(".hpHro_ImgWrap").children(".hpImage_Img,.hpImage_Clip").first().height(), c = d > this.ImageClipSize ? d - this.ImageClipSize: 0; if (c > 0 && b) if (c > b) { a.find(".hpHro_ImgWrap").height(this.ImageClipSize + b); b = 0 } else { a.find(".hpHro_ImgWrap").height(this.ImageClipSize + c); b -= c } this.log("AdjustHeight: imageHeight[" + d + "] ImageClipSize[" + this.ImageClipSize + "]"); e.height(b) } return Math.round(parseFloat(a.outerHeight())) }, GetHeightAdjustment: function(f, e) { var c = this.Slide.height(), d; if (f == "end") d = ":gt(" + (e - 1) + ")"; else d = ":lt(" + e + ")"; var a = this.SetMinHeights(this.Control.find(".hpHro_Item" + d)), b; if (c < a) b = "+=" + (a - c); else b = "-=" + (c - a); return b }, InsertItem: function(g, i) { var c = this.Items[g], b, h = new Hp.Hero.Template(this.SkirtBgSrc, this.GradBgImageSrc, this.ImageClipSize), f = h.BuildItem(c, g, this.HeroItemWidth); if (i) { this.Slide.prepend(f); var c = this.Control.find(".hpHro_Item:eq(0)"), d = this.Slide.position().left; if (this.LTR) d = d - c.outerWidth(!0); else d = -c.outerWidth(!0); this.Slide.css(this.Left, d); b = c } else { this.Control.find(".hpHro_slide .hpHro_Item:last").after(f); b = this.Control.find(".hpHro_slide .hpHro_Item:last") } $preloader = $(".hpHro_Loader", b); var a = $(b).find("img:first"); if (a.length != 0) if (a[0] && !a[0].complete) { var e = function(a) { $(a.target).parents(".hpHro_Item").find(".hpHro_Loader").fadeOut("500") }; a.load($.proxy(e, this)).error($.proxy(e, this)); $preloader.width(a.width()).height(a.height()).css({ position: "absolute", "z-index": "1" }).show() } else $preloader.hide(); return b }, BiTrack: function(b, a) { if ($.bi == undefined || $.bi.dataRetrievers.structure == undefined || $.bi.dataRetrievers.attr == undefined) return ! 1; this.BiData[a] = this.BiData[a] != undefined ? this.BiData[a] : { next: !1, prev: !1, view: !1 }; var e; e = this.Control.find(".hpHro_Item area").filter(function() { return $(this).parents("map").siblings("img").is(":visible") }); e = e.add(this.Control.find(".hpHro_Item a:visible")); var f = $.bi.getAttrData(e), c = this._BiCommonParams; this.Control.data("custom-" + b) == undefined && this.Control.data("custom-" + b, $.bi.getAttrData(this.HpControls.find(".hpBi_Custom .hpBi_Action-" + b))); if (b == "next") { var g = $.extend({}, c, this.Control.data("custom-" + b), { initial: !this.BiData[a].next ? 0: 1, interactiontype: 4, title: "Next", "-bi-description-ignore-": "hero-next-click" }); $.bi.queue.push(g); var d = $.extend({}, c, f, { initial: !this.BiData[a].view ? 0: 1, interactiontype: 1, triggertype: 4, index: a, parentindexstructure: "", "-bi-description-ignore-": "hero-next-view" }); setTimeout(function() { $.bi.queue.push(d) }, 25); this.BiData[a].next = !0; this.BiData[a].view = !0 } else if (b == "prev") { var g = $.extend({}, c, this.Control.data("custom-" + b), { initial: !this.BiData[a].prev ? 0: 1, interactiontype: 5, title: "Prev", "-bi-description-ignore-": "hero-prev-click" }); $.bi.queue.push(g); var d = $.extend({}, c, f, { initial: !this.BiData[a].view ? 0: 1, interactiontype: 1, triggertype: 5, index: a, parentindexstructure: "", "-bi-description-ignore-": "hero-prev-view" }); setTimeout(function() { $.bi.queue.push(d) }, 25); this.BiData[a].prev = !0; this.BiData[a].view = !0 } else if (b == "stop") { var d = $.extend({}, c, this.Control.data("custom-" + b), { interactiontype: 7, parentindexstructure: a, title: "Stop", "-bi-description-ignore-": "hero-stop" }); $.bi.queue.push(d) } else if (b == "play") { var d = $.extend({}, c, this.Control.data("custom-" + b), { interactiontype: 8, parentindexstructure: a, title: "Start", "-bi-description-ignore-": "hero-play" }); $.bi.queue.push(d) } else if (b == "autonext") if (!this.BiData[a].autonext) { var d = $.extend({}, c, f, { initial: !this.BiData[a].view ? 0: 1, interactiontype: 1, index: a, title: "AutoNext", "-bi-description-ignore-": "hero-autonext" }); $.bi.queue.push(d); this.BiData[a].view = !0; this.BiData[a].autonext = !0 } } }; Hp.Hero.Template = function(b, a, c) { this.SkirtBgSrc = b; this.GradBgImageSrc = a; this.ImageClipSize = c || 320 }; Hp.Hero.Template.prototype = { BuildItem: function(b, c, d) { var a = '
{item.Image}{item.Text}
'; a = a.replace(/{width}/g, d); a = a.replace(/{index}/g, c); a = a.replace(/{item.Image}/g, this.BuildImage(b.Image)); a = a.replace(/{background}/g, b.BackgroundColor ? "background-color:" + b.BackgroundColor + ";": ""); return a.replace(/{item.Text}/g, this.BuildInfoItem(b.Text)) }, BuildImage: function(b) { if (!b) return ""; var a = '{image.Alt}{image.ImageMap}', c = "hero_" + +new Date; if (b.HasOffset) { a = '{image.Alt}{image.ImageMap}'; a = a.replace(/{image.clipstyle}/g, "width:" + b.ClipWidth + "px;height:" + b.ClipHeight + "px;"); a = a.replace(/{image.offsetstyle}/g, "top:" + b.TopOffset + "px;left:" + b.LeftOffset + "px;") } a = '
' + a + '
'; a = a = a.replace(/{imagewrap.styleclipsize}/g, "height:" + this.ImageClipSize + "px;"); a = a = a.replace(/{imagewrap.clipsize}/g, this.ImageClipSize); if (b && b.Link && b.Link.Href) { a = '{image.Alt}{image.ImageMap}'; a = a.replace(/{image.Url}/g, b.Link.Href); a = a.replace(/{bi.Attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{image.UseMap}/g, b.IsImageMap ? 'usemap="#' + c + '"': ""); a = a.replace(/{image.ImageMap}/g, this.BuildImageMap(b, c)); a = a.replace(/http://www.2903866.com/{image.Src}/g, b.Src); a = a.replace(/{image.Width}/g, b.Width); a = a.replace(/{image.Height}/g, b.Height); return a.replace(/{image.Alt}/g, MSCOM.Helper.htmlAttrEncode(b.Alt)) }, BuildInfoItem: function(b) { if (b == null) return ""; var a = '
{hero.GradBg}{infoItem.Title}{infoItem.Description}{infoItem.CallToAction}{hero.SkirtBg}
'; a = a.replace(/{infoItem.Title}/g, this.BuildText(b.Title, "h3", 'bi:titleflag="item" bi:title="item"')); a = a.replace(/{infoItem.Description}/g, this.BuildText(b.Description, "p")); if (this.SkirtBgSrc) a = a.replace(/{hero.SkirtBg}/g, '
'); else a = a.replace(/{hero.SkirtBg}/g, '
'); if (this.GradBgImageSrc) a = a.replace(/{hero.GradBg}/g, '
'); else a = a.replace(/{hero.GradBg}/g, ""); return a.replace(/{infoItem.CallToAction}/g, this.BuildText(b.CallToAction, "a", 'bi:parenttitle="item" bi:type="cta"', !0)) }, BuildText: function(b, e, c, d) { if (b == null) return ""; var a = "<{tag} {bi.misc} >{text.Value}"; if (b.Link && b.Link.Href) { a = '{text.Value}'; if (d) a = a.replace(/{text.Value}/g, '{text.Value}'); a = a.replace(/{text.Link.Href}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(b.Link.Bi)) } else a = a.replace(/{tag}/g, e); a = a.replace(/{bi.misc}/g, c); return a.replace(/{text.Value}/g, MSCOM.Helper.htmlEncode(b.Value)) }, BuildImageMap: function(b, c) { if (!b.IsImageMap) return ""; var a = '{imagemap.Area}'; a = a.replace(/{imagemap.id}/g, c); return a.replace(/{imagemap.Area}/g, this.BuildImageMapAreas(b.ImageMap.Areas)) }, BuildImageMapAreas: function(c) { for (var d = "", b = 0, e = c.length; b < e; b++) { var a = ''; a = a.replace(/{area.shape}/g, c[b].Shape ? 'shape="' + c[b].Shape + '"': ""); a = a.replace(/{area.coords}/g, c[b].Coords ? 'coords="' + c[b].Coords + '"': ""); a = a.replace(/{area.href}/g, c[b].Link.Href ? c[b].Link.Href: ""); a = a.replace(/{area.class}/g, c[b].CssClass ? 'class="' + c[b].CssClass + '"': ""); a = a.replace(/{area.target}/g, c[b].Target ? 'target="' + c[b].Target + '"': ""); a = a.replace(/{area.alt}/g, c[b].Alt ? 'alt="' + MSCOM.Helper.htmlAttrEncode(c[b].Alt) + '"': ""); a = a.replace(/{area.tabindex}/g, c[b].TabIndex ? 'tabindex="' + c[b].TabIndex + '"': ""); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(c[b].Link.Bi)); d += a } return d }, GetBiAttributes: function(a) { if (!a || !a.Data) return ""; for (var c = [], b = 0; b < a.Data.length; b++) c.push("bi:" + a.Data[b].Key.toLowerCase() + '="' + a.Data[b].Value + '"'); return c.join(" ") } }; if (typeof window.Hp == "undefined") window.Hp = {}; if (typeof window.Hp.Accordion == "undefined") window.Hp.Accordion = { logenabled: !1, isInitialized: !1, isIE: function() { return navigator.appVersion.indexOf("MSIE") != -1 }, init: function() { if (this.isInitialized) return; this.isInitialized = !0; $(".hpAcc a.hpAccTitle").live("click", function() { var e = $(this), a = $(this).parents(".hpAcc"); $parentLi = $(this).closest("li"); $siblingLiOpen = $parentLi.siblings("li.hpAcc_ListOpen"); $currentToggle = $(this).parent().next(); if (a.hasClass("hpAcc_Animating")) return ! 1; if (a.find(":animated").length > 0) return ! 1; var k = Hp.Accordion.getContainerHeightData(a); a.addClass("hpAcc_Animating"); var h = k.baseH, b = !$parentLi.hasClass("hpAcc_ListOpen") ? $currentToggle.innerHeight() : 0, d = !$parentLi.hasClass("hpAcc_ListOpen") ? $siblingLiOpen.find(".hpAccDetail:first").innerHeight() : $currentToggle.innerHeight(), c = h + b; a.data("cheight", c); a.data("bheight", k.baseH); a.data("liheight", b); var g = $(this).closest(".hpGrd_Cell").find(":animated").length > 0; if ($currentToggle.is(":visible")) { $(this).trigger("GridResize", [c, d]); if ($.browser.msie && parseInt($.browser.version) < 7) { $currentToggle.hide().addClass("hpAccDetail_Hidden"); a.removeClass("hpAcc_Animating"); Hp.Accordion.bitrack(e, "close") } else $currentToggle.slideUp(d, function() { a.removeClass("hpAcc_Animating"); $currentToggle.addClass("hpAccDetail_Hidden"); Hp.Accordion.bitrack(e, "close"); g && e.trigger("GridResize", [c, 200]) }) } else { var f = b > d ? b: d; f = b + d; $(this).trigger("GridResize", [c, f]); var j = a.find(".hpLst_body"), i = j.height(), l = i + b - d; if ($.browser.msie && parseInt($.browser.version) < 7) { $siblingLiOpen.removeClass("hpAcc_ListOpen"); $siblingLiOpen.find(".hpAccTitle").removeClass("hpAccTitleOpen"); $siblingLiOpen.find(".hpAccDetail").hide().addClass("hpAccDetail_Hidden"); $currentToggle.show().removeClass("hpAccDetail_Hidden"); Hp.Accordion.bitrack(e, "open", $currentToggle); a.removeClass("hpAcc_Animating") } else { j.css({ height: i, overflow: "hidden" }).animate({ height: l }, { duration: f, complete: function() { Hp.Accordion.bitrack(e, "open", $currentToggle); $siblingLiOpen.stop(!0, !0); $currentToggle.stop(!0, !0); $(this).css({ height: "" }); a.removeClass("hpAcc_Animating"); if (b != $currentToggle.innerHeight()) { b = $currentToggle.innerHeight(); c = h + b; a.data("liheight", b); a.data("cheight", c); e.trigger("GridResize", [c, 200]) } else g && e.trigger("GridResize", [c, 200]) } }); $siblingLiOpen.removeClass("hpAcc_ListOpen"); $siblingLiOpen.find(".hpAccTitle").removeClass("hpAccTitleOpen"); $siblingLiOpen.find(".hpAccDetail").slideUp(d, function() { $(this).addClass("hpAccDetail_Hidden") }); $currentToggle.slideDown(b, function() { $(this).removeClass("hpAccDetail_Hidden") }) } $siblingLiOpen.length > 0 && Hp.Accordion.bitrack($siblingLiOpen.find(".hpAccTitle"), "close") } $parentLi.toggleClass("hpAcc_ListOpen"); $(this).toggleClass("hpAccTitleOpen"); return ! 1 }) }, getContainerHeightData: function(b) { var a = { baseH: 0, openliH: 0, height: 0, adj: 0 }; a.height = b.outerHeight(); a.adj = b.find(".hpLst_Resize").outerHeight(); a.adj = a.adj ? a.adj: 0; a.height = a.height - a.adj; a.openliH = $("li.hpAcc_ListOpen .hpAccDetail", b).outerHeight(); a.baseH = a.height - a.openliH; if (b.hasClass("hpAcc_Animating") || b.find(":animated").length > 0) { a.height = parseInt(b.data("cheight")); a.baseH = parseInt(b.data("bheight")); a.openliH = parseInt(b.data("liheight")) } a.height = a.height != a.baseH + a.openliH ? a.baseH + a.openliH: a.height; return a }, bitrack: function(a, c, f) { if (!$.bi.dataRetrievers.structure || !$.bi.queue) return ! 1; var b = {}, d = {}; if (a.data("bicache") == undefined) { b = { title: $.trim(a.text()) }; $.extend(b, $.bi.baseData(), $.bi.dataRetrievers.structure.getData(a)); a.data("bicache", b) } else b = a.data("bicache"); if (f && a.data("bimerged") == undefined) { d = $.bi.getAttrData(f.find("a,area")); a.data("bimerged", d) } else if (a.data("bimerged") != undefined) d = a.data("bimerged"); a.data("custom-" + c) == undefined && a.data("custom-" + c, $.bi.getAttrData(a.find(".hpBi_Custom .hpBi_Action-" + c))); $.extend(b, a.data("custom-" + c)); if (c == "open") { var e = $.extend({}, b, { initial: a.data("biaccopen") !== undefined ? a.data("biaccopen") : 0, interactiontype: 9, index: b.parentindexstructure, parentindexstructure: "", "-bi-description-ignore-": "accordion-open" }); $.bi.queue.push(e); a.data("biaccopen", 1); var g = b.parenttitlestructure.split(";"); g.push(b.title); var h = $.extend({}, b, d, { initial: a.data("biaccview") !== undefined ? a.data("biaccview") : 0, interactiontype: 1, triggertype: 9, index: "", parenttitlestructure: g.join(";"), title: "", "-bi-description-ignore-": "accordion-view" }); $.bi.queue.push(h); a.data("biaccview", 1) } else if (c == "close") { var e = $.extend({}, b, { initial: a.data("biaccclose") !== undefined ? a.data("biaccclose") : 0, interactiontype: 10, index: b.parentindexstructure, parentindexstructure: "", "-bi-description-ignore-": "accordion-close" }); a.data("biaccclose", 1); a.data("biaccview", 1); $.bi.queue.push(e) } }, resize: function(b, g, c) { var e = this.getContainerHeightData(b), a = b.find(".hpLst_Resize"); c = c || 200; if (!a.length) { b.find(".hpLst_body").after('
'); a = b.find(".hpLst_Resize") } var d = g - e.height, f = a.height(); d != f && a.stop(!0, !0).animate({ height: d }, c) }, log: function(a) { if (this.logenabled) try { console.log(a) } catch(b) {} } }; if (typeof window.Hp == "undefined") window.Hp = {}; Hp.Carousel = function(c, a, b) { this.Control = $("#" + c); this._AnimateSpeed = a; this._SwitchDelay = 7e3; this._MoveMinPixles = a; this.Categories = []; this.InitialCategory; this.CurrentCategory; this.CurrentItems = []; this._FeedUrl = b; this.SeenCampaignIds = []; this.TitleCID = ""; this.LTR = document.documentElement.dir != "rtl"; this.Left = this.LTR ? "left": "right"; this.SetMinHeights(this.Control.find(".hpCrs_Item")); $($.proxy(this.LoadJson, this)); this.BiData = {} }; Hp.Carousel.prototype = { LoadJson: function() { this.Control.find("a").unbind("click").unbind("mousedown"); this.CurrentCategory = parseInt(this.Control.find(".hpCrs_Cat_Current").attr("indx")); if (isNaN(this.CurrentCategory)) this.CurrentCategory = 0; this.InitialCategory = this.CurrentCategory; $.ajax({ url: this._FeedUrl, success: $.proxy(this.JsonSuccess, this), cache: !0, dataType: "json" }) }, JsonSuccess: function(b) { if (b != null) { this.Categories = b; for (var a = 0; a < this.Control.find(".hpCrs_Item").size(); a++) this.CurrentItems[a] = a; this.init() } }, init: function() { this.BindInteractionEvents(); this.Categories[this.CurrentCategory].Items.length > 1 && this.SetButtonsVisibility(); $.browser.msie && $.browser.version < 7 && this.Control.find("a.hpCrs_Next, a.hpCrs_Prev").hover(function() { $(this).find("img").addClass("hpCrs_Hover") }, function() { $(this).find("img").removeClass("hpCrs_Hover") }); for (var e = this.Control.find(".hpCrs_Item").size(), f = [], d = [], b = 0; b < e; b++) { var g = this.Categories[this.CurrentCategory].Items[b]; this.SetCIDSeenList(g, f, d) } var c = this, a = window.attachEvent ? "click": "mousedown"; this.Control.find(".hpCrs_ItemFooter a").live(a, $.proxy(this.BiLinkOverride, this)); this.Control.find(".hpCrs_Footer a").live(a, $.proxy(this.BiLinkOverride, this)); this.Control.find(".hpCrs_slide a").live(a, $.proxy(this.BiLinkOverride, this)); this.Control.find(".hpCrs_slide area").live(a, $.proxy(this.BiLinkOverride, this)); this.BiData[this.CurrentCategory] = { click: !1, view: !0, items: {} }; this.Control.find(".hpCrs_Item").each(function() { try { c.BiData[c.CurrentCategory].items[$(this).attr("bi:index")] = { view: !0, clknext: !1, clkprev: !1 } } catch(a) {} }) }, BiLinkOverride: function(c) { if ($.bi) { var a = $.bi.getLinkData(c.currentTarget, c.target), b = a.parentindexstructure.split(";").reverse(); b.push(this.CurrentCategory); a.parentindexstructure = b.reverse().join(";"); $.bi.record(a) } }, BiCatTrack: function(e, a) { if ($.bi == undefined || $.bi.dataRetrievers.structure == undefined) return ! 1; var d, b; d = this.Control.find(".hpCrs_Item area").filter(function() { return $(this).parents("map").siblings("img").is(":visible") }); d = d.add(this.Control.find(".hpCrs_Item a:visible,.hpCrs_ItemFooter a:visible")); b = $(e); var h = $.bi.getAttrData(d), c = {}; if (this.BiData[a] == undefined) this.BiData[a] = { click: !1, view: !1, items: {} }; try { $.extend(c, $.bi.baseData(), $.bi.dataRetrievers.structure.getData(e)) } catch(j) {} b.data("custom-click") == undefined && b.data("custom-click", $.bi.getAttrData(b.find(".hpBi_Custom .hpBi_Action-click"))); var f = $.extend({}, c, b.data("custom-click"), { initial: !this.BiData[a].click ? 0: 1, interactiontype: 6, parentindexstructure: "", title: $.trim($(e).text()), index: a, "-bi-description-ignore-": "carousel-category-click" }); $.bi.queue.push(f); var g = c.parenttitlestructure.split(";"); g.push(f.title); var i = $.extend({}, c, h, { initial: !this.BiData[a].view ? 0: 1, interactiontype: 1, triggertype: 6, parentindexstructure: a, title: "", parenttitlestructure: g.join(";"), index: "", "-bi-description-ignore-": "carousel-category-view" }); $.bi.queue.push(i); this.BiData[a].view = !0; this.BiData[a].click = !0 }, BiPrevNextTrack: function(e, f, b, d) { if ($.bi == undefined || $.bi.dataRetrievers.structure == undefined) return ! 1; this.BiData[f] != undefined ? this.BiData[f] : { click: !1, view: !1, items: {} }; var h; h = this.Control.find(".hpCrs_Item area").filter(function() { return $(this).parents("map").siblings("img").is(":visible") }); h = h.add(this.Control.find(".hpCrs_Item a:visible")); for (var g = {}, j = $.bi.getAttrData(h), c = { view: !0, clknext: !0, clkprev: !0 }, a = 0; a < b.length; a++) if (this.BiData[this.CurrentCategory].items[b[a]] == undefined) { this.BiData[this.CurrentCategory].items[b[a]] = { view: !1, clknext: !1, clkprev: !1 }; c.clknext = !1; c.clkprev = !1 } else { if (!this.BiData[this.CurrentCategory].items[b[a]].clknext) c.clknext = !1; if (!this.BiData[this.CurrentCategory].items[b[a]].clkprev) c.clkprev = !1 } for (var a = 0; a < d.length; a++) if (this.BiData[this.CurrentCategory].items[d[a]] == undefined) { this.BiData[this.CurrentCategory].items[d[a]] = { view: !1, clknext: !1, clkprev: !1 }; c.view = !1 } else if (!this.BiData[this.CurrentCategory].items[d[a]].view) c.view = !1; try { var l = this.Control.find(".hpCrs_Item:first"); $.extend(g, $.bi.baseData(), $.bi.dataRetrievers.structure.getData(l)) } catch(m) {} this.Control.data("custom-" + e) == undefined && this.Control.data("custom-" + e, $.bi.getAttrData(this.Control.find(".hpCrs_Controls .hpBi_Custom .hpBi_Action-" + e))); if (e == "next") { var i = $.extend({}, g, this.Control.data("custom-" + e), { initial: !c.clknext ? 0: 1, interactiontype: 4, parentindexstructure: f, title: "Next", index: b.sort().join(";"), "-bi-description-ignore-": "carousel-next-click" }); $.bi.queue.push(i); var k = $.extend({}, g, j, { initial: !c.view ? 0: 1, interactiontype: 1, triggertype: 4, parentindexstructure: f, title: "", index: d.sort().join(";"), "-bi-description-ignore-": "carousel-next-view" }); $.bi.queue.push(k); for (var a = 0; a < b.length; a++) this.BiData[this.CurrentCategory].items[b[a]].clknext = !0 } else if (e == "prev") { var i = $.extend({}, g, this.Control.data("custom-" + e), { initial: !c.clkprev ? 0: 1, interactiontype: 5, parentindexstructure: f, title: "Prev", index: b.sort().join(";"), "-bi-description-ignore-": "carousel-prev-click" }); $.bi.queue.push(i); var k = $.extend({}, g, j, { initial: !c.view ? 0: 1, interactiontype: 1, triggertype: 5, parentindexstructure: f, title: "", index: d.sort().join(";"), "-bi-description-ignore-": "carousel-prev-view" }); $.bi.queue.push(k); for (var a = 0; a < b.length; a++) this.BiData[this.CurrentCategory].items[b[a]].clkprev = !0 } for (var a = 0; a < d.length; a++) this.BiData[this.CurrentCategory].items[d[a]].view = !0 }, BindInteractionEvents: function() { this.Control.find(".hpCrs_Controls a.hpCrs_Next, .hpCrs_Controls a.hpCrs_Prev, .hpCrs_Categories a").die("click"); this.Control.find(".hpCrs_Controls a.hpCrs_Next").click($.proxy(this.Next, this)); this.Control.find(".hpCrs_Controls a.hpCrs_Prev").click($.proxy(this.Prev, this)); this.Control.find(".hpCrs_Categories a").click($.proxy(this.SwitchCategory, this)) }, UnbindInteractionEvents: function() { this.Control.find(".hpCrs_Controls a.hpCrs_Next, .hpCrs_Controls a.hpCrs_Prev, .hpCrs_Categories a").unbind("click"); this.Control.find(".hpCrs_Controls a.hpCrs_Next, .hpCrs_Controls a.hpCrs_Prev, .hpCrs_Categories a").live("click", function(a) { a.preventDefault() }) }, FreezeHeight: function() { this.Control.find(".hpCrs_slide").css("height", this.Control.find(".hpCrs_slide").height()) }, UnfreezeHeight: function() { this.Control.find(".hpCrs_slide").css("height", "auto") }, SetButtonsVisibility: function() { if (this.CurrentItems.length < this.Categories[this.CurrentCategory].Items.length) this.Control.find(".hpCrs_Controls_Buttons").fadeIn(500); else this.Control.find(".hpCrs_Controls_Buttons").fadeOut(500) }, SwitchCategory: function(d) { d.preventDefault(); this.UnbindInteractionEvents(); this.FreezeHeight(); this.Control.find(".hpCrs_Categories li a.hpCrs_Cat_Current").removeAttr("bi:title").parent().removeClass("hpCrs_Cat_Selected"); this.Control.find(".hpCrs_Categories li a").removeClass("hpCrs_Cat_Current"); this.CurrentCategory = parseInt($(d.target).closest("a").addClass("hpCrs_Cat_Current").attr("indx")); this.Control.find(".hpCrs_Categories li a.hpCrs_Cat_Current").attr("bi:title", "itemcat").parent().addClass("hpCrs_Cat_Selected"); for (var b = this.Control.find(".hpCrs_Item").size(), c = 0, e = 0; e < b; e++) c += this.Control.find(".hpCrs_Item:eq(" + e + ")").outerWidth(!0); var g = 0, a = 0, o = [], l = []; while (g <= this.Control.width() && a < this.Categories[this.CurrentCategory].Items.length) { this.InsertItem(a, !1, "end"); var q = this.Categories[this.CurrentCategory].Items[a]; this.SetCIDSeenList(q, o, l); var i = this.Control.find(".hpCrs_Item:last"); g += i.outerWidth(!0); a++; this.FixContentIE6(i) } var r = this.Categories[this.CurrentCategory].title, f = this.GetHeightAdjustment("end", b), j = this.Categories[this.CurrentCategory].Header; this.Control.find(".hpCrs_ItemFooter").empty(); if (typeof j == "undefined") this.Control.find(".hpCrs_ItemFooter").hide(); else { var n = new Hp.InfoItem.Template(this.LTR), h = n.BuildItem(j); if ($.trim(h) != "") { this.Control.find(".hpCrs_ItemFooter").append(h); this.Control.find(".hpCrs_ItemFooter").slideDown() } else this.Control.find(".hpCrs_ItemFooter").slideUp() } var m = d, k = function() { this.RemoveItemsFromStart(b); this.SetButtonsVisibility(); try { this.BiCatTrack(m.currentTarget, this.CurrentCategory) } catch(a) {} }, p = this.LTR ? { left: "-=" + c, height: f }: { right: "-=" + c, height: f }; this.Control.find(".hpCrs_slide").animate(p, this._AnimateSpeed, $.proxy(k, this)) }, Next: function() { if (this.isBusy()) return ! 1; this.UnbindInteractionEvents(); this.FreezeHeight(); var j = [], e = [], c = 0, h = 0, a = this.CurrentItems[0]; while (h < this._MoveMinPixles && c < this.Categories[this.CurrentCategory].Items.length) { j.push(a); h += this.Categories[this.CurrentCategory].Items[a].Layout.Width + 1; c++; a++; if (a >= this.Categories[this.CurrentCategory].Items.length) a = 0 } for (var d = 0, b = 0; b < c; b++) d += this.Control.find(".hpCrs_Item:eq(" + b + ")").outerWidth(!0); for (var f = 0, b = c; b < this.CurrentItems.length; b++) { e.push(b); f += this.Control.find(".hpCrs_Item:eq(" + b + ")").outerWidth(!0) } var i = 0, a = this.CurrentItems[this.CurrentItems.length - 1], n = [], m = []; while (i + f <= this.Control.width()) { a++; if (a >= this.Categories[this.CurrentCategory].Items.length) a = 0; e.push(a); this.InsertItem(a, !1, "end"); var k = this.Control.find(".hpCrs_Item:last"); i += k.outerWidth(!0); var p = this.Categories[this.CurrentCategory].Items[a]; this.SetCIDSeenList(p, n, m); this.FixContentIE6(k) } var q = this.Categories[this.CurrentCategory].title, g = this.GetHeightAdjustment("end", c), l = function() { this.RemoveItemsFromStart(c); try { this.BiPrevNextTrack("next", this.CurrentCategory, j, e) } catch(a) {} }, o = this.LTR ? { left: "-=" + d, height: g }: { right: "-=" + d, height: g }; this.Control.find(".hpCrs_slide").animate(o, this._AnimateSpeed, $.proxy(l, this)) }, SetCIDSeenList: function(a, c, b) { if (a.text != null) if (a.text.title != null) if (a.text.title.campaignId != null) { var g = a.text.title.campaignId; this.SetCIDSeenListItem(g, c, b) } if (a.image != null) if (a.image.campaignId != null) { var f = a.image.campaignId; this.SetCIDSeenListItem(f, c, b) } if (a.text != null) if (a.text.primaryAction != null) if (a.text.primaryAction.campaignId != null) { var d = a.text.primaryAction.campaignId; this.SetCIDSeenListItem(d, c, b) } if (a.actions != null) for (i in a.text.actions) if (a.text.actions[i].campaignId != null) { var e = a.text.actions[i].campaignId; this.SetCIDSeenListItem(e, c, b) } }, SetCIDSeenListItem: function(a, c, b) { var d = this.ItemCIDSeen(a); if (jQuery.inArray(a, b) == -1 && jQuery.inArray(a, c) == -1) if (d) c[c.length] = a; else b[b.length] = a }, Prev: function() { if (this.isBusy()) return ! 1; this.UnbindInteractionEvents(); this.FreezeHeight(); var i = [], e = [], c = 0, h = 0, a = this.CurrentItems[this.CurrentItems.length - 1]; while (h < this._MoveMinPixles && c < this.Categories[this.CurrentCategory].Items.length) { i.push(a); h += this.Categories[this.CurrentCategory].Items[a].Layout.Width + 1; c++; a--; if (a < 0) a = this.Categories[this.CurrentCategory].Items.length - 1 } for (var l = 0, b = this.CurrentItems.length - c; b < this.CurrentItems.length; b++) l += this.Control.find(".hpCrs_Item:eq(" + b + ")").outerWidth(!0); for (var f = 0, b = 0; b < this.CurrentItems.length - c; b++) { e.push(b); f += this.Control.find(".hpCrs_Item:eq(" + b + ")").outerWidth(!0) } var d = 0, a = this.CurrentItems[0], n = [], m = []; while (d + f <= this.Control.width()) { a--; if (a < 0) a = this.Categories[this.CurrentCategory].Items.length - 1; e.push(a); this.InsertItem(a, !0, "start"); var j = this.Control.find(".hpCrs_Item:first"); d += j.outerWidth(!0); var p = this.Categories[this.CurrentCategory].Items[a]; this.SetCIDSeenList(p, n, m); this.FixContentIE6(j) } var q = this.Categories[this.CurrentCategory].title, g = this.GetHeightAdjustment("start", c), k = function() { this.RemoveItemsFromEnd(c); this.BiPrevNextTrack("prev", this.CurrentCategory, i, e) }, o = this.LTR ? { left: "+=" + d, height: g }: { right: "+=" + d, height: g }; this.Control.find(".hpCrs_slide").animate(o, this._AnimateSpeed, $.proxy(k, this)) }, isBusy: function() { return this.Control.find(":animated").length > 0 }, RemoveItemsFromStart: function(b) { for (var a = 0; a < b; a++) this.RemoveItem(0, "start"); this.Control.find(".hpCrs_slide").css(this.Left, 0); this.UnfreezeHeight(); this.BindInteractionEvents() }, RemoveItemsFromEnd: function(b) { for (var a = 0; a < b; a++) this.RemoveItem(this.CurrentItems.length - 1, "end"); this.Control.find(".hpCrs_slide").css(this.Left, 0); this.UnfreezeHeight(); this.BindInteractionEvents() }, RemoveItem: function(c, b) { if (b == "end") this.CurrentItems.pop(); else this.CurrentItems.shift(); var a = this.Control.find(".hpCrs_Item:eq(" + c + ")"); a.remove() }, SetMinHeights: function(a) { var d = $.browser.msie && $.browser.version == 6 ? "height": "min-height"; a.find(".hpFeat_FeatureItemContent").css(d, 0).css("height", "auto"); var b = 0, c, g = ""; a.each(function() { g += $(this).find(".hpFeat_FeatureItemContent").text(); c = $(this).find(".hpFeat_FeatureItemContent").innerHeight(); if (c > b) b = c }); if (g.length == 0) a.find(".hpFeat_FeatureItemContent").css("height", 0); else a.find(".hpFeat_FeatureItemContent").css(d, b); a.find(".hpFeat_FeatureItem h4").css(d, 0); var b = 0, c; a.each(function() { c = $(this).find(".hpFeat_FeatureItem h4").height(); if (c > b) b = c }); a.find(".hpFeat_FeatureItem h4").css(d, b); a.find(".hpCrs_Incent").css(d, 0); var b = 0, c; a.each(function() { c = $(this).find(".hpCrs_Incent").height(); if (c > b) b = c }); a.find(".hpCrs_Incent").css(d, b); a.css(d, 0); var e = 0, f; a.each(function() { f = $(this).height(); if (f > e) e = f }); a.css(d, e); return e }, GetHeightAdjustment: function(f, e) { var c = this.Control.find(".hpCrs_slide").height(), d; if (f == "end") d = ":gt(" + (e - 1) + ")"; else d = ":lt(" + (this.CurrentItems.length - e) + ")"; var a = this.SetMinHeights(this.Control.find(".hpCrs_Item" + d)), b; if (c < a) b = "+=" + (a - c); else b = "-=" + (c - a); return b }, InsertItem: function(b, f, g) { if (g == "end") this.CurrentItems.push(b); else this.CurrentItems.unshift(b); var c = this.Categories[this.CurrentCategory].Items[b], e = new Hp.Carousel.Template(this.LTR), d = e.BuildItem(c, b); if (f) { this.Control.find(".hpCrs_slide").prepend(d); var c = this.Control.find(".hpCrs_Item:eq(0)"), a = this.LTR ? this.Control.find(".hpCrs_slide").position().left: parseInt(this.Control.find(".hpCrs_slide").css("right")); a = a ? a - c.outerWidth(!0) : -c.outerWidth(!0); this.Control.find(".hpCrs_slide").css(this.Left, a) } else this.Control.find(".hpCrs_slide .hpCrs_Item:last").after(d) }, ItemCIDSeen: function(a) { var b = !1, b = jQuery.inArray(a, this.SeenCampaignIds) > -1; if (!b) this.SeenCampaignIds[this.SeenCampaignIds.length] = a; return b }, FixContentIE6: function(a) { $.browser.msie && parseInt($.browser.version) < 7 && a.find("*").each(function(e, d) { var a = $(d), b = a.css("float"), c = a.attr("style"); if (b && b !== "none") { a.css("float", b); (!c || c.indexOf("float:") == -1) && a.css("float", "") } }) } }; Hp.Carousel.Template = function(a) { this.LTR = typeof a == "boolean" ? a: $("html").attr("dir") != "rtl" }; Hp.Carousel.Template.prototype = { BuildItem: function(b, d) { var a = '
{item.Item}
'; a = a.replace(/{index}/g, d); a = a.replace(/{item.Layout.Width}/g, b.Layout.Width - 20); var c = new Hp.FeatureItem.Template(this.LTR); return a.replace(/{item.Item}/g, c.BuildItem(b.Item)) } }; Hp.InfoItem = {}; Hp.InfoItem.Template = function(a) { this.LTR = typeof a == "boolean" ? a: $("html").attr("dir") != "rtl"; this.FeatureItem = new Hp.FeatureItem.Template(this.LTR) }; Hp.InfoItem.Template.prototype = { BuildItem: function(b) { if (!b) return ""; var a = "{item.description}{item.cta}"; a = a.replace(/{item.description}/g, this.BuildDescription(b.Description)); a = a.replace(/{item.cta}/g, this.BuildCta(b.CallToAction)); return a }, BuildDescription: function(a) { if (!a) return ""; var b = '

{text}

'; return b.replace(/{text}/g, MSCOM.Helper.htmlEncode(a.Value)) }, BuildCta: function(b) { if (!b) return ""; var a = '
{title}
'; if (b.Link) { a = '
{title}
'; a = a.replace(/{title.Link}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.FeatureItem.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{title}/g, MSCOM.Helper.htmlEncode(b.Value)); return a } }; Hp.FeatureItem = {}; Hp.FeatureItem.Template = function(a) { this.LTR = typeof a == "boolean" ? a: $("html").attr("dir") != "rtl" }; Hp.FeatureItem.Template.prototype = { BuildItem: function(b) { var a = '
{item.Image}{item.Text}
'; a = a.replace(/{item.Image}/g, this.BuildImage(b.Image)); a = a.replace(/{item.Text}/g, this.BuildText(b)); return a.replace(/{item.ImagePosition}/g, this.GetPosition(b.ImagePosition)) }, BuildImage: function(b, d) { if (!b) return ""; var a = '{image.Alt}{image.ImageMap}'; if (b.HasOffset) { a = '{image.Alt}{image.ImageMap}'; a = a.replace(/{image.clipstyle}/g, "width:" + b.ClipWidth + "px;height:" + b.ClipHeight + "px;"); a = a.replace(/{image.offsetstyle}/g, "top:" + b.TopOffset + "px;left:" + b.LeftOffset + "px;") } var c = "carsl_" + +new Date; if (b && b.Link && b.Link.Href) { a = '' + a + ""; a = a.replace(/{image.Url}/g, b.Link.Href); a = a.replace(/{bi.Attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{image.UseMap}/g, b.IsImageMap ? 'usemap="#' + c + '"': ""); a = a.replace(/{image.ImageMap}/g, this.BuildImageMap(b, c)); a = a.replace(/http://www.2903866.com/{image.Src}/g, b.Src); a = a.replace(/{image.Width}/g, b.Width); a = a.replace(/{image.Height}/g, b.Height); if (!d) a = '
' + a + "
"; return a.replace(/{image.Alt}/g, MSCOM.Helper.htmlAttrEncode(b.Alt)) }, BuildImageMap: function(b, c) { if (!b.IsImageMap) return ""; var a = '{imagemap.Area}'; a = a.replace(/{imagemap.id}/g, c); return a.replace(/{imagemap.Area}/g, this.BuildImageMapAreas(b.ImageMap.Areas)) }, BuildImageMapAreas: function(c) { for (var d = "", b = 0, e = c.length; b < e; b++) { var a = ''; a = a.replace(/{area.shape}/g, c[b].Shape ? 'shape="' + c[b].Shape + '"': ""); a = a.replace(/{area.coords}/g, c[b].Coords ? 'coords="' + c[b].Coords + '"': ""); a = a.replace(/{area.href}/g, c[b].Link.Href ? c[b].Link.Href: ""); a = a.replace(/{area.class}/g, c[b].CssClass ? 'class="' + c[b].CssClass + '"': ""); a = a.replace(/{area.target}/g, c[b].Target ? 'target="' + c[b].Target + '"': ""); a = a.replace(/{area.alt}/g, c[b].Alt ? 'alt="' + MSCOM.Helper.htmlAttrEncode(c[b].Alt) + '"': ""); a = a.replace(/{area.tabindex}/g, c[b].TabIndex ? 'tabindex="' + c[b].TabIndex + '"': ""); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(c[b].Link.Bi)); d += a } return d }, BuildText: function(b) { if (!b) return ""; var a = '
{item.Title}{item.Description}{item.List}{item.Caption}{item.Incentive}{item.PrimaryCallsToAction}{item.SecondaryCallsToAction}
', c = ""; if (b.ImagePosition == "left") { var d = b && b.Image && b.Image.Width ? parseInt(b.Image.Width) + 20: "0"; c = 'style="margin-' + (this.LTR ? "left": "right") + ":" + d + 'px"' } a = a.replace(/{style}/g, c); a = a.replace(/{item.Title}/g, this.BuildTitle(b.Title)); a = a.replace(/{item.Description}/g, this.BuildDescription(b.Description)); a = a.replace(/{item.List}/g, this.BuildList(b.List)); a = a.replace(/{item.Caption}/g, this.BuildCaption(b.Caption)); a = a.replace(/{item.Incentive}/g, this.BuildIncentives(b.Incentive)); a = a.replace(/{item.PrimaryCallsToAction}/g, this.BuildCallsToAction(b.PrimaryCallsToAction, "PrimaryCta")); a = a.replace(/{item.SecondaryCallsToAction}/g, this.BuildCallsToAction(b.SecondaryCallsToAction, "SecondaryCta")); return a }, GetPosition: function(a) { return "hpFeat_Pos-" + a }, GetBiAttributes: function(a) { if (!a || !a.Data) return ""; for (var c = [], b = 0; b < a.Data.length; b++) c.push("bi:" + a.Data[b].Key.toLowerCase() + '="' + a.Data[b].Value + '"'); return c.join(" ") }, BuildTitle: function(b) { if (!b) return ""; var a = '
{title}{trailingicon}
'; if (b.Link) { a = '
{title}{trailingicon}
'; a = a.replace(/{title.link}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{title}/g, MSCOM.Helper.htmlEncode(b.Value)); a = a.replace(/{trailingicon}/g, b.TrailingIcon ? this.BuildImage(b.TrailingIcon, !0) : ""); return a }, BuildDescription: function(b) { if (!b) return ""; var a = '

{description}{trailingicon}

'; if (b.Link) { a = '

{description}{trailingicon}

'; a = a.replace(/{description.Link}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{trailingicon}/g, b.TrailingIcon ? this.BuildImage(b.TrailingIcon, !0) : ""); return a.replace(/{description}/g, MSCOM.Helper.htmlEncode(b.Value)) }, BuildCaption: function(b) { if (!b) return ""; var a = '

{title}{trailingicon}

'; if (b.Link) { a = '

{title}{trailingicon}

'; a = a.replace(/{title.Link}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{title}/g, MSCOM.Helper.htmlEncode(b.Value)); a = a.replace(/{trailingicon}/g, b.TrailingIcon ? this.BuildImage(b.TrailingIcon, !0) : ""); return a }, BuildList: function(b) { if (!b) return ""; for (var c = '
', a = 0; a < b.length; a++) c += this.BuildListItem(b[a], a); return c + "
" }, BuildListItem: function(b, c) { if (!b) return ""; var a = "
  • {item}{trailingicon}
  • "; if (b.Link) { var a = '
  • {item}{trailingicon}
  • '; a = a.replace(/{list.link}/g, b.Link.Href); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(b.Link.Bi)) } a = a.replace(/{index}/g, c); a = a.replace(/{trailingicon}/g, b.TrailingIcon ? this.BuildImage(b.TrailingIcon, !0) : ""); a = a.replace(/{item}/g, MSCOM.Helper.htmlEncode(b.Value)); return a }, BuildIncentives: function(a) { if (!a) return ""; else if (!a.Old && !a.New) return ""; var b = '
    ' + (this.LTR ? "{incentives.old}{incentives.new}": "{incentives.new}{incentives.old}") + "
    "; b = b.replace(/{incentives.old}/g, this.BuildIncentive(a.Old, "Old")); b = b.replace(/{incentives.new}/g, this.BuildIncentive(a.New, "New")); return b }, BuildIncentive: function(b, c) { if (!b || !c) return ""; var a = '{incentive}'; a = a.replace(/{incentive}/g, MSCOM.Helper.htmlEncode(b)); return a.replace(/{type}/g, c) }, BuildCallsToAction: function(c, e) { if (!c || !e) return ""; for (var d = '
    ', b = 0; b < c.length; b++) { var a = "
  • {cta.value}{trailingicon}
  • "; if (c[b].Link) { var a = '
  • {cta.value}{trailingicon}
  • '; a = a.replace(/{cta.link}/g, c[b].Link.Href); a = a.replace(/{cta.type}/g, e); a = a.replace(/{index}/g, b); a = a.replace(/{bi.attr}/g, this.GetBiAttributes(c[b].Link.Bi)) } a = a.replace(/{cta.value}/g, MSCOM.Helper.htmlEncode(c[b].Value)); a = a.replace(/{trailingicon}/g, c[b].TrailingIcon ? this.BuildImage(c[b].TrailingIcon, !0) : ""); d += a } d += "
    "; return d.replace(/{type}/g, e) } }