﻿function TSBCSiteControl() {
    //$("#header").show(); //showing the header tag
    //$("#otherheader").hide(); //hiding the otherheader tag
    $("#header").find("#headerScreenShot").show(); //showing headerScreenShot tag which can be hided on other pages. e.g whyus.aspx
    $("#header").find("#catchLine").show(); //showing catchLine tag which can be hided on other pages. e.g whyus.aspx

    var page = $("#currentpage").text(); //getting the currentpage div from content page, this div a hidden div on the page to track which page we are on.

    //if the page text is default, we are on default page, turn on default page homeheader and turn off page header which is for other pages. Vise versa.
    if (page == "default") {
        //$("#header").find("#navigation").find("#navText2").find("span").html("<a href=\"planning.aspx\">Business plan tools</a>");
        //$("#header").find("#navigation").find("#navText3").find("span").html("<a href=\"online.aspx\">eLearning lessons</a>");
        //$("#header").find("#navigation").find("#navText4").find("span").html("<a href=\"articles.aspx\">Articles</a>");
        //$("#header").find("#navigation").find("#navText5").find("span").html("<a href=\"Templates.aspx\">Templates</a>");
        //$("#header").find("#navigation").find("#navText6").find("span").html("<a href=\"healthcheck.aspx\">Business health check tools</a>");
        //$("#header").find("#navigation").find("#navText7").find("span").html("<a href=\"specialProjects.aspx\">Special projects</a>");

        $("#header").find("#pageTitle").find("h1").text(""); //Set the page title to empty
        $("#header").find("#navigation").find("#navText1").attr("class", "current"); //Set the style of current page text on navigation to current
        $("#header").find("#navigation").find("#navText1").find("span").html("Home"); //Set the current page text on navigation to empty replacing the a tag
        $("#header").find("#breadcrumbs").find(".home").next().text(""); //Set the breadcrumbs text to empty
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotSample.jpg"); //Set the image inside headerScreenShot tag
        $("#header").find("#catchLine").html("<h2>Small business educational content for your website.</h2><h3>Quickly populate your website with high quality, relevant content that will help your small business clients, and encourage repeat visits.</h3>"); //Set the catchline html
    }
    else if (page == "planning") {
        $("#header").find("#pageTitle").find("h1").text("BUSINESS PLAN TOOLS"); //Set the page title to business plan tools
        $("#header").find("#navigation").find("#navText2").attr("class", "current"); //Set the style of current page text on navigation to current
        $("#header").find("#navigation").find("#navText2").find("span").html("Business plan tools"); //Set the current page text on navigation to Business plan tools replacing the a tag
        $("#header").find("#breadcrumbs").find(".home").next().text("Business plan tools"); //Set the breadcrumbs text to Buiness plan tools
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotBPlan.jpg"); //Set the image inside headerScreenShot tag
        $("#header").find("#catchLine").html("<h2>Online planning tools set out in 10 easy steps.</h2><h3>Business planning is the most popular topic small business people search for online.</h3>"); //Set the catchline html
    }
    else if (page == "online") {
        $("#header").find("#pageTitle").find("h1").text("ELEARNING");
        $("#header").find("#navigation").find("#navText3").attr("class", "current");
        $("#header").find("#navigation").find("#navText3").find("span").html("eLearning lessons");
        $("#header").find("#breadcrumbs").find(".home").next().text("eLearning");
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotelearn.jpg");
        $("#header").find("#catchLine").html("<h2>Small business lessons for your website.</h2><h3>Offer visitors to your site a complete online training solution from inside your website.</h3>");
    }
    else if (page == "articles") {
        $("#header").find("#pageTitle").find("h1").text("ARTICLES");
        $("#header").find("#navigation").find("#navText4").attr("class", "current");
        $("#header").find("#navigation").find("#navText4").find("span").html("Articles");
        $("#header").find("#breadcrumbs").find(".home").next().text("Articles");
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotArt.jpg");
        $("#header").find("#catchLine").html("<h2>Content that address specific business issues. </h2><h3>Content such as articles are ideal to flesh out business web sites, and we have collated our most popular topics for you.</h3>");
    }
    else if (page == "templates") {
        $("#header").find("#pageTitle").find("h1").text("TEMPLATES");
        $("#header").find("#navigation").find("#navText5").attr("class", "current");
        $("#header").find("#navigation").find("#navText5").find("span").html("Templates");
        $("#header").find("#breadcrumbs").find(".home").next().text("Templates");
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShottemplate.jpg");
        $("#header").find("#catchLine").html("<h2>Ready-made Excel and Word templates.</h2><h3>Help small business owners experiment with their own data such as cash flow projections, break-even calculations and market research.</h3>");
    }
    else if (page == "healthcheck") {
        $("#header").find("#pageTitle").find("h1").text("HEALTH CHECK TOOLS");
        $("#header").find("#navigation").find("#navText6").attr("class", "current");
        $("#header").find("#navigation").find("#navText6").find("span").html("Business health check tools");
        $("#header").find("#breadcrumbs").find(".home").next().text("Health check tools");
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotHC.jpg");
        $("#header").find("#catchLine").html("<h2>Business self-help diagnostic tools.</h2><h3>Building small business capability often needs business owners to benchmark or compare their current performance to best practice. </h3>");
    }
    else if (page == "specialProjects") {
        $("#header").find("#pageTitle").find("h1").text("SPECIAL PROJECTS");
        $("#header").find("#navigation").find("#navText7").attr("class", "current");
        $("#header").find("#navigation").find("#navText7").find("span").html("Special Projects");
        $("#header").find("#breadcrumbs").find(".home").next().text("Special Projects");
        $("#header").find("#headerScreenShot").find("img").attr("src", "images/screenShotSpecial.jpg");
        $("#header").find("#catchLine").html("<h2>When you need something unique.</h2><h3>Use our small business and IT expertise to create custom solutions. </h3>");
    }
    else if (page == "whyus") {
        $("#header").find("#pageTitle").find("h1").text("WHY US?");
        $("#header").find("#breadcrumbs").find(".home").next().text("Why Us");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "aboutus") {
        $("#header").find("#pageTitle").find("h1").text("ABOUT US");
        $("#header").find("#breadcrumbs").find(".home").next().text("About us");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "contact") {
        $("#header").find("#pageTitle").find("h1").text("CONTACT US");
        $("#header").find("#breadcrumbs").find(".home").next().text("Contact us");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "getthebest") {
        $("#header").find("#pageTitle").find("h1").text("GET THE BEST OUT OF OUR CONTENT");
        $("#header").find("#breadcrumbs").find(".home").next().text("Get the best out of content");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "ourclients") {
        $("#header").find("#pageTitle").find("h1").text("OUR CLIENTS");
        $("#header").find("#breadcrumbs").find(".home").next().text("Our clients");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "signup") {
        $("#header").find("#pageTitle").find("h1").text("SIGN UP FOR OUR E-NEWSLETTER");
        $("#header").find("#breadcrumbs").find(".home").next().text("Sign up for our e-newsletter");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "team") {
        $("#header").find("#pageTitle").find("h1").text("Team");
        $("#header").find("#breadcrumbs").find(".home").next().text("Team");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "free") {
        $("#header").find("#pageTitle").find("h1").text("Free");
        $("#header").find("#breadcrumbs").find(".home").next().text("Free");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "drivetraffic") {
        $("#header").find("#pageTitle").find("h1").text("Drive traffic to your site");
        $("#header").find("#breadcrumbs").find(".home").next().text("Drive traffic to your site");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
    else if (page == "embedding") {
        $("#header").find("#pageTitle").find("h1").text("How to embed our content");
        $("#header").find("#breadcrumbs").find(".home").next().text("How to embed our content");
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    } else if (page == "banklanding") {
        $("#header").find("#pageTitle").find("h1").text("Content for banks");
        $("#header").find("#breadcrumbs").find(".home").hide();
        $("#header").find("#headerScreenShot").hide();
        $("#header").find("#catchLine").hide();
        $("#header").attr("id", "otherheader");
    }
}
