var today = new Date( ); var inTenMinutes = new Date( today.getTime( ) + 10 * 60 * 1000 ); var inTwoDays = new Date( today.getTime( ) + 2 * 24 * 60 * 60 * 1000 ); var inMonth = new Date( today.getTime( ) + 31 * 24 * 60 * 60 * 1000 ); var inTwoMonth = new Date( today.getTime( ) + 62 * 24 * 60 * 60 * 1000 ); var inSixMonth = new Date( today.getTime( ) + 186 * 24 * 60 * 60 * 1000 ); function getCookieVal( offset ) { var endstr = document.cookie.indexOf( ";", offset ); if (endstr == -1) { endstr = document.cookie.length; } return unescape( document.cookie.substring( offset, endstr ) ); } function getCookie( name ) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length var i = 0; while ( i < clen ) { var j = i + alen; if (document.cookie.substring( i, j) == arg ) { return getCookieVal ( j ); } i = document.cookie.indexOf( " ", i ) + 1; if ( i == 0 ) break; } return null; } function deleteCookie ( name, path, domain ) { if ( getCookie( name ) ) { document.cookie = name + "=" + ( (path) ? "; path=" + path : "" ) + ( (domain) ? "; domain=" + domain : "" ) + "; expires=" + today.toGMTString( ); } } function setCookie ( name, value, expires ) { var aref = name + "=" +escape( value ); aref += "; expires=" + expires.toGMTString(); aref += "; path=/"; document.cookie = aref; }