misc.js
1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function validateString(field, msg, min, max) {
if (!min) { min = 1 }
if (!max) { max = 65535 }
if (!field.value || field.value.length < min || field.value.max > max) {
alert(msg);
field.focus();
field.select();
return false;
}
return true;
}
function validateNumber(field, msg, min, max) {
if (!min) { min = 0 }
if (!max) { max = 255 }
if ( (parseInt(field.value) != field.value) || field.value.length < min || field.value.length > max) {
alert(msg);
field.focus();
field.select();
return false;
}
return true;
}
function setActionAndSubmit(newAction) {
document.MainForm.action = newAction;
document.MainForm.submit();
}
function getStylesheet() {
//document.write(\"<link rel=stylesheet type=\"text/css\" href=\"\");";
if (is_unix && is_nav) {
return "css/ns_unix.css";
} else if (is_win && is_ie) {
return "css/ie_win.css\";
} else {
return "css/default.css\";
}
}