forked from zedzedtop/mailzu
-
Notifications
You must be signed in to change notification settings - Fork 7
/
functions.js
136 lines (115 loc) · 4.58 KB
/
functions.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Last modified: 03-04-05
function checkBrowser() {
if ((navigator.appName.indexOf("Netscape") != -1) && (parseFloat(navigator.appVersion) <= 4.79)) {
newWin = window.open("", "message", "height=200,width=300");
newWin.document.writeln("<center><b>This system is optimized for Netscape version 6.0 or higher.<br>" +
"Please visit <a href='http://channels.netscape.com/ns/browsers/download.jsp' target='_blank'>Netscape.com</a> to obtain an update.");
newWin.document.close();
}
}
function help(file) {
window.open("help.php#" + file, "", "width=500,height=500,scrollbars");
void(0);
}
function isIE() {
return document.all;
}
function resOver(cell, color) {
cell.style.backgroundColor = color;
cell.style.cursor = 'hand'
}
function resOut(cell, color) {
cell.style.backgroundColor = color;
}
function showHideSearch(element) {
var expires = new Date();
var time = expires.getTime() + 2592000000;
expires.setTime(time);
var showHide = "";
if (document.getElementById(element).style.display == "none") {
document.getElementById(element).style.display = 'block';
if (document.getElementById(element + '_closed')) {
document.getElementById(element + '_closed').style.display = 'none';
document.getElementById(element + '_td').style.width = '16vw';
}
showHide = "show";
} else {
document.getElementById(element).style.display = 'none';
if (document.getElementById(element + '_closed')) {
document.getElementById(element + '_closed').style.display = 'block';
document.getElementById(element + '_td').style.width = '3vw';
}
showHide = "hide";
}
document.cookie = element + "=" + showHide + ";expires=" + expires.toGMTString();
}
function showHideFullHeaders(table) {
var expires = new Date();
var time = expires.getTime() + 2592000000;
expires.setTime(time);
var showHide = "";
var cnames = 'visiblehidden';
var i = 0;
var rows = document.getElementById(table).rows;
for (i = 0; i < rows.length; i++) {
rows[i].className = cnames.replace(rows[i].className, '');
showHide = rows[i].className;
}
document.cookie = table + "=" + showHide + ";EXpires=" + expires.toGMTString();
}
function changeLanguage(opt) {
var expires = new Date();
var time = expires.getTime() + 2592000000;
var cpath = document.location.href.replace(/\\/g, '/').replace(/\/[^\/]*$/, '').replace(/\\/g, '/').replace(/.*\//, '');
expires.setTime(time);
document.cookie = "lang=" + opt.options[opt.selectedIndex].value + ";expires=" + expires.toGMTString() + ";path=/" + cpath;
document.location.href = document.URL;
}
function clickTab(tabid, panel_to_show) {
document.getElementById(tabid.getAttribute("id")).className = "tab-selected";
rows = document.getElementById("tab-container").getElementsByTagName("td");
for (i = 0; i < rows.length; i++) {
if (rows[i].className == "tab-selected" && rows[i] != tabid) {
rows[i].className = "tab-not-selected";
}
}
div_to_display = document.getElementById(panel_to_show);
div_to_display.style.display = isIE() ? "inline" : "table";
divs = document.getElementById("main-tab-panel").getElementsByTagName("div");
for (i = 0; i < divs.length; i++) {
// only hide panels with prefix "pnl"
if (divs[i] != div_to_display && divs[i].getAttribute("id").substring(0, 3) == "pnl") {
divs[i].style.display = "none";
}
}
}
function showHideMinMax(chk) {
document.getElementById("minH").disabled = document.getElementById("minM").disabled = document.getElementById("maxH").disabled = document.getElementById("maxM").disabled = chk.checked
}
function CheckAll(frm) {
var elmts = frm.elements;
for (i = 0; i < elmts.length; i++) {
if (elmts[i].type == "checkbox") {
elmts[i].checked = true;
ColorRow(elmts[i], "lightyellow");
}
}
}
function CheckNone(frm) {
var elmts = frm.elements;
for (i = 0; i < elmts.length; i++) {
elmts[i].checked = false;
ColorRow(elmts[i], "lightyellow");
}
}
function ColorRow(obj, color) {
obj.checked == true ? bg = color : bg = '';
while (obj.nodeName != 'TR') {
obj = obj.parentNode;
}
obj.style.backgroundColor = bg;
}
function ViewOriginal(enc_mail_id, enc_recip_email) {
var url = "read_original.php?mail_id=" + enc_mail_id + "&recip_email=" + enc_recip_email;
window.open(url, 'OriginalMessage', 'width=800,height=600,scrollbars=1');
}