function validateComment()
{
	var error='';
	if(!document.addComment['tx_ednewscomments_pi1[comment]'].value)
		error='Please add a comment';
	if(!document.addComment['tx_ednewscomments_pi1[email]'].value)
		error='Please add an email';
	else
		if(!isValidEmail(document.addComment['tx_ednewscomments_pi1[email]'].value))
			error='This email is not a valid email address';
	if(!document.addComment['tx_ednewscomments_pi1[name]'].value)
		error='Please add a name';
	
	
	if(error)
		alert(error);
	else
		document.addComment.submit();
}


function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      return false;
    } 
    return true; 
}