Javascript-брояч

NeedFix

Registered
Не знам дали ще ви е много полезно ама ми е първа тема в тоя раздел! :wink:
Така че :
Код:
<html>
<head>
<SCRIPT>
function WinOpen() 
   {
   alert('\nPage will load to full screen.\n\nUse View/Document Source from menu bar to view source.\n\nClose new window to return to this page. ');
   window.open("/","DisplayWindow","menubar=yes");
   window.open("/","DisplayWindow","menubar=yes");
   }
function leapto() 
   {
   window.location="77.html"
   }

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 SetCookie (name, value) 
   {
   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + escape (value) +
     ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
   }
function ResetCounts(name) 
   {
   visits = 0;
   SetCookie("visits", visits, expdate , "/", null, false);
   leapto();
   }
</Script>
</head>
<body>
<CENTER>
  <STRONG><EM> </EM></STRONG>
<Script>
 var expdate = new Date();
var visits;
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
if(!(visits = GetCookie("visits"))) 
   visits = 0;
visits++;
SetCookie("visits", visits, expdate, "/", null, false);
document.write("<center><STRONG>"+"Твоят браузър посети "+"</STRONG></center>" 
+"<FONT COLOR=0000FF><center><STRONG>"+visits+"</STRONG></center></FONT>"
+"<center><STRONG>"+"пъти."+"</STRONG></center><br>" + "<center><font color=#FF00FF>guten.hit.bg</font></center>");
   if(visits == 1) 
      document.write("<P><FONT SIZE=+2><EM><CENTER><STRONG><BLINK>"+" Добре дошъл за първи път!"                 +"</BLINK></STRONG></CENTER></EM></FONT>");
</Script>
</CENTER>
<FORM>
<CENTER>
<TABLE BORDER=0 CELLSPACING=8 CELLPADDING=4 WIDTH=250>
<TR>
<TD align="center"><INPUT NAME="update" TYPE="BUTTON" VALUE="Назад" OnClick="leapto()"></TD>
<TD align="center"><INPUT NAME="reset" TYPE="BUTTON" VALUE="Рестартирай брояча" OnClick="ResetCounts(visits)"></TD>
</TR>
</TABLE>
</CENTER></form>
</body>
</html>
 

Горе