function checkCreateArticleForm(){

  var theMessage = "Please amend the following: \n----------------------------------------\n";
  var noErrors = theMessage;
  
  if (document.createArticleForm.title.value == "" || document.createArticleForm.title.value == null) 
  {
      theMessage = theMessage + "\n --> Title cannot be blank";
  }
  if (document.createArticleForm.author.value == "" || document.createArticleForm.author.value == null) 
  {
      theMessage = theMessage + "\n --> Your name cannot be blank";
  }
  if (document.createArticleForm.article.value == "" || document.createArticleForm.article.value == null) 
  {
      theMessage = theMessage + "\n --> Your article cannot be blank";
  }  
  
  if (theMessage == noErrors)
  {
      return true;
  }
  else
  {
      alert(theMessage);
      return false;
  }
}

function checkCreateCommentForm(){

  var theMessage = "Please amend the following: \n----------------------------------------\n";
  var noErrors = theMessage;
  var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
  
  if (document.createCommentForm.author.value == "" || document.createCommentForm.author.value == null) 
  {
      theMessage = theMessage + "\n --> Your name cannot be blank";
  }
  if (document.createCommentForm.comment.value == "" || document.createCommentForm.comment.value == null) 
  {
      theMessage = theMessage + "\n --> Your comment cannot be blank";
  }  
  if (document.createCommentForm.human.value == "" || document.createCommentForm.human.value == null) 
  {
      theMessage = theMessage + "\n --> Fill in the answer to the sum";
  }  
  if (document.createCommentForm.email.value == "" || document.createCommentForm.email.value == null) 
  {
      theMessage = theMessage + "\n --> Fill in your email address";
  }
  else
  {
    if(pattern.test(document.createCommentForm.email.value)){         
		//alert("true");   
    }else{   
      theMessage = theMessage + "\n --> Your email address is incorrect";
    }
  }
    
  if (theMessage == noErrors)
  {
      return true;
  }
  else
  {
      alert(theMessage);
      return false;
  }
}
