var RecaptchaOptions = {

   theme : 'white'

};





function validate_AddEmail() {

	var doc = document.addEmail;



	if ( doc.addThis.value.indexOf('@') < 0 || doc.addThis.value.indexOf('.') < 0 ) {

		alert("Please enter a valid EMAIL ADDRESS.  This person will then receive updates and can track the progress of this Card with you!");

		doc.addThis.focus();

	} else {

		return true;

	}



	return false;

}





function validate_friendInvite() {

	var doc = document.inviteFriend;

	

	if ( doc.friendsListing.value === "" ) {

		alert("You must add at least 1 friend.");

		doc.name.focus();

	} else if ( doc.fromName.value === "" ) {

		alert("Your NAME is required.");

		doc.fromName.focus();

	} else if ( doc.fromEmail.value.indexOf('@') < 0 || doc.fromEmail.value.indexOf('.') < 0 ) {

		alert("Your EMAIL ADDRESS is invalid.");

		doc.fromEmail.focus();

	} else {

		return true;

	}

	return false;

}



function validate_ShareFriend() {

	var doc = document.share;

	

	if ( doc.fromName.value === "" ) {

		alert("Your NAME is required.");

		doc.fromName.focus();

	} else if ( doc.fromEmail.value.indexOf('@') < 0 || doc.fromEmail.value.indexOf('.') < 0 ) {

		alert("Your EMAIL ADDRESS is invalid.");

		doc.fromEmail.focus();

	} else if ( doc.friendName.value === "" ) {

		alert("Your FRIENDS' NAME is required.");

		doc.friendName.focus();

	} else if ( doc.friendEmail.value.indexOf('@') < 0 || doc.friendEmail.value.indexOf('.') < 0 ) {

		alert("Your FRIENDS' EMAIL ADDRESS is invalid.");

		doc.friendEmail.focus();

	} else {

		return true;

	}

	return false;

}



function validate_Donor() {

	var doc = document.donorRegistrar;

	if ( doc.fullName.value === "" ) {

		alert("Your NAME is required.");

		doc.fullName.focus();

	} else if ( doc.ownerEmail.value.indexOf('@') < 0 || doc.ownerEmail.value.indexOf('.') < 0 ) {

		alert("Your EMAIL ADDRESS is invalid.");

		doc.ownerEmail.focus();

	} else if ( doc.addressCode.value === "" ) {

		alert("Your POSTAL/ZIP CODE is required.");

		doc.addressCode.focus();

	} else if ( doc.schoolId.options[doc.schoolId.selectedIndex].value == "" ) {

		alert("The student's SCHOOL is required.");

		doc.schoolId.focus();

	} else if ( doc.tagIds.value === "" ) {

		alert("Your Card IDS are required.");

		doc.tagIds.focus();

	} else if ( doc.tagIds.value.indexOf(' ') > 0 ) {

		alert("There can be NO SPACES between Card IDS, only commas ',' can be used to separate IDS.");

		doc.tagIds.focus();

	} else {

		//alert(doc.tagIds.value);

		return true;

	}



	return false;

}



function isInt(s) {

	return (s.toString().search(/^-?[0-9]+$/) === 0);

}



function validate_Tagged() {

	var doc = document.acknowledge;

	//var email = doc.emailAddress.value;

	

	if ( doc.tagId.value.length < 7 ) {

		alert("Invalid CARD ID.");

		doc.tagId.focus();

	} else if ( doc.name.value === "" ) {

		alert("Your FIRST NAME is required.");

		doc.name.focus();

	} else if ( doc.city.value === "" ) {

		alert("Your CITY is required.");

		doc.city.focus();

	} else if ( doc.provState.options[doc.provState.selectedIndex].value == "" ) {

		alert("Your PROVINCE/STATE is required.  Choose International if your state or province is not listed.");

		doc.provState.focus();

	} else if ( doc.country.options[doc.country.selectedIndex].value == "" ) {

		alert("Your COUNTRY is required.");

		doc.country.focus();

	} else if ( doc.emailAddress.value.indexOf('@') < 0 || doc.emailAddress.value.indexOf('.') < 0 ) {

		alert("The EMAIL ADDRESS entered is not valid.");

		doc.emailAddress.focus();

	} else if ( doc.msg.value === "" ) {

		alert("Your ACKNOWLEDGEMENT is required.");

		doc.msg.focus();

	} else {

		document.getElementById('submitForm').style.innerText='<img src="../../img/loading.gif" />';

		document.getElementById('submitForm').style.innerHTML='<img src="../../img/loading.gif" />';

		return true;

	}



	return false;

}



function validate_Contact() {

	var doc = document.contact;

	var email = doc.emailAddress.value;

	

	if ( doc.name.value == "" ) {

		alert("Your NAME is required.");

		doc.name.focus();

	} else if ( email.indexOf('@') < 0 || email.indexOf('.') < 0 ) {

		alert("The EMAIL ADDRESS entered is not valid.");

		doc.emailAddress.focus();

	} else if ( doc.subject.value == "" ) {

		alert("A SUBJECT is required.");

		doc.subject.focus();

	} else if ( doc.msg.value == "" ) {

		alert("A MESSAGE is required.");

		doc.msg.focus();

	} else {

		return true;

	}



	return false;

}
