﻿// Requires msiScripts.js
function chkForm(f) {

	// get values for radio buttons
	for (var i=0; i < f.user6.length; i++){
	      if (f.user6[i].checked){
		var honReg = f.user6[i].value;
	      }
	}
	// get values for checkboxes 
		 
	if (!f.user7.checked){
		var emailContact = "No"
	}
	else{
		var emailContact = "Yes"
	}
	if (!f.user8.checked){
		var sharePerm = "No"
	}
	else{
		var sharePerm = "Yes"
	}


	//create the description value so we can email the information back to the user

	var desc = "Donation to San Francisco Baykeeper";
	    desc += ", Recurring Gift:  " + f.user1.value;
	    desc += ", Recognition Name(s):  " + f.user2.value; 
	    desc += ", Tribute Name:  " + f.user3.value; 
	    desc += ", Honoree Name:  " + f.user4.value; 
	    desc += ", Honoree Contact:  " + f.user5.value; 
	    desc += ", Honoree Recognition:  " + honReg; 
	    desc += ", Email Contact:  " + emailContact; 
	    desc += ", Share Permission:  " + sharePerm; 

	f.description.value = desc;


	var r = true;
	if (r) {
		f.name.fieldlabel="Name";
		f.email.fieldlabel="Email";
		f.email.format="email";
		f.address.fieldlabel="Address";
		f.city.fieldlabel="City";
		f.state.fieldlabel="State";
		f.zip.fieldlabel="Zip";
		f.phone.fieldlabel="Phone";
		f.phone.format = "phone";
		f.amount.fieldlabel="Amount";
		f.amount.min = 1.00;

		f.user1.optional = true;
		f.user2.optional = true;
		f.user3.optional = true;
		f.user4.optional = true;
		f.user5.optional = true;
		f.user6.optional = true;
		f.user7.optional = true;
		f.user8.optional = true;
		f.user9.optional = true;
		f.user10.optional = true;
		
		r=verifyForm(f);
	}

	//alert(document.frmAttend.user1.value + "=" + document.frmAttend.amount.value);
	return r;
}
