	function setup_email() {
		var e_add = "arowin@gmail.com";
		var subj = "Ticket order for the Cold Duck";
		var e_body = "Email address: " + document.getElementById("email").value;
		e_body += " - Name: " + document.getElementById("name").value;
		e_body += " - Address: " + document.getElementById("address").value;
		e_body += " - # tickets: " + document.getElementById("tickets").value;
		window.location = "mailto:" + e_add + "?subject=" + subj + "&body=" + e_body;
	}
	
	function sendMail() {
		//First, lets check to make sure everything has been enterred...
		if (!isValidEmail(document.getElementById("email").value)) {
			alert("Invalid email address.");
			document.getElementById("email").focus();
		} else if (document.getElementById("name").value == "") {
			alert("Please enter your name.");
		} else if (document.getElementById("address").value == "") {
			alert("Please enter your address so we know where to send the tickets.");
		} else if (document.getElementById("tickets").value == "") {
			alert("Please enter the number of tickets you want.");
		} else if (!parseInt(document.getElementById("tickets").value)) {
			alert("Please enter a number value for the number of tickets you want.");
		} else {
			setup_email();
		}
	}
	
	function isValidEmail(str) {
		var at = "@";
		var dot = ".";
		var lat = str.indexOf(at);
		var lstr = str.length;
		var ldot = str.indexOf(dot);
		if (str.indexOf(at) == -1)
		   return false;
		if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr)
		   return false;
		if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr)
		    return false;
		 if (str.indexOf(at, (lat + 1)) != -1)
		    return false;
		 if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot)
		    return false;
		 if (str.indexOf(dot, (lat + 2)) == -1)
		    return false;
		 if (str.indexOf(" ") != -1)
		    return false;
 		 return true;			
	}
