﻿$(function () {
    
    // handle post-back scenario for validation
    SetBoxes();

    $(".planSwap").click(function () {
        $(".planSwap").toggle();
        $("#businessPlans").toggle();
        $("#residentialPlans").toggle();

    });

    // handle the boxes for 'how did you hear'
    $("#LeadSource").change(function () {

        $(".signupLeadSourceHint").hide();
        
        // update the UI
        SetBoxes();

    });

    // make sure any appropriate inputs are displayed
    function SetBoxes() {
        var val = $("#LeadSource").val();

        if (val == 'Referral') {
            $("#ReferredBy").show();
        };

        if (val == 'Other') {
            $("#OtherHeardBy").show();
        };

    }
});

