	
	// email validation
	function validEmail(email) {
		invalidChars = ' !#$%^&*(){}[]+=~`?/:;,"'

		
		if (email == "") {
			return false;
		}
		for (i=0; i<invalidChars.length; i++) { //does it contain any invalid characters?
			badChar = invalidChars.charAt(i);
			if (email.indexOf(badChar,0) > -1) {
				return false;
			}
		}
		atPos = email.indexOf("@",1)  		//there must be one "@" symbol
			if (atPos == -1) {
			return false;
		}
		if (email.indexOf("@",atPos+1) != -1) { //and only one "@"
			return false;
		}
		periodPos = email.indexOf(".",atPos+1)  //and at least one "." after the "@"
			if (periodPos == -1) {
			return false;
		}
		if (email.charAt(atPos+1) == ".") {	//is there a "." right after the "@"
			return false;
		}
		if (periodPos+3 > email.length) {  	//must be at least 2 characters after the "."
			return false;
		}
		return true;
	}
	
	// form validation for contact form
	function submitContact(form) {
		sendChoice = form.direct.selectedIndex;
		if (form.direct.options[sendChoice].value == "") {
			alert("A 'Direct to?' selection is required.");
			form.direct.focus();
			return false;
		}
		
		// calls validEmail function
		if (!validEmail(form.email.value)) {
			alert("A valid E-mail Address is required.");
			form.email.focus();
			form.email.select();
			return false;
		}
							
	//if we made it to here, everything's valid, so return true
	return true
	}
	
	// form validation for email submit
	function submitEmail(form) {
		if ((form.name.value == "") || (form.name.value == "Name")) {
			alert("A Name is required.");
			form.name.focus();
			form.name.select();
			return false;
		}
		
		// calls validEmail function
		if (!validEmail(form.email.value) || (form.email.value == "Email")) {
			alert("A valid E-mail Address is required.");
			form.email.focus();
			form.email.select();
			return false;
		}
							
	//if we made it to here, everything's valid, so return true
	return true
	}
	// form function for ticket outlets
	function findoutlet()
	{
		 if (document.tickets.outlet.value.toLowerCase() == "type in an outlet")
		{
			var newname = '';
			parent.location = 'engine.cfm?i=3&state='+document.tickets.state.value+'&city='+document.tickets.city.value+'&outlet='+newname;
		}
		else
		{
		parent.location = 'engine.cfm?i=3&state='+document.tickets.state.value+'&city='+document.tickets.city.value+'&outlet='+document.tickets.outlet.value;
		}
	}
	/* Ticket Outlets Keyword */
	function ClearKeyword(textbox) 
	{
  		if (textbox.value == 'Type in an Outlet') { textbox.value='';}
	}

	function FillKeyword(textbox) 
	{
  		if (textbox.value == '') { textbox.value='Type in an Outlet';}
	}
	/* do not allow the person to hit enter in the bible search form */
	function handleEnter (field, event) 
	{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13) 
	{
		findoutlet();
	} 
	else
	return true;
}



// contact us page js



// email validation
	function validEmail2(emails) {
		invalidChars = ' !#$%^&*(){}[]+=~`?/:;,"'

		
		if (emails == "") {
			return false;
		}
		for (i=0; i<invalidChars.length; i++) { //does it contain any invalid characters?
			badChar = invalidChars.charAt(i);
			if (emails.indexOf(badChar,0) > -1) {
				return false;
			}
		}
		atPos = emails.indexOf("@",1)  		//there must be one "@" symbol
			if (atPos == -1) {
			return false;
		}
		if (emails.indexOf("@",atPos+1) != -1) { //and only one "@"
			return false;
		}
		periodPos = emails.indexOf(".",atPos+1)  //and at least one "." after the "@"
			if (periodPos == -1) {
			return false;
		}
		if (emails.charAt(atPos+1) == ".") {	//is there a "." right after the "@"
			return false;
		}
		if (periodPos+3 > emails.length) {  	//must be at least 2 characters after the "."
			return false;
		}
		return true;
	}
	
	// form validation for contact form
	function submitContact2(form) {
		sendChoice = form.direct.selectedIndex;
		if (form.direct.options[sendChoice].value == "") {
			alert("A 'Direct to?' selection is required.");
			form.direct.focus();
			return false;
		}
		
		// calls validEmail function
		if (!validEmail2(form.emails.value)) {
			alert("A valid E-mail Address is required.");
			form.emails.focus();
			form.emails.select();
			return false;
		}
							
	//if we made it to here, everything's valid, so return true
	return true
	}