$(document).ready(function() {

    FaqHandling();
    ProductInformation();
    //GroupSubscription();

});

function FaqHandling()
{
    if ($("div#faq").length)
    {
        $("div#faq dt").toggle(
            function () {
                $(this).next().show("slow");
            },
            function () {
                $(this).next().hide("slow");
            }
        )
    }
}

function ProductInformation()
{
    if ($("div.detail-level").length)
    {
        $("div.detail-level input:checkbox").each(function(){
            var strValueToFind = $(this).attr("value");

            if ($.cookie('ds_hide_' + strValueToFind) == null || $.cookie('ds_hide_' + strValueToFind) == "false")
            {
                $(this).attr('checked', true);
            }
            else
            {
                $(this).attr('checked', false);
               $("div.lm_workspace ." + strValueToFind).hide();
            }
        });
        
        $("div.detail-level input:checkbox").click(
            function () {
            
                var strValueToFind = $(this).attr("value");
                
                if ($(this).is(':checked'))
                {
                    $("div.lm_workspace ." + strValueToFind).show();
                    $.cookie('ds_hide_' + strValueToFind, "false");
                }
                else
                {
                    $("div.lm_workspace ." + strValueToFind).hide();
                    $.cookie('ds_hide_' + strValueToFind, "true");
                }
            }
        );
    }
}

function GroupSubscription()
{
    if ($("div#group_actions").length)
    {
        $("div#group_actions div.information_link").toggle(
            function () {
                $("div#group_actions div.subscription_container").show("slow");
            },
            function () {
                $("div#group_actions div.subscription_container").hide("slow");
            }
        );
    }

}
