<script type="text/javascript">
document.write('<form id="sumrakCalc"></form>');

$('#sumrakCalc').html('<table>\
 <tr class="header">\
 <td colspan="3">Исходные данные</td>\
 </tr>\
 <tr>\
 <td>&nbsp;</td><td>Ваши</td><td>Соперника</td>\
 </tr>\
 <tr>\
 <td>Социальный статус</td><td><input type="number" name="youSoc" value="1"></td><td><input type="number" name="enSoc" value="1"></td>\
 </tr>\
 <tr>\
 <td>Иммунитет</td><td><input type="number" name="youImm" value="1"></td><td><input type="number" name="enImm" value="1"></td>\
 </tr>\
 <tr>\
 <td>Нападение</td><td><input type="number" name="youAtk" value="1"></td><td><input type="number" name="enAtk" value="1"></td>\
 </tr>\
 <tr>\
 <td>Защита</td><td><input type="number" name="youDef" value="1"></td><td><input type="number" name="enDef" value="1"></td>\
 </tr>\
 <tr>\
 <td>Бешенство</td><td>\
 <select name="youBesh">\
 <option selected value="10">нет</option>\
 <option value="15">Жив 1 из 2</option>\
 <option value="13.125">Живы 2 из 3</option>\
 <option value="22.5">Жив 1 из 3</option>\
 </select>\
 </td><td>\
 <select name="enBesh">\
 <option selected value="10">нет</option>\
 <option value="15">Жив 1 из 2</option>\
 <option value="13.125">Живы 2 из 3</option>\
 <option value="22.5">Жив 1 из 3</option>\
 </select>\
 </td>\
 </tr>\
 <tr><td>Комплект судьи</td><td>\
 <select name="youSud">\
 <option selected value="1">0 вещей</option>\
 <option value="1.03">1 вещь</option>\
 <option value="1.06">2 вещи</option>\
 <option value="1.09">3 вещи</option>\
 <option value="1.12">4 вещи</option>\
 <option value="1.15">5 вещей</option>\
 </select>\
 </td><td>\
 <select name="enSud">\
 <option selected value="1">0 вещей</option>\
 <option value="1.03">1 вещь</option>\
 <option value="1.06">2 вещи</option>\
 <option value="1.09">3 вещи</option>\
 <option value="1.12">4 вещи</option>\
 <option value="1.15">5 вещей</option>\
 </select>\
 </td>\
 </tr>\
 <tr class="header">\
 <td colspan="3">Величина удара</td>\
 </tr>\
 <tr>\
 <td>Дневной</td><td class="youDay result">5</td><td class="enDay result">5</td>\
 </tr>\
 <tr>\
 <td>Ночной</td><td class="youNight result">5</td><td class="enNight result">5</td>\
 </tr>\
 </table>');

var b = true;

function calc(){
var youSoc = parseFloat($('input[name="youSoc"]').val()),
 enSoc = parseFloat($('input[name="enSoc"]').val()),
 youImm = parseFloat($('input[name="youImm"]').val()),
 enImm = parseFloat($('input[name="enImm"]').val()),
 youAtk = parseFloat($('input[name="youAtk"]').val()),
 enAtk = parseFloat($('input[name="enAtk"]').val()),
 youDef = parseFloat($('input[name="youDef"]').val()),
 enDef = parseFloat($('input[name="enDef"]').val()),
 youBesh = parseFloat($('select[name="youBesh"]').val()),
 youSud = parseFloat($('select[name="youSud"]').val()),
 enBesh = parseFloat($('select[name="enBesh"]').val()),
 enSud = parseFloat($('select[name="enSud"]').val()),
 youDay = 10*youSoc/(youSoc*enSud+enImm),
 enDay = 10*enSoc/(enSoc*youSud+youImm),
 youNight = youBesh*youAtk/(youAtk*enSud+enDef),
 enNight = enBesh*enAtk/(enAtk*youSud+youDef); 
$('.youDay').html(Math.round(youDay));
$('.enDay').html(Math.round(enDay));
$('.youNight').html(Math.round(youNight));
$('.enNight').html(Math.round(enNight));
}

$('input[type="number"]').on('keypress',function(e){
b=false
if (!(e.charCode<32||/[\d.]/.test(String.fromCharCode(e.charCode)))) {return false;}
b=true;
});

$('input[type="number"],select').on('change',function(){
 calc();
});

$('input[type="number"]').on('keyup',function(e){
if(!b){return false;}
 calc();
});

</script>