var rand=Math.round(100000*Math.random()); var inutil=''; var t=escape(document.title); function getCookie(Name) { var search = Name + '='; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search); if (offset != -1) { offset += search.length; end = document.cookie.indexOf(';', offset); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(offset, end)); } } return '0'; } var rettime = getCookie('ps_rettime'); var returns = getCookie('ps_returns'); rettime = parseInt(rettime); // Converte stringa in intero returns = parseInt(returns); var mytime = new Date().getTime(); mytime = Math.floor(mytime / 1000); mytime = parseInt(mytime); var newret = 0; if (rettime==0 || returns==0) // Prima visita { rettime = mytime; returns = 1; } else { if (rettime && ((mytime-rettime) > 3600)) { newret = 1; // Nuovo ritorno: va incrementato il contatore giornaliero returns=returns+1; } } var exdate = new Date(); exdate.setDate(exdate.getDate() + 30); document.cookie = "ps_rettime="+mytime+";path=/;expires="+exdate.toUTCString(); document.cookie = "ps_returns="+returns+";path=/;expires="+exdate.toUTCString(); var sc1=""; document.write(sc1);