// Sets cookie values. Expiration date is optional
  //
  function setCookie(name, value, expire) {
  document.cookie = name + "=" + escape(value)
  + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
 }
 
 function getCookie(Name) {
    var search = Name + "="
    if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search)
      if (offset != -1) { // if cookie exists
        offset += search.length
        // set index of beginning of value
        end = document.cookie.indexOf(";", offset)
        // set index of end of cookie value
        if (end == -1)
        end = document.cookie.length
        return unescape(document.cookie.substring(offset, end))
      }
    }
    return "";
  }
  
  function setAdelaUID(uid) {
    var expires = new Date();
    expires.setTime(expires.getTime() + 1000*60*60*24);  //o pulnoci expiruje
    setCookie("adelaUID", uid, expires);
    //alert(expires);
  }
  
  function getAdelaUID(){
    return getCookie("adelaUID");
  }
 
 if(getAdelaUID() == "") {
    var now = new Date();
    var random1, random2, random3, random4, random5;
    random1 = Math.round(Math.random()* 500);
    random2 = Math.round(Math.random()* 500);
    random3 = Math.round(Math.random()* 500);
    random4 = Math.round(Math.random()* 500);
    random5 = Math.round(Math.random()* 500);    
    setAdelaUID(now.getYear() + "." + (now.getMonth() + 1) + "." + now.getDate() + "." + now.getHours() + "." + now.getSeconds() + "." + random1 + "." + random2 + "." + random3 + "."+ random4 + "."+ random5);
 }

ad_code="<A HREF=\"http://ad.tlp.cz/engine/adredir.asp?vzidLidCidBid=5.16.47.430\"> \n" + 
"  <IMG  \n" + 
"  SRC=\"http://ad.tlp.cz/banners/125x125.gif\" \n" + 
"  ALT=\"Golias\" \n" + 
"  BORDER=\"0\" \n" + 
"  HEIGHT=\"125\" \n" + 
"  WIDTH=\"125\" \n" + 
"  > \n" + 
"  </IMG> \n" + 
"</A> ";