﻿
if (typeof window.Csp == 'undefined') { window.Csp = {}; }
Csp.SearchComponent = function(withSiteScoping, withAutoScoping, searchWebHidden, withWatermark, watermarkText, searchBoxContainerId, searchTextBoxId, searchSiteButtonId, searchWebButtonId, scopingDropdownLinkId, scopingMenuContainerId) { this.WithSiteScoping = withSiteScoping; this.WithAutoScoping = withAutoScoping; this.SearchWebHidden = searchWebHidden; this.WithWatermark = withWatermark; this.WatermarkText = watermarkText; this.SearchBoxContainerId = searchBoxContainerId; this.SearchTextBoxId = searchTextBoxId; this.SearchSiteButtonId = searchSiteButtonId; this.SearchWebButtonId = searchWebButtonId; this.DropdownLinkId = scopingDropdownLinkId; this.ScopingMenuContainerId = scopingMenuContainerId; this.isOpen = false; this.init(); }; Csp.SearchComponent.prototype = { init: function() {
    var _this = this; $('#' + this.SearchSiteButtonId).click(function() { _this.search_onClick('mscom'); }); $('#' + this.SearchWebButtonId).click(function() { _this.search_onClick('live'); }); if (this.WithWatermark == true) { $('#' + this.SearchTextBoxId).blur(function() { _this.setWatermark(false); }).focus(function() { _this.clearWatermark(); }); this.setWatermark(true); }
    if (this.WithSiteScoping == true && this.WithAutoScoping == false) { var ddLink = $('#' + this.DropdownLinkId); if (ddLink.length) { ddLink.toggle(Function.createDelegate(this, this.openMenu_onClick), Function.createDelegate(this, this.closeMenu_onClick)); $('#' + this.SearchPanelId + ' span.src_box, #' + this.ScopingMenuContainerId).mouseover(Function.createDelegate(this, this.clearMenuTimer)); $("body").mouseover(Function.createDelegate(this, this.startMenuTimer)); } } 
}, setWatermark: function(always) { var el = $('#' + this.SearchTextBoxId); if (always == true && el.val().length > 0 && el.val() != this.WatermarkText) { this.clearWatermark(); } else if (always == true || el.val().length == 0) { el.addClass('src_watermark').val(this.WatermarkText); } }, clearWatermark: function() { var el = $('#' + this.SearchTextBoxId); if (el.val() == this.WatermarkText) { el.removeClass('src_watermark').val(''); } else { el.removeClass('src_watermark'); } }, search_onClick: function(stype) {
    var el = $('#' + this.SearchTextBoxId); var sterm; if (el.val() != this.WatermarkText) { sterm = el.val(); }
    if (typeof window.DCSext != 'undefined') { DCSext.sterm = sterm || '*'; DCSext.stype = stype; } 
}, openMenu: function() {
    var h = $('#' + this.SearchPanelId + ' span.src_box').height() - 1; if ($('body').hasClass('rtl') == true) { $('#' + this.ScopingMenuContainerId).css({ 'display': 'inline-block', 'top': h + 'px', 'left': '-1px' }); } else { $('#' + this.ScopingMenuContainerId).css({ 'display': 'inline-block', 'top': h + 'px', 'right': '-1px' }); }
    this.isOpen = true;
}, closeMenu: function() { $('#' + this.ScopingMenuContainerId).css('display', 'none'); this.isOpen = false; }, startMenuTimer: function(e) { var fnHide = function() { this.hideTimer = undefined; if (this.isOpen == true) { $('#' + this.DropdownLinkId).click(); } }; if (!this.hideTimer) { this.hideTimer = window.setTimeout(Function.createDelegate(this, fnHide), 100); } }, clearMenuTimer: function(e) { e.stopPropagation(); if (this.hideTimer) { window.clearTimeout(this.hideTimer); this.hideTimer = undefined; } }, openMenu_onClick: function(e) { e.preventDefault(); this.openMenu(); }, closeMenu_onClick: function(e) { e.preventDefault(); this.closeMenu(); } 
};

function cspMediaBlock_parseMetaTag(linkId) { wtRemoveCId(linkId); return true; }
function cspMediaBlock_setImageStyle(divClass, divId, imgStyle) {
    var browserUA = navigator.userAgent.toLowerCase(); var object_div = document.getElementById(divId); if (object_div != null && object_div.getElementsByTagName("object").length > 0) { var img_div = cspGetObjectsOfElementByTagAndClass(object_div.parentNode, "div", divClass); if (img_div.length > 0) { for (var i = 0; i < img_div.length; i++) { if ((browserUA.indexOf("firefox") != -1 || browserUA.indexOf("msie") != -1 || browserUA.indexOf("safari") != -1 || browserUA.indexOf("opera") != -1) && object_div.getElementsByTagName("object")[i].type != "application/x-shockwave-flash") { img_div[i].style.display = imgStyle; } } } }
    return true;
}
function cspMediaBlock_isFlashInstalled() { return cspMediaBlock_getFlashVersion() >= 6; }
function cspMediaBlock_getFlashVersion() {
    var i; if (window.ActiveXObject) { for (i = 12; i > 5; i--) { try { var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i); return i; } catch (e) { } } } else if (navigator.plugins && navigator.plugins.length) { for (i = 0; i < navigator.plugins.length; i++) { if (navigator.plugins[i].name.indexOf("Shockwave Flash") != -1) { return navigator.plugins[i].description.split(" ")[2]; } } }
    return 0;
}
function cspMediaBlock_writeFlashObject(swfFile, width, height, divId) {
    if (width == 0 || width == undefined) { width = ""; }
    if (height == 0 || height == undefined) { height = ""; }
    document.getElementById(divId).innerHTML = "<object " + (width != "" ? " width=\"" + width + "\"" : "") + (height != "" ? " height=\"" + height + "\"" : "") + " classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"><param name=\"movie\" value=\"" + swfFile + "\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed " + (width != "" ? " width=\"" + width + "\"" : "") + (height != "" ? " height=\"" + height + "\"" : "") + " src=\"" + swfFile + "\" quality=\"high\" bgcolor=\"#ffffff\" align=\"middle\" allowScriptAccess=\"always\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" wmode=\"transparent\"></object>"; return true;
}
function cspMediaBlock_showFlash(swfFile, width, height, divId, flImgCid, flCid, flImgId) { if (cspMediaBlock_isFlashInstalled()) { cspMediaBlock_writeFlashObject(swfFile, width, height, divId); if (flCid != flImgCid) { cspMediaBlock_parseMetaTag(flImgCid); } } else { cspMediaBlock_setImageStyle(flImgId, divId, "block"); if (flCid != flImgCid) { cspMediaBlock_parseMetaTag(flCid); } } }
function cspMediaBlock_shouldShowSilverlight(version) { $$U.detectUserAgent(); return Silverlight.isInstalled(version) && !((Sys.Browser.agent === Sys.Browser.Safari && $$U.OS == "Windows") || Sys.Browser.agent === Sys.Browser.Opera); }
function cspMediaBlock_showSilverlight(slVer, slId, xamlFile, slWidth, slHeight, slColor, isWinLess, slFramerate, slImgCid, slImgId, slCid) {
    if (cspMediaBlock_shouldShowSilverlight(slVer)) { var silverlightDiv = document.getElementById(slId); cspMediaBlock_CreateSilverlightObject(xamlFile, silverlightDiv, slId, slWidth, slHeight, slColor, isWinLess, slFramerate, slVer); if (slCid != slImgCid) { cspMediaBlock_parseMetaTag(slImgCid); } } else {
        cspMediaBlock_setImageStyle(slImgId, slId, "block"); if (typeof $$SL != "undefined") { $$SL.registerCreative(Function.createDelegate(window, function() { var silverlightDiv = document.getElementById(slId); cspMediaBlock_CreateSilverlightObject(xamlFile, silverlightDiv, slId, slWidth, slHeight, slColor, isWinLess, slFramerate, slVer); var dcsuri = window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/") + 1) + ($$SG.get_IsDirectInstall() == true ? "directinstall/panel" : "pagegate/panel"); dcsMultiTrack("DCS.dcsuri", dcsuri, "DCSext.wt_linkid", slCid, "WT.dl", "5", "WT.ti", "Silverlight Panel Refresh", "WT.ad", "", "WT.mc_id", "", "WT.seg_4", "Yes", "WT.sli", "Yes", "WT.slv", "1.0"); cspMediaBlock_setImageStyle(slImgId, slId, "none"); })); }
        if (slCid != slImgCid) { cspMediaBlock_parseMetaTag(slCid); } 
    } 
}
function cspMediaBlock_CreateSilverlightObject(xamlFile, silverlightDiv, slId, slWidth, slHeight, slColor, isWinLess, slFramerate, slVer) { Silverlight.createObject(xamlFile, silverlightDiv, slId + "_object", { width: slWidth, height: slHeight, background: slColor, isWindowless: isWinLess, framerate: slFramerate, version: slVer, enableFramerateCounter: "false", ignoreBrowserVer: "false", inplaceInstallPrompt: "false" }, { onError: function() { }, onLoad: null, onResize: null }, null); }

if (typeof window.Csp == "undefined") { window.Csp = {}; }
Csp.Menu = function(id) {
    this._id = id; this._menu = document.getElementById(id); this._hider = null; this._shower = null; $().keypress(Function.createDelegate(this, this.bodyKeyPress)).mouseover(Function.createDelegate(this, this.bodyMouseOver)); $("a.h15-group", this._menu).click(Function.createDelegate(this, this.toggleMenu)).mouseover(Function.createDelegate(this, this.triggerShow)); if (Sys.Browser.agent == Sys.Browser.InternetExplorer) { $("a.h15-link", this._menu).click(Function.createDelegate(this, this.linkClick)); } else { $("a.h15-link", this._menu).mousedown(Function.createDelegate(this, this.linkClick)); }
    $("div.h15-menu-container", this._menu).mouseover(Function.createDelegate(this, this.keepMenuVisible));
}; Csp.Menu.prototype = { bodyKeyPress: function(e) { if (e.keyCode == 27) { var menu = $(".h15-menu-container:visible", this._menu); this.hideMenus(); menu.prev("a.h15-group").each(function() { this.focus(); }); } }, bodyMouseOver: function(e) { this.clearShower(); this.triggerHide(); }, clearHider: function() { if (this._hider != null) { window.clearTimeout(this._hider); this._hider = null; } }, clearShower: function() { if (this._shower != null) { window.clearTimeout(this._shower); this.shower = null; } }, doubleQuote: function(s) { return s.replace("'", "''"); }, hideMenus: function(e) { $("div.h15-groups table td").removeClass("h15-selected"); $(".h15-menu-container", this._menu).hide(); }, keepMenuVisible: function(e) { e.stopPropagation(); this.clearHider(); this.clearShower(); }, linkClick: function(e) { var link = $(e.target); var subgroup = link.parents("ul.h15-links").prev("h6.h15-menu-header"); var group = subgroup.parents("div.h15-menu-container").prev("a.h15-group"); this.webTrends3(link.text(), subgroup.text(), group.text()); }, showFlyout: function(e) {
    var count = $(".h15-menu-container", this._menu).length; var index = $(".h15-menu-container", this._menu).index(e); if (document.documentElement.dir != "rtl") { if (index < 2) { this.showFlyoutLeft(e); } else if (index < count - 2) { if ($(".h15-column:has(.h15-menu)", e).length > 1) { this.showFlyoutRightMulti(e); } else { this.showFlyoutLeft(e); } } else { if ($(".h15-column:has(.h15-menu)", e).length > 1) { this.showFlyoutLeftMulti(e); } else { this.showFlyoutRight(e); } } } else { if (index < 2) { this.showFlyoutRight(e); } else if (index < count - 2) { if ($(".h15-column:has(.h15-menu)", e).length > 1) { this.showFlyoutLeftMulti(e); } else { this.showFlyoutRight(e); } } else { this.showFlyoutLeft(e); } }
    e.show(); window.setTimeout(function() { $(".h15-m1, .h15-m2, .h15-m3, .h15-m4", e).css("background", "#fff"); }, 0);
}, showFlyoutLeft: function(e) { if (document.documentElement.dir == "rtl") { e.css("left", 420 - e.parent("td").width()); } }, showFlyoutLeftMulti: function(e) { if (document.documentElement.dir == "rtl") { e.css("left", -200 - e.parent("td").width()); } else { e.css("left", -560 + e.parent("td").width()); } }, showFlyoutRight: function(e) { if (document.documentElement.dir == "ltr") { e.css("left", -120 + e.parent("td").width()); } }, showFlyoutRightMulti: function(e) { e.css("left", -400 + e.parent("td").width()); }, showMenu: function(e) { this.hideMenus(); var el = $(e.target); el.parent("td").addClass("h15-selected"); this.showFlyout(el.next(".h15-menu-container")); if (typeof el.attr("h15:tag") == "undefined") { this.webTrends1(el.text()); el.attr("h15:tag", "1"); } }, toggleMenu: function(e) { e.preventDefault(); this.clearHider(); this.clearShower(); var el = $(e.target).next(".h15-menu-container"); var shown = el.css("display") != "none"; this.hideMenus(); if (!shown) { el.parent("td").addClass("h15-selected"); this.showFlyout(el); } }, triggerHide: function() { if (this._hider == null) { this._hider = window.setTimeout(Function.createDelegate(this, this.hideMenus), 1); } }, triggerShow: function(e) {
    e.stopPropagation(); this.clearHider(); if (this._shower != null) { this.clearShower(); }
    this._shower = window.setTimeout(Function.createDelegate(this, function() { this.showMenu(e); }), 125);
}, webTrends1: function(name) { if (typeof window.dcsMultiTrack != "undefined") { var name = this.doubleQuote(name); try { dcsMultiTrack("DCS.dcsuri", this.normalizePathname(location.pathname), "DCSext.ngn_clevel", "Level 1", "DCSext.ngn_lname", dcsEscape(dcsEncode(name)), "DCS.ngn_type", "Master Navigation", "WT.si_p", "Level 2a", "WT.ti", name + ":menu:menu", "WT.dl", "1", "DCS.wt_linkid", ""); } catch (e) { } } }, webTrends3: function(name, subgroup, group) { if (typeof window.dcsMultiTrack != "undefined") { var campaignID = ""; var query = (location.search.length > 0) ? location.search.substring(1) : ""; var name = this.doubleQuote(name); var title = this.doubleQuote(group) + ":" + this.doubleQuote(subgroup) + ":" + name; try { dcsMultiTrack("DCS.dcssip", location.hostname, "DCS.dcsuri", this.normalizePathname(location.pathname), "DCS.dcsqry", query, "DCSext.ngn_clevel", "Level 2b", "DCSext.ngn_lname", dcsEscape(dcsEncode(name)), "DCS.ngn_type", "Master Navigation", "WT.si_p", "Level 3", "WT.ti", title, "WT.dl", 1, "DCSext.wt_linkid", campaignID); } catch (e) { } } }, normalizePathname: function(path) { return (path.startsWith("/")) ? path : "/" + path; } 
}; Csp.Menu.layout = function(layout, menu) {
    var columns = $("div.h15-column", menu); var currentHeight = 0; var index = 0; var height = 0; $("div.h15-menu", layout).each(function() {
        height = $(this).height() + 20; if (currentHeight > 0 && index < 3 && currentHeight + height > 450) { index++; currentHeight = 0; }
        currentHeight += height; $(this).appendTo(columns[index]);
    }); var menuHeight = 0; columns.each(function() { menuHeight = Math.max(menuHeight, $(this).height()); }); var menuWidth = (index + 1) * 200; $(menu).height(Math.min(menuHeight, 450) + 10).width(menuWidth).css({ visibility: "visible" }); $(".h15-menu-inner", menu).height(menuHeight); columns.each(function() {
        var column = $(this); var ix = columns.index(this); if (ix < index) { column.addClass("h15-dotted"); }
        if (ix <= index) { column.height(menuHeight); } else { column.hide(); } 
    });
};

if (typeof window.Csp === undefined) { window.Csp = {}; }
Csp.Nbd = function(id, hasStatic, rssUrl, vrtPath, campaignId, campaignName) {
    this.MaxRssItems = 4; this.RssTimeOut = 4000; this.RotationSpeed = 1000; this.RotationTimerTimeout = 4000; this.HoverTimeout = 400; this.rotateTimer = 0; this.hoverTimer = 0; this.rssFeed; this.hasStatic = hasStatic; this.rssUrl = rssUrl; this.vrtPath = vrtPath; this.campaignId = campaignId; this.campaignName = campaignName; this.rssFeedBeconSent; this.id(id); var _this = this; if (Sys.Browser.agent == Sys.Browser.InternetExplorer) { $(this.cssId() + ' .nbd_headline a').click(function(e) { _this.sendClickImpression($(e.target)); }); } else { $(this.cssId() + ' .nbd_headline a').mousedown(function(e) { _this.sendClickImpression($(e.target)); }); }
    if (rssUrl != '') {
        if (this.hasStatic == true) { this.MaxRssItems -= 1; }
        this.loadFeed(rssUrl); this.fnClose = function(e) { if ($(e.target).parents(_this.cssId()).length < 1) { $(_this.cssId() + ' a.nbd_arrow').click(); } }; this.fnBodyKeyPress = function(e) { if (e.keyCode == 27 || $(e.target).parents(_this.cssId()).length < 1) { $(_this.cssId() + ' a.nbd_arrow').click(); } };
    } else { this.waitToEnable(); } 
}; Csp.Nbd.prototype = { id: function(newId) {
    if (newId != '' && newId != undefined) { this._id = newId; this._cssId = '#' + newId; }
    return this._id;
}, cssId: function() { return this._cssId; }, loadFeed: function(url) {
    url = encodeURIComponent(url); var _this = this; $.ajax({ type: 'GET', url: this.vrtPath + '/shared/templates/components/cspMscomNewsBand/Rss.ashx?u=' + url, timeout: this.RssTimeOut, cache: false, dataType: 'xml', success: function(data, textStatus) {
        _this.rssFeed = new Csp.Nbd.Rss(data, _this.MaxRssItems); var menu = $(_this.cssId() + ' .nbd_menu'); var rssItem; var listItem; var items = _this.rssFeed.items; if (items.length > 1) {
            for (var i = 0; i < items.length; i++) {
                rssItem = items[i]; var li = '<li><a class="nbd_NotSent" href="' + rssItem.link + '"'; if (_this.campaignId != '') { li += ' cid="' + _this.campaignId + '"'; }
                if (_this.campaignName != '') { li += ' cpgn="' + _this.campaignName + '"'; }
                li += '>' + rssItem.title + '</a></li>'; $(menu).prepend(li);
            }
            if (Sys.Browser.agent == Sys.Browser.InternetExplorer) { $(_this.cssId() + ' .nbd_menu a').click(function(e) { _this.sendClickImpression($(e.target)); }); } else { $(_this.cssId() + ' .nbd_menu a').mousedown(function(e) { _this.sendClickImpression($(e.target)); }); }
            if (_this.hasStatic == false) { $(_this.cssId() + ' .nbd_headline a').attr('ltype', 'remove'); }
            _this.rssFeedBeconSent = false; _this.rssLoaded = true; _this.waitToEnable();
        }
        $('head').append('<link rel="alternate" type="application/rss+xml" title="' + _this.rssFeed.title + '" href="' + _this.rssUrl + '" />'); if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version > 6) { try { window.external.ContentDiscoveryReset(); } catch (e) { } } 
    } 
    });
}, waitToEnable: function() { if (window.silvergate && !$$SG.get_IsUnloaded()) { var _this = this; silvergate.registerUnload(function() { _this.enable(); }); } else { this.enable(); } }, enable: function() { var headline = $(this.cssId() + ' .nbd_headline a'); this.sendImpression(new Array(headline.attr('cid')), new Array(headline.attr('cpgn')), new Array(headline.text()), '/impression/load ', '0'); this.fallBackBeconSent = !this.hasStatic; if (this.rssLoaded == true) { var _this = this; $(this.cssId() + ' a.nbd_arrow').show().toggle(function() { _this.open(); }, function() { _this.close(); }); this.startRotateTimer(); $(this.cssId() + ' .nbd_bandWrapper').hover(function() { _this.hoverTimer = window.setTimeout(function() { _this.stopRotateTimer(); }, _this.HoverTimeout); }, function() { window.clearTimeout(_this.hoverTimer); }); $(this.cssId() + ' a').focus(function() { _this.stopRotateTimer(); }); } }, open: function() {
    $(this.cssId() + ' .nbd_menuOverflowWrapper').show(); if (this.rssFeedBeconSent == false || this.fallBackBeconSent == false) {
        var cid = new Array(); var cpgn = new Array(); var ti = new Array(); if (this.rssFeedBeconSent == false) { var _this = this; $(this.cssId() + ' .nbd_menu li a.nbd_NotSent').each(function(i, el) { cid.push(_this.campaignId); cpgn.push(_this.campaignName); ti.push($(el).text()); }).removeClass('nbd_NotSent'); this.rssFeedBeconSent = true; }
        if (this.fallBackBeconSent == false) { var lnkFallback = $(this.cssId() + ' .nbd_menu li:last a'); cid.push(lnkFallback.attr('cid')); cpgn.push(lnkFallback.attr('cpgn')); ti.push(lnkFallback.text()); this.fallBackBeconSent = true; }
        this.sendImpression(cid, cpgn, ti, '/impression/open ', '5');
    }
    if ($('html').attr('dir') == 'rtl') { $(this.cssId() + ' .nbd_menuWrapper').css({ 'width': ($(this.cssId() + ' .nbd_bandContainer').width() - $(this.cssId() + ' .nbd_heading').width() - 5) + 'px', 'margin-right': ($(this.cssId() + ' .nbd_heading').width() + 18) + 'px' }); } else { $(this.cssId() + ' .nbd_menuWrapper').css({ 'width': ($(this.cssId() + ' .nbd_bandContainer').width() - $(this.cssId() + ' .nbd_heading').width() - 5) + 'px', 'margin-left': ($(this.cssId() + ' .nbd_heading').width() + 18) + 'px' }); }
    $().bind('mousedown', this.fnClose).bind('keypress', this.fnBodyKeyPress); $('a,:input').bind('focus', this.fnBodyKeyPress);
}, close: function() { $(this.cssId() + ' .nbd_menuOverflowWrapper').hide(); $().unbind('mousedown', this.fnClose).unbind('keypress', this.fnBodyKeyPress); $('a,:input').unbind('focus', this.fnBodyKeyPress); }, rotate: function() {
    if (this.rotateTimer == null) { return; }
    var headline = $(this.cssId() + ' .nbd_headline'); var mrgBtm = 6; var distance = headline.height() + mrgBtm; var old_x = $(this.cssId() + ' .nbd_heading').outerWidth(); if ($('html').attr('dir') == 'rtl' && Sys.Browser.agent == Sys.Browser.InternetExplorer && document.documentMode && document.documentMode >= 8) { old_x--; }
    else if ($('html').attr('dir') == 'rtl' && Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version == 7) { old_x -= this.convertToNumber($(this.cssId() + ' .nbd_bandContainer').css('padding-left')); }
    var old_y = headline.children('div:first').position().top; var old_y2 = headline.append('<div><span></span></div>').children('div:last').position().top; if ($('html').attr('dir') == 'rtl') { headline.children('div:first').css({ 'position': 'absolute', 'top': old_y, 'right': old_x, 'margin-bottom': mrgBtm + 'px' }); headline.children('div:last').css({ 'position': 'absolute', 'top': old_y2 + mrgBtm, 'right': old_x }); if (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version == 7) { headline.children('div').css('width', '932px'); } } else { headline.children('div:first').css({ 'position': 'absolute', 'top': old_y, 'left': old_x, 'margin-bottom': mrgBtm + 'px' }); headline.children('div:last').css({ 'position': 'absolute', 'top': old_y2 + mrgBtm, 'left': old_x }); }
    var menuItem = $(this.cssId() + ' .nbd_menu li:first'); menuItem.children('a').appendTo(this.cssId() + ' .nbd_headline div:last span'); menuItem.remove(); var _this = this; headline.children('div:first').animate({ 'top': (-1 * distance) + 'px' }, this.RotationSpeed, function() {
        if ($(this).find('a').attr('ltype') != 'remove') { var index = $(_this.cssId() + ' .nbd_menu li').size() - 1; $(_this.cssId() + ' .nbd_menu li:last').before('<li></li>'); $(this).find('a').appendTo(_this.cssId() + ' .nbd_menu li:eq(' + index + ')'); }
        $(this).remove();
    }); headline.children('div:last').animate({ 'top': '0px' }, this.RotationSpeed, function() {
        $(this).css({ 'position': 'relative', 'top': 'auto', 'left': 'auto', 'right': 'auto', 'width': 'auto' }); if (_this.rssFeedBeconSent == false) { var lnkHeadline = $(this).find('a'); if (lnkHeadline.hasClass('nbd_NotSent') == true) { _this.sendImpression(new Array(_this.campaignId), new Array(_this.campaignName), new Array(lnkHeadline.text()), '/impression/rotate ', '5'); lnkHeadline.removeClass('nbd_NotSent'); if ($(_this.cssId() + ' .nbd_menu li a.nbd_NotSent').length < 1) { _this.rssFeedBeconSent = true; } } }
        _this.startRotateTimer();
    });
}, startRotateTimer: function() { if (this.rotateTimer != null && !(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version <= 6)) { var _this = this; this.rotateTimer = window.setTimeout(function() { _this.rotate(); }, this.RotationTimerTimeout); } }, stopRotateTimer: function() { this.rotateTimer = null; }, sendImpression: function(cid, cpgn, title, type, dl) {
    if (typeof window.dcsMultiTrack != 'undefined') {
        for (var i = 0; i < title.length; i++) {
            if (title[i].length > 150) { title[i] = title[i].substring(0, 150); }
            title[i] = title[i].replace(/;/g, '%3B');
        }
        var path = document.location.pathname; path = path.substring(0, path.lastIndexOf('/')); dcsMultiTrack('DCS.dcsuri', path + '/newsband' + type, 'DCSext.hpti', title.join(';'), 'WT.dl', dl, 'DCSext.wt_linkid', cid.join(';'), 'DCSext.hpcpgn', cpgn.join(';')); delete DCS.dcsuri
        delete DCSext.hpti; delete DCSext.wt_linkid; delete DCSext.hpcpgn;
    } 
}, sendClickImpression: function(lnk) { this.sendImpression(new Array(lnk.attr('cid')), new Array(lnk.attr('cpgn')), new Array(lnk.text()), '/Click', '1'); }, convertToNumber: function(str) {
    if (/^\d+(px|em|pt|ex|in|cm|mm|pc)$/i.test(str)) { return Number(str.substring(0, str.length - 2)); }
    else if (/^\d+%$/.test(str)) { return Number(str.substring(0, str.length - 1)); }
    else if (/^\d+/.test(str)) { return Number(str); } else { return 0; } 
} 
}; Csp.Nbd.Rss = function(xml, maxItems) { this.title = ''; this.link = ''; this.items = null; this.parse(xml, maxItems); }; Csp.Nbd.Rss.prototype = { parse: function(xml, maxItems) { var channel = $('channel', xml).eq(0); this.title = $(channel).find('title:first').text(); this.link = $(channel).find('link:first').text(); this.items = new Array(); var _this = this; $('item:lt(' + maxItems + ')', xml).each(function() { var item = new Csp.Nbd.Rss.FeedItem(); item.title = $(this).find('title').eq(0).text(); item.link = $(this).find('link').eq(0).text(); _this.items.push(item); }); } }; Csp.Nbd.Rss.FeedItem = function() { }; Csp.Nbd.Rss.FeedItem.prototype = { title: '', link: '' };

var vrtc_activeTabIndices = []; var vrtc_activeTabTimers = []; var vrtc_currentTabGroup = 0; var vrtc_currentTabIndex = 0; var vrtc_isMouseOver = false; var vrtc_impT = null; var vrtc_keyPressFunction = null; var vrtc_tlids = []; var vrtc_tabs = []; var TVIEWHEIGHT = 0; function GKBH(e) {
    var code; if (!e) { e = window.event; }
    if (e.keyCode) { code = e.keyCode; } else if (e.which) { code = e.which; }
    return code;
}
function vrtc_activateTab(tabGroup, index) {
    window.clearTimeout(vrtc_activeTabTimers[tabGroup]); vrtc_currentTabGroup = tabGroup; vrtc_currentTabIndex = index; if (vrtc_activeTabIndices.length <= tabGroup) { vrtc_activeTabIndices[tabGroup] = 0; }
    var vrtc_activeTabIndex = vrtc_activeTabIndices[tabGroup]; if (index != vrtc_activeTabIndex) { vrtc_activeTabTimers[tabGroup] = window.setTimeout(vrtc_activateTabTimer, 250); } 
}
function vrtc_mouseOutTab(tabGroup, index) { window.clearTimeout(vrtc_activeTabTimers[tabGroup]); }
function vrtc_keyPress(o) {
    var k = GKBH(o); if (k == 13 || k == 32) { eval(vrtc_keyPressFunction); return false; }
    return k;
}
function vrtc_activateTabTimer() {
    var vrtc_activeTabIndex = vrtc_activeTabIndices[vrtc_currentTabGroup]; if (vrtc_currentTabIndex != vrtc_activeTabIndex) {
        var h = "vrtc_tbh" + vrtc_currentTabGroup + "_"; var c = "vrtc_tbc" + vrtc_currentTabGroup + "_"; var activeTab = $get(h + vrtc_activeTabIndex); var activeTabPanel = $get(vrtc_tabs[vrtc_activeTabIndex]); var newTab = $get(h + vrtc_currentTabIndex); var newTabPanel = $get(vrtc_tabs[vrtc_currentTabIndex]); var activeTabDiv = cspGetObjectsByTagAndClass("div", "vrtc_activetabdiv"); if (activeTabDiv.length > 0) { activeTabDiv[0].className = "vrtc_activetabdiv vrtc_cf"; $(activeTabDiv[0]).empty().append($(newTabPanel).children().clone()); vrtc_isMouseOver = true; }
        activeTab.className = "vrtc_tab"; newTab.className = "vrtc_tabActive"; vrtc_activeTabIndices[vrtc_currentTabGroup] = vrtc_currentTabIndex; window.clearTimeout(vrtc_impT); vrtc_impT = window.setTimeout("vrtc_swtI(" + vrtc_currentTabIndex + ")", 1000);
    } 
}
function vrtc_swtI(n) {
    if (vrtc_impT != null && n > 0 && vrtc_tlids[n] != false) {
        if (typeof window.dcsMultiTrack != "undefined") { dcsMultiTrack("DCS.dcsuri", "/tabs/" + (n + 1), "WT.ad", "", "WT.mc_id", "", "DCSext.wt_linkid", vrtc_tlids[n], "WT.dl", "5", "WT.ti", "Tab " + (n + 1)); }
        if (typeof window.$$O != "undefined" && $$O.get_handlerUrl() != "") { $$O.recordComponentImpression({ cattr: "/tabs/" + (n + 1), cid: vrtc_tlids[n], cname: "cspVerticalRolloverTab", uri: window.location.href }); }
        vrtc_tlids[n] = false; vrtc_impT = null;
    }
    var fn = function() { wtSetCId($(this).attr("cid"), $(this)); }; if (window.addEventListener)
        $(".vrtc_activetabdiv.vrtc_cf a[cid]").mousedown(fn); else
        $(".vrtc_activetabdiv.vrtc_cf a[cid]").click(fn);
}
function getObjectHeight(i) { return i.offsetHeight; }
function collapseTabs() {
    var objects = cspGetObjectsByTagAndClass("div", "vt_tabPanel"); for (var i = 0; i < vrtc_tabs.length; i++) {
        if (i == 0) { if (!vrtc_isMouseOver) { var activeTabDiv = cspGetObjectsByTagAndClass("div", "vrtc_activetabdiv"); if (activeTabDiv.length > 0) { activeTabDiv[0].className = "vrtc_activetabdiv vrtc_cf"; activeTabDiv[0].innerHTML = objects[i].innerHTML; } } }
        objects[i].className = "vt_tabPanel vrtc_tabHiddenPanel vrtc_cf";
    } 
}
function cspVerticalRolloverTab_parseMetaTag(index) {
    if (index != 0) { wtRemoveCId(vrtc_tlids[index]); }
    return true;
}

function vt_setStyle(id) { if ($.browser.msie == true && $.browser.version >= 7) { var el = document.getElementById(id); if (el) { var s = el.style; s.removeAttribute("filter"); s.removeAttribute("-ms-filter"); } } }

if (typeof window.Csp == "undefined") { window.Csp = {}; }
$$SL = Csp.Silverlight = function(version, interval) { var silverlightVersion = version || "2.0"; var timeout = interval || 3000; return { displayCreatives: function() { handlers.callHandlers(); }, get_SilverlightVersion: function() { return silverlightVersion; }, refreshCreatives: function() { if (Silverlight.isInstalled(silverlightVersion)) { $$SL.displayCreatives(); } else if (typeof $$U != "undefined" && $$U.Browser == "MSIE") { window.setTimeout($$SL.refreshCreatives, timeout); } }, registerCreative: function(handler) { handlers.addHandler(handler); } }; } (); var silvergate; $$SG = Csp.SilverGate = function(args) {
    if (args !== null) { this._DaysToLive = args.daysToLive || 1095; this._InstallID = args.installID; this._IsDirectInstall = args.isDirectInstall || false; this._NoThanksID = args.noThanksID; this._PopupID = args.popupID; this._Version = args.version || "2.0"; }
    this._CloseHandlers = new $$E(); this._InstallHandlers = new $$E(); this._ShowHandlers = new $$E(); this._UnloadHandlers = new $$E(); if (this._InstallID !== null) { $addHandler($get(this._InstallID), "click", Function.createDelegate(this, this.onInstallClick)); }
    if (this._NoThanksID !== null) { $addHandler($get(this._NoThanksID), "click", Function.createDelegate(this, this.onCloseClick)); }
    if ($.browser.ie) { this._KeyPressHandler = $addHandler(document.body, "keypress", Function.createDelegate(this, this.onKeyPress)); } else { this._KeyPressHandler = $addHandler(document, "keypress", Function.createDelegate(this, this.onKeyPress)); }
    if (typeof $$U != "undefined") { $$U.detectUserAgent(); this._InstallUrl = "http://www.microsoft.com/silverlight/handlers/getsilverlight.ashx?v=" + this._Version; } 
}; $$SG.prototype = { dispose: function() {
    if (this._InstallID !== null) { $clearHandlers($get(this._InstallID)); }
    if (this._NoThanksID !== null) { $clearHandlers($get(this._NoThanksID)); }
    if (this._KeyPressHandler !== null) { $clearHandlers(document); $clearHandlers(document.body); } 
}, hidePopup: function() {
    if (this._PageGate != null) { this._PageGate.hide(); this._PageGate.dispose(); }
    this.unloadPopup();
}, onCloseClick: function() {
    $$C.setCookie("pgcld", "true", this._DaysToLive); if (typeof window.dcsMultiTrack != "undefined") { dcsMultiTrack("DCSext.wt_pg", "Page Gate Close", "WT.dl", "16"); }
    this.hidePopup(); this._CloseHandlers.callHandlers();
}, onInstallClick: function() {
    if (typeof window.dcsMultiTrack != "undefined") { dcsMultiTrack("DCSext.wt_pg", "Install now", "WT.dl", "16"); }
    $$SL.refreshCreatives(); location.href = this._InstallUrl; this.hidePopup(); this._InstallHandlers.callHandlers();
}, onKeyPress: function(e) { var target = e.target; var keyCode = e.charCode; if (keyCode == 13 && target.className.indexOf("sg-ignore-enter") == -1) { this.onInstallClick(); } else if (keyCode == 27) { this.onCloseClick(); } }, registerClose: function(handler) { this._CloseHandlers.addHandler(handler); }, registerShow: function(handler) { this._ShowHandlers.addHandler(handler); }, registerUnload: function(handler) { this._UnloadHandlers.addHandler(handler); }, showPopup: function() {
    var popup = $get(this._PopupID); if (popup !== null) { this._PageGate = new Csp.PageGate(this._PopupID); this._PageGate.show(); Sys.UI.DomElement.addCssClass(popup, "sg-popup-image"); popup.style.display = "block"; var installButton = $get(this._InstallID); if (installButton !== null) { installButton.focus(); } }
    if (typeof window.dcsMultiTrack != "undefined") { dcsFunc("dcsCookie"); dcsMeta(); dcsMultiTrack("DCS.dcssip", window.location.hostname, "DCS.dcsuri", window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/") + 1) + "pagegate/", "DCSext.wt_sppt", WT.sp + "hp", "DCSext.wt_pg", "Silverlight Page Gate", "WT.dl", "15", "WT.seg_4", "No", "DCSext.wt_ver", "", "DCSext.wt_target", "", "DCSext.wt_linkid", ""); }
    this._ShowHandlers.callHandlers();
}, showSilverGate: function() { if ($$SG.overridePopup()) { $$C.removeCookie("pgcld"); this.showPopup(); } else if (typeof $$U != "undefined" && $$U.Browser == "Unsupported") { this.unloadPopup(); } else if (typeof $$U != "undefined" && $$U.Browser == "Safari" && $$U.OS == "Windows") { this.unloadPopup(); } else if (typeof window.Silverlight != "undefined" && Silverlight.isInstalled(this._Version)) { $$SL.displayCreatives(); this.unloadPopup(); } else if (!$$C.enabled() || $$C.hasCookie("pgcld")) { this.unloadPopup(); } else { this.showPopup(); } }, unloadPopup: function() {
    if (typeof window.dcsRun != "undefined" && $$SG.get_IsDisplayed()) { dcsRun(); }
    this.dispose(); this._UnloadHandlers.callHandlers(); $$SG.set_IsUnloaded(true);
} 
}; $$SG.get_IsDirectInstall = function() { return this.IsDirectInstall || false; }; $$SG.set_IsDirectInstall = function(value) { this.IsDirectInstall = value; }; $$SG.get_IsDisplayed = function() { return this.IsDisplayed || false; }; $$SG.set_IsDisplayed = function(value) { this.IsDisplayed = value; }; $$SG.get_IsUnloaded = function() { return this.IsUnloaded || false; }; $$SG.set_IsUnloaded = function(value) { this.IsUnloaded = value; }; $$SG.createDirectInstall = function(id, event) {
    $addHandler($get(id), event, function(e) {
        $$U.detectUserAgent(); if (typeof window.$$U != "undefined" && $$U.Browser != "Unsupported") {
            e.preventDefault(); if (typeof window.dcsMultiTrack != "undefined") { var el = $get(this._InstallID); var text = (el != null) ? el.title : "Click to install"; dcsMultiTrack("WT.ti", "Direct Install: " + text, "DCSext.wt_slditi", "Direct Install: " + text, "WT.dl", "18"); }
            $$SL.refreshCreatives(); $$SG.set_IsDirectInstall(true); location.href = "http://www.microsoft.com/silverlight/handlers/getsilverlight.ashx?v=" + $$SL.get_SilverlightVersion();
        } 
    });
}; $$SG.createPageGate = function(args) {
    this.set_IsDisplayed(this.shouldShowSilverGate(args)); if (typeof window.Silverlight != "undefined" && typeof Silverlight.WaitForInstallCompletion != "undefined") { Silverlight.WaitForInstallCompletion = function() { }; }
    silvergate = new $$SG({ daysToLive: args.daysToLive, installID: args.installID, noThanksID: args.noThanksID, popupID: args.popupID }); $().ready(Function.createDelegate(silvergate, silvergate.showSilverGate));
}; $$SG.overridePopup = function() { return $$Q.hasValue("showPageGate") || $$Q.hasValue("showpagegate"); }; $$SG.shouldShowSilverGate = function(args) { if (this.overridePopup()) { return true; } else if (typeof $$U != "undefined" && $$U.Browser == "Unsupported") { return false; } else if (typeof $$U != "undefined" && $$U.Browser == "Safari" && $$U.OS == "Windows") { return false; } else if (typeof window.Silverlight != "undefined" && Silverlight.isInstalled($$SL.get_SilverlightVersion())) { return false; } else if (!args.isDirectInstall && (!$$C.enabled() || $$C.hasCookie("pgcld"))) { return false; } else { return true; } }; $$PG = Csp.PageGate = function(popupID) { this._popupID = popupID; this.initialize(); }
$$PG = Csp.PageGate.prototype = { dispose: function() {
    if (this._ResizeHandler != null) { $removeHandler(window, "resize", this._ResizeHandler); }
    if (this._ScrollHandler != null) { $removeHandler(window, "scroll", this._ScrollHandler); } 
}, getClientBounds: function() {
    var clientWidth; var clientHeight; switch (Sys.Browser.agent) { case Sys.Browser.InternetExplorer: clientWidth = document.documentElement.clientWidth; clientHeight = document.documentElement.clientHeight; break; case Sys.Browser.Safari: clientWidth = window.innerWidth; clientHeight = window.innerHeight; break; case Sys.Browser.Opera: clientWidth = Math.min(window.innerWidth, document.body.clientWidth); clientHeight = Math.min(window.innerHeight, document.body.clientHeight); break; default: clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth); clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight); break; }
    return new Sys.UI.Bounds(0, 0, clientWidth, clientHeight);
}, hide: function() { this._popup.style.display = "none"; this._backgroundEl.style.display = "none"; this.turnSelectsOn(); this.turnTabsOn(); }, initialize: function() {
    if (typeof this._popupID != "undefined") {
        this._tagsWithTabIndex = ["A", "AREA", "BUTTON", "IFRAME", "INPUT", "OBJECT", "SELECT", "TEXTAREA"]; this._popup = $get(this._popupID); if (typeof this._popup != "undefined") {
            this._popup.style.position = "absolute"; this._popup.style.zIndex = "10001"; if (document.body.childNodes.length > 0) { document.body.insertBefore(this._popup, document.body.childNodes[0]); } else { document.body.appendChild(this._popup); }
            this._ResizeHandler = $addHandler(window, "resize", Function.createDelegate(this, this.onResize)); this._ScrollHandler = $addHandler(window, "scroll", Function.createDelegate(this, this.onScroll)); this.resize(); this.hide();
        } 
    } 
}, resize: function() {
    var clientBounds = this.getClientBounds(); var clientHeight = clientBounds.height; var clientWidth = clientBounds.width; var scrollTop = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; var scrollLeft = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft; var scrollHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight); var scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); if (Sys.Browser.agent === Sys.Browser.InternetExplorer && Sys.Browser.version == 6) {
        var bounds = Sys.UI.DomElement.getBounds(this._popup); if (typeof bounds != "undefined") { this._popup.style.top = "20px"; this._popup.style.left = (scrollLeft + ((clientWidth - bounds.width) / 2)) + "px"; }
        var backgroundEl = this._backgroundEl; if (typeof backgroundEl == "undefined") { backgroundEl = this._backgroundEl = document.createElement("DIV"); backgroundEl.className = "sg-background"; backgroundEl.style.left = "0px"; backgroundEl.style.position = "absolute"; backgroundEl.style.top = "0px"; backgroundEl.style.zIndex = "10000"; if (document.body.childNodes.length > 0) { document.body.insertBefore(backgroundEl, document.body.childNodes[0]); } else { document.body.appendChild(backgroundEl); } }
        backgroundEl.style.height = Math.max(clientHeight, scrollHeight) + "px"; backgroundEl.style.width = Math.max(clientWidth, scrollWidth) + "px";
    } else {
        var bounds = Sys.UI.DomElement.getBounds(this._popup); if (typeof bounds != "undefined") { this._popup.style.top = "20px"; this._popup.style.left = ((clientWidth - bounds.width) / 2) + "px"; }
        var backgroundEl = this._backgroundEl; if (typeof backgroundEl == "undefined") { backgroundEl = this._backgroundEl = document.createElement("DIV"); backgroundEl.className = "sg-background"; backgroundEl.style.left = "0px"; backgroundEl.style.position = "fixed"; backgroundEl.style.top = "0px"; backgroundEl.style.zIndex = "10000"; if (document.body.childNodes.length > 0) { document.body.insertBefore(backgroundEl, document.body.childNodes[0]); } else { document.body.appendChild(backgroundEl); } }
        backgroundEl.style.height = Math.max(clientHeight, scrollHeight) + "px"; backgroundEl.style.width = Math.max(clientWidth, scrollWidth) + "px";
    } 
}, show: function() { this._popup.style.display = "block"; this._backgroundEl.style.display = "block"; this.resize(); this.turnSelectsOff(); this.turnTabsOff(); }, turnSelectsOff: function() { if ($.browser.msie && $.browser.version == 6) { $("SELECT").css("visibility", "hidden"); } }, turnSelectsOn: function() { if ($.browser.msie && $.browser.version == 6) { $("SELECT").css("visibility", "visible"); } }, turnTabsOff: function() {
    var popupEls = []; var els = this._popup.getElementsByTagName("*"); for (var i = 0; i < els.length; i++) { popupEls.push(els[i]); }
    this._tabbedEls = []; var allEls = document.getElementsByTagName("*"); for (var i = 0; i < allEls.length; i++) { var el = allEls[i]; if (Array.indexOf(popupEls, el) == -1 && Array.indexOf(this._tagsWithTabIndex, el.tagName) != -1) { this._tabbedEls.push({ tag: el, index: el.tabIndex }); el.tabIndex = "-1"; } } 
}, turnTabsOn: function() { if (typeof this._tabbedEls != "undefined") { for (var i = 0; i < this._tabbedEls.length; i++) { var tabbedEl = this._tabbedEls[i]; tabbedEl.tag.tabIndex = tabbedEl.index; } } }, onResize: function() { this.resize(); }, onScroll: function() { this.resize(); } 
};

