1 // PHP Layers Menu 3.2.0-rc (C) 2001-2004 Marco Pratesi - http://www.marcopratesi.it/
3 function setLMCookie(name, value)
4 {
5 document.cookie = name + '=' + value + ';path=/';
6 }
8 function getLMCookie(name)
9 {
10 foobar = document.cookie.split(name + '=');
11 if (foobar.length < 2) {
12 return null;
13 }
14 tempString = foobar[1];
15 if (tempString.indexOf(';') == -1) {
16 return tempString;
17 }
18 yafoobar = tempString.split(';');
19 return yafoobar[0];
20 }
22 function parseExpandString()
23 {
24 expandString = getLMCookie('phplm_expand');
25 phplm_expand = new Array();
26 if (expandString) {
27 expanded = expandString.split('|');
28 for (i=0; i<expanded.length-1; i++) {
29 phplm_expand[expanded[i]] = 1;
30 }
31 }
32 }
34 function parseCollapseString()
35 {
36 collapseString = getLMCookie('phplm_collapse');
37 phplm_collapse = new Array();
38 if (collapseString) {
39 collapsed = collapseString.split('|');
40 for (i=0; i<collapsed.length-1; i++) {
41 phplm_collapse[collapsed[i]] = 1;
42 }
43 }
44 }
46 parseExpandString();
47 parseCollapseString();
49 function saveExpandString()
50 {
51 expandString = '';
52 for (i=0; i<phplm_expand.length; i++) {
53 if (phplm_expand[i] == 1) {
54 expandString += i + '|';
55 }
56 }
57 setLMCookie('phplm_expand', expandString);
58 }
60 function saveCollapseString()
61 {
62 collapseString = '';
63 for (i=0; i<phplm_collapse.length; i++) {
64 if (phplm_collapse[i] == 1) {
65 collapseString += i + '|';
66 }
67 }
68 setLMCookie('phplm_collapse', collapseString);
69 }