var chk = true; function check_all(f) { var idx = document.getElementsByName("chk[]"); for (i=0; i