﻿$(document).ready(function() {
    nsFooterLinks();
    nsPaneLinks();
});

function nsPaneLinks() {
    var segmentContainer = $("#homeTabs").children("div");
    segmentContainer.each(function(index) {
        switch ($(this).attr("id")) {
            case "paneDefault":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Default.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
            case "panedoctors":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Doctors.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
            case "panedentists":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Dentists.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
            case "paneteachers":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Teachers.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
            case "panelawyers":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Lawyers.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
            case "paneother":
                $(".area_text a", this).click(function() {
                ns_onclick(this, '', 'Home.PromoBoxes.Other.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
                });
                break;
        }
    });
}

function nsFooterLinks() {
    $("#homeLinks ul li a").click(function() {
    ns_onclick(this, '', 'Home.Footer.' + $(this).text().replace(/ /g, ''), 'clickin'); return false;
    });
}
