function hs1(i){if(hs[i]){document.write(" ("+hs[i]+")");}else{document.write(" (0)");}}function hs2(i){if(hstb[i]){document.write(" ("+hstb[i]+")");}else{document.write(" (0)");}}function hs3(i){if(hs[i]){if(hs[i] == 1){return(" ("+hs[i]+" comment) ");}return(" ("+hs[i]+" comments) ");}else{return("");}}function hs4(j){if(hs[j]){return(" ("+hs[j]+")");}else{return(" (0)");}}

function addCommentCounts() {
  var n = document.links.length;
  for(var i = 0; i < n; i++) {
    if(document.links[i].href.indexOf("http://www.haloscan.com/comments/tcpalm/") == 0) {
      var a = document.links[i].href.substring(40, document.links[i].href.length - 1);
      document.links[i].onclick = commentPopup;
      if(document.links[i].href.indexOf("#") == -1) {
        if (document.links[i].firstChild) {
          document.links[i].firstChild.nodeValue = "Comments" + hs4(a) + " »";
        } else {
          if (document.links[i].innerHTML) {
            document.links[i].innerHTML = "Comments" + hs4(a) + " &raquo;";
          }
        }
      }
    }
  }
}

function commentPopup() {
  popup(this.href,440,450);
  return false;
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(addCommentCounts);