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 getMinsInMsc( mnts ) { var today = new Date( ); return new Date( today.getTime( ) + parseInt(mnts) * 60 * 1000 ); } function getHoursInMsc( hrs ) { var today = new Date( ); return new Date( today.getTime( ) + parseInt(hrs) * 60 * 60 * 1000 ); } function getDaysInMsc( days ) { var today = new Date( ); return new Date( today.getTime( ) + parseInt(days) * 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; } function doCookie(cookieName,code,days,s) { var index = -1; var today = new Date(); //today += days*1000*60*60*24; if (days==0) { var exp_str = ""; } else { //alert("I am here today="+today); //alert(today.toUTCString()); //var s = today.toUTCString(); //var exp_str = " expires=" + s.substr(0,7)+"-" + s.substr(8,3) + "-" + s.substr(12,14) + "GMT;"; var exp_str = " expires=" + s + ";"; //alert(exp_str) //alert(s); } if(document.cookie) { index = document.cookie.indexOf(cookieName); } var count = code;//eval(document.cookie.substring(countbegin, countend)) + 1; if (index == -1) { document.cookie = cookieName + "="+count+"; "+exp_str+"path=/"; } else { var countbegin = (document.cookie.indexOf("=", index) + 1); var countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length } document.cookie=cookieName+"="+count+";"+exp_str+"path=/"; } } function rdcookie(cookieName) { if(document.cookie) { var index = document.cookie.indexOf(cookieName); if (index != -1) { var countbegin = (document.cookie.indexOf("=", index) + 1); var countend = document.cookie.indexOf(";", index); if (countend == -1) { countend = document.cookie.length; } return document.cookie.substring(countbegin, countend); } } return 0; }