Index: trunk/kernel/admin_templates/incs/script.js =================================================================== diff -u -r4996 -r5026 --- trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 4996) +++ trunk/kernel/admin_templates/incs/script.js (.../script.js) (revision 5026) @@ -944,4 +944,35 @@ } else { el.removeEventListener(evname, func, true); } - };*/ \ No newline at end of file + };*/ + + function setCookie($Name, $Value) + { + // set cookie + if(getCookie($Name) != $Value) + { + document.cookie = $Name+'='+escape($Value)+'; path=' + $base_path + '/'; + } + } + + function getCookie($Name) + { + // get cookie + var $cookieString = document.cookie; + var $index = $cookieString.indexOf($Name+'='); + if($index == -1) return null; + + $index = $cookieString.indexOf('=',$index)+1; + var $endstr = $cookieString.indexOf(';',$index); + if($endstr == -1) $endstr = $cookieString.length; + return unescape($cookieString.substring($index, $endstr)); + } + + function deleteCookie($Name) + { + // deletes cookie + if (getCookie($Name)) + { + document.cookie = $Name+'=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/'; + } + } \ No newline at end of file