<!--

function getObj(id) {
    if (document.getElementById) { // DOM-compliant browsers (MSIE5, NSN6, O5)
        return document.getElementById(id);
    } else if (document.all) { // MSIE4
        return document.all[id];
    } else if (document.layers) { // NSN4
        return document.layers[id];
    } else { // Trap DHTML-impaired browsers
        return false;
    }
}

function isEmail(who) {
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}

function ValidateEmail1(){

	var msgStr,isValid,checkEmail1;

	msgStr = "";
	isValid = true;
	checkEmail1 = getObj('Email1').value;

	if (checkEmail1.length < 1){
		alert("Please enter your email address.");
		return false;
	}

	if (checkEmail1.length > 0){
		if(!isEmail(checkEmail1)){
			alert("Please enter a valid email address.");
			return false;
		}
	}
	
}

function ValidateEmail2(){

	var msgStr,isValid,checkEmail2;

	msgStr = "";
	isValid = true;
	checkEmail2 = getObj('Email2').value;

	if (checkEmail2.length < 1){
		alert("Please enter your email address.");
		return false;
	}

	if (checkEmail2.length > 0){
		if(!isEmail(checkEmail2)){
			alert("Please enter a valid email address.");
			return false;
		}
	}

}
//-->
