   function initComments() {
      if(document.getElementById("commentLink")) {
         addEventHandler(document.getElementById("commentLink"),"click",function(evt) {
            var href = document.getElementById("commentLink").href;
            href=href.replace(/[a-z]*\/show_comments.php/, "common/get_comments.php").replace(/#[a-z]*/,"");
            if(loadComments(href)) {
               var link = document.getElementById("commentLink");
               link.parentNode.parentNode.removeChild(link.parentNode);
               stopProp(evt);
               prevDef(evt);
               return false;
            }         
         });
         calcCommentCount(document.getElementById("commentLink"));
      }

	var allAs = document.getElementsByTagName("a");
   for(var i = 0; i<allAs.length; i++) {
      if(allAs[i].className=="commentLink" && allAs[i].id!="commentLink") {
         calcCommentCount(allAs[i]);
      }
   }	

      
   }

   function calcCommentCount(elem) {
      var href = elem.href;
      href=href.replace(/[a-z]*\/show_comments.php/, "common/count_comments.php").replace(/#[a-z]*/,"");;
      elem.firstChild.nodeValue = elem.firstChild.nodeValue.replace(/ \([0-9]*\)/,"");
         var req = 0;
         if(isIElt7) {
           try {
             req = new ActiveXObject("Msxml2.XMLHTTP");
           } catch(e) {
             try {
               req = new ActiveXObject("Microsoft.XMLHTTP");
             } catch(e) {
               req = null;
             }
           }
         } else {
            req = new XMLHttpRequest();
         }      

         if (req) {
              req.open('GET', href, true);
              req.onreadystatechange = function () {
                if (req.readyState == 4) {
                  if(req.status == 200) {
                     var count = req.responseText;
                     elem.firstChild.nodeValue += ' (' + count + ')';
                  }
                }
              };
              req.send(null);
         }
      
   }


   function loadComments(href) {
         var cont = document.getElementById("commentContainer");
         for(var i = cont.childNodes.length - 1; i>=0; i--) {
            //cont.removeChild(cont.childNodes[i]);
            cont.childNodes[i].style.visibility="hidden";
         }
         if(cont.childNodes.length == 0) {
            cont.appendChild(document.createTextNode("Laden..."));
         }
   
         var req = 0;
         if(isIElt7) {
           try {
             req = new ActiveXObject("Msxml2.XMLHTTP");
           } catch(e) {
             try {
               req = new ActiveXObject("Microsoft.XMLHTTP");
             } catch(e) {
               req = null;
             }
           }
         } else {
            req = new XMLHttpRequest();
         }      

         if (req) {
              req.open('GET', href, true);
              req.onreadystatechange = function () {
                if (req.readyState == 4) {
                  if(req.status == 200) {
                     var content = req.responseText;
                  } else {
                     var content = "Fehler " + req.status + " beim Laden der Kommentare.";
                  }
                  cont.innerHTML=content;
      
                }
              };
              req.send(null);
              return true;
         } else {
            return false;
         }
   }

