// JavaScript Document

//--------------------------------
// This code compares two fields in a form and submit it
// if they're the same, or not if they're different.
//--------------------------------
function checkEmail(theForm) {
 if ((theForm.email.value != theForm.emailconfirm.value) && ( theForm.officialrules.checked == false ))
 	{
 	alert('The emails don\'t match!\n\nAlso, please confirm you are a resident of the U.S. and have read and agreed to the Official Rules');
 	return false;
 	} 
 else if ((theForm.email.value == theForm.emailconfirm.value) && ( theForm.officialrules.checked == false ))
 	{
	alert("Please confirm you are a resident of the U.S. and have read and agreed to the Official Rules");
 	return false;
 	}
 else if ((theForm.email.value != theForm.emailconfirm.value) && ( theForm.officialrules.checked == true ))
 	{
	alert("The emails don\'t match!");
 	return false;
 	}
 else
	{
    return true;
	}

return true;
}


