forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathietf.js
More file actions
50 lines (47 loc) · 1.67 KB
/
Copy pathietf.js
File metadata and controls
50 lines (47 loc) · 1.67 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
42
43
44
45
46
47
48
49
50
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + expires) +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
function delCookie (name,path,domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function setStyle (cstyleSheet) {
var styleSheet = cstyleSheet;
if(styleSheet=="0") { styleSheet = getCookie('styleSheet'); }
var sheet1 = document.getElementById("sheet1");
var sheet2 = document.getElementById("sheet2");
var sheet3 = document.getElementById("sheet3");
var sheet4 = document.getElementById("sheet4");
sheet1.disabled=true;
sheet2.disabled=true;
sheet3.disabled=true;
sheet4.disabled=true;
if(styleSheet=="1") { sheet1.disabled=false; }
else if(styleSheet=="2") { sheet2.disabled=false; }
else if(styleSheet=="3") { sheet3.disabled=false; }
else if(styleSheet=="4") { sheet4.disabled=false; }
else { styleSheet="1"; sheet1.disabled=false; }
setCookie('styleSheet',styleSheet,"Mon, 31-Dec-2035 23:59:59 GMT","/");
}