// Author M. Suresh
// Copyright©  2008 - www.yoursuresh.info

function submitContactForm() {

var bachelorparty = document.contactform.bachelorparty.checked; // Bachelor party
var wedding = document.contactform.wedding.checked; // Bachelor party
var reception = document.contactform.reception.checked; // Bachelor party
var firstname = document.contactform.firstname.value; // First name Text box is assigned
var lastname = document.contactform.lastname.value; // First name Text box is assigned
//var email = document.contactform.email.value; // First name Text box is assigned
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.contactform.email.value;


	if (bachelorparty == 0 && wedding == 0 && reception == 0) {
		alert ('Please select a event');
	} else if (firstname == "") { // if Firname text box ix empty 
		alert ('Please enter your First Name');
		document.contactform.firstname.focus();
	} else if (lastname == "") {
		alert ('Please enter your Last Name');
		document.contactform.lastname.focus();
	} else if (reg.test(address) == false) {
		alert ('Please enter a valid E-mail address');
		document.contactform.email.focus();
	} else {
		document.contactform.submit();
	}
}

