//© 2007 Rozerot. http://chmod.ru/ . Использование кода без уведомления автора запрещено. function truefalse(ft) { return (ft==true?1:0) } function eslafeurt(ee) { return (ee=1?true:false) } function per() { a=(4*truefalse(document.b.b9.checked)+2*truefalse(document.b.b8.checked)+truefalse(document.b.b7.checked))+""+(4*truefalse(document.b.b6.checked)+2*truefalse(document.b.b5.checked)+truefalse(document.b.b4.checked))+""+(4*truefalse(document.b.b3.checked)+2*truefalse(document.b.b2.checked)+truefalse(document.b.b1.checked)) document.b.num.value=a } function rep() { var preg=/^[0-7]{0,3}$/ if (!preg.test(document.b.num.value)) { alert("Введите восьмеричное число") return 0; } a=parseInt(document.b.num.value,8) ab=a%2 document.b.b1.checked=ab a=(a-ab)/2 ab=a%2 document.b.b2.checked=ab a=(a-ab)/2 ab=a%2 document.b.b3.checked=ab a=(a-ab)/2 ab=a%2 document.b.b4.checked=ab a=(a-ab)/2 ab=a%2 document.b.b5.checked=ab a=(a-ab)/2 ab=a%2 document.b.b6.checked=ab a=(a-ab)/2 ab=a%2 document.b.b7.checked=ab a=(a-ab)/2 ab=a%2 document.b.b8.checked=ab a=(a-ab)/2 ab=a%2 document.b.b9.checked=ab }