  function offensiveComment(thread_id,topicCode,obj)
  {
    var  url="/ReportOffensive.do?oc="+topicCode+"&aid="+thread_id+"&ot=8";
    title = "Offensive";
    var yCord = getY(obj)-150;
    yCord = yCord > 150?yCord:-1;
    jt_loadAjax(url,title,false,400,yCord);
  }
  function openCommentEntry(){
    document.getElementById('commentEntry').style.display="block";
  }
  function openReplyEntry(divObjName){
    document.getElementById(divObjName).style.display="block";
  }
  function postComment(formObj,url)
  {
    var formVars = new Array();
    form= formObj;
    for (var i = 0; i < form.elements.length; i++)
    {
      var formElement = form.elements[i];
      // Special handling for checkboxes (we need an array of selected checkboxes..)!
      if(formElement.type=='checkbox' && !formElement.checked) {
        continue;
      }
      var v=new Object;
      v.name=formElement.name;
      v.value=formElement.value;
      formVars.push(v);
    }
      if((form.commentbox.value).length>0 && !isBlank(form.commentbox.value)){
        postCommentUrl(url, urlEncodeDict(formVars),'comments');
      }else{
        alert("Empty values not allowed");
        form.commentbox.value='';
        form.commentbox.focus();
      }
  }
  function isBlank(val)
  {
    if(val==null){return true;}
      for(var i=0;i<val.length;i++) {
        if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
    }
    return true;
  }
  function handleCommentRequest(){
    if(httpRequest.readyState==1){
      document.getElementById(divLayer).innerHTML = "Loading...";
    }
    if(httpRequest.readyState==4){
      if(httpRequest.status==200){
      document.getElementById(divLayer).innerHTML = '';
      var newdiv = document.createElement("div");
      newdiv.innerHTML = httpRequest.responseText;
      var container = document.getElementById(divLayer);
      container.appendChild(newdiv);

      }else {
        document.getElementById(divLayer).innerHTML  = "Error while retrieving data. Please Refresh the page.";
      }
    }
  }
  function postCommentUrl(url, data, loadableDivLayer)
  {
    divLayer = loadableDivLayer;
    httpRequest = initRequest();
    httpRequest.open('post',url);
    httpRequest.onreadystatechange = handleCommentRequest;
    httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    httpRequest.send(data);
  }