function valForm(){
	var errorExists = 0;
	var NameError = 0;
	var emailError = 0;
	var emailValidError = 0;
	var CommentsError = 0;
	
	document.all.errorHead.style.display='none';
	document.all.errorName.style.display='none';
	document.all.errorEmail.style.display='none';
	document.all.errorEmailInvalid.style.display='none';
	document.all.errorComments.style.display='none';
	
	if(document.form.Name.value==''){errorExists = 1; NameError = 1;}
	if(document.form.email.value==''){errorExists = 1; emailError = 1;}
	if(!validEmail(document.form.email.value)){errorExists = 1; emailValidError = 1;}
	if(document.form.Comments.value==''){errorExists = 1; CommentsError = 1;}
	
	if(errorExists==1){
		document.all.errorHead.style.display='block';
		if(NameError==1){document.all.errorName.style.display='block';}
		if(emailError==1){
			document.all.errorEmail.style.display='block';
		}
		else{
			if(emailValidError==1){document.all.errorEmailInvalid.style.display='block';}
		}
		if(CommentsError==1){document.all.errorComments.style.display='block';}
		return false;
	}
	else{
		return true;
	}
}

//Email validation added in conjunction with form validation 2/9/2005 - Linas Eitmanas
function validEmail(email){

	var invChar = " /:,;";							//Define Invalid Characters
	var atPos = email.indexOf("@",1)
	var atLast = email.lastIndexOf("@")
	var periodPos = email.lastIndexOf(".")
	
	//Look For Invalid Characters
	for(i=0; i<invChar.length; i++)
	{	var badChar = invChar.charAt(i)
		if(email.indexOf(badChar,0) > -1)
			{return false;}
	}
	
	if(atPos == -1){return false;}					//Check For Existence Of "@"
	if(atLast != atPos){return false;}				//Check For ONLY ONE "@"
	if(periodPos == -1){return false;}				//Check For Existence Of "."
	if(periodPos < atPos){return false;}			//Check For "." AFTER "@"
	if(periodPos+3 > email.length){return false;}	//Check For Minimum Of Two Characters AFTER "." 
	
	return true;
}

