function toggleFormVisible(  )
{
  obj = $('microCommentBox');
  if ( obj.className == 'hidden' )
    obj.className='';
  else
    obj.className='hidden'; 
}
function postComments ( )
{
  //$('cmtError').update("&nbsp;");

  form  = $('frmVideoComments');
  inputVisitorName    = form['txtVisitorName'];
  inputTitle          = form['txtTitle'];
  inputVisitorComment = form['txtVisitorComment'];

  var strVisitorName = $(inputVisitorName).getValue(); 
  var strTitle       = $(inputTitle).getValue();
  var strComments    = $(inputVisitorComment).getValue();

  if ( strVisitorName.length < 3 ) {
    $('cmtError').update("Name is required");
    inputVisitorName.addClassName("error");
    return;
  }

  if ( strTitle.length < 4 ) {
    $('cmtError').update("Please Enter a Title / Subject of your comment");
    inputTitle.addClassName("error");
    return;
  }

  if ( strComments.length < 10 ) {
    $('cmtError').update("Please add some comments");
    inputVisitorComment.addClassName("error");
    return;
  }

   new Ajax.Request('/minicom.php',
   {     method:'post',
         parameters: {txtContentId: 1, txtContentType: 11, txtVisitorName: strVisitorName, txtCommentSubject: strTitle, txtCommentBody: strComments},
     onSuccess: function(transport) {
     var response = transport.responseText || "Error";
     toggleFormVisible();
     $('microCommentBoxReply').update(response);     },
     onFailure: function(){ alert('Something went wrong...') }
   });
}

