window.changeProbability = function()
{
    changeRisk();
}

window.changeImpact = function()
{
    changeRisk();
}

window.changeRisk = function()
{
    const impact      = $('[name=impact]').zui('picker').$.state.value;
    const probability = $('[name=probability]').zui('picker').$.state.value;
    const rate        = parseInt(impact * probability);

    let pri = '';
    if(0 <= rate && rate <= 5)   pri = 'low';
    if(5 < rate && rate <= 12)   pri = 'middle';
    if(15 <= rate && rate <= 25) pri = 'high';

    $('[name=rate]').val(rate);
    $('[name=pri]').zui('pripicker').$.changeState({value: pri});
    $('[name=pri]').removeAttr('disabled');
}
