  var sfgate_articleKey  = new ArticleKey(sfgate_file);
  
  function sfgate_ArticleComments() {
//  historyManager(sfgate_title);
    var requestBatch = new RequestBatch();
    requestBatch.AddToRequest(new UpdateArticleAction(sfgate_articleKey, 'http://sfgate.com/cgi-bin/article/article?f='+sfgate_file, sfgate_title, new Section(sfgate_section), sfgate_categories));
    requestBatch.AddToRequest(sfgate_articleKey);
    requestBatch.BeginRequest(sfgate_serverUrl, sfgate_ShowArticleComments);
  }

  function sfgate_ShowArticleComments(responseBatch) {
    var sfgate_article = null;
    if(responseBatch.Responses.length && responseBatch.Responses[0].Article != null) {
      sfgate_article = responseBatch.Responses[0].Article;
    }
    var sfgate_comment_question = '';
    var sfgate_commentCnt = 0;
    if (sfgate_article != null) {
      var sfgate_commentCnt = sfgate_article.Comments.NumberOfComments
    }
    if (sfgate_commentCnt > 0) {
      sfgate_topCnt.innerHTML    = '('+sfgate_commentCnt+')';
      sfgate_bottomCnt.innerHTML = '('+sfgate_commentCnt+')';
      if (sfgate_custom_label) {
        sfgate_comment_question = sfgate_custom_label;
      } else {
        sfgate_comment_question = sfgate_comment_label2;
      }
      if (!sfgate_isActive) {
        sfgate_comment_question += sfgate_comment_append2;
      }
    } else {
      sfgate_topCnt.innerHTML    = '(0)';
      sfgate_bottomCnt.innerHTML = '(0)';
      if (sfgate_custom_label) { 
        sfgate_comment_question = sfgate_custom_label;
        if (sfgate_isActive) {
          sfgate_comment_question += sfgate_comment_append1;
        } else {
          sfgate_comment_question += sfgate_comment_append2;
        }
      } else {
        if (sfgate_isActive) {
          sfgate_comment_question = sfgate_comment_label1;
        } else {
          sfgate_comment_question = 'Comments are closed.';
        }
      }
    }
    sfgate_question.innerHTML = sfgate_comment_question;
    if (sfgate_isActive) { sfgate_addlink_elm.innerHTML  = sfgate_addlink; }
    sfgate_viewlink_elm.innerHTML = sfgate_viewlink;
  }

  function historyManager(t) {
//alert("alert from the historyManager");
  frames["hFrame"].location.href='/cgi-bin/article/comments/ajaxhistory?f='+f+'&t='+t;
}
function historyFunc(f) {
document.getElementByID('hFrame').innerHTML = "f";
}
