var GUI =
{
  hideForm : function(comment)
  {
    //alert('hiding comment form');
    //dom.get('comment-form').style.display = 'none';
  },
  successComment : function(o)
  {
    //alert(o.responseText);
    var ajaxResponse = eval(o.responseText);
    if(ajaxResponse[0].success)
    {
      var c = ajaxResponse[0].data;
      //dom.get('comment-form').innerHTML = "<h1>YAY</h1>"
      var comment = document.createElement("div");
      comment.className = "single-comment green";
      
      /* this is ugly — needs to be fixed properly */
      var contentPara = document.createElement("p");
      c.authorComment = c.authorComment.replace("<p>","");
      c.authorComment = c.authorComment.replace("</p>","");
      contentPara.innerHTML = c.authorComment;
      
      var author = document.createElement("p");
      author.className = "comment-author";

      var authorName = document.createTextNode("— "+c.authorName);
      
      author.appendChild(authorName);
      comment.appendChild(contentPara);
      comment.appendChild(author);

      dom.get('authorComment').value = "";
      dom.get('spamCatch').value = "";
      
      dom.get('comments-list').appendChild(comment);

    }
    else
    {
      alert("comment wasn't inserted");
    }
    /*
    */
  }
};
