var BLL = {
  CommentManager : function (dao)
  {
    this.dao = dao;
    
  	this.spamCatch = "igloo";
  	this.validate = function(c)
  	{
  	  if(c.postId == 0) return false;
  		if(c.authorName == "") return false;
  		if(c.authorEmail == "") return false;
  		if(c.authorComment == "") return false;
  		if(c.spamCatch != this.spamCatch) return false;
  		return true;
  	}

  	this.send = function(c)
  	{
  	  if(this.validate(c))
  		{
  		  this.dao.insertComment(c);
    		return true;
  		};
  		return false;
  	}
  },
  CommentManagerFactory : function(dao)
  {
    this.dao = dao;
    
    this.build = function ()
    {
      return new BLL.CommentManager(this.dao);
    }
  }
}

