/** * @fileoverview JavaScript file for offsite navbar access. */ /** Global var that holds the navbar HTML */ var sbNavbar = ' '; /** Global var that holds the usertools HTML */ var sbUserTools = '
'; /** Highlight map based on URL. */ var highlight_map = { 'http://topics.sacbee.com/arnold(\\+| |%20)schwarzenegger': [ '#nav-capital', 'Arnold' ], 'someplace.com': [ '#nav-sports', '49ers' ], 'thaisiamfolsom.com': [ '#nav-homes', 'Apart' ], 'http://': [ '#nav-news', '' ] }; /** * Shows the navbar. * @param {String} [element] an optional DOM element ID to fill with the navbar data */ function show_vendor_navbar (element) { if (element) { jQuery("#" + element).html(sbNavbar); } else { document.write(sbNavbar); } enable_navbar(); // Set the highlight too for (var link in highlight_map) { var link_regex = new RegExp(link, "i"); if (String(document.location).match(link_regex)) { set_nav_subnav(highlight_map[link][0], highlight_map[link][1]); break; } } } /** * Shows the user tools. * @param {String} [element] an optional DOM element ID to fill with the navbar data */ function show_vendor_usertools (element) { if (element) { jQuery("#" + element).html(sbUserTools); } else { document.write(sbUserTools); } enable_readerservices_menus(); }