// Can this Browser use Cookies? function cookiesEnabled() { // check to see if we can do cookies var result = (navigator.cookieEnabled) ? true : false //if not IE4+ nor NS6+ if(typeof navigator.cookieEnabled=="undefined" && !result) { document.cookie = "testcookie"; result = (document.cookie.indexOf("testcookie")!=-1)? true : false; } return result } // Creates a Cookie function createCookie(name,value) { var expires = ""; var date = new Date(); var days = 730; if(arguments.length > 2) { days = arguments[2]; } date.setTime(date.getTime()+(days*24*60*60*1000)); expires = "expires="+date.toGMTString(); document.cookie = name+"="+value+";"+expires+";path=/"; } // Reads a Cookie function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } // Deletes a Cookie function deleteCookie(name) { createCookie(name,"",-1); }