function AddComment(itemId, commentDivId, commentType)
{
    var commentText = JSONEncode(jQuery("#" + commentDivId).val());

    // validation for editing recipe folder name and description
    jQuery("#aspnetForm").validate().element("#" + commentDivId);
    jQuery("#" + commentDivId).rules(
                                            "add", {
                                            required: true,
                                            maxlength: 500,
                                            messages: {
                                            required: javascript71,
                                            maxlength: javascript65
                                            }
                                        });

    HighValueTask("", function()
    {
        var languageNodeId = (CheckLanguage().substring(0, 2) == 'en') ? 1 : 2;
                
        SendCommentEmail(itemId, commentText);

        if(jQuery("#aspnetForm").validate().element("#" + commentDivId))
        {
          var dataString = '{"itemId":"' + itemId + '", "recipeComment":"' + commentText + '"}';
                    
          CallServiceMethod("/services/UserComments.asmx/AddRecipeComment", dataString,
			function(msg)
			{
				if (commentType == 'recipe')
				{
				  //recipe
				  AddMilestone('M19', 'User successfully added a recipe comment.' + commentText);
				  RefreshRecipeCommentsSection('' + itemId + '');
				  try {
				    gaTrack('submitCommentRecipe');
				  } catch (err) { }				                        
				}
				else if (commentType == 'article')
				{
				  //article
				  AddMilestone('M21', 'User successfully added an article comment.' + commentText);
				  RefreshArticleCommentsSection('' + itemId + '');
				  try {
				    gaTrack('submitCommentTipAndIdea');
				  } catch (err) { }
				}
				else if (commentType == 'blog') {
				  //article
				  AddMilestone('M87', 'User successfully added an blog comment.' + commentText);
				  RefreshBlogCommentsSection();
				  try {
				       gaTrack('submitCommentBlog');
				      } catch (err) { }
				}
				else if (commentType == 'video')
				{
				  //video
				  //AddMilestone('M21', 'User successfully added an article comment.' + commentText);
				  RefreshVideoCommentsSection('' + itemId + '');
//				  try
//				  {
//				  gaTrack('submitCommentTipAndIdea');
//				  } catch (err) { }
				}				                    
				jQuery("#" + commentDivId).val('')
				//RefreshCommentsSection(itemId);
			},
			function(xhr, status, error)
			{
				var err = xhr.responseText;
				document.write(err);
			});
	    }                      
    });
    
    // remove the validation rules so they don't conflict with profile
    jQuery("#" + commentDivId).rules("remove");
}
