function postcomment(theform)
{
  if ( $F('commenttext')=='')
  {
    alert("Please enter a comment.");
    return false;
  }
  
  var data = $(theform).serialize(true);
  
  new Ajax.Request('/ajax/addcomment', 
  {
    parameters: data,
    onSuccess: function(transport) 
    {
      if (! debugErrors(transport.responseText))
      {
        location.reload();
      }
    },
    onFailure: function(transport)
    {
      alert("error");
    }
    
  });

  return false;
}

function showcommentform()
{
  $('addcommentbutton').hide();
  $('addcomment').show();
  $('addcomment').scrollTo();
  Form.Element.activate('commentor');
  return false;
}

function hidecommentform()
{
  $('addcomment').hide();
  $('addcommentbutton').show();
  return false;
}

function reader()
{
  new Ajax.Request('/counter.php', 
  {
    parameters: {url: document.location},
    onSuccess: function(transport) 
    {
    }
  });
}

