-
Notifications
You must be signed in to change notification settings - Fork 2
/
global.js
104 lines (86 loc) · 2.69 KB
/
global.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
window.onload = startsynchr;
window.onerror = catcherr;
if (document.all) {
document.onmouseover = linkover;
document.onmouseout = linkout;
document.onmouseup = linkover;
document.ondragstart = linkover;
document.onclick = linkover;
}
function linkover() {
var obj = event.srcElement, s = status;
if (obj.tagName == "A") s = obj.innerText; else if (obj.tagName == "IMG") s = obj.title;
status = s;
return true;
return true;
}
function linkout() {
status = defaultStatus;
return true;
return true;
}
function fmtint(i) {
return (i < 10 ? "0" + i : i);
}
function synchrclock() {
var now = new Date();
var c = new Date();
c.setTime(stm.getTime() + (now.getTime() - sltm.getTime()));
getLay("server-time").innerHTML = fmtint(c.getHours()) + ":" + fmtint(c.getMinutes()) + ":" + fmtint(c.getSeconds()) + " Uhr";
}
function startsynchr() {
setInterval("synchrclock()", 1000);
}
function param(name) {
var s, a, x, i;
s = location.search;
if (s == "" || s.indexOf(name + "=") == -1) {
if (!(top.frames.location == null)) s = top.frames.location.search;
}
if (s != "" && s.indexOf(name + "=") > -1) {
s = s.substring(1);
a = new Array();
x = new Array();
x = s.split("&");
for (i = 0; i < x.length; i++) {
a[i] = new Array();
a[i] = x[i].split("=");
}
for (i = 0; i < a.length; i++) {
if (a[i][0].toLowerCase() == name.toLowerCase()) break;
}
return unescape(a[i][1]);
} else {
return "";
}
}
var newwin;
function show_abook(type) {
l = parseInt((screen.availWidth - 500) / 2);
t = parseInt((screen.availHeight - 300) / 2);
p = "width=500,height=300,toolbar=0,menubar=0,location=0,status=0,resizable=1,scrollbars=1,left=" + String(l) + ",top=" + String(t);
newwin = window.open("abook.php?mode=selpage&sid=" + param('sid') + "&type=" + type, "AddressBook", p);
setTimeout('newwin.focus();', 200);
}
function setCaret(obj) {
if (obj.createTextRange) {
obj.caretPos = document.selection.createRange().duplicate();
}
}
function smily(str) {
var txtbox = document.formular.text;
if (txtbox.createTextRange && txtbox.caretPos) {
txtbox.caretPos.text = " " + str + " ";
} else {
txtbox.value += " " + str + " ";
}
txtbox.focus(txtbox.caretPos);
}
function getLay(id) {
if (document.getElementById) return document.getElementById(id);
if (document.all) return eval("document.all." + id);
return 0;
}
function catcherr() {
return true;
}