var MSNBC_wrap = new function() { var date = new Date(); var copyright = "\u00A9 " + date.getFullYear() + " NBCNews.com"; var home_link = "http:\/\/www.nbcnews.com\/"; var bg_hdr = "http:\/\/media1.s-nbcnews.com\/i\/msnbc\/Components\/CSS\/img\/hdr_nbcnews.jpg"; var bg_ftr = "http:\/\/media1.s-nbcnews.com\/i\/msnbc\/Components\/CSS\/img\/grid-border-fade.gif"; this.newsMenu = { "items": [{ "section": "U.S. news", "label": "U.S.", "url": "http://www.nbcnews.com/id/3032525/ns/us_news" }, { "section": "World news", "label": "world", "url": "http://www.nbcnews.com/id/3032507/ns/world_news" }, { "section": "Politics", "label": "politics", "url": "http://www.nbcnews.com/id/3032553/ns/politics" }, { "section": "Business", "url": "http://www.nbcnews.com/id/3032072/ns/business" }, { "section": "Sports", "url": "http://nbcsports.msnbc.com/id/3032113/" }, { "section": "Entertainment", "url": "http://www.nbcnews.com/id/3032084/ns/today-entertainment/" }, { "section": "Health", "url": "http://www.nbcnews.com/id/3032076/ns/health" }, { "section": "Techology \u0026 science", "label": "Tech\u00a0\u0026\u00a0science", "url": "http://www.nbcnews.com/id/3032118/ns/technology_and_science" }, { "section": "Travel", "url": "http://www.nbcnews.com/id/3032123/ns/travel" }, { "section": "Local news", "url": "http://www.nbcnews.com/id/3948437/ns/local_news" }, { "section": "Weather", "label": "weather", "url": "http://www.nbcnews.com/id/3032128/ns/weather" }] }; this.footerMenu = { "items": [{ "section": "Home", "label": "NBCNews.com", "url": home_link }, { "section": "About us", "url": "http://www.nbcnews.com/id/32027560/" }, { "section": "Contact", "url": "http://www.nbcnews.com/id/32359544/" }, { "section": "Help", "url": "http://www.nbcnews.com/id/3303511/" }, { "section": "Site map", "url": "http://www.nbcnews.com/html/msnbc/HtmlSitemap0.html" }, { "section": "Jobs", "url": "http://www.nbcnews.com/id/27365695/" }, { "section": "Terms \u0026 Conditions", "url": "http://www.nbcnews.com/id/3303540/" }, { "section": "Privacy", "label": "Privacy policy", "url": "http://www.nbcnews.com/id/48150786" }, { "section": "Legal", "url": "http://help.live.com/help.aspx?project=tou\u0026mkt=en-us" }, { "section": "Advertise", "url": "http://www.nbcnews.com/id/26613008/" }] }; this.tag = function(el, cN, i) { var node = document.createElement(el); if (typeof cN != "undefined") { node.className = cN } if (typeof i != "undefined") { node.id = i } return node }; this.build_newsmenu = function(i) { var link, item, label; var list = this.tag("ul"); var content = this.newsMenu; for (x = 0; content.items.length > x; x++) { label = (content.items[x].label) ? content.items[x].label: content.items[x].section; item = this.build_listitem(content, label); if (label.indexOf("U.S.") != -1) { item.appendChild(document.createTextNode("\u00a0\u00a0\u00a0")); item.className += "list" } else if (label.toLowerCase().indexOf("world") != -1 || label.toLowerCase().indexOf("local") != -1) { item.appendChild(document.createTextNode("\u00a0&\u00a0")); item.className += "list" } list.appendChild(item) } document.getElementById(i).appendChild(list) }; this.build_header = function(i, s) { if (s == "shopping" || location.href.indexOf("msnbc.pgpartner") != -1) { bg_hdr = "http:\/\/media1.s-nbcnews.com\/i\/msnbc\/Components\/CSS\/img\/hdr_bg_shop.jpg" } else if (s == "today" || location.href.indexOf("expediasweeps.onlinepromo") != -1 || document.referrer.indexOf("today.msnbc") != -1 || location.href.indexOf("fromtoday=True") != -1) { if (window.location.href.toLowerCase().indexOf("www.nbcnews.com/apps/modules/mailbag/mailbag_feedback.aspx") > -1) { window.location.href = "http://www.today.com/id/43729398"; } home_link = "http:\/\/today.msnbc.com\/"; bg_hdr = "http:\/\/media1.s-nbcnews.com\/i\/msnbc\/Components\/CSS\/img\/today-hdr-bg-std.jpg"; } var header = this.tag("div", "", "MSNBC_header"); var h1 = this.tag("h1"); var h1_a = this.tag("a"); h1_a.href = home_link; var img = this.tag("img"); img.src = bg_hdr; var menu = this.tag("div", "", "MSNBC_newsMAIN"); var p = this.tag("p"); p.appendChild(document.createTextNode("Categories")); h1_a.appendChild(img); h1.appendChild(h1_a); header.appendChild(h1); menu.appendChild(p); header.appendChild(menu); document.getElementById(i).appendChild(header); if (home_link.indexOf("today.msnbc") != -1) { document.getElementById("MSNBC_wrap_hdr").style.backgroundColor = "#852401"; document.getElementById("MSNBC_wrap_hdr").setAttribute("style", "background-color:#852401;"); menu.style.visibility = "hidden" } this.build_newsmenu("MSNBC_newsMAIN") }; this.build_leaderboard = function(i) { var header = this.tag("div", "", "MSNBC_AdBanner_S"); document.getElementById(i).className += " leaderboard"; document.getElementById(i).appendChild(header) }; this.build_footer = function(i, s) { if (s == "today") { for (var itemIdx = 0; itemIdx < MSNBC_wrap.footerMenu.items.length; itemIdx++) { if (MSNBC_wrap.footerMenu.items[itemIdx].section == "Site map") { MSNBC_wrap.footerMenu.items[itemIdx].url = "http:\/\/www.today.com\/html\/today\/HtmlSitemap0.html"; } } } var link, item, label; var footer = this.tag("div", "", "MSNBC_footer"); var p = this.tag("p"); p.appendChild(document.createTextNode(copyright)); footer.appendChild(p); var list = this.tag("ul", "site"); var content = this.footerMenu; for (x = 0; content.items.length > x; x++) { label = (content.items[x].label) ? content.items[x].label: content.items[x].section; list.appendChild(this.build_listitem(content, label)); if (label.indexOf("MSN") === 0) { break } } footer.appendChild(list); var corp_list = this.tag("ul", "corp"); while (content.items.length > x) { label = (content.items[x].label) ? content.items[x].label: content.items[x].section; corp_list.appendChild(this.build_listitem(content, label)); x++ } footer.appendChild(corp_list); document.getElementById(i).appendChild(footer) }; this.build_listitem = function(content, label) { var link = this.tag("a"); link.appendChild(document.createTextNode(label)); link.href = content.items[x].url; var item = this.tag("li"); item.appendChild(link); return item } };