function writeSessionCookie(n,t){return testSessionCookie()?(document.cookie=escape(n)+"="+escape(t)+"; path=/",!0):!1}function getCookieValue(n){var t=new RegExp(escape(n)+"=([^;]+)");return t.test(document.cookie+";")?(t.exec(document.cookie+";"),unescape(RegExp.$1)):!1}function testSessionCookie(){return document.cookie="testSessionCookie=Enabled",getCookieValue("testSessionCookie")=="Enabled"?!0:!1}function testPersistentCookie(){return writePersistentCookie("testPersistentCookie","Enabled","minutes",1),getCookieValue("testPersistentCookie")=="Enabled"?!0:!1}function writePersistentCookie(n,t,i,r){var u=new Date,e,f;r=r/1;e=i;switch(e.toLowerCase()){case"years":f=u.getYear();f<1e3&&(f=f+1900);u.setYear(f+r);break;case"months":u.setMonth(u.getMonth()+r);break;case"days":u.setDate(u.getDate()+r);break;case"hours":u.setHours(u.getHours()+r);break;case"minutes":u.setMinutes(u.getMinutes()+r);break;default:alert("Invalid periodType parameter for writePersistentCookie()")}document.cookie=escape(n)+"="+escape(t)+"; expires="+u.toGMTString()+"; path=/"}function deleteCookie(n){return getCookieValue(n)&&writePersistentCookie(n,"Pending delete","years",-1),!0}