function getPingwinCode() {
  return '<a href="http://www.pingwin.ru/" target="_blank"><img border=0 width=88 height=31 src="http://www.pingwin.ru/img/pingwin.gif" alt="Каталог &quot;ПИНГВИН&quot; - чуткий и душевный каталог!"></a>';
}

function getWebListCode() {
  return '<a target=_blank href="http://weblist.ru/"><img border=0 width=88 height=31 alt="WebList.Ru" src="http://weblist.ru/images/weblist882.gif"></a>';
}

function getSpyLOGCode() {
  var u = "u834.50.spylog.com";
  var d = document;
  var nv = navigator;
  var na = nv.appName;
  var p = 0;
  d.cookie = "b=b";
  var c = (d.cookie) ? 1 : 0;
  var bv=Math.round(parseFloat(nv.appVersion)*100);
  var n = (na.substring(0,2) == "Mi") ? 0 : 1;
  var rn=Math.random();
  var z = "p="+p+"&rn="+rn+"&c="+c;
  var fr = (self != top) ? 1 : 0;
  var j = (navigator.javaEnabled() ? "Y" : "N");
  var s = screen;
  var px = (n == 0) ? s.colorDepth : s.pixelDepth;
  z += "&wh="+s.width+'x'+s.height+"&px="+px;
  var sl = "1.3";
  var y = "<a href='http://"+u+"/cnt?f=3&p="+p+"&rn="+rn+"' target=_blank>";
  y += "<img src='http://"+u+"/cnt?"+z+"&j="+j+"&sl="+sl+"&r1="+escape(d.referrer)+"&r="+escape(parent.document.referrer)+"&fr="+fr+"&pg="+escape(window.location.href);
  y += "' border=0 width=88 height=31 alt='SpyLOG'>";
  y += "</a>";
  return y;
}

function getTopListCode(){
  var html = '<a target=_blank href="http://top.list.ru/jump?from=120170">';
  var d = document;
  var a = ';r='+escape(top.document.referrer);
  a += ';j='+navigator.javaEnabled();
  var s = screen;
  a += ';s='+s.width+'*'+s.height;
  a += ';d='+(s.colorDepth ? s.colorDepth : s.pixelDepth);
  var js = 13;
  html += '<img src="http://top.list.ru/counter'+
          '?id=120170;t=34;js='+js+a+';rand='+Math.random()+
          '" alt="TopList" '+ 'border=0 height=31 width=88>';
  html += '</a>';
  return html;
}

function getOneRuCode() {
  var html = '<a target=_blank href="http://www.one.ru">' +
             "<img src=\"http://cnt2.one.ru/cgi-bin/cnt.cgi?id=34908&t=1" +
             "&r=" + escape(parent.document.referrer) + "\" width=88 height=31 " +
             "border=0 alt=\"become number one\"></a>";
  return html;
}

//function getCMCCode() {
//  var html = '<a href="http://cmc.narod.ru" target=_blank><img border="0" src="http://cmc.narod.ru/banner.gif" width="88" height="31" alt="Содружество Молодых Сайтов"></a>';
//  return html;
//}

function getRSDNCode() {
  var html = '<a href="http://www.rsdn.ru/" target=_blank title="RSDN.ru"><img src="http://rsdn.ru/rsdn.gif" border="0" width="88" height="31"></a>';
  return html;
}

function addCounters(flag) {
  with (currentBrowser)
    if ((flag != isIE4up) || !isOnline)
      return;
  var html = '<table cellpadding="0" cellspacing="2" border="0" style="margin-top: 0">' +
                 '<tr><td><a target="_blank" href="http://validator.w3.org/check/referer"><img src="images/vhtml401.gif" alt="Valid HTML 4.01!" title="Valid HTML 4.01!" border="0" height="31" width="88"></a></td>' +
                 '<td>' + getPingwinCode() + '</td>' +
                 '<td>' + getWebListCode() + '</td>' +
                 '<td>' + getOneRuCode() + '</td>' +
                 '<td>' + getSpyLOGCode() + '</td>' + 
                 '<td>' + getTopListCode() + '</td>' +
                 '<td>' + getRSDNCode() + '</td>' +
                 '<td><a target="_blank" href="http://jigsaw.w3.org/css-validator"><img src="images/vcss.gif" alt="Valid CSS!" title="Valid CSS!" border="0" height="31" width="88"></a></td></tr>' +
             '</table>';
  if (currentBrowser.isIE4up)
    tdCounter.innerHTML = html;
  else
    document.write(html);
}
