var portletCookie = null; function LoadPortletCookie() { if (portletCookie == null) { /* Set to expire in 24 hours */ portletCookie = new Cookie(document, "portlet_cookie", 24); portletCookie.load(); } } function SavePortletCookie(portletName) { if (portletCookie != null) { portletCookie.store(); } } function OpenClosePortlets (portletName) { var el = document.getElementById(portletName + 'OpenClose'); var el2 = document.getElementById(portletName + 'OpenCloseLink'); LoadPortletCookie(); if (el.style.left == "-999em") { el.style.left = "auto"; el.style.right = "auto"; el.style.position = "relative"; el2.setAttribute('title', "Collapse"); el2.innerHTML = "X"; portletCookie[portletName] = "Expanded"; SavePortletCookie(portletName); } else { el.style.left = "-999em"; el.style.right = "999em"; el.style.position = "absolute"; el2.setAttribute("title", "Expand"); el2.innerHTML = "+"; portletCookie[portletName] = "Collapsed"; SavePortletCookie(); } return false; } function RestorePortlet(portletName) { LoadPortletCookie(); if (portletCookie[portletName] == null) return false; if (portletCookie[portletName] == "Collapsed") OpenClosePortlets(portletName); }