var DAL = {
  CommentDAO : function()
  {
    this.name = "CommentDAO";
    
    this.insertComment = function(c)
    {
      var commentCallback = {
  			onSuccess : function(o)
  			{
  		    //do something useful with the data
  				commentsEvents.publish('comment-succeeded',o);
  			},
  			onFailure : function(o)
  			{
          alert("Error msg = " + o.status);
  				alert("callback failure");
  			}
    	}
    	
      try
      {
        var data = c.toPostData();
    		data += "&format=ajax";
    		var ajax = asyncRequest('POST', '/comment/create', commentCallback,data,5000);
    		return true;
		  }
		  catch(e)
  		{
  		  alert(e);
  		  return false;
  		}
      //alert(comment.authorComment + "was insersted successfully");
    }
  }
};

