/*the base image directory location*/
var base = "/images/";

/*********
pop up a new window
*********/
function openWindow(url,x,y,toolbar,scrollbars,resizable)
{
	new_x=x+20;
	new_y=y+20;
	var options = "toolbar=" + toolbar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",width=" + new_x + ",height=" + new_y;
	newWindow=window.open(url,"WinOpen",options);
}

/*********
switch an image with an ID
*********/
function switchImage(thisId,thisImageSlice)
{
	//is the text "_off" inside this btn?
	if (document.getElementById(thisId).src.indexOf('_off.') < 0)
	{
		thisImg=base+thisImageSlice+thisId+'_off.gif';
	}
	else
	{
		thisImg=base+thisImageSlice+thisId+'_on.gif';
	}
	//set the image
	document.getElementById(thisId).src=thisImg;
}

/*********
expand code for both browsers
*********/
function expandIt(whichEl){
	var browser=navigator.userAgent.toLowerCase();
	var pos=browser.indexOf("gecko");
	var myElement = document.getElementById(whichEl);
	//do for Gecko Browsers
	if (pos>=0) {
		if (myElement.style.visibility == 'visible') {
			myElement.style.visibility = 'hidden';
			myElement.style.position = 'absolute';
			}
		else {
			myElement.style.position = 'relative';
			myElement.style.visibility = 'visible';
			}
	//do for IE
	} else {
		myElement.style.display = (myElement.style.display == "none" ) ? "" : "none";
	}
}

/*********
toggle the text inside a form on/off
*********/
function toggleFormText(thisId, thisText)
{
	//alert(document.getElementById(thisId).value + ',' + thisText);
	if (document.getElementById(thisId).value == thisText)
	{
		document.getElementById(thisId).value='';
	}
	else if (document.getElementById(thisId).value == '')
	{
		document.getElementById(thisId).value=thisText;
	}
}

/*********
validates an email address
*********/
function validateEmail(thisEmail)
{
	//initiate returnMessage variable
	var returnMessage="";

	if(thisEmail == '')
	{
		// alert the user
		returnMessage = "Please type in a valid email address.";
	}
	else
	{
		// function to check email address vilidity
		function emailCheck(emailStr)
		{
			/* The following pattern is used to check if the entered e-mail address
			   fits the user@domain format.  It also is used to separate the username
			   from the domain. */
			var emailPat=/^(.+)@(.+)$/
			/* The following string represents the pattern for matching all special
			   characters.  We don't want to allow special characters in the address.
			   These characters include ( ) < > @ , ; : \ " . [ ]    */
			var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
			/* The following string represents the range of characters allowed in a
			   username or domainname.  It really states which chars aren't allowed. */
			var validChars="\[^\\s" + specialChars + "\]"
			/* The following pattern applies if the "user" is a quoted string (in
			   which case, there are no rules about which characters are allowed
			   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
			   is a legal e-mail address. */
			var quotedUser="(\"[^\"]*\")"
			/* The following pattern applies for domains that are IP addresses,
			   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
			   e-mail address. NOTE: The square brackets are required. */
			var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
			/* The following string represents an atom (basically a series of
			   non-special characters.) */
			var atom=validChars + '+'
			/* The following string represents one word in the typical username.
			   For example, in john.doe@somewhere.com, john and doe are words.
			   Basically, a word is either an atom or quoted string. */
			var word="(" + atom + "|" + quotedUser + ")"
			// The following pattern describes the structure of the user
			var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
			/* The following pattern describes the structure of a normal symbolic
			   domain, as opposed to ipDomainPat, shown above. */
			var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


			/* Finally, let's start trying to figure out if the supplied address is
			   valid. */

			/* Begin with the coarse pattern to simply break up user@domain into
			   different pieces that are easy to analyze. */
			var matchArray=emailStr.match(emailPat);
			//alert(emailStr);
			var checkMatch='-' + matchArray + '-';
			if (checkMatch == "-null-")
			{
			  /* Too many/few @'s or something; basically, this address doesn't
				 even fit the general mould of a valid e-mail address. */
				returnMessage = "The email address seems incorrect (check @ and .'s).";
			}
			else
			{
				var user=matchArray[1];
				var domain=matchArray[2];

				// See if "user" is valid
				if (user.match(userPat)==null)
				{
					// user is not valid
					returnMessage = "The email's username doesn't seem to be valid (before the @).";
				}

				/* if the e-mail address is at an IP address (as opposed to a symbolic
				   host name) make sure the IP address is valid. */
				var IPArray=domain.match(ipDomainPat)
				if (IPArray!=null) {
					// this is an IP address
					  for (var i=1;i<=4;i++) {
						if (IPArray[i]>255) {
							returnMessage = "The email's destination IP address is invalid.";
						}
					}
				}

				// Domain is symbolic name
				var domainArray=domain.match(domainPat)
				if (domainArray==null) {
					returnMessage = "The email's domain name doesn't seem to be valid (after the @).";
				}

				/* domain name seems valid, but now make sure that it ends in a
				   three-letter word (like com, edu, gov) or a two-letter word,
				   representing country (uk, nl), and that there's a hostname preceding
				   the domain or country. */

				/* Now we need to break up the domain to get a count of how many atoms
				   it consists of. */
				var atomPat=new RegExp(atom,"g")
				var domArr=domain.match(atomPat)
				var len=domArr.length
				if (domArr[domArr.length-1].length<2 ||
					domArr[domArr.length-1].length>4) {
				   // the address must end in a two letter or three letter word.
				   returnMessage = "The email must end in a four-letter domain, three-letter domain, or two letter country.";
				}

				// Make sure there's a host name preceding the domain.
				if (len < 2) {
				   returnMessage="This email is missing a hostname!";
				}
			}
		}
		// call the validation function and return its result
		val=emailCheck(thisEmail);
		// if it returns val=no_submit, stop form
	}
	return returnMessage;
}

/************
verify Contact Form
************/
function verifyContactForm()
{
	//form variables
	submitBtnMessage='Saving... Please Wait';
	formName='formContact';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//check name
	if (submitForm)
	{
		formElement="name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement="email_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}
	//check comment
	if (submitForm)
	{
		formElement="comments";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in a comment.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Newsletter
************/
function verifyNewsletterSubscribe(checkboxCount)
{
	//form variables
	submitBtnMessage='Saving... Please Wait';
	formName='formNewsletterSubscribe';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//check name_first
	if (submitForm)
	{
		formElement="name_first";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your first name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check name
	if (submitForm)
	{
		formElement="name_last";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your last name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement="email_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check for newsletter category checked
	if (submitForm)
	{
		newsletterSelected=false;
		formElement="newsletter_categories";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// loop thru all the checkboxes in the page
		for (var i=1; i <= checkboxCount; i++)
		{
			if (document.getElementById('checkbox' + i).checked)
			{
				newsletterSelected=true;
			}
		}
		// no newsletter selected, don't submit the form
		if (!newsletterSelected)
		{
			warningMessage="Please select a newsletter to subscribe to.";
			submitForm=false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Send to a Friend
************/
function verifySendToAFriend()
{
	//form variables
	submitBtnMessage='Sending... Please Wait';
	formName='formSendToAFriend';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";
	toEmailFound=false;

	//check friends_emails
	if (submitForm)
	{
		formElement="to_email_1";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in an email address.';
			formFocus=formElement;
			submitForm=false;
		}
		// verify correctly formed email
		else
		{
			// set variable so next function knows a to_email has been found
			toEmailFound=true;
			//check the email address
			thisMessage=validateEmail(thisDOM.value);
			//if there is no message sent back, set the alert.
			if (thisMessage.length != 0)
			{
				warningMessage=thisMessage;
				formFocus=formElement;
				submitForm=false;
				toEmailFound=true;
			}
		}
	}

	//check the second email
	if (!toEmailFound)
	{
		formElement="to_email_2";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in an email address.';
			formFocus="to_email_1";
			submitForm=false;
		}
		// verify correctly formed email
		else
		{
			// set variable so next function knows a to_email has been found
			toEmailFound=true;
			//check the email address
			thisMessage=validateEmail(thisDOM.value);
			//if there is no message sent back, set the alert.
			if (thisMessage.length != 0)
			{
				warningMessage=thisMessage;
				formFocus=formElement;
				submitForm=false;
			}
		}
	}

	//check the third email
	if (!toEmailFound)
	{
		formElement="to_email_3";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in an email address.';
			formFocus="to_email_1";
			submitForm=false;
		}
		// verify correctly formed email
		else
		{
			//check the email address
			thisMessage=validateEmail(thisDOM.value);
			//if there is no message sent back, set the alert.
			if (thisMessage.length != 0)
			{
				warningMessage=thisMessage;
				formFocus=formElement;
				submitForm=false;
			}
		}
	}

	//check from name
	if (submitForm)
	{
		formElement="from_name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement="from_email";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Wholesale Form
************/
function verifyWholesaleForm()
{
	//form variables
	submitBtnMessage='Submitting Request... Please Wait';
	formName='formWholesale';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//check the title
	if (submitForm)
	{
		formElement="name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your company name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement="email_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//phone
	if (submitForm)
	{
		formElement="phone";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your phone number.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//address
	if (submitForm)
	{
		formElement="address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your address.';
			formFocus=formElement;
			submitForm=false;
		}
	}
	//city
	if (submitForm)
	{
		formElement="city";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your city.';
			formFocus=formElement;
			submitForm=false;
		}
	}
	//state
	if (submitForm)
	{
		formElement="state";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your state.';
			formFocus=formElement;
			submitForm=false;
		}
	}
	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
set the same shipping address
************/
function setSameShippingAddress()
{
	// nameFirst
	document.getElementById('shippingNameFirst').value=document.getElementById('cardNameFirst').value;
	// nameLast
	document.getElementById('shippingNameLast').value=document.getElementById('cardNameLast').value;
	// address
	document.getElementById('shipAddress').value=document.getElementById('billAddress').value;
	// city
	document.getElementById('shipCity').value=document.getElementById('billCity').value;
	// zip
	document.getElementById('shipZip').value=document.getElementById('billZip').value;
	// select the right state
	document.getElementById('shipState').selectedIndex=document.getElementById('billState').selectedIndex;
}

/************
calculate all the Totals
************/
function calculateTotal()
{
	taxAmount=0;
	if (document.getElementById('shipState').value == 'CA')
	{
		// calculate the tax
		taxAmount=(document.getElementById('chargeSubtotal').value * .0825).toFixed(2);
	}
	// set the tax form field
	document.getElementById('chargeTax').value=taxAmount;
	// show the tax
	document.getElementById('taxHTML').innerHTML=taxAmount;
	// get the subtotal
	subtotal=document.getElementById('chargeSubtotal').value;
	// get the shipping cost
	shipping=document.getElementById('chargeShipping').value;
	// set the total
	total=parseFloat(taxAmount) + parseFloat(subtotal) + parseFloat(shipping);
	// set the total field
	document.getElementById('chargeTotal').value=total;
	// show the total
	document.getElementById('totalHTML').innerHTML=total.toFixed(2);
}

/************
verify Checkout Form
************/
function verifyCheckoutForm()
{
	//form variables
	submitBtnMessage='Submitting Request... Please Wait';
	formName='formCheckout';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//cardNameFirst
	if (submitForm)
	{
		formElement="cardNameFirst";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in the first name on your credit card.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//cardNameLast
	if (submitForm)
	{
		formElement="cardNameLast";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in the last name on your credit card.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//cardNumber
	if (submitForm)
	{
		formElement="cardNumber";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your credit card number.';
			formFocus=formElement;
			submitForm=false;
		}
	}
	//cardVerificationNumber
	if (submitForm)
	{
		formElement="cardVerificationNumber";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your card verification number.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//expiration_month
	if (submitForm)
	{
		formElement="expiration_month";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please select the month your credit card expires.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//expiration_year
	if (submitForm)
	{
		formElement="expiration_year";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please select the year your credit card expires.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//billAddress
	if (submitForm)
	{
		formElement="billAddress";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your billing address.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//billCity
	if (submitForm)
	{
		formElement="billCity";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your billing city.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//billState
	if (submitForm)
	{
		formElement="billState";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please select your billing state.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//billZip
	if (submitForm)
	{
		formElement="billZip";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your billing zip.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//billPhone
	if (submitForm)
	{
		formElement="billPhone";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your billing phone number.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	// billEmail
	if (submitForm)
	{
		formElement="billEmail";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shippingNameFirst
	if (submitForm)
	{
		formElement="shippingNameFirst";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in the first name of the person receiving the shipment.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shippingNameLast
	if (submitForm)
	{
		formElement="shippingNameLast";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in the last name of the person receiving the shipment.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shipAddress
	if (submitForm)
	{
		formElement="shipAddress";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your shipping address.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shipCity
	if (submitForm)
	{
		formElement="shipCity";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your shipping city.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shipState
	if (submitForm)
	{
		formElement="shipState";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please select your shipping state.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//shipZip
	if (submitForm)
	{
		formElement="shipZip";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage='Please type in your shipping zip.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Event Registration
************/
function verifyEventRegistration()
{
	//form variables
	submitBtnMessage='Saving Registration Information';
	formName='formEventRegistration';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//quantity
	if (submitForm)
	{
		formElement="quantity";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value.search(/\D/) > -1)
		{
			warningMessage='Please type in a correct registration quantity number.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_registrants
	if (submitForm)
	{
		formElement="reg_registrants";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in the name of the registrant(s).';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_email
	if (submitForm)
	{
		formElement="reg_email";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_name
	if (submitForm)
	{
		formElement="reg_name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_phone
	if (submitForm)
	{
		formElement="reg_phone";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in a phone number we can contact you at.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_address
	if (submitForm)
	{
		formElement="reg_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your address.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_address
	if (submitForm)
	{
		formElement="reg_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your address.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_city
	if (submitForm)
	{
		formElement="reg_city";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please in your city.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_state
	if (submitForm)
	{
		formElement="reg_state";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your state\'s abbreviation (2 letters).';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//reg_zip
	if (submitForm)
	{
		formElement="reg_zip";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// do we find any non-digit character
		if (thisDOM.value == "")
		{
			warningMessage='Please type in your zip code.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
calculate event registration cost
************/
function calculateEventRegistration(quantity,price)
{
	document.getElementById('formEventRegistrationTotal').innerHTML='$ ' + (quantity * price);
}

// loop thru all links in the page, and disable them only if not media library
function disableAllLinks ()
{
	for (var i=0; i < document.links.length; i++)
	{
		document.links[i].onclick=function () { return false; };
		document.links[i].title="All links are disabled while previewing a document.";
	}
	return true;
}
// loop thru all forms in the page, and disable them
function disableAllFormElements ()
{
	for (var i=0; i < document.forms.length; i++)
	{
		for (var j=0; j < document.forms[i].length; j++)
		{
			document.forms[i].elements[j].disabled = true;
		}
		document.forms[i].onfocus = function () {return false; };
		document.forms[i].onclick = function () { return false; };
		document.forms[i].title="All forms are disabled while previewing a document.";
	}
	return true;
}


/*********
check the date of a value
*********/
function validateDate(thisDate)
{
	var thisAlert="";
	var dtFormat = 'MM/DD/YYYY';
	var udt = thisDate;
	if(udt.indexOf("/") == -1){
		thisAlert='The date entered is not valid. Please input a valid date in the format '+dtFormat+'.';
	}
	dt1 = udt.split("/")
	mm1 = (dt1[0]-0);
	dd1 = (dt1[1]-0);
	yy1 = (dt1[2]-0);
	if(isNaN(dd1) || isNaN(mm1) || isNaN(yy1)){
		thisAlert='The date entered is not valid. Please input a valid date in the format '+dtFormat+'.';
	}
	dt2 = new Date(mm1+'/'+dd1+'/'+yy1)
	dd2 = dt2.getDate();
	mm2 = dt2.getMonth()+1;
	yy2 = dt2.getFullYear();

	if(dd1==dd2 && mm1==mm2 && yy1==yy2)
	{
		thisAlert='';
	}
	else
	{
		thisAlert='The date entered is not valid. Please input a valid date in the format '+dtFormat+'. ';
	}

	return thisAlert;
}

/************
verify Coaching Report Info
************/
function verifyCoachingReportInfo()
{
	//form variables
	submitBtnMessage='Saving... Please Wait';
	formName='formReport'

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	//name
	if (submitForm)
	{
		formElement="name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in the sponsor\'s name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//email_address
	if (submitForm)
	{
		formElement="email_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check phone
	if (submitForm)
	{
		formElement="phone";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in the planter\'s daytime phone number.';
			formFocus=formElement;
			submitForm=false;
		}
	}


	//check planters name
	if (submitForm)
	{
		formElement="planters_name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in the planter\'s name.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check plant location
	if (submitForm)
	{
		formElement="plant_location";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please type in the plant location.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	//check district
	if (submitForm)
	{
		formElement="district";
		thisDOM=eval('document.' + formName + '.' + formElement);
		if (thisDOM.value == "")
		{
			warningMessage='Please select the district for this MAP Sponsor Report.';
			formFocus=formElement;
			submitForm=false;
		}
	}

	// check district

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Coaching Report
************/
function verifyCoachingReport(sectionName)
{
	//form variables
	submitBtnMessage='Saving... Please Wait';
	formName='formReport'

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	formDom=eval('document.' + formName);
	// all even numbers are checkboxes, so lets look through those
	/*for (var i = 0; i < 8; i++) {
		// if even, it's a checkbox
		if ((i % 2)==0) {
			// if it's not checked, set to false
			if ((!formDom.elements[i].checked) && (warningMessage.length==0) && (formDom.elements[i].name.length > 0)) {
				submitForm = false;
				warningMessage = "Please review and confirm each area by checking the checkbox.";
			}
		}
	}*/

	//loop through all textareas
	if (submitForm) {
		for (var i = 0; i < 8; i++) {
			// if even, it's a checkbox
			if ((i % 2)!=0) {
				// if it's not checked, set to false
				if ((formDom.elements[i].value == "") && (warningMessage.length == 0) && (formDom.elements[i].name.length > 0)) {
					submitForm = false;
					warningMessage = "Please comment in all the areas concerning the " + sectionName + ".";
				}
			}
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Church Planter Form
************/
function verifyChurchPlanterForm()
{
	//form variables
	submitBtnMessage = 'Sending... Please Wait';
	formName = 'formChurchPlanterApplication';

	//initialize submitForm value
	submitForm = true;
	warningMessage = "";
	formFocus = "";

	// District to Plant in
	if (submitForm)
	{
		formElement = "district_to_plant_in";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter which district you want to plant a church.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//check city
	if (submitForm)
	{
		formElement = "district_city";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a city';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//check state
	if (submitForm)
	{
		formElement = "district_state";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a state';
			formFocus = formElement;
			submitForm = false;
		}
	}

	/***********************************
	********** PERSONAL RECORD *********
	***********************************/
	// check name
	if (submitForm)
	{
		formElement = "pr_full_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your full name. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}
	// check name
	if (submitForm)
	{
		formElement = "pr_full_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your full name. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check date of birth
	if (submitForm)
	{
		formElement = "pr_dob";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter your date of birth. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check gender
	if (submitForm)
	{
		formElement = "pr_gender";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please select your sex. [Personal Record Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check phone number
	if (submitForm)
	{
		formElement = "pr_home_phone";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your home phone number. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check cell number
	if (submitForm)
	{
		formElement = "pr_cell_phone";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your cell phone number. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement = "pr_email_address";
		thisDOM = eval('document.' + formName + '.' + formElement);

		//check the email address
		thisMessage = validateEmail(thisDOM.value);

		//if there is no message sent back, set the alert.
		if (thisMessage.length !=  0)
		{
			warningMessage = thisMessage;
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check mail address
	if (submitForm)
	{
		formElement = "pr_mail_address";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your mail address. [Personal Record Section].';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check marital status
	if (submitForm)
	{
		formElement = "pr_marital_status";
		thisDOM = eval('document.' + formName + '.' + formElement);
		checked = false;

		// Loop through all radio buttons, if any button is checked, set the 'checked' variable to true
		for(i = 0; i < thisDOM.length; i++)
		{
			if(thisDOM[i].checked)
			{
				checked = true;
			}
		}

		// If no radio button is selectd
		if (checked == false)
		{
			warningMessage = 'Please select your marital status. [Personal Record Section].';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check marital history
	if (submitForm)
	{
		formElement = "pr_marital_history";
		thisDOM = eval('document.' + formName + '.' + formElement);
		checked = false;

		// Loop through all radio buttons, if any button is checked, set the 'checked' variable to true
		for(i = 0; i < thisDOM.length; i++)
		{
			if(thisDOM[i].checked)
			{
				checked = true;
			}
		}

		// If no radio button is selectd
		if (checked == false)
		{
			warningMessage = 'Please select your marital history. [Personal Record Section].';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check language
	if (submitForm)
	{
		formElement = "pr_language";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your native language. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check ethnicity
	if (submitForm)
	{
		formElement = "pr_ethnicity";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your ethnicity. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check does applicant hold a license
	if (submitForm)
	{
		formElement = "pr_hold_a_license";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please enter whether you hold a Foursquare License or not. [Personal Record Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check credential type
	if (submitForm)
	{
		formElement = "pr_credential_type";
		thisDOM = eval('document.' + formName + '.' + formElement);
		checked = false;

		// Loop through all radio buttons, if any button is checked, set the 'checked' variable to true
		for(i = 0; i < thisDOM.length; i++)
		{
			if(thisDOM[i].checked)
			{
				checked = true;
			}
		}

		// If no radio button is selectd
		if (checked == false)
		{
			warningMessage = 'Please select your credential type. [Personal Record Section].';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check date current license recieved
	/*if (submitForm)
	{
		formElement = "pr_date_int_lic_rec";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the date your Current Licence was received. [Personal Record Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check US citizen status
	if (submitForm)
	{
		formElement = "pr_us_citizen";
		thisDOM = eval('document.' + formName + '.' + formElement);
		checked = false;

		// Loop through all radio buttons, if any button is checked, set the 'checked' variable to true
		for(i = 0; i < thisDOM.length; i++)
		{
			if(thisDOM[i].checked)
			{
				checked = true;
			}
		}

		// If no radio button is selectd
		if (checked == false)
		{
			warningMessage = 'Please select whether you are a U.S. citizen. [Personal Record Section].';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	/**************************************
	********** SPOUSE INFORMATION *********
	**************************************/
	// check spouse's name
	if (submitForm)
	{
		formElement = "si_spouse_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your spouse\'s name. [Spouse Information Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check spouse's date of birth
	if (submitForm)
	{
		formElement = "si_dob";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter your spouse\'s date of birth. [Spouse Information Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check spouse's gender
	if (submitForm)
	{
		formElement = "si_gender";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please select the sex of your spouse. [Spouse Information Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check spouse's agreement
	if (submitForm)
	{
		formElement = "si_supportive";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please select whether or not your spouse is in agreement with your decision to plant a church. [Spouse Information Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check spouse's language
	if (submitForm)
	{
		formElement = "si_language";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your spouse\'s native language. [Spouse Information Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check spouse's ethnicity
	if (submitForm)
	{
		formElement = "si_ethnicity";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your spouse\'s ethnicity. [Spouse Information Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check whether spouse holds a foursquare license
	if (submitForm)
	{
		formElement = "si_hold_a_license";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please enter whether your spouse holds a Foursquare License. [Spouse Information Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check spouse's date international license recieved
	/*if (submitForm)
	{
		formElement = "si_date_int_lic_rec";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the date your spouse\'s International Licence was received. [Spouse Information Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check spouse's US citizen status
	if (submitForm)
	{
		formElement = "si_us_citizen";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please select whether your spouse is a U.S. citizen. [Spouse Information Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	/****************************
	********** MINISTRY *********
	****************************/
	// check ministry position
	if (submitForm)
	{
		formElement = "min_ministry_position";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your current ministry position. [Ministry Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check appointment date
	if (submitForm)
	{
		formElement = "min_appt_date";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your appointment date. [Ministry Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check full or part time radio buttons
	if (submitForm)
	{
		formElement = "min_part_or_full_time";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please select whether you are full or part time. [Ministry Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	// check hours per week
	if (submitForm)
	{
		formElement = "min_hours";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the amount of hours devoted weekly to your current ministry. [Ministry Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check responsibilities
	if (submitForm)
	{
		formElement = "min_responsibilities";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type your current responsibilities. [Ministry Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check financial support
	if (submitForm)
	{
		formElement = "min_financial_support";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type your monthly financial support. [Ministry Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check prior ministry experience 1
	if (submitForm)
	{
		var ministryArray1 = new Array(5);
		ministryArray1[0] = "min_prev_min_1_church";
		ministryArray1[1] = "min_prev_min_1_city_state";
		ministryArray1[2] = "min_prev_min_1_attendance";
		ministryArray1[3] = "min_prev_min_1_position";
		ministryArray1[4] = "min_prev_min_1_dates";

		for(i = 0; i < ministryArray1.length; i++)
		{
			formElement = ministryArray1[i];
			thisDOM = eval('document.' + formName + '.' + formElement);

			if (thisDOM.value.length == 0)
			{
				warningMessage = 'Please add your prior ministry information. [Ministry Section]';
				formFocus = formElement;
				submitForm = false;
			}
		}
	}

	/****************************
	********** EDUCATION ********
	****************************/
	// check education row 1
	if (submitForm)
	{
		var educationArray1 = new Array(4);
		educationArray1[0] = "edu_1_school";
		educationArray1[1] = "edu_1_grad_date";
		educationArray1[2] = "edu_1_no_of_years";
		educationArray1[3] = "edu_1_degree";

		for(i = 0; i < educationArray1.length; i++)
		{
			formElement = educationArray1[i];
			thisDOM = eval('document.' + formName + '.' + formElement);

			if (thisDOM.value.length == 0)
			{
				warningMessage = 'Please type in your educational background information. [Education Section]';
				formFocus = formElement;
				submitForm = false;
			}
		}
	}

	// check education row 2
	if (submitForm)
	{
		var educationArray2 = new Array(4);
		educationArray2[0] = "edu_2_school";
		educationArray2[1] = "edu_2_grad_date";
		educationArray2[2] = "edu_2_no_of_years";
		educationArray2[3] = "edu_2_degree";

		for(i = 0; i < educationArray2.length; i++)
		{
			formElement = educationArray2[i];
			thisDOM = eval('document.' + formName + '.' + formElement);

			if (thisDOM.value.length == 0)
			{
				warningMessage = 'Please type in your educational background information. [Education Section]';
				formFocus = formElement;
				submitForm = false;
			}
		}
	}

	/****************************
	********** REFERENCES *******
	****************************/
	// check education row 1
	if (submitForm)
	{
		var referencesArray1 = new Array(3);
		referencesArray1[0] = "ref_1_name";
		referencesArray1[1] = "ref_1_contact_number";
		referencesArray1[2] = "ref_1_email_address";

		for(i = 0; i < referencesArray1.length; i++)
		{
			formElement = referencesArray1[i];
			thisDOM = eval('document.' + formName + '.' + formElement);

			if (thisDOM.value.length == 0)
			{
				warningMessage = 'Please enter in at least 1 reference. [Reference Section]';
				formFocus = formElement;
				submitForm = false;
			}
		}
	}

	// check Reference row 2
	/*if (submitForm)
	{
		var referencesArray2 = new Array(3);
		referencesArray2[0] = "ref_2_name";
		referencesArray2[1] = "ref_2_contact_number";
		referencesArray2[2] = "ref_2_email_address";

		for(i = 0; i < referencesArray2.length; i++)
		{
			formElement = referencesArray2[i];
			thisDOM = eval('document.' + formName + '.' + formElement);

			if (thisDOM.value.length == 0)
			{
				warningMessage = 'Please type in at least 3 references. [Reference Section]';
				formFocus = formElement;
				submitForm = false;
			}
		}
	}*/

	/********************************************
	********** Personal Profile Question  *******
	*********************************************/
	// check question 1
	if (submitForm)
	{
		formElement = "ppq_question_1";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 1. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 2
	if (submitForm)
	{
		formElement = "ppq_question_2";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 2. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 3
	if (submitForm)
	{
		formElement = "ppq_question_3";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 3. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 4
	if (submitForm)
	{
		formElement = "ppq_question_4";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 4. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 5
	if (submitForm)
	{
		formElement = "ppq_question_5";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 5. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 6
	if (submitForm)
	{
		formElement = "ppq_question_6";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 6. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 7
	if (submitForm)
	{
		formElement = "ppq_question_7";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 7. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 8
	if (submitForm)
	{
		formElement = "ppq_question_8";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 8. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 9
	if (submitForm)
	{
		formElement = "ppq_question_9";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 9. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 10
	if (submitForm)
	{
		formElement = "ppq_question_10";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 10. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 11
	if (submitForm)
	{
		formElement = "ppq_question_11";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 11. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 12
	if (submitForm)
	{
		formElement = "ppq_question_12";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 12. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 13
	if (submitForm)
	{
		formElement = "ppq_question_13";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please answer question 13. [Personal Profile Question Section]';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 14 radio button
	if (submitForm)
	{
		formElement = "ppq_secular_job";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM[0].checked == false && thisDOM[1].checked == false)
		{
			warningMessage = 'Please answer question 14. [Personal Profile Question Section]';
			formFocus = formElement + '[0]';
			submitForm = false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM = eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
verify Pastoral Form
************/
function verifyPastoralForm()
{
	//form variables
	submitBtnMessage = 'Sending... Please Wait';
	formName = 'formPastoralRecommendation';

	//initialize submitForm value
	submitForm = true;
	warningMessage = "";
	formFocus = "";

	/***********************************
	******** CONTACT INFORMATION *******
	***********************************/
	// check name
	if (submitForm)
	{
		formElement = "ci_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your  name.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement = "ci_email_address";
		thisDOM = eval('document.' + formName + '.' + formElement);

		//check the email address
		thisMessage = validateEmail(thisDOM.value);

		//if there is no message sent back, set the alert.
		if (thisMessage.length !=  0)
		{
			warningMessage = thisMessage;
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check church
	if (submitForm)
	{
		formElement = "ci_church_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the name of your church.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check phone number
	if (submitForm)
	{
		formElement = "ci_phone";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your phone number.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check candidate
	if (submitForm)
	{
		formElement = "ci_candidate_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the name of the candidate. ';
			formFocus = formElement;
			submitForm = false;
		}
	}

	/***********************************
	********** PERSONAL RECORD *********
	************************************/

	// check question 1
	if (submitForm)
	{
		formElement = "pr_ques_1";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your answer to question 1.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 2
	if (submitForm)
	{
		formElement = "pr_ques_2";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your answer to question 2.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 3
	if (submitForm)
	{
		formElement = "pr_ques_3";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your answer to question 3.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 4
	if (submitForm)
	{
		formElement = "pr_ques_4";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your answer to question 4.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 5
	if (submitForm)
	{
		formElement = "pr_ques_5";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your answer to question 5.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	/***********************************************
	********** PERSONAL EVALUATION WORKSHEET *******
	************************************************/

	// check name
	if (submitForm)
	{
		formElement = "pew_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the evaluator\'s name.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//check the email
	if (submitForm)
	{
		formElement = "pew_email_address";
		thisDOM = eval('document.' + formName + '.' + formElement);

		//check the email address
		thisMessage = validateEmail(thisDOM.value);

		//if there is no message sent back, set the alert.
		if (thisMessage.length !=  0)
		{
			warningMessage = thisMessage;
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check relationship
	if (submitForm)
	{
		formElement = "pew_relationship";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your relationship to applicant.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check phone number
	if (submitForm)
	{
		formElement = "pew_phone";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in your phone number.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check candidate
	if (submitForm)
	{
		formElement = "pew_candidate_name";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in the name of the candidate. ';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 1 score
	/*if (submitForm)
	{
		formElement = "pew_ques_1_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #1.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 1
	if (submitForm)
	{
		formElement = "pew_ques_1";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #1.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 2 score
	/*if (submitForm)
	{
		formElement = "pew_ques_2_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #2.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 2
	if (submitForm)
	{
		formElement = "pew_ques_2";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #2.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 3 score
	/*if (submitForm)
	{
		formElement = "pew_ques_3_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #3.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 3
	if (submitForm)
	{
		formElement = "pew_ques_3";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #3.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 4 score
	/*if (submitForm)
	{
		formElement = "pew_ques_4_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #4.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 4
	if (submitForm)
	{
		formElement = "pew_ques_4";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #4.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 5 score
	/*if (submitForm)
	{
		formElement = "pew_ques_5_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #5.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 5
	if (submitForm)
	{
		formElement = "pew_ques_5";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #5.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 6 score
	/*if (submitForm)
	{
		formElement = "pew_ques_6_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #6.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 6
	if (submitForm)
	{
		formElement = "pew_ques_6";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #6.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 7 score
	/*if (submitForm)
	{
		formElement = "pew_ques_7_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #7.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 7
	if (submitForm)
	{
		formElement = "pew_ques_7";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #7.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 8 score
	/*if (submitForm)
	{
		formElement = "pew_ques_8_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #8.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 8
	if (submitForm)
	{
		formElement = "pew_ques_8";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #8.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 9 score
	/*if (submitForm)
	{
		formElement = "pew_ques_9_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #9.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 9
	if (submitForm)
	{
		formElement = "pew_ques_9";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #9.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 10 score
	/*if (submitForm)
	{
		formElement = "pew_ques_10_score";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please enter a score for evaluation #10.';
			formFocus = formElement;
			submitForm = false;
		}
	}*/

	// check question 10
	if (submitForm)
	{
		formElement = "pew_ques_10";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #10.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check question 11
	if (submitForm)
	{
		formElement = "pew_ques_11";
		thisDOM = eval('document.' + formName + '.' + formElement);

		if (thisDOM.value.length == 0)
		{
			warningMessage = 'Please type in an response for evaluation #11.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM = eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

/************
navigation popup for sites not in foursquare.org
************/
function navPopupChangeLinks(fromLeft,fromTop)
{
	for (var i=0; i < document.links.length; i++)
	{
		// don't change if link has /javascript: in it
		if (document.links[i].href.indexOf("javascript:") == -1)
		{
			// replace any ampersands in the url with the string "ampersand" so that it's correctly passed and parsed on the popup page (otherwise it wouldn't recognize the url variables)
			document.links[i].onclick = function () { if (checkWebsiteNetwork(this.href) == -1) {navPopupShowWindow(this.href.replace('&','[ampersand]'),this.target,fromLeft,fromTop); return false;} };
		}
	}
	return true;
}

/************
navigation popup for sites not in foursquare.org
************/
function navPopupShowWindow(thisURL,thisTarget,thisLeft,thisTop)
{
	thisWidth = 760;
	thisHeight = 550;
	// open the window
	navURL = "/nav_popup.sd?sendTo=" + thisURL + "&thisTarget=" + thisTarget;
	newWindow = window.open(navURL, "NavPopup", "menubar=yes, location=yes, toolbar=yes, scrollbars=yes, resizable=yes, width=" + thisWidth +", height=" + thisHeight +",left=" + thisLeft +",top=" + thisTop);
}

/************
navigation popup for sites not in foursquare.org
************/
function checkWebsiteNetwork(thisURL)
{
	// set a variable to store whether or not this is part of the foursquare network of sites, -1 = false
	var withinNetwork = -1;
	var i = 0;

	// create an array of all the foursquare URLs
	var urls = new Array;
	urls[0] = "foursquare.org";
	urls[1] = "foursquarechurch.org";
	urls[2] = "worldbase.org";
	urls[3] = "worldbasela.com";
	urls[4] = "theheritagectr";
	urls[5] = "foursquareconvention";
	urls[6] = "foursquareassociation";
	urls[7] = "israel2007.org";
	urls[8] = "foursquareisrael2007.org";
	urls[9] = "foursquaremissionspress.com";
	urls[10] = "foursquarefoundation";
	urls[11] = "foursquarefoundation.net";
	urls[12] = "lifepacific.edu";
	urls[13] = "reachmore.org";
	urls[14] = "foursquarenextgensummit.com";
	urls[15] = "foursquarenextgensummit.net";
	urls[16] = "foursquarenextgensummit.org";
	urls[17] = "foursquarengs.com";
	urls[18] = "foursquarengs.net";
	urls[19] = "foursquarengs.org";
	urls[20] = "nextgensummit.com";
	urls[21] = "nextgensummit.net";
	urls[22] = "nextgensummit.org";
	urls[23] = "crosspointeconferencecenter.org";
	urls[24] = "foursquareglobalconnect.org";
	urls[25] = "foursquaremissions.blogspot.com";
	urls[26] = "mailto";

	// loop through all the items and check if
	for (i=0; i < urls.length; i++)
	{
		withinNetwork = thisURL.indexOf(urls[i]);
		if (withinNetwork > -1)
		{
			break;
		}
	}
	return withinNetwork;
}

/************
Feedback Form Confirmation
************/
function verifyChurchPlantersProposalForm()
{
	//form variables
	submitBtnMessage='Saving... Please Wait';
	formName='formChurchPlanterProposal';

	//initialize submitForm value
	submitForm=true;
	warningMessage="";
	formFocus="";

	// District
	if (submitForm)
	{
		formElement="district_emails";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage = 'Please select a district.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// Name
	if (submitForm)
	{
		formElement="name";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage = 'Please type in your name.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// City
	if (submitForm)
	{
		formElement="city";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage = 'Please type in your current church\'s city.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// State
	if (submitForm)
	{
		formElement="state";
		thisDOM=eval('document.' + formName + '.' + formElement);
		// make sure this value has a non-space character in it.
		if (thisDOM.value.search(/\S/) == -1)
		{
			warningMessage = 'Please type in your current church\'s state.';
			formFocus = formElement;
			submitForm = false;
		}
	}

	// check the email
	if (submitForm)
	{
		formElement="email_address";
		thisDOM=eval('document.' + formName + '.' + formElement);
		//check the email address
		thisMessage=validateEmail(thisDOM.value);
		//if there is no message sent back, set the alert.
		if (thisMessage.length != 0)
		{
			warningMessage=thisMessage;
			formFocus=formElement;
			submitForm=false;
		}
	}

	// check logo image
	if (submitForm)
	{
		formElement = "proposal";
		thisDOM = eval('document.' +formName + '.' + formElement);

		if (thisDOM.value == "")
		{
			warningMessage = "Please upload your proposal.";
			formFocus = formElement;
			submitForm = false;
		}
		// no file uploaded
		else
		{
			// check for the extensions
			if ((thisDOM.value.indexOf('.doc') > 0) || (thisDOM.value.indexOf('.pdf') > 0))
			{
				submitForm = true;
			}
			// no proper extension found
			else
			{
				warningMessage = "Please upload either a .doc or a .pdf file.";
				formFocus = formElement;
				submitForm = false;
			}
		}
	}

	//disable the form if the form checks out
	if (!submitForm)
	{
		alert(warningMessage);
	}
	else
	{
		formElement = "submitButton";
		thisDOM=eval('document.' + formName + '.' + formElement);
		thisDOM.value="Sending Proposal... Please Wait...";
	}

	//focus the form if necessary
	if (formFocus.length > 0)
	{
		thisDOM=eval('document.' + formName + '.' + formFocus);
		thisDOM.focus();
	}

	//return the boolean value whether or not we should submit this form
	return submitForm;
}

