﻿function checkFields()
{
	if(document.getElementById('source').selectedIndex == 0)
		{
		alert("Please indicate how you found out about Maxwell");
		
		document.getElementById('source').focus();
		return(false);
		}
	if(document.getElementById('first_name').value == "")
		{
		alert("Please enter your First Name");
		 
		document.getElementById('first_name').focus();
		return(false);
		}
	if(document.getElementById('last_name').value == "")
		{
		alert("Please enter your Last Name");
		 
		document.getElementById('last_name').focus();
		return(false);
		}
	if(document.getElementById('institution0').value == "")
		{
		alert("Please enter your Institution");
		 
		document.getElementById('institution0').focus();
		return(false);
		}
	if(document.getElementById('country0').value == "")
		{
		alert("Please enter your Country");
		 
		document.getElementById('country0').focus();
		return(false);
		}
	if(document.getElementById('phone0').value == "")
		{
		alert("Please enter your Telephone");
		 
		document.getElementById('phone0').focus();
		return(false);
		}
	if(document.getElementById('email').value == "")
		{
		alert("Please enter your Email address");
		 
		document.getElementById('email').focus();
		return(false);
		}
		
if (!document.maxwellform.permission.checked)
	{
	alert("Please acknowledge that you give Promega or an authorized Promega distributor permission to contact you at the addresses that you provide.");
	document.maxwellform.permission.focus();
	return(false);
	}
	
// see alpha/0_webprod/regexp/
var reg = new RegExp("^([a-zA-Z0-9-._]+)@([a-zA-Z0-9-._]+.)[a-zA-Z]{2,4}$");
	if (!reg.test(document.maxwellform.email.value) && !document.maxwellform.email.value=="")
	{
	document.maxwellform.email.focus();
	if (confirm("This email does not appear to be correct --> " + document.maxwellform.email.value + ".  To change the address, select OK.  If you are certain it is correct, select CANCEL."))
		{
		return(false);
		}
	return(true);
	}
}	
