function showComments(){
  $('#comments_first').fadeOut("fast");
  $('#comments').slideDown("fast");
  return true;
}
function hideComments(){
  $('#comments').slideUp("fast");
  $('#comments_first').fadeIn("fast");
  return false;
}

if (Drupal.jsEnabled) {
  $(document).ready(function() {
	$('#comments div.box').css('display', 'none');
	$('#show_comments_lnk').click(function() {
	  if ($('#comments').css('display') == 'none') {
        return showComments();
	  } else {
        return hideComments();
      }
    });
    $('#add_comment_lnk').click(function() {
	  if ($('#comments').css('display') == 'none') {
        showComments();
        if ($('#comments div.box').css('display') == 'block') {
          $('#edit-comment').focus();
          return false;
        }
      }
      $('#comments div.box').slideToggle('slow', function() {
        if ($(this).css('display') == 'block') {
          $('#edit-comment').focus();
        }
      });
      return false;
    });
    $('#add_comment_lnk_btm').click(function() {
      if ($('#comments').css('display') == 'none') {
        showComments();
        if ($('#comments div.box').css('display') == 'block') {
          $('#edit-comment').focus();
          return false;
        }
      }
      $('#comments div.box').slideToggle('slow', function() {
        if ($(this).css('display') == 'block') {
          $('#edit-comment').focus();
        }
      });
      return false;
    });
  });
}