/** * Cookies.js, providing easy access to cookies thru the cookiejar object. Enabling so-called "subcookies" thru the subcookiejar * object. * See this related blogpost for more information on how to use these objects: * * Check out this other blogpost for information about the new version: * * * @author Harmen Janssen * @version 2.0 * */ /* based on http://www.quirksmode.org/js/cookies.html, by Peter-Paul Koch */ var cookiejar = { /* set a cookie */ bake: function(cookieName,cookieValue,days,path) { var expires=''; if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); expires = "; expires="+date.toGMTString(); } var thePath = '; path=/'; if (path) { thePath = '; path=' + path; } document.cookie = cookieName+'='+escape(cookieValue)+expires+thePath; return true; }, /* get a cookie value */ fetch: function(cookieName) { var nameEQ = cookieName + '='; var ca = document.cookie.split(';'); for (var i=0; i