Hey, I have a script which shows a few input buttons, and with my Javascript I'm trying to get the script to "Disable" which ever button i pressed for X amount of time....

How ever my script doesn't seem to work, the first input button disables correct as does the second one its like they are grouped... but then all the other buttons outputted do nothing.

Hope you can help me out... heres what i tried:

Code:
<?php
$Short = 0;
$ShortRange = 3;
//------------------------------
function createInput($num)
{
  return '<input type="submit" id="Short['.$num.']" name="Short['.$num.']" value="Attack number '. $num .'"> <br><br>';
}
//------------------------------
?>
<script type="text/javascript">
  var minNum = <?php echo $Short ?>;
  var maxNum = <?php echo $ShortRange ?>;
  var c = 0;

window.onload = function(){

  for(var i = minNum + 1; i < maxNum; i++)
  {
     counter(i);
  }   
}

function counter(num) {
   var btnattack = document.getElementById('Short['+num+']');
   btnattack.disabled = true;
   if (c < 2) {
      btnattack.disabled = true;
      btnattack.value = 'Wait... ' + (2-c);
      c++;
      setTimeout("counter("+num+")", 1000);
   } else {
      btnattack.disabled = false;
      btnattack.value = 'Attack number '+num;
   }
}
</script>
<?php

While($Short != $ShortRange){
   echo createInput($Short+1)."\n";
   $Short = $Short + 1;
   }
?>
Thanks in advance or any help given.