$(document).ready(function() { // Hide intro boxes except first //$("#mainIntroNav .topLeftNavContainer:not(:first)").hide(); // Set first as selected //$("#mainIntroNav .topLeftNavHeading a:first").addClass("on"); // On click event for intro box titles $("#mainIntroNav .topLeftNavHeading").click(function() { $("#mainIntroNav .topLeftNavContainer:visible").hide(); $("#mainIntroNav .topLeftNavHeading a").removeClass(); $(this).find("a").addClass("on"); $(this).next().slideToggle(); //Have to call sifr replace again as would not have worked whilst hiidden. sIFR.replace(vagThin, { selector: ' #mainIntroNav .topLeftNavWrapper .topLeftNavContainer h1 ' , css: ['.sIFR-root { color: #00714E; font-size:28px;}'], wmode:'transparent' }); return false; }); // Hide highlight boxes except first //$(".homepageHighlightBox .navTxtArea:not(:first), .homepageHighlightBox .bottomImg:not(:first)").hide(); // Set first as selected //$(".homepageHighlightBox .topNavLinkImg a:first").addClass("on"); // On click event for highlight box titles $(".homepageHighlightBox .topNavLinkImg").click(function() { $(".homepageHighlightBox .navTxtArea:visible, .homepageHighlightBox .bottomImg:visible").hide(); $(".homepageHighlightBox .topNavLinkImg a").removeClass(); $(this).find("a").addClass("on"); $(this).next().slideToggle(); $(this).next().next().toggle(); return false; }); // Set up summary tabs vTabsContainer = $('
'); vList = $("ul", vTabsContainer); $.each(["Profit before tax", "Income and cost", "Economic profit"], function (i, vTabName) { vLink = $('' + vTabName + '').click(function(){ $(".tabsContainer a").removeClass(); $(this).addClass("on"); $(".summaryOfResults .midImgContainer:visible").hide(); $("#summary" + (i + 1)).show(); return false; }); vList.append($("
  • ").append(vLink)); }); $(".summaryOfResults h2").after(vTabsContainer); // Hide graph images except first $(".summaryOfResults .midImgContainer:not(:first)").hide(); // Set first tab as selected $(".tabsContainer a:first").addClass("on"); });