4
var active = getActiveStyleSheet();
9
setActiveStyleSheet('A-');
13
setActiveStyleSheet('A');
17
setActiveStyleSheet('A+');
21
setActiveStyleSheet('A++');
25
setActiveStyleSheet('A');
29
setActiveStyleSheet('A');
34
function fontsizedown()
36
active = getActiveStyleSheet();
41
setActiveStyleSheet('A+');
45
setActiveStyleSheet('A');
49
setActiveStyleSheet('A-');
53
setActiveStyleSheet('A--');
60
setActiveStyleSheet('A--');
65
function setActiveStyleSheet(title)
69
for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
71
if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
74
if (a.getAttribute('title') == title)
82
function getActiveStyleSheet()
86
for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
88
if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title') && !a.disabled)
90
return a.getAttribute('title');
97
function getPreferredStyleSheet()
102
function createCookie(name, value, days)
106
var date = new Date();
107
date.setTime(date.getTime() + (days*24*60*60*1000));
108
var expires = '; expires=' + date.toGMTString();
115
document.cookie = name + '=' + value + expires + '; path=/';
118
function readCookie(name)
120
var nameEQ = name + '=';
121
var ca = document.cookie.split(';');
123
for (var i = 0; i < ca.length; i++)
127
while (c.charAt(0) == ' ')
129
c = c.substring(1, c.length);
132
if (c.indexOf(nameEQ) == 0)
134
return c.substring(nameEQ.length, c.length);
141
function load_cookie()
143
var cookie = readCookie('style_cookie');
144
var title = cookie ? cookie : getPreferredStyleSheet();
145
setActiveStyleSheet(title);
148
function unload_cookie()
150
var title = getActiveStyleSheet();
151
createCookie('style_cookie', title, 365);
154
onload_functions.push('load_cookie()');
155
onunload_functions.push('unload_cookie()');
158
var cookie = readCookie("style");
159
var title = cookie ? cookie : getPreferredStyleSheet();
160
setActiveStyleSheet(title);