Shelves - bugfix 1403 amongst others
[koha.git] / koha-tmpl / opac-tmpl / prog / en / js / script.js
1         /**
2          * this function checks all checkbox 
3          * or uncheck all if there are already checked.
4          */
5         function CheckAll(){
6                 var checkboxes = document.getElementsByTagName('input');
7                 var nbCheckbox = checkboxes.length;
8                 var check = areAllChecked();
9                 for(var i=0;i<nbCheckbox;i++){
10                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
11                                 checkboxes[i].checked = (check) ? 0 : 1;
12                         }
13                 }
14         }
15         /**
16          * this function return true if all checkbox are checked
17          */
18         function areAllChecked(){
19                 var checkboxes = document.getElementsByTagName('input');
20                 var nbCheckbox = checkboxes.length;
21                 for(var i=0;i<nbCheckbox;i++){
22                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
23                                 if(checkboxes[i].checked == 0){
24                                         return false;
25                                 }
26                         }
27                 }
28                 return true;
29         }
30
31 function confirmDelete(message) {
32         return (confirm(message) ? true : false);
33 }
34
35 function Dopop(link) {
36         newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes');
37 }
38