function createCookie(name,value,hours,path) { if (hours) { var date = new Date(); date.setTime(date.getTime()+(hours*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else { var expires = ""; } document.cookie = name+"="+escape(value)+expires+"; path="+path; }