http = getHTTPObject();
 
function getHTTPObject(){
  var xmlhttp;
 
  /*@cc_on
 
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }catch(E){
      xmlhttp = false;
    }
  }
  @else
    xmlhttp = false;
  @end @*/
 
  if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
    try {
      xmlhttp = new XMLHttpRequest();
    }catch(e){
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

 
function doitm(){
  var url = "http://www.torrents.net/?section=torrent&subsection=comment&id=" + document.getElementById('tid').value;
  url += "&comment=" + encodeURI(document.getElementById('comment').value);

  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
 
  http.send(null);
}

function doit(){
  var url = "http://www.torrents.net/?section=torrent&subsection=comment&id=" + document.getElementById('tid').value;
  url += "&comment=" + encodeURI(document.getElementById('comment').value);
  url += "&recaptcha_challenge_field=" + encodeURI(document.getElementById('recaptcha_challenge_field').value);
  url += "&recaptcha_response_field=" + encodeURI(document.getElementById('recaptcha_response_field').value);

  http.open("GET", url, true);
  http.onreadystatechange = handleHttpResponse;
 
  http.send(null);
}
 
function handleHttpResponse(){
  if(http.readyState == 4){
    document.getElementById('answer').innerHTML = document.getElementById('answer').innerHTML + http.responseText;
    document.getElementById('commentcounter').innerHTML = parseInt(document.getElementById('commentcounter').innerHTML) + 1;
  }
}
