<script>
function naiti() {
var checkboxs = document.frm1.getElementsByTagName('input'),
n = checkboxs.length,
time1 ='',
time2 =''
for (var i= 0; i < n;i++) {
if(checkboxs[i].type == 'checkbox' & checkboxs[i].checked) {
time1 = checkboxs[i].value;
break;
}
}
for (var j= 0; j < n;j++) {
if(checkboxs[j].type == 'checkbox' & checkboxs[j].checked) {
time2 = checkboxs[j].value;
}
}
if (Number(time1) < Number(time2)){
for (var k= Number(time1); k < Number(time2); k++){
document.getElementById(k).checked = 'true';
}
var timesumm = (Number(time2) - Number(time1))*0.5;
var key=1;
document.getElementById('timesumm').innerHTML = 'Выбранное время ' + timesumm + ' часа(ов)';
document.getElementById('clock1').value = time1;
document.getElementById('clock2').value = time2;
document.getElementById('clocksumm').value = timesumm;
}
}
function sbros() {
for (var m= 1; m < 49; m++){
document.getElementById(m).checked = '';
}
document.getElementById('timesumm').innerHTML = '';
}
</script>
<script type="text/javascript">
var t1 = document.getElementsByClassName('time1');
var t2 = document.getElementsByClassName('time2');
for (var i=0; i<24; i++){
for (var z= t1[i].innerHTML; z < Number(t2[i].innerHTML)+1; z++){
document.getElementById(z).disabled = 'true';
}
}
</script>
<script type="text/javascript">
var t1 = document.getElementsByClassName('time3');
var t2 = document.getElementsByClassName('time4');
for (var i=0; i<24; i++){
for (var z= t1[i].innerHTML; z < Number(t2[i].innerHTML)+1; z++){
document.getElementById(z).disabled = 'true';
}
}
</script>
|