// JavaScript Document
$(document).ready(init);
 function init(){
   $("#commentform").submit(check_form);
 }
 
function check_form(){
  var erros=0;
  if($('#author').length==1){
    if(!($('#author').val()).length){
      erros++;
    }
  }
  if($('#email').length==1){
    if(!($('#email').val()).length){
      erros++;
    }
  }
  if(!($('#comment').val()).length){
    erros++;
  }
  if(erros){
    alert("todos os campos são obrigatórios!");
    return(false);
  }else{
    return(true);
  }
}
