emailFormat = false;
emailMatch = false;


function downloadSubmit()	{

// validate the form
// if all 3 fields are not empty (have been filled)....
if ((document.FreePosterForm.name.value != "") && (document.FreePosterForm.email.value != "")	 && (document.FreePosterForm.confirmEmail.value != "")	) {
				// make sure the email address is a correct email format....
				emailCheck(document.FreePosterForm.email.value);				
				
}

// if all 3 fields are not filled, check which ones are empty and alert user....
else {
		if (document.FreePosterForm.name.value == "")	{
			alert("Please enter your Name");
		}
		
		if (document.FreePosterForm.email.value == "")	{
			alert("Please enter your Email Address");
		}

		if (document.FreePosterForm.confirmEmail.value == "")	{
			alert("Please confirm your Email Address");
		}
}
}

<!-- Original:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function emailCheck(emailStr) {
// checks if the e-mail address is valid
var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
var matchArray = emailStr.match(emailPat);
if (matchArray == null) {
alert("Your email address seems incorrect.  Please check the format of your email address to make sure it is correct. Example: yourname@domain.com");
emailFormat = false;
// make sure the emails match...
//checkEmailMatch();
return false;
}

// make sure the IP address domain is valid
var IPArray = matchArray[2].match(/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/);
if (IPArray != null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!")
emailFormat = false;
// make sure the emails match...
//checkEmailMatch();
return false;
      }
   }
}

emailFormat = true;
// make sure the emails match...
checkEmailMatch();
return true;

}
//  End -->


function checkEmailMatch()	{
email = document.FreePosterForm.email.value;
emailConfirm = document.FreePosterForm.confirmEmail.value;

if (email != emailConfirm) {
						alert("Your Email Address and Email Confirmation do not match");
}

else {
		emailMatch = true;
		submitFreePosterForm();
}		
		
}



function submitFreePosterForm()	{
// if email addresses are okay, submit the form;
//alert('email format = ' + emailFormat);
//alert('email match = ' + emailMatch);
document.FreePosterForm.submit();

}


