
function checkEmail(emailStr)
{
	var re = /^(([^()<>@,;:\\\"".[\]\ ]+)|(\""[^\r\""]+\""))((\.[^()<>@,;:\\\"".[\]\ ]+)|(\.\""[^\r\""]+\""))*@((([a-zA-Z0-9\-]+\.)*([a-zA-Z0-9][a-zA-Z0-9\-]+)*[a-zA-Z0-9]+\.[a-zA-Z]{2,})|(\[(25[0-4]|2[0-4]\d|1\d{2}|[1-9]\d?)(\.(25[0-4]|2[0-4]\d|1\d{2}|[1-9]\d|\d)){2}(\.(25[0-4]|2[0-4]\d|1\d{2}|[1-9]\d?)))\])$/
	if (!re.test(emailStr)){
		//alert("Email address format is not valid.")
		
	}
	return re.test(emailStr);
}

function testInput()
{
	var NoBlanks = true
	if (document.inputForm.Email.value>"" && NoBlanks)
	{
		if(!checkEmail(document.inputForm.Email.value))
		{
			document.inputForm.Email.focus();
			NoBlanks = false;
		}else{
			if(document.inputForm.OldEmail.value>"" && document.inputForm.Email.value!=document.inputForm.OldEmail.value){
				if(confirm("You are changing your email address. This will remove your old email address from all previously subscribed lists and resubscribe you to the selected lists. Do you wish to do this ?")){
					document.inputForm.EmailChange.value = 1
				}else{
					document.inputForm.EmailChange.value = 0
				}
			}
		}
	}else{
		NoBlanks = false;
		alert("Please enter a valid Email address.")
		document.inputForm.Email.focus();
	}
	return NoBlanks
}