$(function()
{
    $.setAjaxForm('#copyForm');
    /* show team menu. */
    $('[name^=multiple]').change(function()
    {
        var $inputGroup = $(this).parents('.input-group');
        if($(this).prop('checked'))
        {
            $('#assignedTo, #assignedTo_chosen').addClass('hidden');
            $('.team, #teamMember').removeClass('hidden');
            computeTeamMember();
        }
        else
        {
            $('#assignedTo, #assignedTo_chosen').removeClass('hidden');
            $('.team, #teamMember').addClass('hidden');
        }
        $inputGroup.fixInputGroup();
    });

    $('#assignedTo').chosen();
    $('[name^=multiple]').change();
    $('[name^=team]').change(function(){computeTeamMember()});
})
