<!--

function validate(form) {
	var msg="";
	if (!checkedbox(form.chkList)) msg += " * You must select an event. \n";
	if (!fnamevalid(form.txtFirstName)) msg += " * The First Name field is required. \n";
	if (!lnamevalid(form.txtLastName)) msg += " * The Last Name field is required. \n";
	if (!fieldvalid(form.txtTitle)) msg += " * The Title field is required. \n";
	if (!orgvalid(form.txtCompanyName)) msg += " * The Organization field is required. \n";
	if (!phonevalid(form.txtPhoneNumber)) msg += " * A valid phone number is required. \n";
	if (!checkEmail(form.txtEmail)) msg += " * A valid email address is required. \n";
	



	
	if (msg == "") {
		return true;
	} else {
		alert("Please correct the following issues:\n\n" + msg);
		return false;
	}
}

function validEmail(form) {
	var msg="";
	if (!checkEmail(form.email)) msg += "A valid email address is required. \n";
	
	if (msg == "") {
		return true;
	} else {
		alert(msg);
		return false;
	}
}
   
   function fieldvalid(fieldname) {
		if (fieldname.value.length != 0) return true;
		return false;
	}
   
	function fnamevalid(txtFirstName) {
		if (txtFirstName.value.length != 0) return true;
		return false;
	}
	
	function lnamevalid(txtLastName) {
		if (txtLastName.value.length != 0) return true;
		return false;
	}
	
	function orgvalid(txtCompanyName) {
		if (txtCompanyName.value.length != 0) return true;
		return false;
	}
	
	function titlevalid(txtTitle) {
		if (txtTitle.value.length != 0) return true;
		return false;
	}
	//This script and many more are available free online at The JavaScript Source!! http://javascript.internet.com
	function checkEmail(txtEmail) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txtEmail.value)){
	return (true)
	}
	//alert("Invalid E-mail Address! Please re-enter.")
	return (false)
	}
	
	


function phonevalid(txtPhoneNumber) {
	
	valid = CheckPhoneNumber(txtPhoneNumber.value)
	if (!valid) {
	return false;
	}
	return true;
	}

	
	
		
	
function CheckPhoneNumber(txtPhoneNumber) {
	var valid = 1
	var GoodChars = "0123456789()-+ "
	var i = 0
	if (txtPhoneNumber=="") {
		// Return false if number is empty
		valid = 0
	}
	for (i =0; i <= txtPhoneNumber.length -1; i++) {
		if (GoodChars.indexOf(txtPhoneNumber.charAt(i)) == -1) {
// Note: Remove the comments from the following line to see this
// for loop in action.
// alert(txtPhoneNumber.charAt(i) + " is no good.")
			valid = 0
		} // End if statement
	} // End for loop
	if (txtPhoneNumber.length < 10) {
		// Return false if less than ten characters
		valid = 0
	}
	return valid
}

	
	
	function faxvalid1(txtFax) {
		if (txtFax.value.length != 0) return true;
		return false;
	}
	
	function faxvalid2(txtPreferredDelivery) {
		Delivery = txtPreferredDelivery.selectedIndex
		if (txtPreferredDelivery.options[Delivery].value != "F") return true;
		return false;
	}

	function checkedbox(chkList){
		var checkSelected = false;
		
		for (i = 0;  i < chkList.length;  i++)
		{
		if (chkList[i].checked)
		checkSelected = true;
		}
		if (!checkSelected) return (false);
		return true;
}


//-->



