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 = '{text}
'; return b.replace(/{text}/g, MSCOM.Helper.htmlEncode(a.Value)) }, BuildCta: 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 = '