function octalchange () { var val = document.chmod.t_total.value; var ownerbin = parseInt(val.charAt(0)).toString(2); while (ownerbin.length<3) { ownerbin="0"+ownerbin; }; var groupbin = parseInt(val.charAt(1)).toString(2); while (groupbin.length<3) { groupbin="0"+groupbin; }; var otherbin = parseInt(val.charAt(2)).toString(2); while (otherbin.length<3) { otherbin="0"+otherbin; }; document.chmod.owner4.checked = parseInt(ownerbin.charAt(0)); document.chmod.owner2.checked = parseInt(ownerbin.charAt(1)); document.chmod.owner1.checked = parseInt(ownerbin.charAt(2)); document.chmod.group4.checked = parseInt(groupbin.charAt(0)); document.chmod.group2.checked = parseInt(groupbin.charAt(1)); document.chmod.group1.checked = parseInt(groupbin.charAt(2)); document.chmod.other4.checked = parseInt(otherbin.charAt(0)); document.chmod.other2.checked = parseInt(otherbin.charAt(1)); document.chmod.other1.checked = parseInt(otherbin.charAt(2)); calc_chmod(1); }; function calc_chmod(nototals) { var users = new Array("owner", "group", "other"); var totals = new Array("","",""); var syms = new Array("","",""); for (var i=0; i