Index: openacs-4/packages/forums/www/resources/forums.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/resources/forums.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/forums/www/resources/forums.js 28 Feb 2008 06:51:49 -0000 1.4 +++ openacs-4/packages/forums/www/resources/forums.js 12 Mar 2008 05:26:43 -0000 1.5 @@ -140,18 +140,13 @@ return null; } -window.onload = function(e) { +function loadMsgsState() { var cookie = readCookie("style"); - if (cookie == 'null') var title = getPreferredStyleSheet(); + var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); } -window.onunload = function(e) { +function saveMsgsState() { var title = getActiveStyleSheet(); createCookie("style", title, 365); } - -var cookie = readCookie("style"); -if (cookie == 'null') var title = getPreferredStyleSheet(); -setActiveStyleSheet(title); -