home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2001 February / MICD2001_02_NR1.iso / Tapety / cokies.js < prev    next >
Text File  |  2001-01-04  |  913b  |  38 lines

  1. var first=0;
  2.  
  3. function setcookie(counter)
  4. {
  5.  var today = new Date()
  6.  var expires = new Date()
  7.  expires.setTime(today.getTime() + 1000*60*60*20)
  8.  document.cookie = "motorek guest=" + counter + "$" +  escape(name) + "; expires=" + expires.toGMTString()
  9. }
  10.  
  11. function getCookie(search)
  12. {
  13.  if (document.cookie.length > 0) {
  14.     offset = document.cookie.indexOf(search) 
  15.     if (offset != -1) { 
  16.         offset += search.length 
  17.         end = document.cookie.indexOf(";", offset) 
  18.         if (end == -1) 
  19.             end = document.cookie.length
  20.             return unescape(document.cookie.substring(offset, end))
  21.         }
  22.     }
  23. }
  24.  
  25. function klikaj()
  26. {
  27. document.write('<div style="position:absolute; visibility: hidden">'+
  28. '<IFRAME WIDTH=1 HEIGHT=1 SRC="http://www.wyszukaj.com/rank/test.htm"></IFRAME>'+
  29. '</div>')
  30. }
  31.  
  32. var guest = getCookie("motorek guest=") 
  33.  
  34. if(guest==null) 
  35. {
  36.  klikaj()
  37.  timerID = setTimeout("setcookie(1)",3000);
  38. }