// Strip off the wrapping if present, and trim white space. function loseLink(html) { return html.replace(//, "").replace(/<\/a>/, "").replace(/^\s*/, "").replace(/\s*$/, ""); } // Align the page title with the low-down, if present if (jQuery("#lowdown").length > 0) jQuery(".pageTitle").addClass("indentedPageTitle"); // Move the control panel to the login links area jQuery("#controlPanel").remove().appendTo(jQuery("#panel")); hideControlPanel(); // Adjust control panel visibility to match user's selection adjustControlPanelVisibility(true); // Make sure all "new window" links open in a new window jQuery(".new_window a").attr("target", "_blank"); // Make sure any links to the current page are flagged as .current jQuery("a[href='" + pageUrl + "']").addClass("current"); // Prune breadcrumbs to lose the dashboard link and redundant space home/home page links // Lose the dashboard link jQuery("#breadcrumbs .first").remove(); // Lose the space link (redundant with home) var crumbs = jQuery("#breadcrumbs li"); if (crumbs.length > 0) { jQuery(crumbs.get(0)).remove(); } // Eliminate the space link if it's duplicated by the next link (home page) var crumbs = jQuery("#breadcrumbs li span"); if (crumbs.length > 1) { if (loseLink(crumbs.get(0).innerHTML.toLowerCase()) == loseLink(crumbs.get(1).innerHTML.toLowerCase())) { var spaceHome = jQuery("#breadcrumbs li").get(0); jQuery(spaceHome).remove(); } } // Make sure the first breadcrumb has the .first class var crumbs = jQuery("#breadcrumbs li"); if (crumbs.length > 0) { jQuery(crumbs.get(0)).addClass("first"); } // alert(jQuery("#login").get(0).innerHTML);