﻿$(document).ready(function() {

    var defaultVal = $(".chk").val();
      
    if(defaultVal == "individual")
    {
        $("#ind_expander").slideDown("fast", function() {
            $("#org_services_expander").slideUp("fast");
        });            
    }
    else if(defaultVal == "organisation")
    {
        $("#ind_expander").slideUp("fast", function() {
            $("#org_services_expander").slideDown();
        });            
    }
    else
    {
        $("#ind_expander").slideDown();
        $("#org_services_expander").slideDown();
    }

    $(".chk").click( function() {
        var val = $(this).val();
        
        if(val == "individual")
        {
            $("#ind_expander").slideDown("fast", function() {
                $("#org_services_expander").slideUp("fast");
            });            
        }
        else if(val == "organisation")
        {
            $("#ind_expander").slideUp("fast", function() {
                $("#org_services_expander").slideDown();
            });            
        }
        else
        {
            $("#ind_expander").slideDown();
            $("#org_services_expander").slideDown();
        }
    });
    
    $("#ind_params").hide();
    $("#ind_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#ind_params").slideToggle("slow");
    });

    $("#org_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#org_params").slideToggle("slow");
    });

    $("#clinical_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#clinical_params").slideToggle("slow");
    });

    $("#sports_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#sports_params").slideToggle("slow");
    });

    $("#lifestyle_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#lifestyle_params").slideToggle("slow");
    });

    $("#org_services_params").hide();
    $("#org_services_expander").click(function() {
        //animation to expand and close the parameters boxes
        $("#org_services_params").slideToggle("slow");
    });

});// end document ready function 