function ChangeAction(ival)
{
return emailValid(ival);
}

function isValidEmail(emailAddress) {
    var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    return re.test(emailAddress);
}


function emailValid(ival) {
  var oktoproceed = true; 
  var errortext = '';  
     {
	if (isValidEmail(document.checkoutform.email.value)){
	} else {
	errortext=errortext+'You must enter a valid Email Address.\n';
	oktoproceed=false;
	}
    }

    if (document.checkoutform.email.value!=document.checkoutform.confirmemail.value) {
	errortext=errortext+'Please check your email address. The \'confirm\' email address does not match your actual email address.\n';
	oktoproceed=false;
	}

  	
    if (errortext!='') {
	alert(errortext);
	}
    return oktoproceed;
}
