Jacek Kowalski
2019-12-16 07517ae563097e04e91ea3fae2c2ca1cf2309b86
commit | author | age
175a52 1 function keypress(e) {
JK 2     if(!e) {
3         e = window.event;
4     }
5     
6     switch(e.keyCode) {
7         case 112:
8             setTimeout('window.location.replace("index.php");', 10);
9             return false;
10         break;
11         case 113:
12             setTimeout('window.location.replace("add.php");', 10);
13             return false;
14         break;
15         case 114:
16             setTimeout('window.location.replace("place.php");', 10);
17             return false;
18         break;
19         case 115:
20             setTimeout('window.location.replace("generate.php");', 10);
21             return false;
22         break;
23     }
24 }
25
26 function ffalse(ids) {
27     i=1;
28     while(true) {
29         obj = document.getElementById(ids+i);
30         if(!obj) break;
31         
32         if((obj.hasAttribute('required') || obj.className=='focus') && obj.value=='') {
33             obj.focus();
34             return false;
35         }
36         i++;
37     }
38     
39     return true;
40 }
41
42 function ffalse_focus() {
43     el = document.getElementsByClassName('focus');
44     
45     for(i=0; i<el.length; i++) {
46         el.item(i).onfocus = "this.className=''";
47     }
48 }
49
50 function uc_all(ids, check) {
51     list = document.getElementById(ids).getElementsByTagName('input');
52     
53     for(i=0; i<list.length; i++) {
54         box = list.item(i);
55         if(box.type == 'checkbox') {
56             box.checked = check;
57         }
58     }
59 }
60
61 function pups_init() {
62     an = document.getElementsByTagName('a');
63     
64     for(i=0; i<an.length; i++) {
65         if((an.item(i).href+'').match('cover.php\?')) {
66             an[i].onclick = pups;
67         }
68     }
69 }
70
71 function pups(an) {
72     an = an.target.parentNode;
73     if(an) {
74         win = window.open(an.href+'&pop', '_blank', 'dependent=yes,toolbar=no,resizable=yes');
75         return false;
76     }
77 }
78
79 function on_loaded() {
80     ffalse_focus();
81     pups_init();
82 }
83
84 document.onkeydown = keypress;
85 window.onload = on_loaded();