  $(document).ready(function () 
    {
      $(".submit-comment-post").bind('click', validate);
    });

  function checkEmail(val)
  {
    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    return filter.test(val);
  }

  function checkUrl(val)
  {
    var filter=/((http|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+\.[^#?\s]+)(#[\w\-]+)?/;
    return filter.test(val);
  }

  function validate()
  {
    var error = false;
    /*
    if (!checkEmail($('#id_email')[0].value))
    {
      error = true;
      if ($('#id_email').siblings('ul.errorlist').length == 0)
      {
        $('#id_email').before('<ul class=\"errorlist\"><li>Enter a valid e-mail address.</li></ul>');
      }
    }
    if (!($('#id_url')[0].value == '' || checkUrl($('#id_url')[0].value)))
    {
      error = false;
      if ($('#id_url').siblings('ul.errorlist').length == 0)
      {
        $('#id_url').before('<ul class=\"errorlist\"><li>Enter a valid URL.</li></ul>'); 
      }
    }
    */
    if (!error) //if no error procceed with the form submission
    {
      $(".submit-comment-post").parents("form")[0].submit()
    }
  }