$(document).ready(function()
{
    $('a.mode-toggle').click(function()
    {
        $('a.mode-toggle').removeClass('active');
        $(this).addClass('active');

        $('#cardMode, #listMode').hide();
        $('#' + $(this).data('mode') + 'Mode').show();

        $.cookie('projectViewType', $(this).data('mode'), {path: "/"});
    })

    var type = $.cookie('projectViewType');
    if(typeof(type) == 'undefined' || type == '') type = 'card';
    if(v.status == 'bysearch') type = 'list';
    $('#menuActions a[data-mode=' + type +']').click();
});
