function chkEmail(source, arg) {
	// var emailreg = /^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$/;
    var emailreg = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; 
	var regex = new RegExp(emailreg);
	email = ValidatorGetVal(source.controltovalidate);
	email = email.replace( /^\s+/g, "" );// strip leading
	email = email.replace( /\s+$/g, "" );// strip trailing
	if(regex.test(email)) {
		arg.IsValid = true;
	}
	else {
		arg.IsValid = false;
	}
}
	
function ValidatorGetVal(id) {
	var control;
	control = document.getElementById(id);
	if (typeof(control.value) == "string") {
		return control.value;
	}
	if (typeof(control.tagName) == "undefined" && typeof(control.length) == "number") {
		var j;
		for (j=0; j < control.length; j++) {
			var inner = control[j];
		    if (typeof(inner.value) == "string" && (inner.type != "radio" || inner.status == true)) {
				return inner.value;
		    }
		}
	}
	return "";
}
		
