$(function() {
    if ($('#id').val() == '0') { $('#file24').attr('disabled', false); $('#file16').attr('disabled', false); }

    $('.concext').click(_SingleSelect);
    $('.finalinitial').click(_SingleSelect);

    function _SingleSelect() {
        if (this.checked) {
            var chkClass = $(this).attr('class');
            $('.' + chkClass).each(function(i, e) { $(e).removeAttr('checked'); });
            $(this).attr('checked', true);
        }
        else {
            $(this).removeAttr('checked');
        }
    }
    
    isDeadlineAccountingPausedCheck(true);
    $('#isfixed, #isfinal').click(function() {
        isDeadlineAccountingPausedCheck(false);
    });
});

function isDeadlineAccountingPausedCheck(disableonly) {
    var fixedCheck = $("#isfixed").attr('checked') != undefined;
    var finalCheck = $("#isfinal").attr('checked') != undefined;

    $("#isdeadlineaccountingpaused").attr('disabled', fixedCheck || finalCheck);
    if (disableonly != undefined && !disableonly) {
        $("#isdeadlineaccountingpaused").attr('checked', fixedCheck || finalCheck);
    }
}

function selectStatusDescriptionLanguage() {
    var url = 'fieldlanguage.ivp/load?textarea=true&table=Status&field=DescriptionXml&id=' + $('#id').val();
    openDialog(url, 'selectlanguage', { width: 900, height: 650 });
    return false;
}

function selectStatusNameLanguage() {
    var url = 'fieldlanguage.ivp/load?required=true&table=Status&field=NameXml&id=' + $('#id').val();
    openDialog(url, 'selectlanguage', { width: 900, height: 650 });
    return false;
}