/dev/adei/hovhannes

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei/hovhannes

« back to all changes in this revision

Viewing changes to js/menu.js

  • Committer: hovhannes
  • Date: 2012-07-25 09:52:29 UTC
  • Revision ID: hovhannes-20120725095229-9kkxct7c74m642lt
Save State on upper menu

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
    }
124
124
}
125
125
 
 
126
function setCookie(c_name,value,exdays)
 
127
 {
 
128
 var exdate=new Date();
 
129
 exdate.setDate(exdate.getDate() + exdays);
 
130
 var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
 
131
 document.cookie=c_name + "=" + c_value;
 
132
 }
 
133
function getCookie(c_name)
 
134
 {
 
135
 var i,x,y,ARRcookies=document.cookie.split(";");
 
136
 for (i=0;i<ARRcookies.length;i++)
 
137
 {
 
138
   x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
 
139
   y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
 
140
   x=x.replace(/^\s+|\s+$/g,"");
 
141
   if (x==c_name)
 
142
     {
 
143
     return unescape(y);
 
144
     }
 
145
   }
 
146
 }
 
147
MENU.prototype.SaveState = function() {
 
148
        setCookie("LastState",document.location.href, 30 );
 
149
}
 
150
 
126
151
MENU.prototype.onClick = function(self) {
127
152
    return function(itemId,itemValue) {
128
153
        var params = itemId.split("__");
135
160
                args += ", \"" + params[i] + "\"";
136
161
        }
137
162
        
 
163
        //alert(params[0]);
138
164
        var cmd = "if (typeof self." + params[0] + " == \"function\") {" +
139
165
            "self." + params[0] + "(" + args + ");" +
140
166
        "} else {" +