/*
The isEmpty and isWhitespace functions were taken straight from Netscape's JavaScript development site, http://developer
.netscape.com.
*/
var numb = '0123456789';
var lwr = 'abcdefghijklmnopqrstuvwxyz';
var upr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

function isValid(parm,val) {
        if (parm == "") return true;
        for (i=0; i<parm.length; i++) {
                if (val.indexOf(parm.charAt(i),0) == -1) return false;
        }
        return true;
}

function trim(s) {
	return s.replace(/^\s+|\s+$/g, "");
}

function isNum(parm) {return isValid(parm,numb);}

function isFloat(s) {
	var n = trim(s);
	return n.length>0 && !(/[^0-9.]/).test(n) && (/\.\d/).test(n);
}

function isNumber(s) {
	var n = trim(s);
	return n.length>0 && +n == n;
}

// whitespace characters
var whitespace = " \t\n\r";

/****************************************************************/
function leftpad(theItem, thePad, minSize) {
	newItem = new String(theItem);
	while (newItem.length < minSize) {
		newItem = thePad + newItem;
	}
	return newItem;
}

/****************************************************************/
function isEmpty(s) {
// Check whether string s is empty.
	return ((s == null) || (s.length == 0))
}

/****************************************************************/
function isWhitespace(s) {
	var i;

// Is s empty?
	if (isEmpty(s))
		return true;

// Search through string's characters one by one
// until we find a non-whitespace character.
// When we do, return false; if we don't, return true.

        for (i = 0; i < s.length; i++) {
// Check that current character isn't whitespace.
                var c = s.charAt(i);
                if (whitespace.indexOf(c) == -1)
                        return false;
        }

// All characters are whitespace.
        return true;
}

/****************************************************************/
function ForceEntry(val, str) {
        var strInput = new String(val.value);

        if (isWhitespace(strInput)) {
                alert(str);
                return false;
        }
 else
                return true;
}

/****************************************************************/
function TotalRaffleTix() {
	amtdue=0;
	numtix=parseFloat(document.webform.numtickets.selectedIndex)+1;
	if (numtix > 5)
		amtdue+=parseFloat(document.webform.ticketprice.value) * (numtix-1);
	else
		amtdue+=parseFloat(document.webform.ticketprice.value) * numtix;
	document.webform.total.value=amtdue;
	document.webform.amtdue.value=amtdue;
}

/****************************************************************/
function ValidateBdNomData() {

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
        if (isEmpty(document.webform.Q1.value) || isEmpty(document.webform.Q2.value) || isEmpty(document.webform.Q3.value) || isEmpty(document.webform.Q4.value) || isEmpty(document.webform.Q5.value) || isEmpty(document.webform.Q6.value) || isEmpty(document.webform.Q7.value) || isEmpty(document.webform.Q8.value) || isEmpty(document.webform.Q9.value) || isEmpty(document.webform.Q10.value) || isEmpty(document.webform.Q11.value)) {
		alert("Please answer all eleven questions.");
        	if (isEmpty(document.webform.Q1.value))
                	document.webform.Q1.focus();
        	else if (isEmpty(document.webform.Q2.value))
                	document.webform.Q2.focus();
        	else if (isEmpty(document.webform.Q3.value))
                	document.webform.Q3.focus();
        	else if (isEmpty(document.webform.Q4.value))
                	document.webform.Q4.focus();
        	else if (isEmpty(document.webform.Q5.value))
                	document.webform.Q5.focus();
        	else if (isEmpty(document.webform.Q6.value))
                	document.webform.Q6.focus();
        	else if (isEmpty(document.webform.Q7.value))
                	document.webform.Q7.focus();
        	else if (isEmpty(document.webform.Q8.value))
                	document.webform.Q8.focus();
        	else if (isEmpty(document.webform.Q9.value))
                	document.webform.Q9.focus();
        	else if (isEmpty(document.webform.Q10.value))
                	document.webform.Q10.focus();
        	else
                	document.webform.Q11.focus();
                return false;
	}
}

/****************************************************************/
function ValidateRaffleData() {

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;

        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	TotalRaffleTix();
//	if ((document.webform.PrizeChoice1.selectedIndex == 0) || (document.webform.PrizeChoice2.selectedIndex == 0) || (document.webform.PrizeChoice3.selectedIndex == 0)) {
        if ((document.webform.PrizeChoice1.selectedIndex == 0) || (document.webform.PrizeChoice2.selectedIndex == 0)) {
// must make all choices
//		alert("Please indicate your 1st, 2nd, & 3rd choice of prizes.");
                alert("Please indicate your 1st & 2nd choice of prizes.");
        	if (document.webform.PrizeChoice1.selectedIndex == 0)
                	document.webform.PrizeChoice1.focus();
        	else if (document.webform.PrizeChoice2.selectedIndex == 0)
                	document.webform.PrizeChoice2.focus();
//        	else
//                	document.webform.PrizeChoice3.focus();
                return false;
        }
	else {
// can't choose the same choice more than once
//        	if ((document.webform.PrizeChoice1.selectedIndex == document.webform.PrizeChoice2.selectedIndex) || (document.webform.PrizeChoice1.selectedIndex == document.webform.PrizeChoice3.selectedIndex) || (document.webform.PrizeChoice2.selectedIndex == document.webform.PrizeChoice3.selectedIndex)) {
        	if (document.webform.PrizeChoice1.selectedIndex == document.webform.PrizeChoice2.selectedIndex) {
//                	alert("Your 1st, 2nd, & 3rd choice of prizes must all be different. Please choose again.");
                	alert("Your 1st & 2nd choice of prizes must be different. Please choose again.");
        		if (document.webform.PrizeChoice1.selectedIndex == document.webform.PrizeChoice2.selectedIndex)
                		document.webform.PrizeChoice2.focus();
//        		else
//                		document.webform.PrizeChoice3.focus();
                	return false;
        	}
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateCoachingData() {

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;

        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (document.webform.numsessions.selectedIndex == 0) {
                alert("Please indicate the number of coaching sessions you want to sign up for.");
                document.webform.numsessions.focus();
                return false;
        }
	numsessions=document.webform.numsessions.value;
        if ((document.webform.CoachChoice1.selectedIndex == 0) || (document.webform.CoachChoice2.selectedIndex == 0) || (document.webform.CoachChoice3.selectedIndex == 0) || (document.webform.CoachChoice4.selectedIndex == 0)) {
// must make numsessions choices
		if ((numsessions == 1) && (document.webform.CoachChoice1.selectedIndex == 0)) {
                	alert("Please indicate your 1st choice of coaches.");
                	document.webform.CoachChoice1.focus();
                	return false;
        	}
		if ((numsessions == 2) && ((document.webform.CoachChoice1.selectedIndex == 0) || (document.webform.CoachChoice2.selectedIndex == 0))) {
                	alert("Please indicate your 1st & 2nd choice of coaches.");
			if (document.webform.CoachChoice1.selectedIndex == 0)
                		document.webform.CoachChoice1.focus();
			else
                		document.webform.CoachChoice2.focus();
                	return false;
        	}
		if ((numsessions == 3) && ((document.webform.CoachChoice1.selectedIndex == 0) || (document.webform.CoachChoice2.selectedIndex == 0) || (document.webform.CoachChoice3.selectedIndex == 0))) {
                	alert("Please indicate your 1st, 2nd, & 3rd choice of coaches.");
			if (document.webform.CoachChoice1.selectedIndex == 0)
                		document.webform.CoachChoice1.focus();
			else if (document.webform.CoachChoice2.selectedIndex == 0)
                		document.webform.CoachChoice2.focus();
			else
                		document.webform.CoachChoice3.focus();
                	return false;
        	}
		if ((numsessions == 4) && ((document.webform.CoachChoice1.selectedIndex == 0) || (document.webform.CoachChoice2.selectedIndex == 0) || (document.webform.CoachChoice3.selectedIndex == 0) || (document.webform.CoachChoice4.selectedIndex == 0))) {
                	alert("Please indicate your 1st, 2nd, 3rd, & 4th choice of coaches.");
			if (document.webform.CoachChoice1.selectedIndex == 0)
                		document.webform.CoachChoice1.focus();
			else if (document.webform.CoachChoice2.selectedIndex == 0)
                		document.webform.CoachChoice2.focus();
			else if (document.webform.CoachChoice3.selectedIndex == 0)
                		document.webform.CoachChoice3.focus();
			else
                		document.webform.CoachChoice4.focus();
                	return false;
        	}
	}
//	else {
// can't choose the same choice more than once
		if (((document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice2.selectedIndex) && (document.webform.CoachChoice1.selectedIndex != 0)) || ((document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice3.selectedIndex) && (document.webform.CoachChoice1.selectedIndex != 0)) || ((document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice4.selectedIndex) && (document.webform.CoachChoice1.selectedIndex != 0)) || ((document.webform.CoachChoice2.selectedIndex == document.webform.CoachChoice3.selectedIndex) && (document.webform.CoachChoice2.selectedIndex != 0)) || ((document.webform.CoachChoice2.selectedIndex == document.webform.CoachChoice4.selectedIndex) && (document.webform.CoachChoice2.selectedIndex != 0)) || ((document.webform.CoachChoice3.selectedIndex == document.webform.CoachChoice4.selectedIndex)&& (document.webform.CoachChoice3.selectedIndex != 0))) {
			alert("Your 1st, 2nd, 3rd, & 4th choice of coaches must all be different. Please choose again.");
			if (document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice2.selectedIndex)
				document.webform.CoachChoice2.focus();
			else if (document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice3.selectedIndex)
				document.webform.CoachChoice3.focus();
			else if (document.webform.CoachChoice1.selectedIndex == document.webform.CoachChoice4.selectedIndex)
				document.webform.CoachChoice4.focus();
			else if (document.webform.CoachChoice2.selectedIndex == document.webform.CoachChoice3.selectedIndex)
				document.webform.CoachChoice3.focus();
			else if (document.webform.CoachChoice2.selectedIndex == document.webform.CoachChoice4.selectedIndex)
				document.webform.CoachChoice4.focus();
			else
				document.webform.CoachChoice4.focus();
			return false;
		}
//	}
/*
	if (numsessions == 1) {
		document.webform.CoachChoice2.selectedIndex = 0;
		document.webform.CoachChoice3.selectedIndex = 0;
		document.webform.CoachChoice4.selectedIndex = 0;
	}
	else if (numsessions == 2) {
		document.webform.CoachChoice3.selectedIndex = 0;
		document.webform.CoachChoice4.selectedIndex = 0;
	}
	else if (numsessions == 3) {
		document.webform.CoachChoice4.selectedIndex = 0;
	}
*/
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateOwlInfoData() {

        if (isEmpty(document.owlinfo.realname.value)) {
                alert("Please enter your Name.");
                document.owlinfo.realname.focus();
                return false;
        }

        if (isEmpty(document.owlinfo.Street_Address.value)) {
                alert("Please enter your Street Address.");
                document.owlinfo.Street_Address.focus();
                return false;
        }

        if (isEmpty(document.owlinfo.Phone_Number.value)) {
                alert("Please enter your Phone Number.");
                document.owlinfo.Phone_Number.focus();
                return false;
        }

        if ((isEmpty(document.owlinfo.City.value)) || (document.owlinfo.State.selectedIndex == 0) || (isEmpty(document.owlinfo.Zip_Code.value))) {
                alert("Please enter your City, State/Province, Zip Code, and Country.");
                if (isEmpty(document.owlinfo.City.value))
                        document.owlinfo.City.focus();
                else if (document.owlinfo.State.selectedIndex == 0)
                        document.owlinfo.State.focus();
                else if (isEmpty(document.owlinfo.Zip_Code.value))
                        document.owlinfo.Zip_Code.focus();
                return false;
        }

        if (isEmpty(document.owlinfo.email.value)) {
		alert("Please enter your Email Address.");
                document.owlinfo.email.focus();
                return false;
        }

        if ((document.owlinfo.SCN_member[0].checked == false) & (document.owlinfo.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.owlinfo.SCN_member[0].focus();
                return false;
        }

	if ((document.owlinfo.Order_OWL_Workbook_$150.checked == false) && (document.owlinfo.Order_OWL_Workbook_$200.checked == false) && (document.owlinfo.Send_OWL_Info.checked == false) && (document.owlinfo.Send_SCN_Info.checked == false)) {
                alert("Please indicate which info you are interested in: SCN/OWL brochures or the OWL manual");
                document.owlinfo.Send_OWL_Info.focus();
                return false;
	}
	else {
		if ((document.owlinfo.Order_OWL_Workbook_$150.checked == true) && (document.owlinfo.Order_OWL_Workbook_$200.checked == true)) {
			document.owlinfo.Order_OWL_Workbook_$200.checked=false;
		}
		else {
			if (document.owlinfo.Order_OWL_Workbook_$200.checked == true) {
				document.owlinfo.OWL_Workbook_discount=0;
			}
		}
	}

}

/****************************************************************/
function ValidateCommonData(pronoun) {
USA="USA";
CANADA="CANADA";
        if (isEmpty(document.webform.Street_Address.value)) {
                alert("Please enter " + pronoun + " Street Address.");
                document.webform.Street_Address.focus();
                return false;
        }

        if (isEmpty(document.webform.Phone_Number.value)) {
                alert("Please enter " + pronoun + " Phone Number.");
                document.webform.Phone_Number.focus();
                return false;
        }

        if ((isEmpty(document.webform.City.value)) || (document.webform.State.selectedIndex == 0) || (isEmpty(document.webform.Zip_Code.value))) {
                alert("Please enter " + pronoun + " City, State/Province, Zip Code, and Country.");
                if (isEmpty(document.webform.City.value))
                        document.webform.City.focus();
                else if (document.webform.State.selectedIndex == 0)
                        document.webform.State.focus();
                else if (isEmpty(document.webform.Zip_Code.value))
                        document.webform.Zip_Code.focus();
                return false;
        }
	if ((document.webform.Country.value == USA) || (document.webform.Country.value == CANADA)) {
		if (document.webform.State.selectedIndex < 2) {
                	alert("Please enter " + pronoun + " State/Province.");
                        document.webform.State.focus();
                	return false;
        	}
        }
	return true;

}

/****************************************************************/
function ValidateMembershipData() {

USA="USA";
CANADA="CANADA";
MEXICO="MEXICO";

	if ((document.webform.National_Membership[0].checked == false) && (document.webform.National_Membership[1].checked == false) && (document.webform.National_Membership[2].checked == false) && (document.webform.National_Membership[3].checked == false) && (document.webform.National_Membership[4].checked == false) && (document.webform.National_Membership[5].checked == false) && (document.webform.Chapter_Membership.checked == false)) {
                alert("Please indicate the type of membership you are interested in: National &/or Chapter");
                document.webform.National_Membership[0].focus();
                return false;
	}
	else {
			amtdue=0;
			if (document.webform.National_Membership[0].checked == true) {
				if (document.webform.Country.value == USA)
					amtdue+=parseFloat(document.webform.member.value);
				else if ((document.webform.Country.value == CANADA) || (document.webform.Country.value == MEXICO))
					amtdue+=parseFloat(document.webform.National_Membership_CanMex.value);
				else
					amtdue+=parseFloat(document.webform.National_Membership_Other.value);
			}
			else if (document.webform.National_Membership[1].checked == true)
				amtdue+=parseFloat(document.webform.supporter.value);
			else if (document.webform.National_Membership[2].checked == true)
				amtdue+=parseFloat(document.webform.sponsor.value);
			else if (document.webform.National_Membership[3].checked == true)
				amtdue+=parseFloat(document.webform.patron.value);
			else if (document.webform.National_Membership[4].checked == true)
				amtdue+=parseFloat(document.webform.benefactor.value);
			else if (document.webform.National_Membership[5].checked == true)
				amtdue+=parseFloat(document.webform.orgmember.value);

			if (document.webform.Board_Member.checked == true) {
				amtdue-=parseFloat(document.webform.member_discount.value);
			}

			if (document.webform.Chapter_Membership.checked == true) {
				amtdue+=parseFloat(document.webform.IC.value);
				if (document.webform.Board_Member.checked == true)
					amtdue-=parseFloat(document.webform.member_discount_IC.value);
			}
			document.webform.amtdue.value=amtdue;
	}
	return true;

}

/****************************************************************/
function ValidateJoinData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Referred_From">
SCNMEM="Story Circle Network member";
FRIEND="a friend";
pronoun1="your";

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (document.webform.Referred_From.selectedIndex == 0) {
                alert("Please tell us where you heard about SCN");
                document.webform.Referred_From.focus();
                return false;
        }
	else if ((document.webform.Referred_From.value == "OTHER") && (isEmpty(document.webform.Referred_From_Other.value))) {
                alert("Please give us more detail on where you heard about SCN");
                document.webform.Referred_From_Other.focus();
                return false;
        }
	else if (((document.webform.Referred_From.value == SCNMEM) || (document.webform.Referred_From.value == FRIEND)) && (isEmpty(document.webform.Referring_Member.value))) {
                alert("Please give us the name of the person who referred you to SCN");
                document.webform.Referring_Member.focus();
                return false;
        }
	if (!ValidateMembershipData())
		return false;
	else {
		thishii="scn";
		if (isEmpty(document.webform.hii.value)) {
			alert("Please enter the answer to the Human Intelligence Identification Question.");
			document.webform.hii.focus();
			return false;
		}
		else {
			hii=document.webform.hii.value;
			if (hii != thishii) {
				alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
				document.webform.hii.focus();
				return false;
			}
		}
		document.webform.hiianswer.value=thishii;
        }
}

/****************************************************************/
function ValidateOrderData() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
pronoun1="your"

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter " + pronoun1 + " Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
		document.webform.email.focus();
		return false;
	}
	if (isEmpty(document.webform.Book_BookOfDays_$15.value) && isEmpty(document.webform.Book_CuckooBrow_$25.value) && isEmpty(document.webform.Book_BlenheimPalace_$25.value) && isEmpty(document.webform.Book_BleedingHearts_$25.value) && isEmpty(document.webform.Book_WFL_$20.value) && isEmpty(document.webform.Tshirt_M_$14.value) && isEmpty(document.webform.Tshirt_L_$14.value) && isEmpty(document.webform.Tshirt_XL_$14.value) && isEmpty(document.webform.Tshirt_2X_$14.value)) {
		alert("Please enter the number of items you wish to reserve.");
		document.webform.Book_BookOfDays_$15.focus();
		return false;
	}
	if (((document.webform.ShipToCountry.value != USA) && (document.webform.ShipToCountry.value != "")) || ((document.webform.BillToCountry.value != USA) && (document.webform.ShipToCountry.value == ""))) {
		alert("If you are ordering outside the US, query by email to susan@susanalbert.com and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
		return true;
	}
}

/****************************************************************/
function ValidateLLRegisterData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,SCN_member">
pronoun1="your"

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate " + pronoun1 + " membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
        if ((document.webform.stay_sunday_night.checked == false) & (document.webform.sunday_single_occupancy.checked == true)) {
                document.webform.sunday_single_occupancy.checked=false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
	regtype=document.webform.regtype.value;
	TotalLLRegAmt();
        if (document.webform.okdone.value == 0) {
                alert("Thanks for registering! Info on how to pay your $" + amtdue + " " + regtype + " registration fee will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function TotalLLRegAmt() {
// calculate amt due:

	if (document.webform.SCN_member[0].checked == true)
		memornot="member";
	else
		memornot="non-member";

	amtdue=0;
	regamt=parseFloat(document.webform.retreatfee.value);
	numnights=parseFloat(document.webform.num_nights.value);
	single_surcharge=parseFloat(document.webform.single_charge.value);
	singlefee=numnights*single_surcharge;
	sundayfee=parseFloat(document.webform.sunday_charge.value);
	if ((document.webform.SCN_member[0].checked == true) || (document.webform.SCN_member[1].checked == false))
		regamt-=parseFloat(document.webform.retreat_discount.value);
	if (document.webform.single_occupancy.checked == true)
		regamt+=singlefee;
	if (document.webform.stay_sunday_night.checked == true) {
		regamt+=sundayfee;
		if (document.webform.sunday_single_occupancy.checked == true)
			regamt+=single_surcharge;
	}
	amtdue+=regamt;
	document.webform.amtdue.value=amtdue;
}

/****************************************************************/
function ValidateLLSubsidyData() {

//<input type=hidden name="required" value="realname,email,family_income,SCN_involvement">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if ((document.webform.family_income[0].checked == false) && (document.webform.family_income[1].checked == false) && (document.webform.family_income[2].checked == false)) {
                alert("Please indicate your family income.");
                document.webform.family_income[0].focus();
                return false;
        }
        if (isEmpty(document.webform.SCN_involvement.value)) {
                alert("Please tell us about your SCN involvement.");
                document.webform.SCN_involvement.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateEnrollData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,SCN_member">
pronoun1="your"

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate " + pronoun1 + " membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
	numreg=0;
	for (var i=0; i<document.webform.elements.length; i++) {
		thiselem=document.webform.elements[i].name;
		thisvalue=document.webform.elements[i].value;
		thischk=document.webform.elements[i].checked;
		if (thiselem.indexOf("workshop_") != -1) {
			if (thischk) {
				numreg++;
				whichreg+=thisvalue;
			}
		}
	}
	if (numreg == 0) {
		whichelem=0;
		for (var i=0; i<document.webform.elements.length; i++) {
			thiselem=document.webform.elements[i].name;
			if (thiselem.indexOf("workshop_") != -1) {
				whichelem=i;
				break;
			}
		}
                alert("Please indicate the workshop you are registering for.");
		document.webform.elements[whichelem].focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateEnrollMMData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,SCN_member">
pronoun1="your"

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (!ValidateCommonData("your"))
		return false;
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate " + pronoun1 + " membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
}

/****************************************************************/
function ValidateNewMemData() {

//<input type=hidden name="required" value="realname,email,want_to_join_ecircle">
pronoun1="your"

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if ((document.webform.want_to_join_ecircle[0].checked == false) && (document.webform.want_to_join_ecircle[1].checked == false) && (document.webform.want_to_join_ecircle[2].checked == false) && (document.webform.want_to_join_ecircle[3].checked == false)) {
		alert("Please indicate your preference for participating in a reading &/or writing e-circle by selecting one or more answers to 'I want to participate in...'");
               	document.webform.want_to_join_ecircle[0].focus();
               	return false;
       	}
	else {
		if ((document.webform.want_to_join_ecircle[2].checked == true) || (document.webform.want_to_join_ecircle[3].checked == true)) {
//			document.webform.want_to_join_ecircle[0].checked=false;
			document.webform.want_to_join_ecircle[1].checked=false;
       		}
		if (document.webform.want_to_join_ecircle[3].checked == true) {
       			if (isEmpty(document.webform.writing_circle_experience.value)) {
				alert("Please tell us about your writing experience.");
               			document.webform.writing_circle_experience.focus();
               			return false;
       			}
			if ((document.webform.writing_level[0].checked == false) && (document.webform.writing_level[1].checked == false) && (document.webform.writing_level[2].checked == false)) {
				alert("Please rate your level of writing experience.");
               			document.webform.writing_level[0].focus();
               			return false;
       			}
       			if (isEmpty(document.webform.writing_circle_goal.value)) {
				alert("Please tell us about your writing circle goals.");
               			document.webform.writing_circle_goal.focus();
               			return false;
       			}
       		}
       	}
}

/****************************************************************/
function ValidateGiftData() {
//<input type=hidden name="required" value="GiftGiver_Name,GiftGiver_Email,GiftGiver_Phone_Number,GiftGiver_Country,GiftGiver_Street_Address,GiftGiver_City,GiftGiver_State,GiftGiver_Zip_Code,Name,Email_Address,Phone_Number,Country,Street_Address,City,State,Zip_Code">

pronoun1="your"
pronoun2="the gift recipient's"

        if (isEmpty(document.webform.GiftGiver_Name.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.GiftGiver_Name.focus();
                return false;
        }
        if (isEmpty(document.webform.GiftGiver_Street_Address.value)) {
                alert("Please enter " + pronoun1 + " Street Address.");
                document.webform.GiftGiver_Street_Address.focus();
                return false;
        }
        if (isEmpty(document.webform.GiftGiver_Phone_Number.value)) {
                alert("Please enter " + pronoun1 + " Phone Number.");
                document.webform.GiftGiver_Phone_Number.focus();
                return false;
        }
        if ((isEmpty(document.webform.GiftGiver_City.value)) || (document.webform.GiftGiver_State.selectedIndex == 0) || (isEmpty(document.webform.GiftGiver_Zip_Code.value))) {
                alert("Please enter " + pronoun1 + " City, State/Province, Zip Code, and Country.");
                if (isEmpty(document.webform.GiftGiver_City.value))
                        document.webform.GiftGiver_City.focus();
                else if (document.webform.GiftGiver_State.selectedIndex == 0)
                        document.webform.GiftGiver_State.focus();
                else if (isEmpty(document.webform.GiftGiver_Zip_Code.value))
                        document.webform.GiftGiver_Zip_Code.focus();
                return false;
        }
        if (isEmpty(document.webform.GiftGiver_Email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.GiftGiver_Email.focus();
                return false;
        }
        if (isEmpty(document.webform.Name.value)) {
		alert("Please enter " + pronoun2 + " Name.");
                document.webform.Name.focus();
                return false;
        }
	if (!ValidateCommonData("the gift recipient's"))
		return false;
        if (isEmpty(document.webform.Email_Address.value)) {
		alert("Please enter " + pronoun2 + " Email Address.");
                document.webform.Email_Address.focus();
                return false;
        }
	if (!ValidateMembershipData())
		return false;
	else {
		thishii="scn";
		if (isEmpty(document.webform.hii.value)) {
			alert("Please enter the answer to the Human Intelligence Identification Question.");
			document.webform.hii.focus();
			return false;
		}
		else {
			hii=document.webform.hii.value;
			if (hii != thishii) {
				alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
				document.webform.hii.focus();
				return false;
			}
		}
		document.webform.hiianswer.value=thishii;
	}
}

/****************************************************************/
function ValidateConfDonationData(id) {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Current_SCN_Member,Item_Description,Donation_Receipt_Method">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.Current_SCN_Member[0].checked == false) & (document.webform.Current_SCN_Member[1].checked == false)) {
                alert("Please answer the question, 'Are you currently a member of the Story Circle Network?'");
                document.webform.Current_SCN_Member[0].focus();
                return false;
        }
        if (isEmpty(document.webform.Item_Description.value)) {
                alert("Please enter a description of your item.");
                document.webform.Item_Description.focus();
                return false;
        }
        if ((document.webform.Donation_Type[0].checked == false) & (document.webform.Donation_Type[1].checked == false)) {
                alert("Please select the type of donation you are making: Silent Auction/Door Prize *or* Gift Bag");
                document.webform.Donation_Type[0].focus();
                return false;
        }
	else {
        	if (document.webform.Donation_Type[0].checked == true) {
        		if (isEmpty(document.webform.Artist_Bio.value)) {
                		alert("Please enter the creator/artist's bio information.");
                		document.webform.Artist_Bio.focus();
                		return false;
        		}
        		if (isEmpty(document.webform.Minimum_Price.value)) {
                		alert("Please enter the minimum price (starting bid) for your item.");
                		document.webform.Minimum_Price.focus();
                		return false;
        		}
			else {
        			if (!isNum(document.webform.Minimum_Price.value)) {
					alert("You entered an invalid price (" + document.webform.Minimum_Price.value + "). Please enter a dollar value.");
                			document.webform.Minimum_Price.focus();
                			return false;
        			}
        		}
        		if ((document.webform.Donation_Preference[0].checked == false) & (document.webform.Donation_Preference[1].checked == false) & (document.webform.Donation_Preference[2].checked == false)) {
                		document.webform.Donation_Preference[2].checked=true;
        		}
        		document.webform.GiftQty.value="";
        	}
		else {
			giftqty=parseFloat(document.webform.GiftQty.value);
        		if (isEmpty(document.webform.GiftQty.value)) {
	                	alert("Please enter the number of items to be donated for the gift bags.");
                		document.webform.GiftQty.focus();
                		return false;
        		}
       			else if (!isNum(document.webform.GiftQty.value)) {
				alert("You entered an invalid quantity (" + document.webform.GiftQty.value + "). Please enter a number.");
               			document.webform.GiftQty.focus();
               			return false;
       			}
       			if (giftqty < 30) {
				alert("You entered a quantity of " + giftqty + " for the number of gift bag items you are donating. We cannot accept fewer than 30 items. Please correct this.");
              				document.webform.GiftQty.focus();
              				return false;
       			}
        		document.webform.Artist_Bio.value="";
        		document.webform.Minimum_Price.value="";
        		document.webform.Donation_Preference[0].checked=false;
        		document.webform.Donation_Preference[1].checked=false;
        		document.webform.Donation_Preference[2].checked=false;
        	}
        }
        if ((document.webform.Donation_Receipt_Method[0].checked == false) & (document.webform.Donation_Receipt_Method[1].checked == false)) {
                alert("Please indicate how you will get your donation to SCN.");
                document.webform.Donation_Receipt_Method[0].focus();
                return false;
        }
}

/****************************************************************/
function ValidateConfPresData(id) {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Current_SCN_Member,Registration_Type,Presentation_Title,Presentation_Synopsis,Presentation_Goals,Presentation_Methods,Presentation_Benefits,Suggested_Track,Resume">
pronoun1="your"

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.Current_SCN_Member[0].checked == false) & (document.webform.Current_SCN_Member[1].checked == false)) {
                alert("Please answer the question, 'Are you currently a member of the Story Circle Network?'");
                document.webform.Current_SCN_Member[0].focus();
                return false;
        }
if (!id) {
        if ((document.webform.Registration_Type[0].checked == false) & (document.webform.Registration_Type[1].checked == false)) {
                alert("Please indicate " + pronoun1 + " conference registration plans");
                document.webform.Registration_Type[0].focus();
                return false;
        }
}
        if (isEmpty(document.webform.Presentation_Title.value)) {
                alert("Please enter the title of " + pronoun1 + " presentation.");
                document.webform.Presentation_Title.focus();
                return false;
        }
        if (isEmpty(document.webform.Presentation_Synopsis.value)) {
                alert("Please enter the synopsis of " + pronoun1 + " presentation.");
                document.webform.Presentation_Synopsis.focus();
                return false;
        }
        if (isEmpty(document.webform.Presentation_Goals.value)) {
                alert("Please enter the goals of " + pronoun1 + " presentation.");
                document.webform.Presentation_Goals.focus();
                return false;
        }
        if (isEmpty(document.webform.Presentation_Methods.value)) {
                alert("Please enter the method of " + pronoun1 + " presentation.");
                document.webform.Presentation_Methods.focus();
                return false;
        }
        if (isEmpty(document.webform.Presentation_Benefits.value)) {
                alert("Please enter the benefits of " + pronoun1 + " presentation.");
                document.webform.Presentation_Benefits.focus();
                return false;
        }
/*
        if (isEmpty(document.webform.Publications.value)) {
                alert("Please list " + pronoun1 + " publications.");
                document.webform.Publications.focus();
                return false;
        }
*/
if (!id) {
        if ((document.webform.Suggested_Track[0].checked == false) & (document.webform.Suggested_Track[1].checked == false) & (document.webform.Suggested_Track[2].checked == false) & (document.webform.Suggested_Track[3].checked == false)) {
                alert("Please tell us which track you suggest for " + pronoun1 + " presentation.");
                document.webform.Suggested_Track[0].focus();
                return false;
        }
}
        if (isEmpty(document.webform.Resume.value)) {
                alert("Please enter " + pronoun1 + " resume.");
                document.webform.Resume.focus();
                return false;
        }

}

/****************************************************************/
function ValidateConfRegData() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,SCN_member,Referred_From,Registration_Requested">
YES="yes";

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
        if (document.webform.Referred_From.selectedIndex == 0) {
                alert("Please tell us where you heard about the conference");
                document.webform.Referred_From.focus();
                return false;
        }
//	if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false) & (document.webform.Thursday_FieldDay[0].checked == false) & (document.webform.Thursday_FieldDay[1].checked == false) & (document.webform.Thursday_FieldDay[2].checked == false) & (document.webform.Thursday_FieldDay[3].checked == false) & (document.webform.Friday_PreConf[0].checked == false) & (document.webform.Friday_PreConf[1].checked == false)) {
        if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false) & (document.webform.Friday_PreConf[0].checked == false) & (document.webform.Friday_PreConf[1].checked == false)) {
                alert("Please indicate the type of registration you desire.");
                document.webform.Registration_Requested[0].focus();
                return false;
        }
	else {
//        	if ((document.webform.Registration_Requested[1].checked == true) & (document.webform.Thursday_FieldDay[0].checked == false) & (document.webform.Thursday_FieldDay[1].checked == false) & (document.webform.Thursday_FieldDay[2].checked == false) & (document.webform.Thursday_FieldDay[3].checked == false) & (document.webform.Friday_PreConf[0].checked == false) & (document.webform.Friday_PreConf[1].checked == false) & (document.webform.Friday_Registration.checked == false) & (document.webform.Saturday_Registration.checked == false) & (document.webform.Saturday_Lunch.checked == false) & (document.webform.Sunday_Registration.checked == false) & (document.webform.Sunday_Lunch.checked == false)) {
        	if ((document.webform.Registration_Requested[1].checked == true) & (document.webform.Friday_PreConf[0].checked == false) & (document.webform.Friday_PreConf[1].checked == false) & (document.webform.Friday_Registration.checked == false) & (document.webform.Saturday_Registration.checked == false) & (document.webform.Saturday_Lunch.checked == false) & (document.webform.Sunday_Registration.checked == false) & (document.webform.Sunday_Lunch.checked == false)) {
                	alert("Please indicate the type of partial registration you desire.");
                	document.webform.Friday_PreConf[0].focus();
                	return false;
        	}
//        	if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false) & ((document.webform.Thursday_FieldDay[0].checked == true) || (document.webform.Thursday_FieldDay[1].checked == true) || (document.webform.Thursday_FieldDay[2].checked == true) || (document.webform.Thursday_FieldDay[3].checked == true)))
        	if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false))
        		document.webform.Registration_Requested[1].checked = true;
        	if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false) & ((document.webform.Friday_PreConf[0].checked == true) || (document.webform.Friday_PreConf[1].checked == true)))
        		document.webform.Registration_Requested[1].checked = true;
/*
        	if ((document.webform.Thursday_FieldDay[0].checked == true) & (document.webform.Thursday_FieldDay[1].checked == true)) {
                	alert("You can only select ONE morning field-writing session. Please de-select one.");
                	document.webform.Thursday_FieldDay[0].focus();
                	return false;
		}
        	if ((document.webform.Thursday_FieldDay[2].checked == true) & (document.webform.Thursday_FieldDay[3].checked == true)) {
                	alert("You can only select ONE afternoon field-writing session. Please de-select one.");
                	document.webform.Thursday_FieldDay[2].focus();
                	return false;
		}
*/
        }

	TotalConfRegAmt();

        if ((!isEmpty(document.webform.scholarship_reg_fees.value)) || (!isEmpty(document.webform.scholarship_travel_lodging.value)) || (!isEmpty(document.webform.scholarship_reason.value)) || (!isEmpty(document.webform.scholarship_community_use.value)) || (document.webform.scholarship_share_experiences[0].checked == true) || (document.webform.scholarship_share_experiences[1].checked == true)) {
        	if (document.webform.SCN_member[1].checked == true) {
               		alert("Financial assistance for the SCN conference is only available for our dues-paying members. You'll need to join SCN (and then indicate on the conference registration form that you are a member) or remove your scholarship request from this form.");
               		document.webform.scholarship_share_experiences[0].checked=false;
               		document.webform.scholarship_share_experiences[1].checked=false;
               		document.webform.scholarship_reg_fees.focus();
               		return false;
		}
		else {
			subsidy_ok=document.webform.subsidy_ok.value;
			if (subsidy_ok == YES) {
        			if (isEmpty(document.webform.scholarship_reg_fees.value) && isEmpty(document.webform.scholarship_travel_lodging.value)) {
                			alert("Please indicate the amount(s) of scholarship you desire.");
                			document.webform.scholarship_reg_fees.focus();
                			return false;
        			}
        			if (isEmpty(document.webform.scholarship_reason.value)) {
                			alert("Please indicate the reason you are applying for a scholarship.");
                			document.webform.scholarship_reason.focus();
                			return false;
        			}
        			if (isEmpty(document.webform.scholarship_community_use.value)) {
                			alert("Please tell us how you will share your experiences in your community.");
                			document.webform.scholarship_community_use.focus();
                			return false;
        			}
        			if ((document.webform.scholarship_share_experiences[0].checked == false) && (document.webform.scholarship_share_experiences[1].checked == false)) {
                			alert("Please answer the question: \"Will you agree to share your follow up experiences?\"");
                			document.webform.scholarship_share_experiences[0].focus();
                			return false;
        			}
        		}
			else {
               			alert("We're sorry. The deadline for scholarship applications has passed. You can still register for the conference, but can not apply for a scholarship. Please press the Register button to complete your registration.");
                		document.webform.scholarship_reg_fees.value="";
                		document.webform.scholarship_travel_lodging.value="";
                		document.webform.scholarship_reason.value="";
                		document.webform.scholarship_community_use.value="";
                		document.webform.scholarship_share_experiences[0].checked=false;
                		document.webform.scholarship_share_experiences[1].checked=false;
               			return false;
        		}
		}
        }
        if (document.webform.okdone.value == 0) {
                alert("Thanks for registering! Info on how to pay your $" + amtdue + " registration fee will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function TotalConfRegAmt() {
// calculate amt due:
today=new Date();
thisyy=today.getYear();
if (thisyy<1000)
	thisyy+=1900;
thismm=today.getMonth();
thismm++;
thismm=leftpad(thismm, "0", 2);
thisdd=today.getDate();
thisdd=leftpad(thisdd, "0", 2);
yymmdd=thisyy + thismm + thisdd;
yymmdd=document.webform.now.value;

/*
<input type="hidden" name="conference_feebump" value="25">
<input type="hidden" name="fri_feebump" value="25">
<input type="hidden" name="sat_feebump" value="25">
<input type="hidden" name="sun_feebump" value="25">
<input type="hidden" name="food_feebumpF" value="5">
<input type="hidden" name="food_feebumpSS" value="10">
<input type="hidden" name="register_early" value="20051215">
<input type="hidden" name="register_regular" value="20060202">
yymmdd=20071215;
yymmdd=20071216;
yymmdd=20080201;
*/
YYMMDD="";
YYMMDD+=yymmdd;
thisM = YYMMDD.substring(4,6);
thisD = YYMMDD.substring(6,8);
thisY = YYMMDD.substring(0,4);
thisday = thisM + "/" + thisD + "/" + thisY;
whichregpd="";
if (yymmdd <= document.webform.register_early.value) {
	whichregpd="early";
	bumpconf=0;
	bumpthu=0;
	bumpfri=0;
	bumpsat=0;
	bumpsun=0;
	bumpfoodfri=0;
	bumpfoodss=0;
}
else if (yymmdd <= document.webform.register_regular.value) {
	whichregpd="regular";
	bumpconf=parseFloat(document.webform.conference_feebump.value);
	bumpthu=parseFloat(document.webform.thu_feebump.value);
	bumpfri=parseFloat(document.webform.fri_feebump.value);
	bumpsat=parseFloat(document.webform.sat_feebump.value);
	bumpsun=parseFloat(document.webform.sun_feebump.value);
	bumpfoodfri=parseFloat(document.webform.food_feebumpF.value);
	bumpfoodss=parseFloat(document.webform.food_feebumpSS.value);
}
else {
	whichregpd="late";
	bumpconf=parseFloat(document.webform.conference_feebump.value)+parseFloat(document.webform.conference_feebump.value);
	bumpthu=parseFloat(document.webform.thu_feebump.value)+parseFloat(document.webform.thu_feebump.value);
	bumpfri=parseFloat(document.webform.fri_feebump.value)+parseFloat(document.webform.fri_feebump.value);
	bumpsat=parseFloat(document.webform.sat_feebump.value)+parseFloat(document.webform.sat_feebump.value);
	bumpsun=parseFloat(document.webform.sun_feebump.value)+parseFloat(document.webform.sun_feebump.value);
	bumpfoodfri=parseFloat(document.webform.food_feebumpF.value)+parseFloat(document.webform.food_feebumpF.value);
	bumpfoodss=parseFloat(document.webform.food_feebumpSS.value)+parseFloat(document.webform.food_feebumpSS.value);
}

if (document.webform.SCN_member[0].checked == true)
	memornot="member";
else
	memornot="non-member";

if (document.webform.Presenter.checked == true) {
	presenter_panelist="presenter";
	presenter="yes";
	panelist="no";
}
else {
	presenter="no";
	if (document.webform.Panelist.checked == true) {
		panelist="yes";
		presenter_panelist="panelist/coach";
	}
	else {
		panelist="no";
		presenter_panelist="";
	}
}

	amtdue=0;
	amtfullreg=0;
	amtfrireg=0;
	amtsatreg=0;
	amtsatlreg=0;
	amtsunreg=0;
	amtsunlreg=0;
	amtfielddayreg=0;
	amtpreconfreg=0;
	amtpresdisc=0;
	amtpanldisc=0;
	document.webform.amtfullreg.value="";
	document.webform.amtfrireg.value="";
	document.webform.amtsatreg.value="";
	document.webform.amtsatlreg.value="";
	document.webform.amtsunreg.value="";
	document.webform.amtsunlreg.value="";
	document.webform.amtfielddayreg.value="";
	document.webform.amtpreconfreg.value="";
	document.webform.presenter_panelist.value="";
        if (document.webform.Registration_Requested[0].checked == true) {
		document.webform.amtfrireg.value="";
		document.webform.amtsatreg.value="";
		document.webform.amtsatlreg.value="";
		document.webform.amtsunreg.value="";
		document.webform.amtsunlreg.value="";
        	document.webform.Friday_Registration.checked = false;
        	document.webform.Saturday_Registration.checked = false;
        	document.webform.Saturday_Lunch.checked = false;
        	document.webform.Sunday_Registration.checked = false;
        	document.webform.Sunday_Lunch.checked = false;
		amtfullreg=parseFloat(document.webform.fullfee.value);
        	if ((document.webform.SCN_member[1].checked == true) || (document.webform.SCN_member[0].checked == false))
			amtfullreg+=parseFloat(document.webform.full_feebump.value);
        	if (presenter == "yes") {
			amtpresdisc=parseFloat(document.webform.presenter_discount_full.value);
			amtfullreg-=amtpresdisc;
		}
        	else if (panelist == "yes") {
			amtpanldisc=parseFloat(document.webform.panelist_discount_full.value);
			amtfullreg-=amtpanldisc;
		}
		document.webform.amtfullreg.value=amtfullreg;
		amtdue+=amtfullreg;
        }
	else {
        	if (document.webform.Friday_Registration.checked == true) {
			amtfrireg=parseFloat(document.webform.food_fri.value);
			amtfrireg+=bumpfoodfri;
			document.webform.amtfrireg.value=amtfrireg;
			amtdue+=amtfrireg;
        	}
        	if (document.webform.Saturday_Registration.checked == true) {
			amtsatreg=parseFloat(document.webform.saturdayfee.value);
			amtsatreg+=bumpsat;
        		if ((document.webform.SCN_member[1].checked == true) || (document.webform.SCN_member[0].checked == false))
				amtsatreg+=parseFloat(document.webform.sat_feebump.value);
        		if (presenter == "yes") {
				amtpresdiscSat=parseFloat(document.webform.presenter_discount_sat.value);
				amtsatreg-=amtpresdiscSat;
				amtpresdisc+=amtpresdiscSat;
			}
			document.webform.amtsatreg.value=amtsatreg;
			amtdue+=amtsatreg;
        		if (document.webform.Saturday_Lunch.checked == true)
        			document.webform.Saturday_Lunch.checked = false;
        	}
        	if (document.webform.Saturday_Lunch.checked == true) {
			amtsatlreg=parseFloat(document.webform.food_sat.value);
			amtsatlreg+=bumpfoodss;
			document.webform.amtsatlreg.value=amtsatlreg;
			amtdue+=amtsatlreg;
        	}
        	if (document.webform.Sunday_Registration.checked == true) {
			amtsunreg=parseFloat(document.webform.sundayfee.value);
			amtsunreg+=bumpsun;
        		if ((document.webform.SCN_member[1].checked == true) || (document.webform.SCN_member[0].checked == false))
				amtsunreg+=parseFloat(document.webform.sun_feebump.value);
        		if (presenter == "yes") {
				amtpresdiscSun=parseFloat(document.webform.presenter_discount_sun.value);
				amtsunreg-=amtpresdiscSun;
				amtpresdisc+=amtpresdiscSun;
			}
			document.webform.amtsunreg.value=amtsunreg;
			amtdue+=amtsunreg;
        		if (document.webform.Sunday_Lunch.checked == true)
        			document.webform.Sunday_Lunch.checked = false;
        	}
        	if (document.webform.Sunday_Lunch.checked == true) {
			amtsunlreg=parseFloat(document.webform.food_sun.value);
			amtsunlreg+=bumpfoodss;
			document.webform.amtsunlreg.value=amtsunlreg;
			amtdue+=amtsunlreg;
        	}
        }
/*
        if ((document.webform.Thursday_FieldDay[0].checked == true) || (document.webform.Thursday_FieldDay[1].checked == true) || (document.webform.Thursday_FieldDay[2].checked == true) || (document.webform.Thursday_FieldDay[3].checked == true)) {
		amtfielddayreg=parseFloat(document.webform.thursdayfee.value);
		amtfielddayreg+=bumpthu;
		numfd=0;
        	if (document.webform.Thursday_FieldDay[0].checked == true)
			numfd++
        	if (document.webform.Thursday_FieldDay[1].checked == true)
			numfd++
        	if (document.webform.Thursday_FieldDay[2].checked == true)
			numfd++
        	if (document.webform.Thursday_FieldDay[3].checked == true)
			numfd++
		totamtfielddayreg=amtfielddayreg*numfd;
		document.webform.amtfielddayreg.value=totamtfielddayreg;
//alert("FD: " + numfd + "; amtfielddayreg: " + amtfielddayreg + "; wf.amtfielddayreg: " + document.webform.amtfielddayreg.value);
		amtdue+=totamtfielddayreg;
        }
*/
        if ((document.webform.Friday_PreConf[0].checked == true) || (document.webform.Friday_PreConf[1].checked == true)) {
		amtpreconfreg=parseFloat(document.webform.fridayfee.value);
		amtpreconfreg+=bumpfri;
		numpc=0;
        	if (document.webform.Friday_PreConf[0].checked == true)
			numpc++
		if (document.webform.Friday_PreConf[1].checked == true)
			numpc++
		totamtpreconfreg=amtpreconfreg*numpc;
		document.webform.amtpreconfreg.value=totamtpreconfreg;
		amtdue+=totamtpreconfreg;
        }
	document.webform.amtdue.value=amtdue;
	document.webform.whichregpd.value=whichregpd;
	document.webform.memornot.value=memornot;
	presenter_panelist_text="";
	presenter_panelist_disc=0;
	if (amtpresdisc != 0) {
		presenter_panelist_disc=amtpresdisc;
		document.webform.Panelist.checked = false;
	}
	else if (amtpanldisc != 0)
		presenter_panelist_disc=amtpanldisc;
	presenter_panelist_text = presenter_panelist_disc + " " + presenter_panelist;
	document.webform.presenter_panelist.value=presenter_panelist_text;
	document.webform.presenter_panelist_disc.value=presenter_panelist_disc;
	document.webform.today.value=thisday;
}

/****************************************************************/
function ValidateWWconfData() {

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }

        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }

        if (isEmpty(document.webform.PhoneNumber.value)) {
		alert("Please enter your Phone Number.");
                document.webform.PhoneNumber.focus();
                return false;
        }

        if ((document.webform.AttendConference[1].checked == true) && (isEmpty(document.webform.WhyNotAttendConference.value))) {
		alert("Please tell us why you would not be interested in attending this conference.");
                document.webform.WhyNotAttendConference.focus();
                return false;
        }

        if ((document.webform.ParticipateInConference[0].checked == true) && (isEmpty(document.webform.HowToParticipateInConference.value))) {
		alert("Please tell us how you would like to participate in this conference.");
                document.webform.HowToParticipateInConference.focus();
                return false;
        }
}

/****************************************************************/
function ValidateLSSpecialRegData() {
//<input type=hidden name="required" value="realname,email">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
/*
        if ((document.webform.Sat_Reg_KathleenMoore.checked == false) & (document.webform.Sat_Reg_SusanAlbert.checked == false)) {
                alert("Please indicate the session(s) in which you want to register.");
                document.webform.Sat_Reg_KathleenMoore.focus();
                return false;
        }
*/

/*
        if ((document.webform.Saturday_Registration[0].checked == false) & (document.webform.Saturday_Registration[1].checked == false)) {
                alert("Please select the session in which you want to register.");
                document.webform.Saturday_Registration[0].focus();
                return false;
        }
*/
        if (document.webform.Saturday_Registration.checked == false) {
                document.webform.Saturday_Registration.checked=true;
        }
}

/****************************************************************/
function ValidateLSRegData(flag) {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,SCN_member,Registration_Requested">

today=new Date();
thisyy=today.getYear();
if (thisyy<1000)
	thisyy+=1900;
thismm=today.getMonth();
thismm++;
thismm=leftpad(thismm, "0", 2);
thisdd=today.getDate();
thisdd=leftpad(thisdd, "0", 2);
yymmdd=thisyy + thismm + thisdd;

if ((yymmdd > document.webform.register_regular.value) && (!flag)) {
	alert("Registration is now closed! We're sorry!");
	return false;
}
else {
        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
        if ((document.webform.student[0].checked == false) & (document.webform.student[1].checked == false)) {
                alert("Please indicate whether or not you are a college student");
                document.webform.student[0].focus();
                return false;
        }
        if ((document.webform.Registration_Requested[0].checked == false) & (document.webform.Registration_Requested[1].checked == false) & (document.webform.Workshop_RegistrationT1A.checked == false) & (document.webform.Workshop_RegistrationT1B.checked == false) & (document.webform.Workshop_RegistrationT2A.checked == false) & (document.webform.Workshop_RegistrationT2B.checked == false) & (document.webform.Workshop_RegistrationT2C.checked == false)) {
                alert("Please indicate the type of registration you desire (full, partial, &/or field-writing sessions).");
                document.webform.Registration_Requested[0].focus();
                return false;
        }
	else {
//        	if ((document.webform.Registration_Requested[1].checked == true) & (document.webform.Friday_Registration.checked == false) & (document.webform.Saturday_Registration.checked == false) & (document.webform.Saturday_Registration_NL.checked == false) & (document.webform.Saturday_Lunch.checked == false) & (document.webform.Workshop_RegistrationF1.checked == false) & (document.webform.Workshop_RegistrationF2.checked == false) & (document.webform.Workshop_RegistrationS1.checked == false) & (document.webform.Workshop_RegistrationS2.checked == false) & (document.webform.Workshop_RegistrationS3.checked == false) & (document.webform.Workshop_RegistrationS4.checked == false)) {
        	if ((document.webform.Registration_Requested[1].checked == true) & (document.webform.Saturday_Registration.checked == false) & (document.webform.Saturday_Registration_NL.checked == false) & (document.webform.Saturday_Lunch.checked == false) & (document.webform.Workshop_RegistrationF1.checked == false) & (document.webform.Workshop_RegistrationF2.checked == false) & (document.webform.Workshop_RegistrationS1.checked == false) & (document.webform.Workshop_RegistrationS2.checked == false) & (document.webform.Workshop_RegistrationS3.checked == false) & (document.webform.Workshop_RegistrationS4.checked == false)) {
                	alert("Please indicate the type of partial registration you desire.");
//                	document.webform.Friday_Registration.focus();
                	document.webform.Saturday_Registration.focus();
                	return false;
        	}
        }

//check scholarship request
        if (document.webform.scholarship_reg_fees.checked == true) {
        	if (document.webform.SCN_member[0].checked == false) {
                	alert("Only SCN members can apply for a scholarship. If you are planning to join now, please change your answer to 'Are you currently a member of the Story Circle Network?' to 'Yes'.");
                	document.webform.scholarship_reg_fees.focus();
        		document.webform.scholarship_reg_fees.checked=false;
                	return false;
        	}
		else {
        		if (isEmpty(document.webform.scholarship_reason.value) || isEmpty(document.webform.scholarship_community_use.value) || (document.webform.scholarship_share_experiences[0].checked == false & document.webform.scholarship_share_experiences[1].checked == false)) {
                		alert("To apply for a scholarship please give your reasons for applying, explain how you will share your experiences, and indicate if you are willing to share your follow up experiences with us.");
        			if (isEmpty(document.webform.scholarship_reason.value))
                			document.webform.scholarship_reason.focus();
				else if (isEmpty(document.webform.scholarship_community_use.value))
                			document.webform.scholarship_community_use.focus();
				else
					document.webform.scholarship_share_experiences[0].focus();
                		return false;
        		}
        	}
        }
	else {
        	document.webform.scholarship_reg_fees.checked=false;
		document.webform.scholarship_reason.value="";
		document.webform.scholarship_community_use.value="";
		document.webform.scholarship_share_experiences[0].checked=false;
		document.webform.scholarship_share_experiences[1].checked=false;
        }
	TotalLSConfRegAmt(flag);

        if (document.webform.okdone.value == 0) {
                alert("Thanks for registering! Info on how to pay your $" + amtdue + " registration fee will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}
}

function TotalLSConfRegAmt(flag) {
// calculate amt due:
YES="yes";
today=new Date();
thisyy=today.getYear();
if (thisyy<1000)
	thisyy+=1900;
thismm=today.getMonth();
thismm++;
thismm=leftpad(thismm, "0", 2);
thisdd=today.getDate();
thisdd=leftpad(thisdd, "0", 2);
yymmdd=thisyy + thismm + thisdd;

/*
<input type="hidden" name="conference_feebump" value="25">
<input type="hidden" name="fri_feebump" value="25">
<input type="hidden" name="food_feebumpF" value="5">
<input type="hidden" name="food_feebumpSS" value="10">
<input type="hidden" name="register_early" value="20051215">
<input type="hidden" name="register_regular" value="20060202">
*/
if (yymmdd <= document.webform.register_early.value) {
	full_fee=parseFloat(document.webform.fee_early.value);
	thu_fee=parseFloat(document.webform.fee_early_thu.value);
	fri_fee=parseFloat(document.webform.fee_early_fri.value);
	sat_fee=parseFloat(document.webform.fee_early_sat.value);
	sat_nl_fee=parseFloat(document.webform.fee_early_sat_nl.value);
	sat_lunch_fee=parseFloat(document.webform.fee_early_sat_lunch.value);
	wkshop_fee=parseFloat(document.webform.fee_early_wkshop.value);
	wkshop_fld_fee=parseFloat(document.webform.fee_early_wkshop_fld.value);
        if (document.webform.student[0].checked == true) {
		full_fee=parseFloat(document.webform.fee_early_student.value);
		thu_fee=parseFloat(document.webform.fee_early_thu_student.value);
		fri_fee=parseFloat(document.webform.fee_early_fri_student.value);
		sat_fee=parseFloat(document.webform.fee_early_sat_student.value);
		sat_nl_fee=parseFloat(document.webform.fee_early_sat_nl_student.value);
		sat_lunch_fee=parseFloat(document.webform.fee_early_sat_lunch_student.value);
		wkshop_fee=parseFloat(document.webform.fee_early_wkshop_student.value);
		wkshop_fld_fee=parseFloat(document.webform.fee_early_wkshop_fld_student.value);
	}
}
else if (yymmdd <= document.webform.register_regular.value) {
	full_fee=parseFloat(document.webform.fee_reg.value);
	thu_fee=parseFloat(document.webform.fee_reg_thu.value);
	fri_fee=parseFloat(document.webform.fee_reg_fri.value);
	sat_fee=parseFloat(document.webform.fee_reg_sat.value);
	sat_nl_fee=parseFloat(document.webform.fee_reg_sat_nl.value);
	sat_lunch_fee=parseFloat(document.webform.fee_reg_sat_lunch.value);
	wkshop_fee=parseFloat(document.webform.fee_reg_wkshop.value);
	wkshop_fld_fee=parseFloat(document.webform.fee_reg_wkshop_fld.value);
        if (document.webform.student[0].checked == true) {
		full_fee=parseFloat(document.webform.fee_reg_student.value);
		fri_fee=parseFloat(document.webform.fee_reg_fri_student.value);
		sat_fee=parseFloat(document.webform.fee_reg_sat_student.value);
		sat_nl_fee=parseFloat(document.webform.fee_reg_sat_nl_student.value);
		sat_lunch_fee=parseFloat(document.webform.fee_reg_sat_lunch_student.value);
		wkshop_fee=parseFloat(document.webform.fee_reg_wkshop_student.value);
		wkshop_fld_fee=parseFloat(document.webform.fee_reg_wkshop_fld_student.value);
	}
}
else if (!flag) {
	alert("Registration is now closed! We're sorry!");
	return false;
}
else {
	full_fee=parseFloat(document.webform.fee_late.value);
	fri_fee=parseFloat(document.webform.fee_late_fri.value);
	sat_fee=parseFloat(document.webform.fee_late_sat.value);
	sat_nl_fee=parseFloat(document.webform.fee_late_sat_nl.value);
	sat_lunch_fee=parseFloat(document.webform.fee_late_sat_lunch.value);
	wkshop_fee=parseFloat(document.webform.fee_late_wkshop.value);
	wkshop_fld_fee=parseFloat(document.webform.fee_late_wkshop_fld.value);
        if (document.webform.student[0].checked == true) {
		full_fee=parseFloat(document.webform.fee_late_student.value);
		fri_fee=parseFloat(document.webform.fee_late_fri_student.value);
		sat_fee=parseFloat(document.webform.fee_late_sat_student.value);
		sat_nl_fee=parseFloat(document.webform.fee_late_sat_nl_student.value);
		sat_lunch_fee=parseFloat(document.webform.fee_late_sat_lunch_student.value);
		wkshop_fee=parseFloat(document.webform.fee_late_wkshop_student.value);
		wkshop_fld_fee=parseFloat(document.webform.fee_late_wkshop_fld_student.value);
	}
}

	amtdue=0;
	amtfullreg=0;
//	amtfrireg=0;
	amtsatreg=0;
	amtsatnlreg=0;
	amtsatlreg=0;
	amtwkshopreg=0;
	amtwkshopfldreg=0;
	document.webform.amtfullreg.value="";
	document.webform.amtfullregval.value="";
//	document.webform.amtfrireg.value="";
//	document.webform.amtfriregval.value="";
	document.webform.amtsatreg.value="";
	document.webform.amtsatregval.value="";
	document.webform.amtsatnlreg.value="";
	document.webform.amtsatnlregval.value="";
	document.webform.amtsatlreg.value="";
	document.webform.amtsatlregval.value="";
	document.webform.amtwkshopreg.value="";
	document.webform.amtwkshopregval.value="";
	document.webform.amtwkshopfldreg.value="";
	document.webform.amtwkshopfldregval.value="";
        if (document.webform.Registration_Requested[0].checked == true) {
//		document.webform.amtfrireg.value="";
		document.webform.amtsatreg.value="";
		document.webform.amtsatnlreg.value="";
		document.webform.amtsatlreg.value="";
		document.webform.amtwkshopreg.value="";
//        	document.webform.Friday_Registration.checked = false;
        	document.webform.Saturday_Registration.checked = false;
        	document.webform.Saturday_Registration_NL.checked = false;
        	document.webform.Saturday_Lunch.checked = false;
        	document.webform.Workshop_RegistrationF1.checked = false;
        	document.webform.Workshop_RegistrationF2.checked = false;
        	document.webform.Workshop_RegistrationS1.checked = false;
        	document.webform.Workshop_RegistrationS2.checked = false;
        	document.webform.Workshop_RegistrationS3.checked = false;
        	document.webform.Workshop_RegistrationS4.checked = false;
		amtfullreg=full_fee;
		document.webform.amtfullreg.value=amtfullreg;
		document.webform.amtfullregval.value=amtfullreg;
		amtdue+=amtfullreg;
        }
	else {
/*
        	if (document.webform.Friday_Registration.checked == true) {
			amtfrireg=fri_fee;
			document.webform.amtfrireg.value=amtfrireg;
			document.webform.amtfriregval.value=amtfrireg;
			amtdue+=amtfrireg;
        	}
*/
        	if (document.webform.Saturday_Registration.checked == true) {
			amtsatreg=sat_fee;
			document.webform.amtsatreg.value=amtsatreg;
			document.webform.amtsatregval.value=amtsatreg;
			amtdue+=amtsatreg;
        		if (document.webform.Saturday_Registration_NL.checked == true)
        			document.webform.Saturday_Registration_NL.checked = false;
        		if (document.webform.Saturday_Lunch.checked == true)
        			document.webform.Saturday_Lunch.checked = false;
        		if (document.webform.Workshop_RegistrationS1.checked == true)
        			document.webform.Workshop_RegistrationS1.checked = false;
        		if (document.webform.Workshop_RegistrationS2.checked == true)
        			document.webform.Workshop_RegistrationS2.checked = false;
        		if (document.webform.Workshop_RegistrationS3.checked == true)
        			document.webform.Workshop_RegistrationS3.checked = false;
        		if (document.webform.Workshop_RegistrationS4.checked == true)
        			document.webform.Workshop_RegistrationS4.checked = false;
        	}
        	if (document.webform.Saturday_Registration_NL.checked == true) {
			amtsatnlreg=sat_nl_fee;
			document.webform.amtsatnlreg.value=amtsatnlreg;
			document.webform.amtsatnlregval.value=amtsatnlreg;
			amtdue+=amtsatnlreg;
        		if (document.webform.Saturday_Lunch.checked == true)
        			document.webform.Saturday_Lunch.checked = false;
        		if (document.webform.Workshop_RegistrationS1.checked == true)
        			document.webform.Workshop_RegistrationS1.checked = false;
        		if (document.webform.Workshop_RegistrationS2.checked == true)
        			document.webform.Workshop_RegistrationS2.checked = false;
        		if (document.webform.Workshop_RegistrationS3.checked == true)
        			document.webform.Workshop_RegistrationS3.checked = false;
        		if (document.webform.Workshop_RegistrationS4.checked == true)
        			document.webform.Workshop_RegistrationS4.checked = false;
        	}
        	if (document.webform.Saturday_Lunch.checked == true) {
			amtsatlreg=sat_lunch_fee;
			document.webform.amtsatlreg.value=amtsatlreg;
			document.webform.amtsatlregval.value=amtsatlreg;
			amtdue+=amtsatlreg;
        	}
        	if (document.webform.Workshop_RegistrationF1.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
        	if (document.webform.Workshop_RegistrationF2.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
        	if (document.webform.Workshop_RegistrationS1.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
        	if (document.webform.Workshop_RegistrationS2.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
        	if (document.webform.Workshop_RegistrationS3.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
        	if (document.webform.Workshop_RegistrationS4.checked == true) {
			amtwkshopreg+=wkshop_fee;
        	}
		document.webform.feewkshop.value=wkshop_fee;
		document.webform.amtwkshopreg.value=amtwkshopreg;
		document.webform.amtwkshopregval.value=amtwkshopreg;
		amtdue+=amtwkshopreg;
        }
       	if (document.webform.Workshop_RegistrationT1A.checked == true) {
		amtwkshopfldreg+=wkshop_fld_fee;
       	}
       	if (document.webform.Workshop_RegistrationT1B.checked == true) {
		amtwkshopfldreg+=wkshop_fld_fee;
       	}
       	if (document.webform.Workshop_RegistrationT2A.checked == true) {
		amtwkshopfldreg+=wkshop_fld_fee;
       	}
       	if (document.webform.Workshop_RegistrationT2B.checked == true) {
		amtwkshopfldreg+=wkshop_fld_fee;
       	}
       	if (document.webform.Workshop_RegistrationT2C.checked == true) {
		amtwkshopfldreg+=wkshop_fld_fee;
       	}
	document.webform.feewkshopfld.value=wkshop_fld_fee;
	document.webform.amtwkshopfldreg.value=amtwkshopfldreg;
	document.webform.amtwkshopfldregval.value=amtwkshopfldreg;
	amtdue+=amtwkshopfldreg;

	document.webform.amtdue.value=amtdue;
	document.webform.amtdueval.value=amtdue;
}

/****************************************************************/
function ValidateWWOrderData() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
/*
	if (document.webform.WhatWildness_$20.selectedIndex == 0) {
		alert("Please enter the number of book you wish to order.");
		document.webform.WhatWildness_$20.focus();
		return false;
	}
	if ((document.webform.Country.value != USA) && (document.webform.Country.value != "")) {
		alert("If you are ordering outside the US, query by email to storycircle@storycircle.org and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
		return true;
	}
*/
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
	UpdateWWOrderData();
}

/****************************************************************/
function UpdateWWOrderData() {
	numbooks=document.webform.WhatWildness_$20.value;
	thissalestax=document.webform.thissalestax.value;
	orderamt=numbooks*20;
	shipchg=4;
	if (numbooks > 1) {
		shipchg+=numbooks-1;
	}
	salestax=0;
	if (document.webform.State.value == "TX") {
		salestax=thissalestax*orderamt;
	}
	document.webform.orderamt.value=orderamt.toFixed(2);
	document.webform.shipchg.value=shipchg.toFixed(2);
	document.webform.salestax.value=salestax.toFixed(2);
	amtdue=orderamt+shipchg+salestax;
	document.webform.amtdue.value=amtdue.toFixed(2);
}

/****************************************************************/
function ValidateVendorData() {
//<input type=hidden name="required" value="realname,Business_Name,email,Street_Address,City,State,Zip_Code,Country,Phone_Number,Table_Size,SCN_member,Product_Description,TX_Sales_Tax_Permit,SCN_not_responsible_for_loss">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.Business_Name.value)) {
		alert("Please enter your Business Name.");
                document.webform.Business_Name.focus();
                return false;
        }
        if ((document.webform.Table_Size[0].checked == false) & (document.webform.Table_Size[1].checked == false)) {
                alert("Please indicate the size table you want to reserve.");
                document.webform.Table_Size[0].focus();
                return false;
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
//	if ((document.webform.TX_Sales_Tax_Permit[0].checked == false) & (document.webform.TX_Sales_Tax_Permit[1].checked == false) & (document.webform.TX_Sales_Tax_Permit[2].checked == false)) {
	if ((document.webform.TX_Sales_Tax_Permit[0].checked == false) & (document.webform.TX_Sales_Tax_Permit[1].checked == false)) {
                alert("Please indicate the status of your Texas Sales Tax & Use Permit");
                document.webform.TX_Sales_Tax_Permit[0].focus();
                return false;
        }
        else if ((document.webform.TX_Sales_Tax_Permit[1].checked == true) & (isEmpty(document.webform.TX_Sales_Tax_Permit_Number.value))) {
                alert("Please enter your Texas Sales Tax & Use Permit number");
                document.webform.TX_Sales_Tax_Permit_Number.focus();
                return false;
        }
        if (document.webform.SCN_not_responsible_for_loss.checked == false) {
                alert("Please acknowledge that SCN is not responsible for damages/losses.");
                document.webform.SCN_not_responsible_for_loss.focus();
                return false;
        }
        if (isEmpty(document.webform.Product_Description.value)) {
		alert("Please enter a description of the product you want to sell.");
                document.webform.Product_Description.focus();
                return false;
        }
	TotalVendorAmt();
}

function TotalVendorAmt() {
	amtdue=0;
	table_full=parseFloat(document.webform.Table_Size_full.value);
	table_half=parseFloat(document.webform.Table_Size_half.value);
	member_dues=parseFloat(document.webform.SCN_member_dues.value);
       	if (document.webform.Table_Size[0].checked == true) {
		amtdue+=table_full;
       	}
	else {
		amtdue+=table_half;
       	}
        if (document.webform.SCN_member[1].checked == true) {
		amtdue+=member_dues;
       	}
	document.webform.amtdue.value=amtdue;
	document.webform.totamtdue.value=amtdue;
}

/****************************************************************/
function ValidateKTSAuthorData() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,RecipeTitle1,SubmitDate1">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.RecipeTitle1.value)) {
		alert("Please enter the name of your 1st piece.");
                document.webform.RecipeTitle1.focus();
                return false;
        }
        if ((isEmpty(document.webform.SubmitDateMM1.value)) || (isEmpty(document.webform.SubmitDateDD1.value)) || (isEmpty(document.webform.SubmitDateYYYY1.value))) {
		alert("Please enter the submission date for your 1st piece.");
        	if (isEmpty(document.webform.SubmitDateMM1.value))
                	document.webform.SubmitDateMM1.focus();
        	else if (isEmpty(document.webform.SubmitDateDD1.value))
                	document.webform.SubmitDateDD1.focus();
        	else
                	document.webform.SubmitDateYYYY1.focus();
                return false;
        }
        else {
		mm1 = parseFloat(document.webform.SubmitDateMM1.value);
		dd1 = parseFloat(document.webform.SubmitDateDD1.value);
		yyyy1 = parseFloat(document.webform.SubmitDateYYYY1.value);
        	if ((!isNum(document.webform.SubmitDateMM1.value)) || ((mm1 < 1) || (mm1 > 12))) {
			alert("You entered an invalid month (" + document.webform.SubmitDateMM1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateMM1.focus();
                	return false;
		}
        	if ((!isNum(document.webform.SubmitDateDD1.value)) || ((dd1 < 1) || (dd1 > 31))) {
			alert("You entered an invalid day (" + document.webform.SubmitDateDD1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateDD1.focus();
                	return false;
		}
        	else if ((!isNum(document.webform.SubmitDateYYYY1.value)) || ((yyyy1 < 2006) || (yyyy1 > 2007))) {
			alert("You entered an invalid year (" + document.webform.SubmitDateYYYY1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateYYYY1.focus();
                	return false;
		}
		submitdate1 = mm1 + "/" + dd1 + "/" + yyyy1;
                document.webform.SubmitDate1.value=submitdate1;
        }
        if ((!isEmpty(document.webform.RecipeTitle2.value)) || (!isEmpty(document.webform.SubmitDateMM2.value)) || (!isEmpty(document.webform.SubmitDateDD2.value)) || (!isEmpty(document.webform.SubmitDateYYYY2.value))
) {
        	if (isEmpty(document.webform.RecipeTitle2.value)) {
			alert("Please enter the name of your 2nd piece.");
                	document.webform.RecipeTitle2.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM2.value)) || (isEmpty(document.webform.SubmitDateDD2.value)) || (isEmpty(document.webform.SubmitDateYYYY2.value))) {
			alert("Please enter the submission date for your 2nd piece.");
        		if (isEmpty(document.webform.SubmitDateMM2.value))
                		document.webform.SubmitDateMM2.focus();
        		else if (isEmpty(document.webform.SubmitDateDD2.value))
                		document.webform.SubmitDateDD2.focus();
        		else
                		document.webform.SubmitDateYYYY2.focus();
                	return false;
        	}
        	else {
			mm2 = parseFloat(document.webform.SubmitDateMM2.value);
			dd2 = parseFloat(document.webform.SubmitDateDD2.value);
			yyyy2 = parseFloat(document.webform.SubmitDateYYYY2.value);
        		if ((!isNum(document.webform.SubmitDateMM2.value)) || ((mm2 < 1) || (mm2 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateMM2.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD2.value)) || ((dd2 < 1) || (dd2 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateDD2.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY2.value)) || ((yyyy2 < 2006) || (yyyy2 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateYYYY2.focus();
                		return false;
			}
			submitdate2 = mm2 + "/" + dd2 + "/" + yyyy2;
                	document.webform.SubmitDate2.value=submitdate2;
        	}
        }
        if ((!isEmpty(document.webform.RecipeTitle3.value)) || (!isEmpty(document.webform.SubmitDateMM3.value)) || (!isEmpty(document.webform.SubmitDateDD3.value)) || (!isEmpty(document.webform.SubmitDateYYYY3.value))) {
        	if (isEmpty(document.webform.RecipeTitle3.value)) {
			alert("Please enter the name of your 3rd piece.");
                	document.webform.RecipeTitle3.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM3.value)) || (isEmpty(document.webform.SubmitDateDD3.value)) || (isEmpty(document.webform.SubmitDateYYYY3.value))) {
			alert("Please enter the submission date for your 3rd piece.");
        		if (isEmpty(document.webform.SubmitDateMM3.value))
                		document.webform.SubmitDateMM3.focus();
        		else if (isEmpty(document.webform.SubmitDateDD3.value))
                		document.webform.SubmitDateDD3.focus();
        		else
                		document.webform.SubmitDateYYYY3.focus();
                	return false;
        	}
        	else {
			mm3 = parseFloat(document.webform.SubmitDateMM3.value);
			dd3 = parseFloat(document.webform.SubmitDateDD3.value);
			yyyy3 = parseFloat(document.webform.SubmitDateYYYY3.value);
        		if ((!isNum(document.webform.SubmitDateMM3.value)) || ((mm3 < 1) || (mm3 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateMM3.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD3.value)) || ((dd3 < 1) || (dd3 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateDD3.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY3.value)) || ((yyyy3 < 2006) || (yyyy3 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateYYYY3.focus();
                		return false;
			}
			submitdate3 = mm3 + "/" + dd3 + "/" + yyyy3;
                	document.webform.SubmitDate3.value=submitdate3;
        	}
        }
        if ((!isEmpty(document.webform.RecipeTitle4.value)) || (!isEmpty(document.webform.SubmitDateMM4.value)) || (!isEmpty(document.webform.SubmitDateDD4.value)) || (!isEmpty(document.webform.SubmitDateYYYY4.value))) {
        	if (isEmpty(document.webform.RecipeTitle4.value)) {
			alert("Please enter the name of your 4th piece.");
                	document.webform.RecipeTitle4.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM4.value)) || (isEmpty(document.webform.SubmitDateDD4.value)) || (isEmpty(document.webform.SubmitDateYYYY4.value))) {
			alert("Please enter the submission date for your 4th piece.");
        		if (isEmpty(document.webform.SubmitDateMM4.value))
                		document.webform.SubmitDateMM4.focus();
        		else if (isEmpty(document.webform.SubmitDateDD4.value))
                		document.webform.SubmitDateDD4.focus();
        		else
                		document.webform.SubmitDateYYYY4.focus();
                	return false;
        	}
        	else {
			mm4 = parseFloat(document.webform.SubmitDateMM4.value);
			dd4 = parseFloat(document.webform.SubmitDateDD4.value);
			yyyy4 = parseFloat(document.webform.SubmitDateYYYY4.value);
        		if ((!isNum(document.webform.SubmitDateMM4.value)) || ((mm4 < 1) || (mm4 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM4.value + ") for your 4th submission date. Please correct it.");
                		document.webform.SubmitDateMM4.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD4.value)) || ((dd4 < 1) || (dd4 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD4.value + ") for your 4th submission date. Please correct it.");
                		document.webform.SubmitDateDD4.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY4.value)) || ((yyyy4 < 2006) || (yyyy4 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY4.value + ") for your 4th submission date. Please correct it.");
                		document.webform.SubmitDateYYYY4.focus();
                		return false;
			}
			submitdate4 = mm4 + "/" + dd4 + "/" + yyyy4;
                	document.webform.SubmitDate4.value=submitdate4;
        	}
        }
        if ((!isEmpty(document.webform.RecipeTitle5.value)) || (!isEmpty(document.webform.SubmitDateMM5.value)) || (!isEmpty(document.webform.SubmitDateDD5.value)) || (!isEmpty(document.webform.SubmitDateYYYY5.value))) {
        	if (isEmpty(document.webform.RecipeTitle5.value)) {
			alert("Please enter the name of your 5th piece.");
                	document.webform.RecipeTitle5.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM5.value)) || (isEmpty(document.webform.SubmitDateDD5.value)) || (isEmpty(document.webform.SubmitDateYYYY5.value))) {
			alert("Please enter the submission date for your 5th piece.");
        		if (isEmpty(document.webform.SubmitDateMM5.value))
                		document.webform.SubmitDateMM5.focus();
        		else if (isEmpty(document.webform.SubmitDateDD5.value))
                		document.webform.SubmitDateDD5.focus();
        		else
                		document.webform.SubmitDateYYYY5.focus();
                	return false;
        	}
        	else {
			mm5 = parseFloat(document.webform.SubmitDateMM5.value);
			dd5 = parseFloat(document.webform.SubmitDateDD5.value);
			yyyy5 = parseFloat(document.webform.SubmitDateYYYY5.value);
        		if ((!isNum(document.webform.SubmitDateMM5.value)) || ((mm5 < 1) || (mm5 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM5.value + ") for your 5th submission date. Please correct it.");
                		document.webform.SubmitDateMM5.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD5.value)) || ((dd5 < 1) || (dd5 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD5.value + ") for your 5th submission date. Please correct it.");
                		document.webform.SubmitDateDD5.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY5.value)) || ((yyyy5 < 2006) || (yyyy5 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY5.value + ") for your 5th submission date. Please correct it.");
                		document.webform.SubmitDateYYYY5.focus();
                		return false;
			}
			submitdate5 = mm5 + "/" + dd5 + "/" + yyyy5;
                	document.webform.SubmitDate5.value=submitdate5;
        	}
        }
        if ((!isEmpty(document.webform.RecipeTitle6.value)) || (!isEmpty(document.webform.SubmitDateMM6.value)) || (!isEmpty(document.webform.SubmitDateDD6.value)) || (!isEmpty(document.webform.SubmitDateYYYY6.value))) {
        	if (isEmpty(document.webform.RecipeTitle6.value)) {
			alert("Please enter the name of your 6th piece.");
                	document.webform.RecipeTitle6.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM6.value)) || (isEmpty(document.webform.SubmitDateDD6.value)) || (isEmpty(document.webform.SubmitDateYYYY6.value))) {
			alert("Please enter the submission date for your 6th piece.");
        		if (isEmpty(document.webform.SubmitDateMM6.value))
                		document.webform.SubmitDateMM6.focus();
        		else if (isEmpty(document.webform.SubmitDateDD6.value))
                		document.webform.SubmitDateDD6.focus();
        		else
                		document.webform.SubmitDateYYYY6.focus();
                	return false;
        	}
        	else {
			mm6 = parseFloat(document.webform.SubmitDateMM6.value);
			dd6 = parseFloat(document.webform.SubmitDateDD6.value);
			yyyy6 = parseFloat(document.webform.SubmitDateYYYY6.value);
        		if ((!isNum(document.webform.SubmitDateMM6.value)) || ((mm6 < 1) || (mm6 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM6.value + ") for your 6th submission date. Please correct it.");
                		document.webform.SubmitDateMM6.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD6.value)) || ((dd6 < 1) || (dd6 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD6.value + ") for your 6th submission date. Please correct it.");
                		document.webform.SubmitDateDD6.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY6.value)) || ((yyyy6 < 2006) || (yyyy6 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY6.value + ") for your 6th submission date. Please correct it.");
                		document.webform.SubmitDateYYYY6.focus();
                		return false;
			}
			submitdate6 = mm6 + "/" + dd6 + "/" + yyyy6;
                	document.webform.SubmitDate6.value=submitdate6;
        	}
        }
        if ((!isEmpty(document.webform.RecipeTitle7.value)) || (!isEmpty(document.webform.SubmitDateMM7.value)) || (!isEmpty(document.webform.SubmitDateDD7.value)) || (!isEmpty(document.webform.SubmitDateYYYY7.value))) {
        	if (isEmpty(document.webform.RecipeTitle7.value)) {
			alert("Please enter the name of your 7th piece.");
                	document.webform.RecipeTitle7.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM7.value)) || (isEmpty(document.webform.SubmitDateDD7.value)) || (isEmpty(document.webform.SubmitDateYYYY7.value))) {
			alert("Please enter the submission date for your 7th piece.");
        		if (isEmpty(document.webform.SubmitDateMM7.value))
                		document.webform.SubmitDateMM7.focus();
        		else if (isEmpty(document.webform.SubmitDateDD7.value))
                		document.webform.SubmitDateDD7.focus();
        		else
                		document.webform.SubmitDateYYYY7.focus();
                	return false;
        	}
        	else {
			mm7 = parseFloat(document.webform.SubmitDateMM7.value);
			dd7 = parseFloat(document.webform.SubmitDateDD7.value);
			yyyy7 = parseFloat(document.webform.SubmitDateYYYY7.value);
        		if ((!isNum(document.webform.SubmitDateMM7.value)) || ((mm7 < 1) || (mm7 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM7.value + ") for your 7th submission date. Please correct it.");
                		document.webform.SubmitDateMM7.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD7.value)) || ((dd7 < 1) || (dd7 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD7.value + ") for your 7th submission date. Please correct it.");
                		document.webform.SubmitDateDD7.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY7.value)) || ((yyyy7 < 2006) || (yyyy7 > 2007))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY7.value + ") for your 7th submission date. Please correct it.");
                		document.webform.SubmitDateYYYY7.focus();
                		return false;
			}
			submitdate7 = mm7 + "/" + dd7 + "/" + yyyy7;
                	document.webform.SubmitDate7.value=submitdate7;
        	}
        }
}

/****************************************************************/
function JustCountWords(field, countfield, overflowfield, maxlimit, errmsg) {
	wordcounter=0;
	toolong_pos=0;
	for (x=0;x<field.value.length;x++) {
		if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {
			wordcounter++
		}  // Counts the spaces while ignoring double spaces, usually one in between each word.
		if (wordcounter > maxlimit) {
			if (toolong_pos == 0)
				toolong_pos=x;
		}
	}
	if (toolong_pos > 0) {
//		overflowfield.value = "Below is the text that exceeds the " + maxlimit + " word limit:\n\n" + field.value.substring(toolong_pos);
//		field.value = field.value.substring(0, toolong_pos);
	}
	countfield.value = maxlimit - wordcounter;
//	if (wordcounter <= maxlimit)
//		overflowfield.value = errmsg.value;
	return wordcounter;
}

/****************************************************************/
function CountWords4(field, countfield, overflowfield, maxlimit, errmsg) {
	wordcounter=0;
	toolong_pos=0;
	for (x=0;x<field.value.length;x++) {
		if (field.value.charAt(x) == " " && field.value.charAt(x-1) != " ")  {
			wordcounter++
		}  // Counts the spaces while ignoring double spaces, usually one in between each word.
		if (wordcounter > maxlimit) {
			if (toolong_pos == 0)
				toolong_pos=x;
		}
//     		else {
//			countfield.value = maxlimit - wordcounter;
//		}
	}
	if (toolong_pos > 0) {
		overflowfield.value = "Below is the text that exceeds the " + maxlimit + " word limit:\n\n" + field.value.substring(toolong_pos);
		field.value = field.value.substring(0, toolong_pos);
	}
	countfield.value = maxlimit - wordcounter;
	if (wordcounter <= maxlimit)
		overflowfield.value = errmsg.value;
	return wordcounter;
}

/****************************************************************/
function CountWords3(obj,countobj){

	var formcontent=obj.value
	formcontent=formcontent.split(" ")
	countobj.value=formcontent.length
}

/****************************************************************/
function CountWords2(wordLen,obj){
	var len = obj.value.split(/[\s]+/);
	if(len.length > wordLen){
		alert("You've exceeded the "+wordLen+" word limit for the article!");
		obj.oldValue = obj.value!=obj.oldValue?obj.value:obj.oldValue;
		obj.value = obj.oldValue?obj.oldValue:"";
		return false;
	}
	return true;
}

/****************************************************************/
function CountWords(this_field, show_word_count, show_char_count, countobj) {
	if (show_word_count == null) {
		show_word_count = true;
	}
	if (show_char_count == null) {
		show_char_count = false;
	}
	var char_count = this_field.length;
	var fullStr = this_field + " ";
	var initial_whitespace_rExp = /^[^A-Za-z0-9]+/gi;
	var left_trimmedStr = fullStr.replace(initial_whitespace_rExp, "");
	var non_alphanumerics_rExp = rExp = /[^A-Za-z0-9]+/gi;
	var cleanedStr = left_trimmedStr.replace(non_alphanumerics_rExp, " ");
	var splitString = cleanedStr.split(" ");
	var word_count = splitString.length -1;
	if (fullStr.length < 2) {
		word_count = 0;
	}
	if (word_count == 1) {
		wordOrWords = " word";
	}
	else {
		wordOrWords = " words";
	}
	if (char_count == 1) {
		charOrChars = " character";
	} else {
		charOrChars = " characters";
	}
	if (show_word_count & show_char_count) {
		alert ("Word Count:\n" + "    " + word_count + wordOrWords + "\n" + "    " + char_count + charOrChars);
	}
	else {
		if (show_word_count) {
			alert ("Word Count:  " + word_count + wordOrWords);
		}
		else {
			if (show_char_count) {
				alert ("Character Count:  " + char_count + charOrChars);
      			}
   		}
	}
	if (countobj)
		countobj.value=word_count;
	else
		return word_count;
}

/****************************************************************/
var selectedOptions = [];
function countSelected(select,maxNumber){
	for (var i=0; i<select.options.length; i++){
		if (select.options[i].selected && select.options[i].value != "" && !new RegExp(i,'g').test(selectedOptions.toString())){
			selectedOptions.push(i);
		}

		if (!select.options[i].selected && new RegExp(i,'g').test(selectedOptions.toString())){
			selectedOptions = selectedOptions.sort(function(a,b){return a-b});  
			for (var j=0; j<selectedOptions.length; j++){
				if (selectedOptions[j] == i){
					selectedOptions.splice(j,1);
				}
			}
		}

		if (select.options[i].value == "") {
			select.options[i].selected = false;
		}
		if (selectedOptions.length > maxNumber) {
			var throwAlert = true;
			select.options[i].selected = false;
			selectedOptions.pop();
		}
	}

	if (throwAlert == true){
		return false;
	}
	else
		return true;
}

/****************************************************************/
function countChecked(checkboxitem) {
count=0;
	for (var i=0; i < checkboxitem.length; i++) {
		checkboxitem[i].checked?count++:null;
	}
	return count;
}

/****************************************************************/
function ValidateBRData() {
//<input type=hidden name="required" value="realname,email,SCN_member,BookTitle,BookAuthor,Publisher,PublicationYear,ISBN,YourReview,AuthorInfo">

max_word_count=1000;

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
	else {
        	if (document.webform.SCN_member[1].checked == true) {
                	alert("We're sorry, but you must be a member of SCN to submit a review.");
                	document.webform.SCN_member[1].focus();
                	return false;
        	}
        }
        if (isEmpty(document.webform.BookTitle.value)) {
		alert("Please enter the title of the book.");
                document.webform.BookTitle.focus();
                return false;
        }
        if (isEmpty(document.webform.BookAuthor.value)) {
		alert("Please enter the author's name.");
                document.webform.BookAuthor.focus();
                return false;
        }
        if (isEmpty(document.webform.Publisher.value)) {
		alert("Please enter the book publisher's name.");
                document.webform.Publisher.focus();
                return false;
        }
        if (isEmpty(document.webform.PublicationYear.value)) {
		alert("Please enter the year that the book was published.");
                document.webform.PublicationYear.focus();
                return false;
        }
        if (isEmpty(document.webform.ISBN.value)) {
		alert("Please enter the ISBN of the book.");
                document.webform.ISBN.focus();
                return false;
        }
	if (document.webform.Category.selectedIndex == -1) {
                alert("Please select the book's category");
                document.webform.Category.focus();
                return false;
        }
	else {
		if (countSelected(document.webform.Category,3) == false) {
                	alert("No more than 3 categories may be selected; only the first 3 have been saved.");
                	document.webform.Category.focus();
                	return false;
        	}
        }
        if (isEmpty(document.webform.YourReview.value)) {
		alert("Please enter your review.");
                document.webform.YourReview.focus();
                return false;
        }
	else {
		wordcount=CountWords(document.webform.YourReview.value,0,0);
		if (wordcount > max_word_count) {
			alert("Your review must be no more than " + max_word_count + " words (it is currently " + wordcount + " words). Please shorten it and re-submit.");
                	document.webform.YourReview.focus();
                	return false;
        	}
        }
        if (isEmpty(document.webform.AuthorInfo.value)) {
		alert("Please enter some information about the author.");
                document.webform.AuthorInfo.focus();
                return false;
        }
}

/****************************************************************/
function ValidateJrnlData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Referred_From">
SCNMEM="Story Circle Network member";
FRIEND="a friend";
pronoun1="your";

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter " + pronoun1 + " Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter " + pronoun1 + " Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }

	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
        if ((document.webform.V12N1.checked == false) & (document.webform.V12N2.checked == false) & (document.webform.V12N3.checked == false) & (document.webform.V12N4.checked == false) & (document.webform.V11N1.checked == false) & (document.webform.V11N2.checked == false) & (document.webform.V11N3.checked == false) & (document.webform.V11N4.checked == false) & (document.webform.V10N1.checked == false) & (document.webform.V10N2.checked == false) & (document.webform.V10N3.checked == false) & (document.webform.V10N4.checked == false) & (document.webform.V9N1.checked == false) & (document.webform.V9N2.checked == false) & (document.webform.V9N3.checked == false) & (document.webform.V9N4.checked == false) & (document.webform.V8N1.checked == false) & (document.webform.V8N2.checked == false) & (document.webform.V8N3.checked == false) & (document.webform.V8N4.checked == false) & (document.webform.V7N1.checked == false) & (document.webform.V7N2.checked == false) & (document.webform.V7N3.checked == false) & (document.webform.V7N4.checked == false) & (document.webform.V6N1.checked == false) & (document.webform.V6N2.checked == false) & (document.webform.V6N3.checked == false) & (document.webform.V6N4.checked == false) & (document.webform.V5N1.checked == false) & (document.webform.V5N2.checked == false) & (document.webform.V5N3.checked == false) & (document.webform.V5N4.checked == false) & (document.webform.V4N1.checked == false) & (document.webform.V4N2.checked == false) & (document.webform.V4N3.checked == false) & (document.webform.V4N4.checked == false) & (document.webform.V3N1.checked == false) & (document.webform.V3N2.checked == false) & (document.webform.V3N3.checked == false) & (document.webform.V3N4.checked == false) & (document.webform.V2N1.checked == false) & (document.webform.V2N2.checked == false) & (document.webform.V2N3.checked == false) & (document.webform.V2N4.checked == false) & (document.webform.V1N1.checked == false) & (document.webform.V1N2.checked == false) & (document.webform.V1N3.checked == false) & (document.webform.V1N4.checked == false)) {
                alert("Please select the issue(s) you want to purchase.");
                document.webform.V12N1.focus();
                return false;
        }
	else {
		numjournals=0;
		if (document.webform.V12N1.checked == true)
			numjournals++;
		if (document.webform.V12N2.checked == true)
			numjournals++;
		if (document.webform.V12N3.checked == true)
			numjournals++;
		if (document.webform.V12N4.checked == true)
			numjournals++;
		if (document.webform.V11N1.checked == true)
			numjournals++;
		if (document.webform.V11N2.checked == true)
			numjournals++;
		if (document.webform.V11N3.checked == true)
			numjournals++;
		if (document.webform.V11N4.checked == true)
			numjournals++;
		if (document.webform.V10N1.checked == true)
			numjournals++;
		if (document.webform.V10N2.checked == true)
			numjournals++;
		if (document.webform.V10N3.checked == true)
			numjournals++;
		if (document.webform.V10N4.checked == true)
			numjournals++;
		if (document.webform.V9N1.checked == true)
			numjournals++;
		if (document.webform.V9N2.checked == true)
			numjournals++;
		if (document.webform.V9N3.checked == true)
			numjournals++;
		if (document.webform.V9N4.checked == true)
			numjournals++;
		if (document.webform.V8N1.checked == true)
			numjournals++;
		if (document.webform.V8N2.checked == true)
			numjournals++;
		if (document.webform.V8N3.checked == true)
			numjournals++;
		if (document.webform.V8N4.checked == true)
			numjournals++;
		if (document.webform.V7N1.checked == true)
			numjournals++;
		if (document.webform.V7N2.checked == true)
			numjournals++;
		if (document.webform.V7N3.checked == true)
			numjournals++;
		if (document.webform.V7N4.checked == true)
			numjournals++;
		if (document.webform.V6N1.checked == true)
			numjournals++;
		if (document.webform.V6N2.checked == true)
			numjournals++;
		if (document.webform.V6N3.checked == true)
			numjournals++;
		if (document.webform.V6N4.checked == true)
			numjournals++;
		if (document.webform.V5N1.checked == true)
			numjournals++;
		if (document.webform.V5N2.checked == true)
			numjournals++;
		if (document.webform.V5N3.checked == true)
			numjournals++;
		if (document.webform.V5N4.checked == true)
			numjournals++;
		if (document.webform.V4N1.checked == true)
			numjournals++;
		if (document.webform.V4N2.checked == true)
			numjournals++;
		if (document.webform.V4N3.checked == true)
			numjournals++;
		if (document.webform.V4N4.checked == true)
			numjournals++;
		if (document.webform.V3N1.checked == true)
			numjournals++;
		if (document.webform.V3N2.checked == true)
			numjournals++;
		if (document.webform.V3N3.checked == true)
			numjournals++;
		if (document.webform.V3N4.checked == true)
			numjournals++;
		if (document.webform.V2N1.checked == true)
			numjournals++;
		if (document.webform.V2N2.checked == true)
			numjournals++;
		if (document.webform.V2N3.checked == true)
			numjournals++;
		if (document.webform.V2N4.checked == true)
			numjournals++;
		if (document.webform.V1N1.checked == true)
			numjournals++;
		if (document.webform.V1N2.checked == true)
			numjournals++;
		if (document.webform.V1N3.checked == true)
			numjournals++;
		if (document.webform.V1N4.checked == true)
			numjournals++;
		ship_charge=0.00;
		subtotal=0.00;
		journalprice=0.00;
		amtdue=0.00;
		journal_1_9=parseFloat(document.webform.journal_1_9.value);
		journal_10=parseFloat(document.webform.journal_10.value);
		journal_1sh=parseFloat(document.webform.journal_1sh.value);
		journal_2_5sh=parseFloat(document.webform.journal_2_5sh.value);
		journal_6sh=parseFloat(document.webform.journal_6sh.value);
		if (numjournals > 9)
			journalprice=journal_10;
		else
			journalprice=journal_1_9;
		subtotal=numjournals*journalprice;
		if (numjournals > 5)
			ship_charge=journal_6sh;
		else if (numjournals > 1)
			ship_charge=journal_2_5sh;
		else
			ship_charge=journal_1sh;
		amtdue=subtotal+ship_charge;
		document.webform.subtotal.value=subtotal;
		document.webform.numjournals.value=numjournals;
		document.webform.journalprice.value=journalprice;
		document.webform.ship_charge.value=ship_charge;
		document.webform.amtdue.value=amtdue;
        }
}

/****************************************************************/
function TotalConfEval() {

	total_eval=0;
	synopsis=parseFloat(document.webform.synopsis.value);
	goals=parseFloat(document.webform.goals.value);
	methods=parseFloat(document.webform.methods.value);
	benefits=parseFloat(document.webform.benefits.value);
	qualifications=parseFloat(document.webform.qualifications.value);
	total_eval+=synopsis+goals+methods+benefits+qualifications;
       	if (synopsis > 20) {
		alert("You entered an evaluation of " + synopsis + " for 'Title/Synopsis'. Evaluation cannot be greater than 20. Please correct this.");
              		document.webform.synopsis.focus();
              		return false;
       	}
       	else if (goals > 20) {
		alert("You entered an evaluation of " + goals + " for 'Goals'. Evaluation cannot be greater than 20. Please correct this.");
              		document.webform.goals.focus();
              		return false;
       	}
       	else if (methods > 20) {
		alert("You entered an evaluation of " + methods + " for 'Methods'. Evaluation cannot be greater than 20. Please correct this.");
              		document.webform.methods.focus();
              		return false;
       	}
       	else if (benefits > 20) {
		alert("You entered an evaluation of " + benefits + " for 'Benefits'. Evaluation cannot be greater than 20. Please correct this.");
              		document.webform.benefits.focus();
              		return false;
       	}
       	else if (qualifications > 20) {
		alert("You entered an evaluation of " + qualifications + " for 'Qualifications'. Evaluation cannot be greater than 20. Please correct this.");
              		document.webform.qualifications.focus();
              		return false;
       	}
	else if (total_eval > 120) {
		alert("You entered a total evaluation of " + total_eval + ". Total evaluation cannot be greater than 120. Please correct this.");
		document.webform.synopsis.focus();
		return false;
       	}
	else {
		evaltot=synopsis+goals+methods+benefits+qualifications;
		overalleval=evaltot/5;
		overalleval=overalleval.toFixed(2);
		document.webform.overalleval.value=overalleval;
		document.webform.overalleval.value=overalleval;
		document.webform.overalleval2.value=overalleval;
              	return true;
       	}
}

/****************************************************************/
function ValidateConfPresEvalData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Bio,Title,Entry">

        if (document.webform.realname.selectedIndex == 0) {
                alert("Please select your Name from the pull-down menu.");
                document.webform.realname.focus();
                return false;
        }
        if (document.webform.email.selectedIndex == 0) {
                alert("Please select your Email Address from the pull-down menu.");
                document.webform.email.focus();
                return false;
        }
        if (document.webform.proposal.selectedIndex == 0) {
                alert("Please select the name of the proposal that you are judging from the pull-down menu.");
                document.webform.proposal.focus();
                return false;
        }
        if ((isEmpty(document.webform.synopsis.value)) || (isEmpty(document.webform.goals.value)) || (isEmpty(document.webform.methods.value)) || (isEmpty(document.webform.benefits.value)) || (isEmpty(document.webform.qualifications.value)) || ((document.webform.synopsis.value == 0) || (document.webform.goals.value == 0) || (document.webform.methods.value == 0) || (document.webform.benefits.value == 0) || (document.webform.qualifications.value == 0))) {
		alert("Please enter your evaluations for each of the five categories (a number between 1 and 20).");
        	if ((isEmpty(document.webform.synopsis.value)) || (document.webform.synopsis.value == 0))
                	document.webform.synopsis.focus();
		else if ((isEmpty(document.webform.goals.value)) || (document.webform.goals.value == 0))
                	document.webform.goals.focus();
		else if ((isEmpty(document.webform.methods.value)) || (document.webform.methods.value == 0))
                	document.webform.methods.focus();
		else if ((isEmpty(document.webform.benefits.value)) || (document.webform.benefits.value == 0))
                	document.webform.benefits.focus();
		else
                	document.webform.qualifications.focus();
                return false;
        }
	else {
        	if ((!isNum(document.webform.synopsis.value)) || (!isNum(document.webform.goals.value)) || (!isNum(document.webform.methods.value)) || (!isNum(document.webform.benefits.value)) || (!isNum(document.webform.qualifications.value))) {
        		if (!isNum(document.webform.synopsis.value)) {
				alert("You entered an invalid evaluation for 'Title/Synopsis' (" + document.webform.synopsis.value + "). Please enter a numeric value (max. 20).");
                		document.webform.synopsis.focus();
			}
        		else if (!isNum(document.webform.goals.value)) {
				alert("You entered an invalid evaluation for 'Goals' (" + document.webform.goals.value + "). Please enter a numeric value (max. 20).");
                		document.webform.goals.focus();
			}
        		else if (!isNum(document.webform.methods.value)) {
				alert("You entered an invalid evaluation for 'Methods' (" + document.webform.methods.value + "). Please enter a numeric value (max. 20).");
                		document.webform.methods.focus();
			}
        		else if (!isNum(document.webform.benefits.value)) {
				alert("You entered an invalid evaluation for 'Benefits' (" + document.webform.benefits.value + "). Please enter a numeric value (max. 20).");
                		document.webform.benefits.focus();
			}
        		else if (!isNum(document.webform.qualifications.value)) {
				alert("You entered an invalid evaluation for 'Qualifications' (" + document.webform.qualifications.value + "). Please enter a numeric value (max. 20).");
                		document.webform.qualifications.focus();
			}
                	return false;
        	}
		else {
			if (!TotalConfEval())
                		return false;
        	}
        }
}

/****************************************************************/
function ValidateContestJudge2Data() {

//<input type=hidden name="required" value="realname,email,entry,ranking">

        if (document.webform.realname.selectedIndex == 0) {
                alert("Please select your Name from the pull-down menu.");
                document.webform.realname.focus();
                return false;
        }
        if (document.webform.email.selectedIndex == 0) {
                alert("Please select your Email Address from the pull-down menu.");
                document.webform.email.focus();
                return false;
        }
        if (document.webform.entry.selectedIndex == 0) {
                alert("Please select the name of the entry that you are judging from the pull-down menu.");
                document.webform.entry.focus();
                return false;
        }
        if (document.webform.ranking.selectedIndex == 0) {
                alert("Please choose a ranking from the pull-down menu.");
                document.webform.ranking.focus();
                return false;
        }
}

/****************************************************************/
function ValidateContestJudge1Data() {

//<input type=hidden name="required" value="realname,email,entry,story,originality,voice,coherence,polish_proof">

        if (document.webform.realname.selectedIndex == 0) {
                alert("Please select your Name from the pull-down menu.");
                document.webform.realname.focus();
                return false;
        }
        if (document.webform.email.selectedIndex == 0) {
                alert("Please select your Email Address from the pull-down menu.");
                document.webform.email.focus();
                return false;
        }
        if (document.webform.entry.selectedIndex == 0) {
                alert("Please select the name of the entry that you are judging from the pull-down menu.");
                document.webform.entry.focus();
                return false;
        }
        if (document.webform.story.selectedIndex == 0) {
                alert("Please choose a score for 'Story' from the pull-down menu.");
                document.webform.story.focus();
                return false;
        }
        if (document.webform.originality.selectedIndex == 0) {
                alert("Please choose a score for 'Originality' from the pull-down menu.");
                document.webform.originality.focus();
                return false;
        }
        if (document.webform.voice.selectedIndex == 0) {
                alert("Please choose a score for 'Voice' from the pull-down menu.");
                document.webform.voice.focus();
                return false;
        }
        if (document.webform.coherence.selectedIndex == 0) {
                alert("Please choose a score for 'Coherence' from the pull-down menu.");
                document.webform.coherence.focus();
                return false;
        }
        if (document.webform.polish_proof.selectedIndex == 0) {
                alert("Please choose a score for 'Polish/Proof' from the pull-down menu.");
                document.webform.polish_proof.focus();
                return false;
        }
}

/****************************************************************/
function ValidateContestData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Bio,Title,Entry">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email != "none") && ((email.indexOf("@") == -1) || (email.indexOf(".") == -1))) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.Bio.value)) {
		alert("Please enter your brief biography.");
                document.webform.Bio.focus();
                return false;
        }
        if (isEmpty(document.webform.Title.value)) {
		alert("Please enter the Title of your entry.");
                document.webform.Title.focus();
                return false;
        }
        if (isEmpty(document.webform.WordCount.value)) {
		alert("Please enter the Word Count for your entry (max. 1200).");
                document.webform.WordCount.focus();
                return false;
        }
	else {
        	if (!isNum(document.webform.WordCount.value)) {
			alert("You entered an invalid word count (" + document.webform.WordCount.value + "). Please enter a numeric value (max. 1200).");
                	document.webform.WordCount.focus();
                	return false;
        	}
		else {
        		if (document.webform.WordCount.value > 1200) {
				alert("Word count cannot be greater than 1200. Please correct this.");
                		document.webform.WordCount.focus();
                		return false;
        		}
        	}
        }
        if (isEmpty(document.webform.Entry.value)) {
		alert("Please enter your contest writing piece.");
                document.webform.Entry.focus();
                return false;
        }
}

/****************************************************************/
function ValidateWflPres() {

//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Workshop_Title,Workshop_Description,Workshop_Synopsis,Workshop_Methods,Workshop_Benefits,Qualifications">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.Workshop_Title.value)) {
		alert("Please enter the Title of your proposal.");
                document.webform.Workshop_Title.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Description.value)) {
		alert("Please enter a brief Description of your proposal.");
                document.webform.Workshop_Description.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Synopsis.value)) {
		alert("Please enter a Synopsis of your proposal.");
                document.webform.Workshop_Synopsis.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Methods.value)) {
		alert("Please describe the Methods used for writing exercises in your proposal.");
                document.webform.Workshop_Methods.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Benefits.value)) {
		alert("Please describe the Benefits that participants can expect from your proposal.");
                document.webform.Workshop_Benefits.focus();
                return false;
        }
        if (isEmpty(document.webform.Qualifications.value)) {
		alert("Please describe your Qualifications as a presenter.");
                document.webform.Qualifications.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateKTSinfo() {

//<input type=hidden name="required" value="realname,email,info_wanted">

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.info_wanted[0].checked == false) & (document.webform.info_wanted[1].checked == false) & (document.webform.info_wanted[2].checked == false) & (document.webform.info_wanted[3].checked == false) & (document.webform.info_wanted[4].checked == false)) {
		alert("Please indicate the type(s) of info you are interested in.");
		document.webform.info_wanted[0].focus();
		return false;
        }
	else {
		info_wanted_string = "[";
        	if (document.webform.info_wanted[0].checked == true)
			info_wanted_string = info_wanted_string + " " + document.webform.info_wanted[0].value + " /";
        	if (document.webform.info_wanted[1].checked == true)
			info_wanted_string = info_wanted_string + " " + document.webform.info_wanted[1].value + " /";
        	if (document.webform.info_wanted[2].checked == true)
			info_wanted_string = info_wanted_string + " " + document.webform.info_wanted[2].value + " /";
        	if (document.webform.info_wanted[3].checked == true)
			info_wanted_string = info_wanted_string + " " + document.webform.info_wanted[3].value + " /";
        	if (document.webform.info_wanted[4].checked == true)
			info_wanted_string = info_wanted_string + " " + document.webform.info_wanted[4].value + " /";
		info_wanted_string = info_wanted_string + "]";
		document.webform.info_wanted_string.value=info_wanted_string;
        }
}

/****************************************************************/
function ValidateKTSorder() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.items_ordered.value == 0) {
		alert("Please enter the number of books you wish to order.");
		document.webform.items_ordered.focus();
		return false;
	}
       	if (!isNum(document.webform.items_ordered.value)) {
		alert("You entered an invalid number of books (" + document.webform.items_ordered.value + "). Please enter a numeric value.");
               	document.webform.items_ordered.focus();
               	return false;
       	}
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	if (document.webform.Country.value != USA) {
		document.webform.State.selectedIndex=1;
		if (foreign_shipchg == 0) {
			alert("If you are ordering outside the US, query by email to storycircle@storycircle.org and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
			return false;
		}
	}
	else {
		if (foreign_shipchg != 0) {
			document.webform.foreign_shipchg.value=0;
		}
	}
	UpdateKTSorder();
}

/****************************************************************/
function UpdateKTSorder() {
	items_ordered=parseFloat(document.webform.items_ordered.value);
	itemprice=parseFloat(document.webform.itemprice.value);
	thissalestax=parseFloat(document.webform.thissalestax.value);
	discountnum=parseFloat(document.webform.discountnum.value);
	discountpct=parseFloat(document.webform.discountpct.value);
	discountnum2=parseFloat(document.webform.discountnum2.value);
	discountpct2=parseFloat(document.webform.discountpct2.value);
	discountnum3=parseFloat(document.webform.discountnum3.value);
	discountpct3=parseFloat(document.webform.discountpct3.value);
	thisshipchg=parseFloat(document.webform.thisshipchg.value);
	addlshipchg=parseFloat(document.webform.addlshipchg.value);
	bulkshipchg=parseFloat(document.webform.bulkshipchg.value);
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	orderamt=parseFloat(items_ordered*itemprice);
	bookorderamt=orderamt;
	discountamt=0.00;
	shipcost1=0.00;
	shipcost2=0.00;
	shipcost1+=1*thisshipchg;
//	subtotal=0.00;
	salestax=0.00;
	amtdue=0.00;
	if (items_ordered >= discountnum3) {
		discountamt+=orderamt * discountpct3;
		orderamt-=discountamt;
	}
	else if (items_ordered >= discountnum2) {
		discountamt+=orderamt * discountpct2;
		orderamt-=discountamt;
	}
	else if (items_ordered >= discountnum) {
		discountamt+=orderamt * discountpct;
		orderamt-=discountamt;
	}
	if (foreign_shipchg > 0) {
		shipcost2=foreign_shipchg;
	}
	else {
		if (items_ordered > 1) {
			if (items_ordered >= discountnum3) {
				shipcost1=0;
				shipcost2=bulkshipchg;
			}
			else
				shipcost2+=(items_ordered-1)*addlshipchg;
		}
	}
	subtotal=orderamt+shipcost1+shipcost2;
	if (document.webform.State.value == "TX") {
		salestax=subtotal * thissalestax;
	}
	neworderamt=orderamt.toFixed(2);
	newbookorderamt=bookorderamt.toFixed(2);
	discountamtrev=0.00-discountamt;
	newdiscountamt=discountamtrev.toFixed(2);
	newsalestax=salestax.toFixed(2);
	newshipcost1=shipcost1.toFixed(2);
	newshipcost2=shipcost2.toFixed(2);
	document.webform.bookorderamt.value=newbookorderamt;
	document.webform.orderamt.value=neworderamt;
	document.webform.discountamt.value=newdiscountamt;
	document.webform.salestax.value=newsalestax;
	newsubtotal=subtotal.toFixed(2);
	document.webform.subtotal.value=newsubtotal;
	document.webform.shipcost1.value=newshipcost1;
	if (foreign_shipchg == 0.00) {
		document.webform.shipcost2.value=newshipcost2;
	}
	else {
		document.webform.shipcost2.value=0;
	}
	amtdue=subtotal+salestax;
	newamtdue=amtdue.toFixed(2);
	document.webform.totaldue.value=newamtdue;
	document.webform.amtdue.value=newamtdue;
}

/****************************************************************/
function ValidateKTSparty() {

//<input type=hidden name="required" value="realname,email,info_wanted">

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.rsvp[0].checked == false) & (document.webform.rsvp[1].checked == false)) {
		alert("Please tell us if you're coming to the party or not.");
		document.webform.rsvp[0].focus();
		return false;
        }
}

/****************************************************************/
function ValidateKTSorder2() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.items_ordered.value == 0) {
		alert("Please enter the number of books you wish to order.");
		document.webform.items_ordered.focus();
		return false;
	}
       	if (!isNum(document.webform.items_ordered.value)) {
		alert("You entered an invalid number of books (" + document.webform.items_ordered.value + "). Please enter a numeric value (max. 5).");
               	document.webform.items_ordered.focus();
               	return false;
       	}
	else {
       		if (document.webform.items_ordered.value > 5) {
			alert("You can order a maximum of 5 books. Please correct this.");
               		document.webform.items_ordered.focus();
               		return false;
       		}
       	}
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	if (document.webform.Country.value != USA) {
		document.webform.State.selectedIndex=1;
		if (foreign_shipchg == 0) {
			alert("If you are ordering outside the US, query by email to storycircle@storycircle.org and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
			return false;
		}
	}
	else {
		if (foreign_shipchg != 0) {
			document.webform.foreign_shipchg.value=0;
		}
	}
	UpdateKTSorder2();
        if (document.webform.okdone.value == 0) {
                alert("Thanks for your order! Info on how to pay your $" + newamtdue + " total will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function UpdateKTSorder2() {
	items_ordered=parseFloat(document.webform.items_ordered.value);
	itemprice=parseFloat(document.webform.itemprice.value);
	thissalestax=parseFloat(document.webform.thissalestax.value);
	thisshipchg=parseFloat(document.webform.thisshipchg.value);
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	orderamt=parseFloat(items_ordered*itemprice);
	bookorderamt=orderamt;
	shipcost1=0.00;
	shipcost1+=1*thisshipchg;
	shipcost2=0.00;
//	subtotal=0.00;
	salestax=0.00;
	amtdue=0.00;
	if (foreign_shipchg > 0) {
		shipcost2=foreign_shipchg;
	}
	subtotal=orderamt+shipcost1+shipcost2;
	if (document.webform.State.value == "TX") {
		salestax=subtotal * thissalestax;
	}
	neworderamt=orderamt.toFixed(2);
	newbookorderamt=bookorderamt.toFixed(2);
	newsalestax=salestax.toFixed(2);
	newshipcost1=shipcost1.toFixed(2);
	newshipcost2=shipcost2.toFixed(2);
	document.webform.bookorderamt.value=newbookorderamt;
	document.webform.orderamt.value=neworderamt;
	document.webform.salestax.value=newsalestax;
	newsubtotal=subtotal.toFixed(2);
	document.webform.subtotal.value=newsubtotal;
	document.webform.shipcost1.value=newshipcost1;
	if (foreign_shipchg == 0.00) {
		document.webform.shipcost2.value=newshipcost2;
	}
	else {
		document.webform.shipcost2.value=0;
	}
	amtdue=subtotal+salestax;
	newamtdue=amtdue.toFixed(2);
	document.webform.totaldue.value=newamtdue;
	document.webform.amtdue.value=newamtdue;
}

/****************************************************************/
function ValidateKTSorder3() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.items_ordered.value == 0) {
		alert("Please enter the number of books you wish to order.");
		document.webform.items_ordered.focus();
		return false;
	}
	maxordernum=parseFloat(document.webform.maxordernum.value);
       	if (!isNum(document.webform.items_ordered.value)) {
		alert("You entered an invalid number of books (" + document.webform.items_ordered.value + "). Please enter a numeric value (max. " + maxordernum + ").");
               	document.webform.items_ordered.focus();
               	return false;
       	}
	else {
       		if (document.webform.items_ordered.value > maxordernum) {
			alert("You can order a maximum of " + maxordernum + " books. Please correct this.");
               		document.webform.items_ordered.focus();
               		return false;
       		}
       	}
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	if (document.webform.Country.value != USA) {
		document.webform.State.selectedIndex=1;
		if (foreign_shipchg == 0) {
			alert("If you are ordering outside the US, query by email to storycircle@storycircle.org and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
			return false;
		}
	}
	else {
		if (foreign_shipchg != 0) {
			document.webform.foreign_shipchg.value=0;
		}
	}
	UpdateKTSorder3();
        if (document.webform.okdone.value == 0) {
                alert("Thanks for your order! Info on how to pay your $" + newamtdue + " total will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function UpdateKTSorder3() {
	items_ordered=parseFloat(document.webform.items_ordered.value);
	itemprice=parseFloat(document.webform.itemprice.value);
	thissalestax=parseFloat(document.webform.thissalestax.value);
	thisshipchg=parseFloat(document.webform.thisshipchg.value);
	shipchg=parseFloat(document.webform.shipchg.value);
	shipchgTX=parseFloat(document.webform.shipchgTX.value);
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	orderamt=parseFloat(items_ordered*itemprice);
	bookorderamt=orderamt;
	shipcost1=0.00;
	shipcost2=0.00;
//	subtotal=0.00;
	salestax=0.00;
	amtdue=0.00;
	if (document.webform.State.value == "TX")
		shipcost1=shipchgTX;
	else
		shipcost1=shipchg;
	if (foreign_shipchg > 0) {
		shipcost2=foreign_shipchg;
	}
	subtotal=orderamt+shipcost1+shipcost2;
	if (document.webform.State.value == "TX") {
		salestax=subtotal * thissalestax;
	}
	neworderamt=orderamt.toFixed(2);
	newbookorderamt=bookorderamt.toFixed(2);
	newsalestax=salestax.toFixed(2);
	newshipcost1=shipcost1.toFixed(2);
	newshipcost2=shipcost2.toFixed(2);
	document.webform.thisshipchg.value=shipcost1;
	document.webform.bookorderamt.value=newbookorderamt;
	document.webform.orderamt.value=neworderamt;
	document.webform.salestax.value=newsalestax;
	newsubtotal=subtotal.toFixed(2);
	document.webform.subtotal.value=newsubtotal;
	document.webform.shipcost1.value=newshipcost1;
	if (foreign_shipchg == 0.00) {
		document.webform.shipcost2.value=newshipcost2;
	}
	else {
		document.webform.shipcost2.value=0;
	}
	amtdue=subtotal+salestax;
	newamtdue=amtdue.toFixed(2);
	document.webform.totaldue.value=newamtdue;
	document.webform.amtdue.value=newamtdue;
}

/****************************************************************/
function ValidateKTSorder4() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
	if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
		document.webform.email.focus();
		return false;
	}
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.items_ordered.value == 0) {
		alert("Please enter the number of books you wish to order.");
		document.webform.items_ordered.focus();
		return false;
	}
       	if (!isNum(document.webform.items_ordered.value)) {
		alert("You entered an invalid number of books (" + document.webform.items_ordered.value + "). Please enter a numeric value).");
               	document.webform.items_ordered.focus();
               	return false;
       	}
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	if (document.webform.Country.value != USA) {
		document.webform.State.selectedIndex=1;
		if (foreign_shipchg == 0) {
			alert("If you are ordering outside the US, query by email to storycircle@storycircle.org and we will tell you the amount of the postage for your order. You will be billed for exact postage plus $3 packing/mailing. International orders must be made through PayPal.");
			return false;
		}
	}
	else {
		if (foreign_shipchg != 0) {
			document.webform.foreign_shipchg.value=0;
		}
	}
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
	UpdateKTSorder4();
        if (document.webform.okdone.value == 0) {
                alert("Thanks for your order! Info on how to pay your $" + newamtdue + " total will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function UpdateKTSorder4() {
	items_ordered=parseFloat(document.webform.items_ordered.value);
	itemprice=parseFloat(document.webform.itemprice.value);
	thissalestax=parseFloat(document.webform.thissalestax.value);
	thisshipchg=parseFloat(document.webform.thisshipchg.value);
	addlshipchg=parseFloat(document.webform.addlshipchg.value);
	foreign_shipchg=parseFloat(document.webform.foreign_shipchg.value);
	orderamt=parseFloat(items_ordered*itemprice);
	bookorderamt=orderamt;
	shipcost1=0.00;
	shipcost2=0.00;
	shipcost1+=1*thisshipchg;
	salestax=0.00;
	amtdue=0.00;
	if (foreign_shipchg > 0) {
		shipcost2+=foreign_shipchg;
	}
	else {
		if (items_ordered > 1) {
			shipcost2+=(items_ordered-1)*addlshipchg;
		}
	}
	subtotal=orderamt+shipcost1+shipcost2;
	if (document.webform.State.value == "TX") {
		salestax=subtotal * thissalestax;
	}
	neworderamt=orderamt.toFixed(2);
	newbookorderamt=bookorderamt.toFixed(2);
	newsalestax=salestax.toFixed(2);
	newshipcost1=shipcost1.toFixed(2);
	newshipcost2=shipcost2.toFixed(2);
	document.webform.thisshipchg.value=shipcost1;
	document.webform.bookorderamt.value=newbookorderamt;
	document.webform.orderamt.value=neworderamt;
	document.webform.salestax.value=newsalestax;
	newsubtotal=subtotal.toFixed(2);
	document.webform.subtotal.value=newsubtotal;
	document.webform.shipcost1.value=newshipcost1;
	if (foreign_shipchg == 0.00) {
		document.webform.shipcost2.value=newshipcost2;
	}
	else {
		document.webform.shipcost2.value=0;
	}
	amtdue=subtotal+salestax;
	newamtdue=amtdue.toFixed(2);
	document.webform.totaldue.value=newamtdue;
	document.webform.amtdue.value=newamtdue;
}

/****************************************************************/
function ValidateBdVolHrs() {

//<input type=hidden name="required" value="realname,Street_Address,City,State,Zip_Code,Country,email,Phone_Number">
USA="USA";

        if (document.webform.realname.selectedIndex == 0) {
		alert("Please select your Name.");
		document.webform.realname.focus();
		return false;
	}
        if (document.webform.email.selectedIndex == 0) {
		alert("Please select your Email Address.");
		document.webform.email.focus();
		return false;
	}
//	if ((document.webform.week1.value == "") || (document.webform.week2.value == "") || (document.webform.week3.value == "") || (document.webform.week4.value == "") || (document.webform.week5.value == "") || (document.webform.week6.value == "") || (document.webform.week7.value == "") || (document.webform.week8.value == "") || (document.webform.week9.value == "") || (document.webform.week10.value == "") || (document.webform.week11.value == "") || (document.webform.week12.value == "") || (document.webform.week13.value == "") || (document.webform.week14.value == "") || (document.webform.week15.value == "") || (document.webform.week16.value == "") || (document.webform.week17.value == "") || (document.webform.week18.value == "")) {
//		alert("Please enter your #hours for each week.");
		if ((document.webform.week1.value == "") || (document.webform.week1.value == "0"))
			document.webform.week1.value="0.0";
		if ((document.webform.week2.value == "") || (document.webform.week2.value == "0"))
			document.webform.week2.value="0.0";
		if ((document.webform.week3.value == "") || (document.webform.week3.value == "0"))
			document.webform.week3.value="0.0";
		if ((document.webform.week4.value == "") || (document.webform.week4.value == "0"))
			document.webform.week4.value="0.0";
		if ((document.webform.week5.value == "") || (document.webform.week5.value == "0"))
			document.webform.week5.value="0.0";
		if ((document.webform.week6.value == "") || (document.webform.week6.value == "0"))
			document.webform.week6.value="0.0";
		if ((document.webform.week7.value == "") || (document.webform.week7.value == "0"))
			document.webform.week7.value="0.0";
		if ((document.webform.week8.value == "") || (document.webform.week8.value == "0"))
			document.webform.week8.value="0.0";
		if ((document.webform.week9.value == "") || (document.webform.week9.value == "0"))
			document.webform.week9.value="0.0";
		if ((document.webform.week10.value == "") || (document.webform.week10.value == "0"))
			document.webform.week10.value="0.0";
		if ((document.webform.week11.value == "") || (document.webform.week11.value == "0"))
			document.webform.week11.value="0.0";
		if ((document.webform.week12.value == "") || (document.webform.week12.value == "0"))
			document.webform.week12.value="0.0";
		if ((document.webform.week13.value == "") || (document.webform.week13.value == "0"))
			document.webform.week13.value="0.0";
		if ((document.webform.week14.value == "") || (document.webform.week14.value == "0"))
			document.webform.week14.value="0.0";
		if ((document.webform.week15.value == "") || (document.webform.week15.value == "0"))
			document.webform.week15.value="0.0";
		if ((document.webform.week16.value == "") || (document.webform.week16.value == "0"))
			document.webform.week16.value="0.0";
		if ((document.webform.week17.value == "") || (document.webform.week17.value == "0"))
			document.webform.week17.value="0.0";
		if ((document.webform.week18.value == "") || (document.webform.week18.value == "0"))
			document.webform.week18.value="0.0";
/*
*/
//		return false;
//	}
//	else {
       		if (!isNumber(document.webform.week1.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week1.value + ") for week #1. Please enter a numeric value).");
               		document.webform.week1.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week2.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week2.value + ") for week #2. Please enter a numeric value).");
               		document.webform.week2.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week3.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week3.value + ") for week #3. Please enter a numeric value).");
               		document.webform.week3.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week4.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week4.value + ") for week #4. Please enter a numeric value).");
               		document.webform.week4.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week5.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week5.value + ") for week #5. Please enter a numeric value).");
               		document.webform.week5.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week6.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week6.value + ") for week #6. Please enter a numeric value).");
               		document.webform.week6.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week7.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week7.value + ") for week #7. Please enter a numeric value).");
               		document.webform.week7.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week8.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week8.value + ") for week #8. Please enter a numeric value).");
               		document.webform.week8.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week9.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week9.value + ") for week #9. Please enter a numeric value).");
               		document.webform.week9.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week10.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week10.value + ") for week #10. Please enter a numeric value).");
               		document.webform.week10.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week11.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week11.value + ") for week #11. Please enter a numeric value).");
               		document.webform.week11.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week12.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week12.value + ") for week #12. Please enter a numeric value).");
               		document.webform.week12.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week13.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week13.value + ") for week #13. Please enter a numeric value).");
               		document.webform.week13.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week14.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week14.value + ") for week #14. Please enter a numeric value).");
               		document.webform.week14.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week15.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week15.value + ") for week #15. Please enter a numeric value).");
               		document.webform.week15.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week16.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week16.value + ") for week #16. Please enter a numeric value).");
               		document.webform.week16.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week17.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week17.value + ") for week #17. Please enter a numeric value).");
               		document.webform.week17.focus();
               		return false;
       		}
       		if (!isNumber(document.webform.week18.value)) {
			alert("You entered an invalid number of hours (" + document.webform.week18.value + ") for week #18. Please enter a numeric value).");
               		document.webform.week18.focus();
               		return false;
       		}
//	}
	totalhours=TotalBdVolHrs();
        if (document.webform.okdone.value == 0) {
                alert("Thanks for submitting your " + totalhours + " hours!");
//        	document.webform.okdone.value=1;
        }
	if (totalhours == "0") {
		document.webform.totalhours.value="0.0";
		document.webform.hourstotal.value="0.0";
	}
	else {
		document.webform.totalhours.value=totalhours;
		document.webform.hourstotal.value=totalhours;
	}
}

/****************************************************************/
function TotalBdVolHrs() {
	totalhours=0.0;
	if ((document.webform.week1.value == "") || (document.webform.week1.value == "0"))
		document.webform.week1.value="0.0";
	if ((document.webform.week2.value == "") || (document.webform.week2.value == "0"))
		document.webform.week2.value="0.0";
	if ((document.webform.week3.value == "") || (document.webform.week3.value == "0"))
		document.webform.week3.value="0.0";
	if ((document.webform.week4.value == "") || (document.webform.week4.value == "0"))
		document.webform.week4.value="0.0";
	if ((document.webform.week5.value == "") || (document.webform.week5.value == "0"))
		document.webform.week5.value="0.0";
	if ((document.webform.week6.value == "") || (document.webform.week6.value == "0"))
		document.webform.week6.value="0.0";
	if ((document.webform.week7.value == "") || (document.webform.week7.value == "0"))
		document.webform.week7.value="0.0";
	if ((document.webform.week8.value == "") || (document.webform.week8.value == "0"))
		document.webform.week8.value="0.0";
	if ((document.webform.week9.value == "") || (document.webform.week9.value == "0"))
		document.webform.week9.value="0.0";
	if ((document.webform.week10.value == "") || (document.webform.week10.value == "0"))
		document.webform.week10.value="0.0";
	if ((document.webform.week11.value == "") || (document.webform.week11.value == "0"))
		document.webform.week11.value="0.0";
	if ((document.webform.week12.value == "") || (document.webform.week12.value == "0"))
		document.webform.week12.value="0.0";
	if ((document.webform.week13.value == "") || (document.webform.week13.value == "0"))
		document.webform.week13.value="0.0";
	if ((document.webform.week14.value == "") || (document.webform.week14.value == "0"))
		document.webform.week14.value="0.0";
	if ((document.webform.week15.value == "") || (document.webform.week15.value == "0"))
		document.webform.week15.value="0.0";
	if ((document.webform.week16.value == "") || (document.webform.week16.value == "0"))
		document.webform.week16.value="0.0";
	if ((document.webform.week17.value == "") || (document.webform.week17.value == "0"))
		document.webform.week17.value="0.0";
	if ((document.webform.week18.value == "") || (document.webform.week18.value == "0"))
		document.webform.week18.value="0.0";
	week1=parseFloat(document.webform.week1.value);
	week2=parseFloat(document.webform.week2.value);
	week3=parseFloat(document.webform.week3.value);
	week4=parseFloat(document.webform.week4.value);
	week5=parseFloat(document.webform.week5.value);
	week6=parseFloat(document.webform.week6.value);
	week7=parseFloat(document.webform.week7.value);
	week8=parseFloat(document.webform.week8.value);
	week9=parseFloat(document.webform.week9.value);
	week10=parseFloat(document.webform.week10.value);
	week11=parseFloat(document.webform.week11.value);
	week12=parseFloat(document.webform.week12.value);
	week13=parseFloat(document.webform.week13.value);
	week14=parseFloat(document.webform.week14.value);
	week15=parseFloat(document.webform.week15.value);
	week16=parseFloat(document.webform.week16.value);
	week17=parseFloat(document.webform.week17.value);
	week18=parseFloat(document.webform.week18.value);
	totalhours+=week1+week2+week3+week4+week5+week6+week7+week8+week9+week10+week11+week12+week13+week14+week15+week16+week17+week18
	document.webform.totalhours.value=totalhours;
	document.webform.hourstotal.value=totalhours;
	return totalhours;
}

/****************************************************************/
function ValidateTWAuthorData() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,StoryTitle1,SubmitDate1">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.StoryTitle1.value)) {
		alert("Please enter the name of your 1st piece.");
                document.webform.StoryTitle1.focus();
                return false;
        }
        if ((isEmpty(document.webform.SubmitDateMM1.value)) || (isEmpty(document.webform.SubmitDateDD1.value)) || (isEmpty(document.webform.SubmitDateYYYY1.value))) {
		alert("Please enter the submission date for your 1st piece.");
        	if (isEmpty(document.webform.SubmitDateMM1.value))
                	document.webform.SubmitDateMM1.focus();
        	else if (isEmpty(document.webform.SubmitDateDD1.value))
                	document.webform.SubmitDateDD1.focus();
        	else
                	document.webform.SubmitDateYYYY1.focus();
                return false;
        }
        else {
		mm1 = parseFloat(document.webform.SubmitDateMM1.value);
		dd1 = parseFloat(document.webform.SubmitDateDD1.value);
		yyyy1 = parseFloat(document.webform.SubmitDateYYYY1.value);
        	if ((!isNum(document.webform.SubmitDateMM1.value)) || ((mm1 < 1) || (mm1 > 12))) {
			alert("You entered an invalid month (" + document.webform.SubmitDateMM1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateMM1.focus();
                	return false;
		}
        	if ((!isNum(document.webform.SubmitDateDD1.value)) || ((dd1 < 1) || (dd1 > 31))) {
			alert("You entered an invalid day (" + document.webform.SubmitDateDD1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateDD1.focus();
                	return false;
		}
        	else if ((!isNum(document.webform.SubmitDateYYYY1.value)) || ((yyyy1 < 2007) || (yyyy1 > 2008))) {
			alert("You entered an invalid year (" + document.webform.SubmitDateYYYY1.value + ") for your 1st submission date. Please correct it.");
                	document.webform.SubmitDateYYYY1.focus();
                	return false;
		}
		submitdate1 = mm1 + "/" + dd1 + "/" + yyyy1;
                document.webform.SubmitDate1.value=submitdate1;
        }
        if ((!isEmpty(document.webform.StoryTitle2.value)) || (!isEmpty(document.webform.SubmitDateMM2.value)) || (!isEmpty(document.webform.SubmitDateDD2.value)) || (!isEmpty(document.webform.SubmitDateYYYY2.value))
) {
        	if (isEmpty(document.webform.StoryTitle2.value)) {
			alert("Please enter the name of your 2nd piece.");
                	document.webform.StoryTitle2.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM2.value)) || (isEmpty(document.webform.SubmitDateDD2.value)) || (isEmpty(document.webform.SubmitDateYYYY2.value))) {
			alert("Please enter the submission date for your 2nd piece.");
        		if (isEmpty(document.webform.SubmitDateMM2.value))
                		document.webform.SubmitDateMM2.focus();
        		else if (isEmpty(document.webform.SubmitDateDD2.value))
                		document.webform.SubmitDateDD2.focus();
        		else
                		document.webform.SubmitDateYYYY2.focus();
                	return false;
        	}
        	else {
			mm2 = parseFloat(document.webform.SubmitDateMM2.value);
			dd2 = parseFloat(document.webform.SubmitDateDD2.value);
			yyyy2 = parseFloat(document.webform.SubmitDateYYYY2.value);
        		if ((!isNum(document.webform.SubmitDateMM2.value)) || ((mm2 < 1) || (mm2 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateMM2.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD2.value)) || ((dd2 < 1) || (dd2 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateDD2.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY2.value)) || ((yyyy2 < 2007) || (yyyy2 > 2008))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY2.value + ") for your 2nd submission date. Please correct it.");
                		document.webform.SubmitDateYYYY2.focus();
                		return false;
			}
			submitdate2 = mm2 + "/" + dd2 + "/" + yyyy2;
                	document.webform.SubmitDate2.value=submitdate2;
        	}
        }
        if ((!isEmpty(document.webform.StoryTitle3.value)) || (!isEmpty(document.webform.SubmitDateMM3.value)) || (!isEmpty(document.webform.SubmitDateDD3.value)) || (!isEmpty(document.webform.SubmitDateYYYY3.value))) {
        	if (isEmpty(document.webform.StoryTitle3.value)) {
			alert("Please enter the name of your 3rd piece.");
                	document.webform.StoryTitle3.focus();
                	return false;
        	}
        	if ((isEmpty(document.webform.SubmitDateMM3.value)) || (isEmpty(document.webform.SubmitDateDD3.value)) || (isEmpty(document.webform.SubmitDateYYYY3.value))) {
			alert("Please enter the submission date for your 3rd piece.");
        		if (isEmpty(document.webform.SubmitDateMM3.value))
                		document.webform.SubmitDateMM3.focus();
        		else if (isEmpty(document.webform.SubmitDateDD3.value))
                		document.webform.SubmitDateDD3.focus();
        		else
                		document.webform.SubmitDateYYYY3.focus();
                	return false;
        	}
        	else {
			mm3 = parseFloat(document.webform.SubmitDateMM3.value);
			dd3 = parseFloat(document.webform.SubmitDateDD3.value);
			yyyy3 = parseFloat(document.webform.SubmitDateYYYY3.value);
        		if ((!isNum(document.webform.SubmitDateMM3.value)) || ((mm3 < 1) || (mm3 > 12))) {
				alert("You entered an invalid month (" + document.webform.SubmitDateMM3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateMM3.focus();
                		return false;
			}
        		if ((!isNum(document.webform.SubmitDateDD3.value)) || ((dd3 < 1) || (dd3 > 31))) {
				alert("You entered an invalid day (" + document.webform.SubmitDateDD3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateDD3.focus();
                		return false;
			}
        		else if ((!isNum(document.webform.SubmitDateYYYY3.value)) || ((yyyy3 < 2007) || (yyyy3 > 2008))) {
				alert("You entered an invalid year (" + document.webform.SubmitDateYYYY3.value + ") for your 3rd submission date. Please correct it.");
                		document.webform.SubmitDateYYYY3.focus();
                		return false;
			}
			submitdate3 = mm3 + "/" + dd3 + "/" + yyyy3;
                	document.webform.SubmitDate3.value=submitdate3;
        	}
        }
}

/****************************************************************/
function ValidateOwwPropData() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Current_SCN_Member,Class_Term,Workshop_Title,Workshop_Synopsis,Workshop_Goals,Workshop_Methods,Workshop_ScheduleTimeCommitment,Workshop_StudentSkillLevel,WorkshopClassSizeMax,WorkshopClassSizeMin,Resume">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.Current_SCN_Member[0].checked == false) & (document.webform.Current_SCN_Member[1].checked == false)) {
                alert("Please answer the question, 'Are you currently a member of the Story Circle Network?'");
                document.webform.Current_SCN_Member[0].focus();
                return false;
        }
        if (document.webform.Class_Term.selectedIndex == 0) {
                alert("Please indicate the term for which you are proposing a class.");
                document.webform.Class_Term.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Title.value)) {
                alert("Please enter the title of your proposed class.");
                document.webform.Workshop_Title.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Synopsis.value)) {
                alert("Please enter the synopsis of your proposed class.");
                document.webform.Workshop_Synopsis.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Goals.value)) {
                alert("Please describe what the students who successfully complete this class will be able to do.");
                document.webform.Workshop_Goals.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Methods.value)) {
                alert("Please enter the instruction/communication methods of your proposed class.");
                document.webform.Workshop_Methods.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_ScheduleTimeCommitment.value)) {
                alert("Please enter the schedule and time commitment for your proposed class.");
                document.webform.Workshop_ScheduleTimeCommitment.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_StudentSkillLevel.value)) {
                alert("Please enter the student skill level & equipment required for your proposed class.");
                document.webform.Workshop_StudentSkillLevel.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_ClassSizeMax.value)) {
                alert("Please enter the maximum class size for your proposed class.");
                document.webform.Workshop_ClassSizeMax.focus();
                return false;
        }
        else if (!isNum(document.webform.Workshop_ClassSizeMax.value)) {
		alert("You entered an invalid maximum class size (" + document.webform.Workshop_ClassSizeMax.value + "). Please enter a numeric value.");
               	document.webform.Workshop_ClassSizeMax.focus();
               	return false;
        }
        if (isEmpty(document.webform.Workshop_ClassSizeMin.value)) {
                alert("Please enter the minimum class size for your proposed class.");
                document.webform.Workshop_ClassSizeMin.focus();
                return false;
        }
        else if (!isNum(document.webform.Workshop_ClassSizeMin.value)) {
		alert("You entered an invalid minimum class size (" + document.webform.Workshop_ClassSizeMin.value + "). Please enter a numeric value.");
               	document.webform.Workshop_ClassSizeMin.focus();
               	return false;
        }
        if (isEmpty(document.webform.Resume.value)) {
                alert("Please enter your resume.");
                document.webform.Resume.focus();
                return false;
        }

}

/****************************************************************/
function ValidateOwwPropRankData() {

        if (document.webform.realname.selectedIndex == 0) {
                alert("Please select your Name from the pull-down menu.");
                document.webform.realname.focus();
                return false;
        }
        if (document.webform.email.selectedIndex == 0) {
                alert("Please select your Email Address from the pull-down menu.");
                document.webform.email.focus();
                return false;
        }
        if (document.webform.proposal.selectedIndex == 0) {
                alert("Please select the name of the proposal that you are judging from the pull-down menu.");
                document.webform.proposal.focus();
                return false;
        }
        if ((isEmpty(document.webform.topic.value)) || (isEmpty(document.webform.methods.value)) || (isEmpty(document.webform.materials.value)) || (isEmpty(document.webform.schedule.value)) || (isEmpty(document.webform.studentskills.value)) || (isEmpty(document.webform.resources.value)) || (isEmpty(document.webform.qualifications.value))) {
		alert("Please enter your remarks for each of the seven categories.");
        	if (isEmpty(document.webform.topic.value))
                	document.webform.topic.focus();
		else if (isEmpty(document.webform.methods.value))
                	document.webform.methods.focus();
		else if (isEmpty(document.webform.materials.value))
                	document.webform.materials.focus();
		else if (isEmpty(document.webform.schedule.value))
                	document.webform.schedule.focus();
		else if (isEmpty(document.webform.studentskills.value))
                	document.webform.studentskills.focus();
		else if (isEmpty(document.webform.resources.value))
                	document.webform.resources.focus();
		else 
                	document.webform.qualifications.focus();
                return false;
        }
        if (document.webform.evaluation.selectedIndex == 0) {
                alert("Please select your evaluation (1-10) from the pull-down menu.");
                document.webform.evaluation.focus();
                return false;
        }
}

/****************************************************************/
function ValidateNewMemQData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,my_story,storytelling_medium,interests">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if (document.webform.admin.value == "") {
			if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
				alert("Invalid email address: '" + email + "'");
				document.webform.email.focus();
				return false;
			}
		}
		else {
			isnone = email.substring(0,4);
			if (isnone = "none") {
				document.webform.email.value=document.webform.admin_email.value;
			}
		}
        }
        if (isEmpty(document.webform.Phone_Number.value)) {
                alert("Please enter your Phone Number.");
                document.webform.Phone_Number.focus();
                return false;
        }
        if ((isEmpty(document.webform.City.value)) || (document.webform.State.selectedIndex == 0)) {
                alert("Please enter your City and State/Province.");
                if (isEmpty(document.webform.City.value))
                        document.webform.City.focus();
                else if (document.webform.State.selectedIndex == 0)
                        document.webform.State.focus();
                return false;
        }
        if (isEmpty(document.webform.my_story.value)) {
		alert("Please tell us your story.");
                document.webform.my_story.focus();
                return false;
        }
        if (isEmpty(document.webform.storytelling_medium.value)) {
		alert("Please describe your favorite storytelling medium.");
                document.webform.storytelling_medium.focus();
                return false;
        }
/*
	if ((document.webform.interests[0].checked == false) && (document.webform.interests[1].checked == false) && (document.webform.interests[2].checked == false) && (document.webform.interests[3].checked == false) && (document.webform.interests[4].checked == false)) {
                alert("Please indicate your interests.");
                document.webform.interests[0].focus();
                return false;
        }
*/
}

/****************************************************************/
function ValidateBlogData() {

//<input type=hidden name="required" value="realname,email,blogname">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.blogname.value)) {
                alert("Please enter your idea for the name of the SCN blog.");
                document.webform.blogname.focus();
                return false;
        }
}

/****************************************************************/
function ValidateTshirtData() {

//<input type=hidden name="required" value="realname,Phone_Number,email,Street_Address,City,State,Zip_Code,Country">

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
//no 3X fem, med reg, 1X reg
	if (isEmpty(document.webform.Size_Med_fem.value) && isEmpty(document.webform.Size_Lg_fem.value) && isEmpty(document.webform.Size_1X_fem.value) && isEmpty(document.webform.Size_2X_fem.value) && isEmpty(document.webform.Size_Lg_reg.value) && isEmpty(document.webform.Size_2X_reg.value) && isEmpty(document.webform.Size_3X_reg.value)) {
		alert("Please enter the number and size of t-shirt(s) you wish to purchase.");
		document.webform.Size_Med_fem.focus();
		return false;
	}
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateDonateData() {

//<input type=hidden name="required" value="realname,Phone_Number,email,Street_Address,City,State,Zip_Code,Country">

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	giftamt=0;
        if ((isEmpty(document.webform.Annual_Fund.value)  || (document.webform.Annual_Fund.value == 0)) && (isEmpty(document.webform.Memorial_Fund.value) || (document.webform.Memorial_Fund.value == 0)) && (isEmpty(document.webform.Sugar_bowl.value) || (document.webform.Sugar_bowl.value == 0)) && (isEmpty(document.webform.Other.value) || (document.webform.Other.value == 0))) {
		alert("Please enter the amount of your gift or pledge.");
                document.webform.Annual_Fund.focus();
                return false;
        }
	else {
		if (!ValidateDonateDataAmt())
			return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
	document.webform.giftamt.value=giftamt;
	document.webform.giftamt2.value=giftamt;
        if (document.webform.okdone.value == 0) {
                alert("Thank you! Info on how to send your $" + giftamt + " gift will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function ValidateDonateDataAmt() {

	giftamt=0;
       	if (!isEmpty(document.webform.Annual_Fund.value)) {
		if (!isFloat(document.webform.Annual_Fund.value)) {
			alert("You entered an invalid amount (" + document.webform.Annual_Fund.value + ") for your Annual Fund donation. Please correct it.");
               		document.webform.Annual_Fund.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(document.webform.Annual_Fund.value);
       		}
       	}
       	if (!isEmpty(document.webform.Memorial_Fund.value)) {
		if (!isFloat(document.webform.Memorial_Fund.value)) {
			alert("You entered an invalid amount (" + document.webform.Memorial_Fund.value + ") for your Memorial Fund donation. Please correct it.");
               		document.webform.Memorial_Fund.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(document.webform.Memorial_Fund.value);
       		}
       	}
       	if (!isEmpty(document.webform.Sugar_bowl.value)) {
		if (!isFloat(document.webform.Sugar_bowl.value)) {
			alert("You entered an invalid amount (" + document.webform.Sugar_bowl.value + ") for your Sugar Bowl donation. Please correct it.");
               		document.webform.Sugar_bowl.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(document.webform.Sugar_bowl.value);
       		}
       	}
       	if (!isEmpty(document.webform.Other.value)) {
		if (!isFloat(document.webform.Other.value)) {
			alert("You entered an invalid amount (" + document.webform.Other.value + ") for your 'other' donation. Please correct it.");
               		document.webform.Other.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(document.webform.Other.value);
       		}
       	}
	document.webform.giftamt.value=giftamt;
	document.webform.giftamt2.value=giftamt;
	return true;
}

/****************************************************************/
function ValidateSpeakerData() {

//<input type=hidden name="required" value="realname,Street_Address,Phone_Number,City,State,email,Zip_Code,Speaking_Fee,Topics_Offered,Bio">

	if (isEmpty(document.webform.realname.value)) {
		alert("Please enter your Name.");
		document.webform.realname.focus();
		return false;
	}
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.Speaking_Fee.value)) {
		alert("Please enter your speaking fee.");
                document.webform.Speaking_Fee.focus();
                return false;
        }
        if (isEmpty(document.webform.Topics_Offered.value)) {
		alert("Please list the topics you offer.");
                document.webform.Topics_Offered.focus();
                return false;
        }
        if (isEmpty(document.webform.Bio.value)) {
		alert("Please enter your bio.");
                document.webform.Bio.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateBogProp() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Membership_Length,SCN_Activities,Workshop_Title,Workshop_Description,Qualifications">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Membership_Length,SCN_Activities,Workshop_Title,Workshop_Description,Qualifications">
        if (isEmpty(document.webform.Membership_Length.value)) {
                alert("Please enter the length of your SCN membership.");
                document.webform.Membership_Length.focus();
                return false;
        }
        if (isEmpty(document.webform.SCN_Activities.value)) {
                alert("Please enter the SCN activities in which you have been involved.");
                document.webform.SCN_Activities.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Title.value)) {
                alert("Please enter the title of your workshop.");
                document.webform.Workshop_Title.focus();
                return false;
        }
        if (isEmpty(document.webform.Workshop_Description.value)) {
                alert("Please enter a description of your workshop.");
                document.webform.Workshop_Description.focus();
                return false;
        }
        if (isEmpty(document.webform.Qualifications.value)) {
                alert("Please enter your qualifications.");
                document.webform.Qualifications.focus();
                return false;
        }

	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateYLYS() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Membership_Length,SCN_Activities,Workshop_Title,Workshop_Description,Qualifications">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Order_number_of_copies_$15">
        if (isEmpty(document.webform.Order_number_of_copies_$15.value)) {
                alert("Please enter the number of copies you want to order.");
                document.webform.Order_number_of_copies_$15.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateCourage() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	numordered=0;
	for (var i=0; i<document.webform.elements.length; i++) {
		thiselem=document.webform.elements[i].name;
		thisvalue=document.webform.elements[i].value;
		if (thiselem.indexOf("Courage_Common_Sense_hardcover") != -1) {
			numordered+=thisvalue;
		}
		if (thiselem.indexOf("Courage_Common_Sense_paperback") != -1) {
			numordered+=thisvalue;
		}
	}
	if (numordered == 0) {
		whichelem=0;
		for (var i=0; i<document.webform.elements.length; i++) {
			thiselem=document.webform.elements[i].name;
			if (thiselem.indexOf("Courage_Common_Sense_hardcover") != -1) {
				whichelem=i;
				break;
			}
		}
                alert("Please enter the number of copies you want to order.");
		document.webform.elements[whichelem].focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateAnthologyData() {
//<input type=hidden name="required" value="realname,email,Street_Address,City,State,Zip_Code,Country,Phone_Number,Title,CircleInfo,WritingType,WordCount,OriginalWork,PublishState,Entry,Bio">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.Title.value)) {
                alert("Please enter the title of your piece.");
                document.webform.Title.focus();
                return false;
        }
        if (isEmpty(document.webform.CircleInfo.value)) {
                alert("Please enter the Facilitator's name and the city and state of the writing or reading circle you belong to.");
                document.webform.CircleInfo.focus();
                return false;
        }
        if ((document.webform.WritingType[0].checked == false) & (document.webform.WritingType[1].checked == false)) {
                alert("Please indicate the type of writing you are submitting.");
                document.webform.WritingType[0].focus();
                return false;
        }
        if (isEmpty(document.webform.WordCount.value)) {
                alert("Please enter the word count or number of lines in your piece.");
                document.webform.WordCount.focus();
                return false;
        }
        if (document.webform.OriginalWork.checked == false) {
                alert("Please indicate if this is your original work.");
                document.webform.OriginalWork.focus();
                return false;
        }
        if ((document.webform.PublishState[0].checked == false) & (document.webform.PublishState[1].checked == false)) {
                alert("Please indicate if this piece has been published before.");
                document.webform.PublishState[0].focus();
                return false;
        }
        if (isEmpty(document.webform.Entry.value)) {
                alert("Please enter your writing piece.");
                document.webform.Entry.focus();
                return false;
        }
        if (isEmpty(document.webform.Bio.value)) {
                alert("Please enter your brief bio.");
                document.webform.Bio.focus();
                return false;
        }

	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateDonationData() {
today=new Date();
thisyy=today.getYear();
if (thisyy<1000)
	thisyy+=1900;
thismm=today.getMonth();
thismm++;
thismm=leftpad(thismm, "0", 2);
thisdd=today.getDate();
thisdd=leftpad(thisdd, "0", 2);
yymmdd=thisyy + thismm + thisdd;

	giftamt=0;
        if ((isEmpty(document.webform.AddOn1.value)  || (document.webform.AddOn1.value == 0)) && (isEmpty(document.webform.AddOn2.value) || (document.webform.AddOn2.value == 0)) && (isEmpty(document.webform.AddOn3.value) || (document.webform.AddOn3.value == 0)) && (isEmpty(document.webform.AddOn4.value) || (document.webform.AddOn4.value == 0)) && (isEmpty(document.webform.AddOn6.value) || (document.webform.AddOn6.value == 0))) {
		alert("Please enter the amount of your gift or pledge." + document.webform.AddOn6.value);
                document.webform.AddOn1.focus();
                return false;
        }
	else {
		if (!ValidateDonationDataAmt())
			return false;
		if (document.webform.AddOn1.value > 0)
			document.webform.AddOn1.value="$" + document.webform.AddOn1.value + " Annual fund";
		if (document.webform.AddOn2.value > 0)
			document.webform.AddOn2.value="$" + document.webform.AddOn2.value + " Memorial fund";
		if (document.webform.AddOn3.value > 0)
			document.webform.AddOn3.value="$" + document.webform.AddOn3.value + " Sugar Bowl";
		if (document.webform.AddOn4.value > 0)
			document.webform.AddOn4.value="$" + document.webform.AddOn4.value + " other donation";
		if (document.webform.AddOn6.value > 0) {
			if ((document.webform.Recur[0].checked == false) && (document.webform.Recur[1].checked == false) && (document.webform.Recur[2].checked == false)) {
				alert("Please indicate the frequency of your recurring payment.");
               			document.webform.Recur[0].focus();
               			return false;
       			}
			if (document.webform.Recur[0].checked == true)
				whatkind=" (12 monthly payments)";
			else if (document.webform.Recur[1].checked == true)
				whatkind=" (4 quarterly payments)";
			if (document.webform.Recur[2].checked == true)
				whatkind=" (1 yearly payment)";
			document.webform.AddOn6.value="$" + document.webform.AddOn6.value + " recurring donation" + whatkind;
			document.webform.startDate.value=yymmdd;
       		}
        }
}

/****************************************************************/
function ValidateDonationDataAmt() {

	giftamt=0;
       	if (!isEmpty(document.webform.AddOn1.value)) {
		addon1=document.webform.AddOn1.value;
		if ((addon1.indexOf("$") != -1)) {
			newaddon1=addon1.replace(/\$/g, "");
			document.webform.AddOn1.value=newaddon1;
			addon1=newaddon1;
		}
		if ((addon1.indexOf(".") == -1)) {
			newaddon1=addon1 + ".00";
			document.webform.AddOn1.value=newaddon1;
			addon1=newaddon1;
		}
		if (!isFloat(addon1)) {
			alert("You entered an invalid amount (" + addon1 + ") for your Annual Fund donation. Please correct it.");
               		document.webform.AddOn1.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(addon1);
       		}
       	}
       	if (!isEmpty(document.webform.AddOn2.value)) {
		addon2=document.webform.AddOn2.value;
		if ((addon2.indexOf("$") != -1)) {
			newaddon2=addon2.replace(/\$/g, "");
			document.webform.AddOn2.value=newaddon2;
			addon2=newaddon2;
		}
		if ((addon2.indexOf(".") == -1)) {
			newaddon2=addon2 + ".00";
			document.webform.AddOn2.value=newaddon2;
			addon2=newaddon2;
		}
		if (!isFloat(addon2)) {
			alert("You entered an invalid amount (" + addon2 + ") for your Memorial Fund donation. Please correct it.");
               		document.webform.AddOn2.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(addon2);
       		}
       	}
       	if (!isEmpty(document.webform.AddOn3.value)) {
		addon3=document.webform.AddOn3.value;
		if ((addon3.indexOf("$") != -1)) {
			newaddon3=addon3.replace(/\$/g, "");
			document.webform.AddOn3.value=newaddon3;
			addon3=newaddon3;
		}
		if ((addon3.indexOf(".") == -1)) {
			newaddon3=addon3 + ".00";
			document.webform.AddOn3.value=newaddon3;
			addon3=newaddon3;
		}
		if (!isFloat(addon3)) {
			alert("You entered an invalid amount (" + addon3 + ") for your Sugar Bowl donation. Please correct it.");
               		document.webform.AddOn3.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(addon3);
       		}
       	}
       	if (!isEmpty(document.webform.AddOn4.value)) {
		addon4=document.webform.AddOn4.value;
		if ((addon4.indexOf("$") != -1)) {
			newaddon4=addon4.replace(/\$/g, "");
			document.webform.AddOn4.value=newaddon4;
			addon4=newaddon4;
		}
		if ((addon4.indexOf(".") == -1)) {
			newaddon4=addon4 + ".00";
			document.webform.AddOn4.value=newaddon4;
			addon4=newaddon4;
		}
		if (!isFloat(addon4)) {
			alert("You entered an invalid amount (" + addon4 + ") for your 'other' donation. Please correct it.");
               		document.webform.AddOn4.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(addon4);
       		}
       	}
       	if (!isEmpty(document.webform.AddOn6.value)) {
		addon6=document.webform.AddOn6.value;
		if ((addon6.indexOf("$") != -1)) {
			newaddon6=addon6.replace(/\$/g, "");
			document.webform.AddOn6.value=newaddon6;
			addon6=newaddon6;
		}
		if ((addon6.indexOf(".") == -1)) {
			newaddon6=addon6 + ".00";
			document.webform.AddOn6.value=newaddon6;
			addon6=newaddon6;
		}
		if (!isFloat(addon6)) {
			alert("You entered an invalid amount (" + addon6 + ") for your 'recurring' donation. Please correct it.");
               		document.webform.AddOn6.focus();
               		return false;
       		}
		else {
			giftamt+=parseFloat(addon6);
       		}
       	}
	document.webform.Price.value=giftamt;
	return true;
}

/****************************************************************/
function ValidateJoinRenewData() {
USA="USA";
CANADA="CANADA";
MEXICO="MEXICO";
SCNMEM="Story Circle Network member";
FRIEND="a friend";
OTHER="OTHER";
OTHERWEBSITE="another website";

now=parseFloat(document.webform.now.value);
duesdatechg=parseFloat(document.webform.duesdatechg.value);

        if (document.webform.Referred_From.selectedIndex == 0) {
                alert("Please tell us where you heard about SCN");
                document.webform.Referred_From.focus();
                return false;
        }
	else {
		if ((document.webform.Referred_From.value == OTHERWEBSITE) || (document.webform.Referred_From.value == OTHER)) {
			if (isEmpty(document.webform.Referred_From_Other.value)) {
                		alert("Please give us more detail on where you heard about SCN");
                		document.webform.Referred_From_Other.focus();
                		return false;
        		}
			else
				document.webform.Referring_Member.value="";
        	}
		else if ((document.webform.Referred_From.value == SCNMEM) || (document.webform.Referred_From.value == FRIEND)) {
			if (isEmpty(document.webform.Referring_Member.value)) {
                		alert("Please give us the name of the person who referred you to SCN");
                		document.webform.Referring_Member.focus();
                		return false;
        		}
			else
				document.webform.Referred_From_Other.value="";
        	}
		else {
			document.webform.Referring_Member.value="";
			document.webform.Referred_From_Other.value="";
        	}
        }
	amtdue=0;
        if ((document.webform.MemberLevel.selectedIndex == 0) && (document.webform.AddOn2.checked == false)) {
		alert("Please indicate the membership you are interested in (national &/or chapter)");
		document.webform.MemberLevel.focus();
		return false;
        }
        else if ((document.webform.MemberLevel.selectedIndex == 0) && (document.webform.AddOn2.checked == true)) {
		alert("Please note: Memberships in the Internet Chapter are available only to dues-paying members of the National Story Circle Network. If you are not already a dues-paying member of the national organization, you must join it, too.");
		document.webform.MemberLevel.focus();
        }
        else if (document.webform.MemberLevel.selectedIndex == 1) {
		if (document.webform.Country.value == USA)
			amtdue+=parseFloat(document.webform.member.value);
		else if ((document.webform.Country.value == CANADA) || (document.webform.Country.value == MEXICO))
			amtdue+=parseFloat(document.webform.National_Membership_CanMex.value);
		else
			amtdue+=parseFloat(document.webform.National_Membership_Other.value);
	}
	else {
		if (now < duesdatechg) {
        		if (document.webform.MemberLevel.selectedIndex == 2)
				amtdue+=parseFloat(document.webform.supporter.value);
        		else if (document.webform.MemberLevel.selectedIndex == 3)
				amtdue+=parseFloat(document.webform.sponsor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 4)
				amtdue+=parseFloat(document.webform.patron.value);
        		else if (document.webform.MemberLevel.selectedIndex == 5)
				amtdue+=parseFloat(document.webform.benefactor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 6)
				amtdue+=parseFloat(document.webform.orgmember.value);
		}
		else {
        		if (document.webform.MemberLevel.selectedIndex == 2)
				amtdue+=parseFloat(document.webform.friend.value);
        		else if (document.webform.MemberLevel.selectedIndex == 3)
				amtdue+=parseFloat(document.webform.donor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 4)
				amtdue+=parseFloat(document.webform.supporter.value);
        		else if (document.webform.MemberLevel.selectedIndex == 5)
				amtdue+=parseFloat(document.webform.contributor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 6)
				amtdue+=parseFloat(document.webform.sustainer.value);
        		else if (document.webform.MemberLevel.selectedIndex == 7)
				amtdue+=parseFloat(document.webform.patron.value);
        		else if (document.webform.MemberLevel.selectedIndex == 8)
				amtdue+=parseFloat(document.webform.benefactor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 9)
				amtdue+=parseFloat(document.webform.orgmember.value);
		}
	}

/*
	if (document.webform.AddOn3.checked == true)
		amtdue-=parseFloat(document.webform.member_discount.value);
*/
        if (document.webform.MemberLevel.selectedIndex != 0) {
		if (document.webform.AddOn3.checked == true)
			amtdue-=parseFloat(document.webform.member_discount.value);
	}

	if (document.webform.AddOn2.checked == true) {
		amtdue+=parseFloat(document.webform.IC.value);
		if (document.webform.AddOn3.checked == true)
			amtdue-=parseFloat(document.webform.member_discount_IC.value);
	}
	if (amtdue < 0) {
		alert("Problem with what you have selected; your amount due is $" + amtdue + ". Please indicate the membership you are interested in (national &/or chapter)");
		document.webform.MemberLevel.focus();
		return false;
	}
	else if (amtdue == 0) {
		alert("Please indicate the membership you are interested in (national &/or chapter)");
		document.webform.MemberLevel.focus();
		return false;
	}
	else {
		document.webform.Price.value=amtdue;
		document.webform.AddOn1.value=document.webform.MemberLevel.value;
		if (document.webform.Country.value != USA) {
			if ((document.webform.Country.value != CANADA) && (document.webform.Country.value != MEXICO))
				document.webform.AddOn1.value=document.webform.AddOn1.value + " (" + document.webform.Country.value + " country)";
			else
				document.webform.AddOn1.value=document.webform.AddOn1.value + " (" + document.webform.Country.value + ")";
		}
		referred_from=document.webform.Referred_From.value;
		referred_from="referred from: " + referred_from;
		if (document.webform.Referred_From_Other.value != "")
			referred_from+=" (" + document.webform.Referred_From_Other.value + ")";
		else if (document.webform.Referring_Member.value != "")
			referred_from+=" (" + document.webform.Referring_Member.value + ")";
		document.webform.AddOn4.value=referred_from;
	}
}

/****************************************************************/
function ValidateGiftMemData() {
USA="USA";
CANADA="CANADA";
MEXICO="MEXICO";
SCNMEM="Story Circle Network member"
FRIEND="a friend"

now=parseFloat(document.webform.now.value);
duesdatechg=parseFloat(document.webform.duesdatechg.value);

        if (isEmpty(document.webform.Name.value)) {
		alert("Please enter the gift recipient's Name.");
                document.webform.Name.focus();
                return false;
        }
	if (!ValidateCommonData("the gift recipient's"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter the gift recipient's Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	amtdue=0;
        if (document.webform.MemberLevel.selectedIndex == 1) {
		if (document.webform.Country.value == USA)
			amtdue+=parseFloat(document.webform.member.value);
		else if ((document.webform.Country.value == CANADA) || (document.webform.Country.value == MEXICO))
			amtdue+=parseFloat(document.webform.National_Membership_CanMex.value);
		else
			amtdue+=parseFloat(document.webform.National_Membership_Other.value);
	}
	else {
		if (now < duesdatechg) {
        		if (document.webform.MemberLevel.selectedIndex == 2)
				amtdue+=parseFloat(document.webform.supporter.value);
        		else if (document.webform.MemberLevel.selectedIndex == 3)
				amtdue+=parseFloat(document.webform.sponsor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 4)
				amtdue+=parseFloat(document.webform.patron.value);
        		else if (document.webform.MemberLevel.selectedIndex == 5)
				amtdue+=parseFloat(document.webform.benefactor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 6)
				amtdue+=parseFloat(document.webform.orgmember.value);
		}
		else {
        		if (document.webform.MemberLevel.selectedIndex == 2)
				amtdue+=parseFloat(document.webform.friend.value);
        		else if (document.webform.MemberLevel.selectedIndex == 3)
				amtdue+=parseFloat(document.webform.donor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 4)
				amtdue+=parseFloat(document.webform.supporter.value);
        		else if (document.webform.MemberLevel.selectedIndex == 5)
				amtdue+=parseFloat(document.webform.contributor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 6)
				amtdue+=parseFloat(document.webform.sustainer.value);
        		else if (document.webform.MemberLevel.selectedIndex == 7)
				amtdue+=parseFloat(document.webform.patron.value);
        		else if (document.webform.MemberLevel.selectedIndex == 8)
				amtdue+=parseFloat(document.webform.benefactor.value);
        		else if (document.webform.MemberLevel.selectedIndex == 9)
				amtdue+=parseFloat(document.webform.orgmember.value);
		}
	}

/*
	if (document.webform.AddOn3.checked == true)
		amtdue-=parseFloat(document.webform.member_discount.value);
*/

        if (document.webform.MemberLevel.selectedIndex != 0) {
		if (document.webform.AddOn3.checked == true)
			amtdue-=parseFloat(document.webform.member_discount.value);
	}
	if (document.webform.AddOn2.checked == true) {
		amtdue+=parseFloat(document.webform.IC.value);
		if (document.webform.AddOn3.checked == true)
			amtdue-=parseFloat(document.webform.member_discount_IC.value);
	}
	if (amtdue == 0) {
		alert("Please indicate the membership you are interested in (national &/or chapter)");
		document.webform.MemberLevel.focus();
		return false;
	}
	else {
		document.webform.Price.value=amtdue;
		document.webform.AddOn1.value=document.webform.MemberLevel.value;
		if (document.webform.Country.value != USA)
			document.webform.AddOn1.value=document.webform.AddOn1.value + " (" + document.webform.Country.value + ")";
		recipient="[gift recipient: " + document.webform.Name.value + ", ";
		recipient+=document.webform.Street_Address.value + ", ";
		recipient+=document.webform.City.value + " ";
		recipient+=document.webform.State.value + " ";
		if (document.webform.Country.value != USA)
			recipient+=document.webform.Country.value + " ";
		recipient+=document.webform.Zip_Code.value + " ";
		recipient+="(" + document.webform.Phone_Number.value + ", ";
		recipient+=document.webform.email.value + ")";
		recipient+="]";
		document.webform.AddOn4.value=recipient;
	}
}

/****************************************************************/
function ValidatePaymentData() {

	amtdue=0;
        if (isEmpty(document.webform.Price.value)  || (document.webform.Price.value == 0)) {
		alert("Please enter the amount of your payment.");
                document.webform.Price.focus();
                return false;
        }
	else {
		if (!isFloat(document.webform.Price.value) && !isNum(document.webform.Price.value)) {
			alert("You entered an invalid amount (" + document.webform.Price.value + ") for your 'other' donation. Please correct it.");
               		document.webform.Price.focus();
               		return false;
       		}
        }
        if (isEmpty(document.webform.Describe.value)) {
		alert("Please indicate what you are paying for.");
                document.webform.Describe.focus();
                return false;
        }
}

/****************************************************************/
function ValidateTshirtOrderData() {

	size="";
	price=0;
        if ((document.webform.Size1.selectedIndex == 0) && (document.webform.Size2.selectedIndex == 0)) {
		alert("Please indicate which t-shirt(s) you wish to purchase.");
		document.webform.Size1.focus();
		return false;
	}
	else {
        	if (document.webform.Size1.selectedIndex != 0) {
			size=size + "Periwinkle, size " + document.webform.Size1.value;
			price+=parseFloat(document.webform.price_periwinkle.value);
		}
        	if (document.webform.Size2.selectedIndex != 0) {
			if (size != "")
				size=size + "; ";
			size=size + "Beige, size " + document.webform.Size2.value;
			price+=parseFloat(document.webform.price_beige.value);
		}
		document.webform.AddOn1.value=size;
		document.webform.Price.value=price;
	}
}

/****************************************************************/
function ValidateJrnlOrderData() {

	orderinfo="";
	price=0;
        if ((document.webform.V15N1.checked == false) && (document.webform.V15N2.checked == false) && (document.webform.V15N3.checked == false) && (document.webform.V15N4.checked == false) && (document.webform.V15TwAnth.checked == false) && (document.webform.V14N1.checked == false) && (document.webform.V14N2.checked == false) && (document.webform.V14N3.checked == false) && (document.webform.V14N4.checked == false) && (document.webform.V14TwAnth.checked == false) && (document.webform.V13N1.checked == false) && (document.webform.V13N2.checked == false) && (document.webform.V13N3.checked == false) && (document.webform.V13N4.checked == false) && (document.webform.V12N1.checked == false) && (document.webform.V12N2.checked == false) && (document.webform.V12N3.checked == false) && (document.webform.V12N4.checked == false) && (document.webform.V11N1.checked == false) && (document.webform.V11N2.checked == false) && (document.webform.V11N3.checked == false) && (document.webform.V11N4.checked == false) && (document.webform.V10N1.checked == false) && (document.webform.V10N2.checked == false) && (document.webform.V10N3.checked == false) && (document.webform.V10N4.checked == false) && (document.webform.V9N1.checked == false) && (document.webform.V9N2.checked == false) && (document.webform.V9N3.checked == false) && (document.webform.V9N4.checked == false) && (document.webform.V8N1.checked == false) && (document.webform.V8N2.checked == false) && (document.webform.V8N3.checked == false) && (document.webform.V8N4.checked == false) && (document.webform.V7N1.checked == false) && (document.webform.V7N2.checked == false) && (document.webform.V7N3.checked == false) && (document.webform.V7N4.checked == false) && (document.webform.V6N1.checked == false) && (document.webform.V6N2.checked == false) && (document.webform.V6N3.checked == false) && (document.webform.V6N4.checked == false) && (document.webform.V5N1.checked == false) && (document.webform.V5N2.checked == false) && (document.webform.V5N3.checked == false) && (document.webform.V5N4.checked == false) && (document.webform.V4N1.checked == false) && (document.webform.V4N2.checked == false) && (document.webform.V4N3.checked == false) && (document.webform.V4N4.checked == false) && (document.webform.V3N1.checked == false) && (document.webform.V3N2.checked == false) && (document.webform.V3N3.checked == false) && (document.webform.V3N4.checked == false) && (document.webform.V2N1.checked == false) && (document.webform.V2N2.checked == false) && (document.webform.V2N3.checked == false) && (document.webform.V2N4.checked == false) && (document.webform.V1N1.checked == false) && (document.webform.V1N2.checked == false) && (document.webform.V1N3.checked == false) && (document.webform.V1N4.checked == false)) {
                alert("Please select the issue(s) you want to purchase.");
                document.webform.V15N1.focus();
                return false;
        }
	else {
		numjournals=0;
		if (document.webform.V15N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V15N1, ";
		}
		if (document.webform.V15N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V15N2, ";
		}
		if (document.webform.V15N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V15N3, ";
		}
		if (document.webform.V15N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V15N4, ";
		}
		if (document.webform.V15TwAnth.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V15TwAnth, ";
		}
		if (document.webform.V14N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V14N1, ";
		}
		if (document.webform.V14N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V14N2, ";
		}
		if (document.webform.V14N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V14N3, ";
		}
		if (document.webform.V14N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V14N4, ";
		}
		if (document.webform.V14TwAnth.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V14TwAnth, ";
		}
		if (document.webform.V13N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V13N1, ";
		}
		if (document.webform.V13N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V13N2, ";
		}
		if (document.webform.V13N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V13N3, ";
		}
		if (document.webform.V13N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V13N4, ";
		}
		if (document.webform.V12N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V12N1, ";
		}
		if (document.webform.V12N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V12N2, ";
		}
		if (document.webform.V12N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V12N3, ";
		}
		if (document.webform.V12N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V12N4, ";
		}
		if (document.webform.V11N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V11N1, ";
		}
		if (document.webform.V11N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V11N2, ";
		}
		if (document.webform.V11N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V11N3, ";
		}
		if (document.webform.V11N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V11N4, ";
		}
		if (document.webform.V10N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V10N1, ";
		}
		if (document.webform.V10N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V10N2, ";
		}
		if (document.webform.V10N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V10N3, ";
		}
		if (document.webform.V10N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V10N4, ";
		}
		if (document.webform.V9N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V9N1, ";
		}
		if (document.webform.V9N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V9N2, ";
		}
		if (document.webform.V9N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V9N3, ";
		}
		if (document.webform.V9N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V9N4, ";
		}
		if (document.webform.V8N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V8N1, ";
		}
		if (document.webform.V8N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V8N2, ";
		}
		if (document.webform.V8N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V8N3, ";
		}
		if (document.webform.V8N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V8N4, ";
		}
		if (document.webform.V7N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V7N1, ";
		}
		if (document.webform.V7N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V7N2, ";
		}
		if (document.webform.V7N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V7N3, ";
		}
		if (document.webform.V7N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V7N4, ";
		}
		if (document.webform.V6N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V6N1, ";
		}
		if (document.webform.V6N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V6N2, ";
		}
		if (document.webform.V6N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V6N3, ";
		}
		if (document.webform.V6N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V6N4, ";
		}
		if (document.webform.V5N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V5N1, ";
		}
		if (document.webform.V5N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V5N2, ";
		}
		if (document.webform.V5N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V5N3, ";
		}
		if (document.webform.V5N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V5N4, ";
		}
		if (document.webform.V4N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V4N1, ";
		}
		if (document.webform.V4N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V4N2, ";
		}
		if (document.webform.V4N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V4N3, ";
		}
		if (document.webform.V4N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V4N4, ";
		}
		if (document.webform.V3N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V3N1, ";
		}
		if (document.webform.V3N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V3N2, ";
		}
		if (document.webform.V3N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V3N3, ";
		}
		if (document.webform.V3N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V3N4, ";
		}
		if (document.webform.V2N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V2N1, ";
		}
		if (document.webform.V2N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V2N2, ";
		}
		if (document.webform.V2N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V2N3, ";
		}
		if (document.webform.V2N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V2N4, ";
		}
		if (document.webform.V1N1.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V1N1, ";
		}
		if (document.webform.V1N2.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V1N2, ";
		}
		if (document.webform.V1N3.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V1N3, ";
		}
		if (document.webform.V1N4.checked == true) {
			numjournals++;
			orderinfo=orderinfo + "V1N4, ";
		}
		ship_charge=0.00;
		subtotal=0.00;
		journalprice=0.00;
		amtdue=0.00;
		journal_1_9=parseFloat(document.webform.journal_1_9.value);
		journal_10=parseFloat(document.webform.journal_10.value);
		journal_1sh=parseFloat(document.webform.journal_1sh.value);
		journal_2_5sh=parseFloat(document.webform.journal_2_5sh.value);
		journal_6sh=parseFloat(document.webform.journal_6sh.value);
		if (numjournals > 9)
			journalprice=journal_10;
		else
			journalprice=journal_1_9;
		subtotal=numjournals*journalprice;
		if (numjournals > 5)
			ship_charge=journal_6sh;
		else if (numjournals > 1)
			ship_charge=journal_2_5sh;
		else
			ship_charge=journal_1sh;
		amtdue=subtotal+ship_charge;
		document.webform.subtotal.value=sprintf("%01.2f", subtotal);
		document.webform.numjournals.value=numjournals;
		document.webform.journalprice.value=sprintf("%01.2f", journalprice);
		this_ship_charge=sprintf("%01.2f", ship_charge);
//alert("Ship charge: " + this_ship_charge);
		document.webform.ship_charge.value=this_ship_charge;
		document.webform.amtdue.value=sprintf("%01.2f", amtdue);
		document.webform.Qty.value=numjournals;
		orderinfolen=orderinfo.length;
//alert("orderinfo: [" + orderinfo + "]; length: " + orderinfolen);
		if (orderinfo.substring(orderinfolen-2,2) == ", ");
			orderinfo=orderinfo.substring(0,orderinfolen-2);
//alert("orderinfo: [" + orderinfo + "]");
		document.webform.AddOn1.value=orderinfo;
		document.webform.Ship.value=this_ship_charge;
		document.webform.Price.value=price;
        }
}

/****************************************************************/
function ValidateCourageOrder() {

	bookorder="";
	price=0;
	numordered=0;
	shipping=0.00;
	pricehc=parseFloat(document.webform.PriceHC.value);
	pricepb=parseFloat(document.webform.PricePB.value);
	for (var i=0; i<document.webform.elements.length; i++) {
		thiselem=document.webform.elements[i].name;
		if (thiselem.indexOf("Courage_Common_Sense_hardcover") != -1) {
			thisvalue=parseFloat(document.webform.elements[i].value);
			if (thisvalue != "") {
				numordered+=thisvalue;
				bookorder=bookorder + "Hardcover (" + thisvalue + " at $" + pricehc + ")";
				price+=thisvalue*pricehc;
			}
		}
		if (thiselem.indexOf("Courage_Common_Sense_paperback") != -1) {
			thisvalue=parseFloat(document.webform.elements[i].value);
			if (thisvalue != "") {
				numordered+=thisvalue;
				if (bookorder != "")
					bookorder+="; ";
				bookorder=bookorder + "Paperback (" + thisvalue + " at $" + pricepb + ")";
				price+=thisvalue*pricepb;
			}
		}
	}
	if (numordered == 0) {
		whichelem=0;
		for (var i=0; i<document.webform.elements.length; i++) {
			thiselem=document.webform.elements[i].name;
			if (thiselem.indexOf("Courage_Common_Sense_hardcover") != -1) {
				whichelem=i;
				break;
			}
		}
                alert("Please enter the number of copies you want to order.");
		document.webform.elements[whichelem].focus();
                return false;
        }
	shipcost=parseFloat(document.webform.thisshipchg.value);
	addlshipcost=parseFloat(document.webform.addlshipchg.value);
	shipping=shipcost;
	if (numordered > 1) {
		shipping+=(numordered-1)*addlshipcost;
	}
	bookorder+=" [price includes $" + shipping + " s/h]";
	document.webform.AddOn1.value=bookorder;
	document.webform.Price.value=price+shipping;
}

/****************************************************************/
function ValidateWWOrder() {

	bookorder="";
	numordered=0;
	shipping=0.00;
	price=parseFloat(document.webform.PricePB.value);
        if (isEmpty(document.webform.WhatWildness.value)) {
                alert("Please enter the number of copies you want to order.");
		document.webform.WhatWildness.focus();
                return false;
	}
	else {
		if (!isNum(document.webform.WhatWildness.value)) {
			alert("You entered an invalid number (" + document.webform.WhatWildness.value + "). Please correct it.");
               		document.webform.WhatWildness.focus();
               		return false;
		}
		else {
			ordernum=parseFloat(document.webform.WhatWildness.value);
			numordered+=ordernum;
			bookorder=bookorder + "(" + ordernum + " at $" + price + ")";
			subtotal=ordernum*price;
		}
	}
	shipcost=parseFloat(document.webform.thisshipchg.value);
	addlshipcost=parseFloat(document.webform.addlshipchg.value);
	shipping=shipcost;
	if (numordered > 1) {
		shipping+=(numordered-1)*addlshipcost;
	}
	bookorder+=" [price includes $" + shipping + " s/h]";
	document.webform.AddOn1.value=bookorder;
	document.webform.Price.value=subtotal+shipping;
}

/****************************************************************/
function ValidateOwlPurchaseData() {

/*
	if ((document.webform.Order_OWL_Workbook[0].checked == false) && (document.webform.Order_OWL_Workbook[1].checked == false)) {
                alert("Please indicate which type of purchase (individual/institution) you are making");
                document.webform.Order_OWL_Workbook[0].focus();
                return false;
	}
*/

        if ((document.webform.SCN_member[0].checked == false) && (document.webform.SCN_member[1].checked == false)) {
                alert("Please indicate your membership status");
                document.webform.SCN_member[0].focus();
                return false;
        }
	else {
		orderinfo="";
		price=0.00;
		priceind=parseFloat(document.webform.PriceInd.value);
		priceinst=parseFloat(document.webform.PriceInst.value);
		discount=parseFloat(document.webform.OWL_Workbook_discount.value);
		shipchg=parseFloat(document.webform.shipchg.value);
/*
        	if (document.webform.Order_OWL_Workbook[0].checked == true) {
			orderinfo="Individual teacher purchase";
*/
			price+=priceind;
        		if (document.webform.SCN_member[0].checked == true) {
				orderinfo=" [SCN member rate]";
				price-=discount;
        		}
			else
				orderinfo=" [non-member rate]";
/*
        	}
		else {
			orderinfo="Institutional purchase";
			price+=priceinst;
        	}
*/
        }
	document.webform.AddOn1.value=orderinfo;
	document.webform.Price.value=price+shipchg;

}

/****************************************************************/
function ValidateSearchData() {

	whichelem=0;
	for (var i=0; i<document.searchform.elements.length; i++) {
		thiselem=document.searchform.elements[i].name;
		if (thiselem.indexOf("sp-q") != -1) {
			whichelem=i;
			break;
		}
	}
	searchstring=document.searchform.elements[whichelem].value;
	if (searchstring.substring(0,1) != "\"")
		searchstring="\"" + searchstring;
	strlen=searchstring.length;
	if (searchstring.substring(strlen-1,strlen) != "\"")
		searchstring=searchstring + "\"";
	document.searchform.elements[whichelem].value=searchstring;
}

/****************************************************************/
function ValidateLLEvalData() {

//<input type=hidden name="db_fields" value="TeachingFacility,TeachingFacilityComment,SleepingAccomodations,SleepingAccomodationsComment,DiningHallFood,DiningHallFoodComment,Surroundings,SurroundingsComment,TeacherMetNeeds,TeacherMetNeedsComment,RetreatStructure,RetreatStructureComment,OfficeMetNeeds,OfficeMetNeedsComment,SuggestedFacilities,SuggestedFacilitators,ExtendRetreat,Comments">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (((document.webform.TeachingFacility[0].checked == true) || (document.webform.TeachingFacility[1].checked == true) || (document.webform.TeachingFacility[2].checked == true)) && (document.webform.TeachingFacilityComment.value == "")) {
                alert("Please explain your low rating for how the teaching facility (the Service Building) met our needs.");
                document.webform.TeachingFacilityComment.focus();
                return false;
        }
        if (((document.webform.SleepingAccomodations[0].checked == true) || (document.webform.SleepingAccomodations[1].checked == true) || (document.webform.SleepingAccomodations[2].checked == true)) && (document.webform.SleepingAccomodationsComment.value == "")) {
                alert("Please explain your low rating for how the sleeping accomodations meet your needs.");
                document.webform.SleepingAccomodationsComment.focus();
                return false;
        }
        if (((document.webform.DiningHallFood[0].checked == true) || (document.webform.DiningHallFood[1].checked == true) || (document.webform.DiningHallFood[2].checked == true)) && (document.webform.DiningHallFoodComment.value == "")) {
                alert("Please explain your low rating for the dining hall food.");
                document.webform.DiningHallFoodComment.focus();
                return false;
        }
        if (((document.webform.Surroundings[0].checked == true) || (document.webform.Surroundings[1].checked == true) || (document.webform.Surroundings[2].checked == true)) && (document.webform.SurroundingsComment.value == "")) {
                alert("Please explain your low rating for the surroundings.");
                document.webform.SurroundingsComment.focus();
                return false;
        }
        if (((document.webform.TeacherMetNeeds[0].checked == true) || (document.webform.TeacherMetNeeds[1].checked == true) || (document.webform.TeacherMetNeeds[2].checked == true)) && (document.webform.TeacherMetNeedsComment.value == "")) {
                alert("Please explain your low rating for how the teacher met your needs.");
                document.webform.TeacherMetNeedsComment.focus();
                return false;
        }
        if (((document.webform.RetreatStructure[0].checked == true) || (document.webform.RetreatStructure[1].checked == true) || (document.webform.RetreatStructure[2].checked == true)) && (document.webform.RetreatStructureComment.value == "")) {
                alert("Please explain your low rating for how the retreat time was structured.");
                document.webform.RetreatStructureComment.focus();
                return false;
        }
        if (((document.webform.OfficeMetNeeds[0].checked == true) || (document.webform.OfficeMetNeeds[1].checked == true) || (document.webform.OfficeMetNeeds[2].checked == true)) && (document.webform.OfficeMetNeedsComment.value == "")) {
                alert("Please explain your low rating for how the SCN office met your needs.");
                document.webform.OfficeMetNeedsComment.focus();
                return false;
        }
}

/****************************************************************/
function ValidateConfDonationDataGB(id) {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Current_SCN_Member,Item_Description,Donation_Receipt_Method">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.Current_SCN_Member[0].checked == false) & (document.webform.Current_SCN_Member[1].checked == false)) {
                alert("Please answer the question, 'Are you currently a member of the Story Circle Network?'");
                document.webform.Current_SCN_Member[0].focus();
                return false;
        }
        if (isEmpty(document.webform.Item_Description.value)) {
                alert("Please enter a description of your item.");
                document.webform.Item_Description.focus();
                return false;
        }
	if (isEmpty(document.webform.GiftQty.value)) {
               	alert("Please enter the number of items to be donated for the gift bags.");
              		document.webform.GiftQty.focus();
              		return false;
      		}
     	else if (!isNum(document.webform.GiftQty.value)) {
		alert("You entered an invalid quantity (" + document.webform.GiftQty.value + "). Please enter a number.");
		document.webform.GiftQty.focus();
           	return false;
       	}
        if ((document.webform.Donation_Receipt_Method[0].checked == false) & (document.webform.Donation_Receipt_Method[1].checked == false)) {
                alert("Please indicate how you will get your donation to SCN.");
                document.webform.Donation_Receipt_Method[0].focus();
                return false;
        }
}

/****************************************************************/
function ValidateConfDonationDataAD(id) {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,Current_SCN_Member,Item_Description,Donation_Receipt_Method">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((document.webform.Current_SCN_Member[0].checked == false) & (document.webform.Current_SCN_Member[1].checked == false)) {
                alert("Please answer the question, 'Are you currently a member of the Story Circle Network?'");
                document.webform.Current_SCN_Member[0].focus();
                return false;
        }
        if (isEmpty(document.webform.Item_Description.value)) {
                alert("Please enter a description of your item.");
                document.webform.Item_Description.focus();
                return false;
        }
	if (isEmpty(document.webform.Artist_Bio.value)) {
		alert("Please enter the creator/artist's bio information.");
               	document.webform.Artist_Bio.focus();
               	return false;
        }
        if (isEmpty(document.webform.Minimum_Price.value)) {
		alert("Please enter the minimum price (starting bid) for your item.");
		document.webform.Minimum_Price.focus();
		return false;
        }
	else {
        	if (!isNum(document.webform.Minimum_Price.value)) {
			alert("You entered an invalid price (" + document.webform.Minimum_Price.value + "). Please enter a dollar value.");
               		document.webform.Minimum_Price.focus();
               		return false;
        	}
        }
        if ((document.webform.Donation_Preference[0].checked == false) & (document.webform.Donation_Preference[1].checked == false) & (document.webform.Donation_Preference[2].checked == false)) {
              		document.webform.Donation_Preference[2].checked=true;
        }
        if ((document.webform.Donation_Receipt_Method[0].checked == false) & (document.webform.Donation_Receipt_Method[1].checked == false)) {
                alert("Please indicate how you will get your donation to SCN.");
                document.webform.Donation_Receipt_Method[0].focus();
                return false;
        }
}

/****************************************************************/
function ValidateExpireData() {
USA="USA";
CANADA="CANADA";

        if (isEmpty(document.webform.firstname.value)) {
                alert("Please enter your First Name.");
                document.webform.firstname.focus();
                return false;
        }
        if (isEmpty(document.webform.lastname.value)) {
                alert("Please enter your Last Name.");
                document.webform.lastname.focus();
                return false;
        }
	if ((document.webform.Country.value == USA) || (document.webform.Country.value == CANADA)) {
		if (document.webform.State.selectedIndex < 2) {
			alert("Please enter your State/Province.");
			document.webform.State.focus();
			return false;
		}
		if (isEmpty(document.webform.Zip_Code.value)) {
			alert("Please enter your Zipcode.");
			document.webform.Zip_Code.focus();
			return false;
		}
        }
	else {
		document.webform.State.selectedIndex=1;
		document.webform.Zip_Code.value="";
        }
	document.webform.indxstate.value=document.webform.State.selectedIndex;
	document.webform.indxcountry.value=document.webform.Country.selectedIndex;
//alert("state index: " + document.webform.indxstate.value + "; country index: " + document.webform.indxcountry.value);
}

/****************************************************************/
function LoadExpireData() {
USA="USA";
CANADA="CANADA";

alert("state index: " + document.webform.indxstate.value + "; country index: " + document.webform.indxcountry.value);
	document.webform.State.selectedIndex=document.webform.indxstate.value;
	document.webform.Country.selectedIndex=document.webform.indxcountry.value;
}

/****************************************************************/
function ValidateSugarBowlData() {

//<input type=hidden name="required" value="realname,email,family_income,assist_reason,scn_activities,SCN_member_friend,SCN_member_friend_names,past_sugar_bowl_recipient,past_sugar_bowl_recipient_date">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if ((document.webform.family_income[0].checked == false) && (document.webform.family_income[1].checked == false) && (document.webform.family_income[2].checked == false)) {
                alert("Please indicate your family income.");
                document.webform.family_income[0].focus();
                return false;
        }
	if ((document.webform.SCN_member_friend[0].checked == false) && (document.webform.SCN_member_friend[1].checked == false)) {
                alert("Please indicate whether or not you know any current SCN members.");
                document.webform.SCN_member_friend[0].focus();
                return false;
        }
	else {
        	if ((document.webform.SCN_member_friend[1].checked == true) && (isEmpty(document.webform.SCN_member_friend_names.value))) {
                	alert("Please tell us your SCN member friend's name(s).");
                	document.webform.SCN_member_friend_names.focus();
                	return false;
        	}
		else {
        		if (document.webform.SCN_member_friend[0].checked == true)
				document.webform.SCN_member_friend_names.value="n/a";
        	}
        }
	if ((document.webform.past_sugar_bowl_recipient[0].checked == false) && (document.webform.past_sugar_bowl_recipient[1].checked == false)) {
                alert("Please indicate whether or not you have received a Sugar Bowl membership in the past.");
                document.webform.past_sugar_bowl_recipient[0].focus();
                return false;
        }
	else {
        	if ((document.webform.past_sugar_bowl_recipient[1].checked == true) && (isEmpty(document.webform.past_sugar_bowl_recipient_date.value))) {
                	alert("Please tell us when [what year(s)] you received a Sugar Bowl membership.");
                	document.webform.past_sugar_bowl_recipient_date.focus();
                	return false;
        	}
		else {
        		if (document.webform.past_sugar_bowl_recipient[0].checked == true)
				document.webform.past_sugar_bowl_recipient_date.value="n/a";
        	}
        }
        if (isEmpty(document.webform.assist_reason.value)) {
                alert("Please tell us your reasons for applying for assistance.");
                document.webform.assist_reason.focus();
                return false;
        }
        if (isEmpty(document.webform.scn_activities.value)) {
                alert("Please tell us about your current or planned SCN involvement.");
                document.webform.scn_activities.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function CountBlogPostWords() {

max_word_count_blogpost=document.webform.max_word_count_blogpost.value;

        if (!isEmpty(document.webform.blogpost.value)) {
		wordcount=CountWords4(document.webform.blogpost,document.webform.remLen,document.webform.errorblogpost,max_word_count_blogpost,document.webform.blogposterror);
		document.webform.usedLen.value=wordcount;
		if (wordcount > max_word_count_blogpost) {
			alert("Your blog post must be no more than " + max_word_count_blogpost + " words (it is currently " + wordcount + " words). It has been shortened -- see the 'overflow' text in the box with the yellow background. Review/revise your blog post and resubmit.");
			document.webform.saveblogpost.value=document.webform.blogpost.value;
               		document.webform.blogpost.focus();
               		return false;
       		}
       	}
}

/****************************************************************/
function ValidateBlogPostData() {
//<input type=hidden name="required" value="realname,email,postmonth,postday,posttitle,blogpost,bloggerbio,blogimage,biourl">

max_word_count_blogpost=document.webform.max_word_count_blogpost.value;
max_word_count_bloggerbio=document.webform.max_word_count_bloggerbio.value;

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.postmonth.selectedIndex == 0) {
                alert("Please select the month of your blog post.");
                document.webform.postmonth.focus();
                return false;
        }
	if (document.webform.postday.selectedIndex == 0) {
                alert("Please select the day of your blog post.");
                document.webform.postday.focus();
                return false;
        }
	else {
		whichmonth=document.webform.postmonth.value;
		whichday=document.webform.postday.value;
		switch (whichmonth) {
			case "01":
				monthname="Jan";
				break;
			case "02":
				monthname="Feb";
				break;
			case "03":
				monthname="Mar";
				break;
			case "04":
				monthname="Apr";
				break;
			case "05":
				monthname="May";
				break;
			case "06":
				monthname="Jun";
				break;
			case "07":
				monthname="Jul";
				break;
			case "08":
				monthname="Aug";
				break;
			case "09":
				monthname="Sep";
				break;
			case "10":
				monthname="Oct";
				break;
			case "11":
				monthname="Nov";
				break;
			case "12":
				monthname="Dec";
				break;
		}
		ok=0;
		if (((whichmonth == "04") || (whichmonth == "06") || (whichmonth == "09") || (whichmonth == "11")) && (whichday > 30)) {
               		alert("Invalid day '" + whichday + "' for month '" + monthname + "'. Please select a day between 1 & 30 for your blog post.");
                	document.webform.postday.focus();
                	return false;
        	}
		else if ((whichmonth == "02") && (whichday > 29)) {
               		alert("Invalid day '" + whichday + "' for month '" + monthname + "'. Please select a day between 1 & 29 for your blog post.");
                	document.webform.postday.focus();
                	return false;
        	}
		else {
			ok=1;
        	}
        }
        if (isEmpty(document.webform.posttitle.value)) {
		alert("Please enter your blog post's title.");
                document.webform.posttitle.focus();
                return false;
        }
        if (isEmpty(document.webform.blogpost.value)) {
		alert("Please enter your blog post.");
                document.webform.blogpost.focus();
                return false;
        }
	else {
/*
		wordcount=CountWords(document.webform.blogpost.value,1,1);
		wordcount=CountWords2(max_word_count_blogpost,document.webform.blogpost.value);
*/
		wordcount=CountWords4(document.webform.blogpost,document.webform.remLen,document.webform.errorblogpost,max_word_count_blogpost,document.webform.blogposterror);
		document.webform.usedLen.value=wordcount;
		if (wordcount > max_word_count_blogpost) {
			alert("Your blog post must be no more than " + max_word_count_blogpost + " words (it is currently " + wordcount + " words). It has been shortened -- see the 'overflow' text in the box with the yellow background. Review/revise your blog post and resubmit.");
			document.webform.saveblogpost.value=document.webform.blogpost.value;
                	document.webform.blogpost.focus();
//	        	document.webform.okdone.value=1;
                	return false;
        	}
        }
        if (isEmpty(document.webform.bloggerbio.value)) {
		alert("Please enter your brief bio.");
                document.webform.bloggerbio.focus();
                return false;
        }
	else {
		wordcount=CountWords(document.webform.bloggerbio.value,0,0);
		if (wordcount > max_word_count_bloggerbio) {
			alert("Your brief bio must be no more than " + max_word_count_bloggerbio + " words (it is currently " + wordcount + " words). Please shorten it and re-submit.");
                	document.webform.bloggerbio.focus();
                	return false;
        	}
        }
        if (isEmpty(document.webform.blogimage.value)) {
		alert("Please enter the web address (or 'n/a' or 'email SCN') of the image to run with your blog post.");
                document.webform.blogimage.focus();
                return false;
        }
	else {
		url = document.webform.blogimage.value;
		firstpart = url.substring(0,7);
		first3 = url.substring(0,3);
		first9 = url.substring(0,9);
		first12 = url.substring(0,12);
		if ((firstpart != "http://") & (first3 != "n/a") & (first12 != "email to SCN")) {
//			document.webform.blogimage.value=substr(url,7);
			document.webform.blogimage.value="http://" + url;
		}
        }
        if (isEmpty(document.webform.biourl.value)) {
		alert("Please enter the web address (or 'n/a')  you'd like to link your name to in your blog post.");
                document.webform.biourl.focus();
                return false;
        }
	else {
		url = document.webform.biourl.value;
		firstpart = url.substring(0,7);
		first3 = url.substring(0,3);
		first9 = url.substring(0,9);
		first12 = url.substring(0,12);
		if ((firstpart != "http://") & (first3 != "n/a")) {
//			document.webform.biourl.value=substr(url,7);
			document.webform.biourl.value="http://" + url;
		}
        }
//	alert("Thanks for submitting your blog post!");
}

/****************************************************************/
function ValidateJrnlSubmissionData() {
//<input type=hidden name="sort" value="realname,email,City,State,pseudonym,blog,CircleInfo,publication,poetry_or_prose,PublishEmail,PublishBlog,PublishCircle,submissiontitle,submission,authorbio,image">

max_word_count_truewords_real=350;
max_word_count_truewords=400;
max_word_count_eextra_real=500;
max_word_count_eextra=550;
max_line_count_truewords=30;
max_line_count_eextra=50;
max_word_count_authorbio_real=60;
max_word_count_authorbio=75;

	recipTW=document.webform.recipientTW.value;
	recipEE=document.webform.recipientEE.value;
	subjectTW=document.webform.subjectTW.value;
	subjectEE=document.webform.subjectEE.value;
	subject=document.webform.subjectBase.value;

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if ((isEmpty(document.webform.City.value)) || (document.webform.State.selectedIndex == 0)) {
                alert("Please enter your City and State/Province.");
                if (isEmpty(document.webform.City.value))
                        document.webform.City.focus();
                else if (document.webform.State.selectedIndex == 0)
                        document.webform.State.focus();
                return false;
        }
        if (isEmpty(document.webform.CircleInfo.value)) {
                alert("Please indicate the location (city/state or 'internet chapter' and e-circle number) of the writing or reading circle you belong to (or 'n/a' if you are not in a circle).");
                document.webform.CircleInfo.focus();
                return false;
        }
        if ((document.webform.publication[0].checked == false) & (document.webform.publication[1].checked == false)) {
                alert("Please indicate which publication your submission is for.");
                document.webform.publication[0].focus();
                return false;
        }
        if ((document.webform.poetry_or_prose[0].checked == false) & (document.webform.poetry_or_prose[1].checked == false)) {
                alert("Please indicate if your submission is poetry or prose.");
                document.webform.poetry_or_prose[0].focus();
                return false;
        }
        if (document.webform.poetry_or_prose[0].checked == true) {
        	if (isEmpty(document.webform.poetry_length.value)) {
			alert("Please enter the number of lines in your poem.");
                	document.webform.poetry_length.focus();
                	return false;
        	}
		else {
			poetry_length=document.webform.poetry_length.value;
			if ((document.webform.publication[0].checked == true) & (poetry_length > max_line_count_truewords)) {
				alert("Your 'True Words' poetry submission must be no more than " + max_line_count_truewords + " lines (you said it was " + poetry_length + " lines). Please shorten it and re-submit.");
                		document.webform.poetry_length.focus();
                		return false;
        		}
			else if ((document.webform.publication[1].checked == true) & (poetry_length > max_line_count_eextra)) {
				alert("Your 'E-Extra!' poetry submission must be no more than " + max_line_count_eextra + " lines (you said it was " + poetry_length + " lines). Please shorten it and re-submit.");
                		document.webform.poetry_length.focus();
                		return false;
        		}
        	}
        }
	else
        	document.webform.poetry_length.value="";
        if (isEmpty(document.webform.submissiontitle.value)) {
		alert("Please enter the title of your piece.");
                document.webform.submissiontitle.focus();
                return false;
        }
        if (isEmpty(document.webform.submission.value)) {
		alert("Please enter your writing piece.");
                document.webform.submission.focus();
                return false;
        }
	else {
		wordcount=CountWords(document.webform.submission.value,0,0);
		if ((document.webform.publication[0].checked == true) & (wordcount > max_word_count_truewords)) {
			alert("Your 'True Words' submission must be no more than " + max_word_count_truewords_real + " words (it is currently " + wordcount + " words). Please shorten it and re-submit.");
                	document.webform.submission.focus();
                	return false;
        	}
		else if ((document.webform.publication[1].checked == true) & (wordcount > max_word_count_eextra)) {
			alert("Your 'E-Extra!' submission must be no more than " + max_word_count_eextra_real + " words (it is currently " + wordcount + " words). Please shorten it and re-submit.");
                	document.webform.submission.focus();
                	return false;
        	}
        }
	if (document.webform.publication[1].checked == true) {
		if (isEmpty(document.webform.authorbio.value)) {
			alert("Please enter your brief bio.");
                	document.webform.authorbio.focus();
                	return false;
        	}
		else {
			wordcount=CountWords(document.webform.authorbio.value,0,0);
			if (wordcount > max_word_count_authorbio) {
				alert("Your brief bio must be no more than " + max_word_count_authorbio_real + " words (it is currently " + wordcount + " words). Please shorten it and re-submit.");
                		document.webform.authorbio.focus();
                		return false;
        		}
        	}
        	if (isEmpty(document.webform.image.value)) {
			alert("Please enter the web address (or 'n/a' or 'email SCN') of the image to run with your 'E-Extra!' submission.");
                	document.webform.image.focus();
                	return false;
        	}
		else {
			url = document.webform.image.value;
			firstpart = url.substring(0,7);
			first3 = url.substring(0,3);
			if ((firstpart != "http://") & (first3 != "n/a")) {
//				document.webform.image.value=substr(url,7);
				document.webform.image.value="http://" + url;
			}
        	}
		document.webform.recipient.value=recipEE;
		document.webform.subject.value=subject + " (" + subjectEE + ")";
        }
	else {
                document.webform.authorbio.value="n/a";
		document.webform.image.value="n/a";
		document.webform.recipient.value=recipTW;
		document.webform.subject.value=subject + " (" + subjectTW + ")";
        }
}

/****************************************************************/
function ValidateGiftCardInfo() {
whichprompt=0;

	if (isEmpty(document.webform.name.value)) {
		alert("Please enter your name.");
		document.webform.name.focus();
		return false;
	}
	else
		fromname=document.webform.name.value;
	if (isEmpty(document.webform.giftee.value)) {
		alert("Please enter the name of the person to whom you are giving a gift.");
		document.webform.giftee.focus();
		return false;
	}
	else
		toname=document.webform.giftee.value;
	if ((document.webform.gift1.checked == false) & (document.webform.gift2.checked == false)) {
		alert("Please select the membership(s) you are giving.");
		document.webform.gift1.focus();
		return false;
	}
	else {
		gift1="";
		gift2="";
		if (document.webform.gift1.checked == true)
			gift1=document.webform.gift1.value;
		if (document.webform.gift2.checked == true)
			gift2=document.webform.gift2.value;
	}
	if ((document.webform.occasion[0].checked == false) & (document.webform.occasion[1].checked == false) & (document.webform.occasion[2].checked == false) & (document.webform.occasion[3].checked == false)) {
		alert("Please indicate the occasion for your gift.");
		document.webform.occasion[0].focus();
		return false;
	}
	else {
		if (document.webform.occasion[0].checked == true) {
			document.webform.prompt.value=document.webform.occasion1_prompt.value;
			document.webform.prompt_name.value=document.webform.occasion1_prompt_name.value;
			document.webform.prompt_pdf.value=document.webform.occasion1_prompt_pdf.value;
			occasion=document.webform.occasion[0].value;
			whichprompt=1;
		}
		else if (document.webform.occasion[1].checked == true) {
			document.webform.prompt.value=document.webform.occasion2_prompt.value;
			document.webform.prompt_name.value=document.webform.occasion2_prompt_name.value;
			document.webform.prompt_pdf.value=document.webform.occasion2_prompt_pdf.value;
			occasion=document.webform.occasion[1].value;
			whichprompt=2;
		}
		else if (document.webform.occasion[2].checked == true) {
			document.webform.prompt.value=document.webform.occasion3_prompt.value;
			document.webform.prompt_name.value=document.webform.occasion3_prompt_name.value;
			document.webform.prompt_pdf.value=document.webform.occasion3_prompt_pdf.value;
			occasion=document.webform.occasion[2].value;
			whichprompt=3;
		}
		else if (document.webform.occasion[3].checked == true) {
			document.webform.prompt.value=document.webform.occasion4_prompt.value;
			document.webform.prompt_name.value=document.webform.occasion4_prompt_name.value;
			document.webform.prompt_pdf.value=document.webform.occasion4_prompt_pdf.value;
			occasion=document.webform.occasion[3].value;
			whichprompt=4;
		}
		prompt_name=document.webform.prompt_name.value;
		prompt_pdf=document.webform.prompt_pdf.value;
		pdflink="/generate_giftcard.php?toname=" + toname + "&fromname=" + fromname + "&occasion=" + occasion + "&gift1=" + gift1 + "&gift2=" + gift2 + "&prompt_name=" + prompt_name + "&promptnum=" + whichprompt;
		document.webform.pdflink.value=pdflink;
	}
//	return true;
}

/****************************************************************/
function ValidateICQData() {
//<input type=hidden name="required" value="realname,email">


        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
}

/****************************************************************/
function ValidateSartonJudgeApp() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,num_books_read_monthly,num_memoirs_read_last_year,author,authored_books_articles,blogger,blog_url,writing_contest_judge,writing_contest_description,read_eval_5_books_5_weeks,post_evals_online,read_eval_additional_books,judging_skills">
        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.num_books_read_monthly.value)) {
		alert("Please indicate the number of books you read monthly.");
                document.webform.num_books_read_monthly.focus();
                return false;
        }
        if (isEmpty(document.webform.num_memoirs_read_last_year.value)) {
		alert("Please indicate the number of memoirs you read in the last 12 months.");
                document.webform.num_memoirs_read_last_year.focus();
                return false;
        }
        if ((document.webform.author[0].checked == false) & (document.webform.author[1].checked == false)) {
                alert("Please answer the question, 'Are you an author?'");
                document.webform.author[0].focus();
                return false;
        }
	else if ((document.webform.author[0].checked == true) & (isEmpty(document.webform.authored_books_articles.value))) {
		alert("Please enter the titles of your books/articles.");
                document.webform.authored_books_articles.focus();
                return false;
        }
	else if (document.webform.author[1].checked == true)
                document.webform.authored_books_articles.value="";
        if ((document.webform.blogger[0].checked == false) & (document.webform.blogger[1].checked == false)) {
                alert("Please answer the question, 'Are you a blogger?'");
                document.webform.blogger[0].focus();
                return false;
        }
	else if ((document.webform.blogger[0].checked == true) & (isEmpty(document.webform.blog_url.value))) {
		alert("Please enter the URL of your blog.");
                document.webform.blog_url.focus();
                return false;
        }
	else if (document.webform.blogger[1].checked == true)
                document.webform.blog_url.value="";
        if ((document.webform.writing_contest_judge[0].checked == false) & (document.webform.writing_contest_judge[1].checked == false)) {
                alert("Please answer the question, 'Have you ever been a judge in a writing competition?'");
                document.webform.writing_contest_judge[0].focus();
                return false;
        }
	else if ((document.webform.writing_contest_judge[0].checked == true) & (isEmpty(document.webform.writing_contest_description.value))) {
		alert("Please describe your previous writing competition judging activities.");
                document.webform.writing_contest_description.focus();
                return false;
        }
	else if (document.webform.writing_contest_judge[1].checked == true)
                document.webform.writing_contest_description.value="";
//	if ((document.webform.SCN_activities[0].checked == false) && (document.webform.SCN_activities[1].checked == false) && (document.webform.SCN_activities[2].checked == false) && (document.webform.SCN_activities[3].checked == false) && (document.webform.SCN_activities[4].checked == false) && (document.webform.SCN_activities[5].checked == false) && (document.webform.SCN_activities[6].checked == false) && (document.webform.SCN_activities[7].checked == false) && (document.webform.SCN_activities[8].checked == false) && (document.webform.SCN_activities[9].checked == false) && (document.webform.SCN_activities[10].checked == false) && (document.webform.SCN_activities[11].checked == false) && (document.webform.SCN_activities[12].checked == false)) {
//		alert("Please indicate the SCN acitivities in which you have participated.");
//		document.webform.SCN_activities[0].focus();
//		return false;
//	}
        if ((document.webform.read_eval_5_books_5_weeks[0].checked == false) & (document.webform.read_eval_5_books_5_weeks[1].checked == false)) {
                alert("Please answer the question, 'would you be able to read and evaluate 5 books in 5 weeks?'");
                document.webform.read_eval_5_books_5_weeks[0].focus();
                return false;
        }
        if ((document.webform.post_evals_online[0].checked == false) & (document.webform.post_evals_online[1].checked == false)) {
                alert("Please answer the question, 'would you be able to post your evaluations online, on our website?'");
                document.webform.post_evals_online[0].focus();
                return false;
        }
        if ((document.webform.read_eval_additional_books[0].checked == false) & (document.webform.read_eval_additional_books[1].checked == false)) {
                alert("Please answer the question, 'might you be willing to read and evaluate additional books?'");
                document.webform.read_eval_additional_books[0].focus();
                return false;
        }
        if (isEmpty(document.webform.judging_skills.value)) {
		alert("Please indicate why you feel you would be a good judge and what skills you bring to the process.");
                document.webform.judging_skills.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateSartonPrizeApp() {
//<input type=hidden name="required" value="realname,email,Phone_Number,Country,Street_Address,City,State,Zip_Code,booktitle,bookauthor,isbn,pubdate,publisher,pubaddress,editor,editor_email,payment_method">
NA="n/a";

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.booktitle.value)) {
		alert("Please enter the title of your book.");
                document.webform.booktitle.focus();
                return false;
        }
        if (isEmpty(document.webform.bookauthor.value)) {
		alert("Please enter the author of your book.");
                document.webform.bookauthor.focus();
                return false;
        }
        if (isEmpty(document.webform.isbn.value)) {
		alert("Please enter the book's ISBN.");
                document.webform.isbn.focus();
                return false;
        }
        if (isEmpty(document.webform.pubdate.value)) {
		alert("Please enter the book's publication date.");
                document.webform.pubdate.focus();
                return false;
        }
        if (isEmpty(document.webform.publisher.value)) {
		alert("Please enter the book's publisher.");
                document.webform.publisher.focus();
                return false;
        }
        if (isEmpty(document.webform.pubaddress.value)) {
		alert("Please enter the publisher's address.");
                document.webform.pubaddress.focus();
                return false;
        }
        if (isEmpty(document.webform.editor.value)) {
		alert("Please enter the name of the book's editor.");
                document.webform.editor.focus();
                return false;
        }
        if (isEmpty(document.webform.editor_email.value)) {
		alert("Please enter the editor's email Address.");
                document.webform.editor_email.focus();
                return false;
        }
	else {
		editor_email=document.webform.editor_email.value;
		editor=document.webform.editor.value;
		if (editor == NA) {
			if (editor_email != NA)
				document.webform.editor_email.value=NA;
		}
		else {
			if ((editor_email.indexOf("@") == -1) || (editor_email.indexOf(".") == -1)) {
				alert("Invalid email address: '" + editor_email + "'");
				document.webform.editor_email.focus();
				return false;
			}
		}
        }
        if ((document.webform.payment_method[0].checked == false) & (document.webform.payment_method[1].checked == false)) {
                alert("Please indicate your payment method");
                document.webform.payment_method[0].focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateCommitmentToServe() {
        if (document.webform.myname.selectedIndex == 0) {
		alert("Please select your Name.");
		document.webform.myname.focus();
		return false;
	}
}

/****************************************************************/
function updateCommitmentToServe() {
        myname=document.webform.myname.value;
	memberinfo=myname.split("|");
	realname=memberinfo[0];
	email=memberinfo[1];
	termstart=memberinfo[2];
	termend=memberinfo[3];
	document.webform.realname.value=realname;
	document.webform.email1.value=email;
	document.webform.email.value=email;
	document.webform.termstart1.value=termstart;
	document.webform.termstart.value=termstart;
	document.webform.termend1.value=termend;
	document.webform.termend.value=termend;
}

/****************************************************************/
function ValidateSartonDesignApp() {

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
	if (!ValidateCommonData("your"))
		return false;
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.design_notes.value)) {
                alert("Please enter a note about your design.");
                document.webform.design_notes.focus();
                return false;
        }
	thishii="scn";
	if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
		document.webform.hii.focus();
		return false;
	}
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
			document.webform.hii.focus();
			return false;
		}
	}
	document.webform.hiianswer.value=thishii;
}

/****************************************************************/
function ValidateSartonPrizeEval() {
//<input type=hidden name="db_fields" value="booktitle,Characters,Story,StoryImpact,NarrativeVoice,Place,LanguageStyle,LanguageStructure,Presentation,BonusPoints,ExceptionalInfo,RoundTwo">
coordinator="coordinator";
juror="juror_round1";

	if (document.webform.jurorname.selectedIndex == 0) {
                alert("Please select your Name.");
                document.webform.jurorname.focus();
                return false;
        }
	else {
		jurorinfo=document.webform.jurorname.value.split("|");
		realname=jurorinfo[0];
		email=jurorinfo[1];
		role=jurorinfo[2];
		document.webform.realname.value=realname;
		document.webform.email.value=email;
		document.webform.role.value=role;
        }
/*
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
*/
        if (isEmpty(document.webform.booktitle.value)) {
                alert("Please enter the title of the book.");
                document.webform.booktitle.focus();
                return false;
        }
	if (role != coordinator) {
		if (document.webform.Characters.selectedIndex == 0) {
			alert("Please assign a number of points for 'Character.'");
                	document.webform.Characters.focus();
                	return false;
        	}
		if (document.webform.Story.selectedIndex == 0) {
			alert("Please assign a number of points for 'Story.'");
                	document.webform.Story.focus();
                	return false;
        	}
		if (document.webform.StoryImpact.selectedIndex == 0) {
			alert("Please assign a number of points for 'Memoirist's Relationship to Her Story.'");
                	document.webform.StoryImpact.focus();
                	return false;
        	}
		if (document.webform.NarrativeVoice.selectedIndex == 0) {
			alert("Please assign a number of points for 'Narrative Voice.'");
                	document.webform.NarrativeVoice.focus();
                	return false;
        	}
		if (document.webform.Place.selectedIndex == 0) {
			alert("Please assign a number of points for 'Place.'");
                	document.webform.Place.focus();
                	return false;
        	}
		if (document.webform.LanguageStyle.selectedIndex == 0) {
			alert("Please assign a number of points for 'Language Style.'");
                	document.webform.LanguageStyle.focus();
                	return false;
        	}
		if (document.webform.LanguageStructure.selectedIndex == 0) {
			alert("Please assign a number of points for 'Language Structure.'");
                	document.webform.LanguageStructure.focus();
                	return false;
        	}
		if (document.webform.Presentation.selectedIndex == 0) {
			alert("Please assign a number of points for 'Presentation.'");
                	document.webform.Presentation.focus();
                	return false;
        	}
        	if ((document.webform.RoundTwo[0].checked == false) & (document.webform.RoundTwo[1].checked == false)) {
                	alert("Please indicate if this book should be considered for the final round of judging");
                	document.webform.RoundTwo[0].focus();
                	return false;
        	}
	}
	else {
        	if ((document.webform.RoundOne[0].checked == false) & (document.webform.RoundOne[1].checked == false)) {
                	alert("Coordinator: please indicate if this book should be considered for the first round of judging");
                	document.webform.RoundOne[0].focus();
                	return false;
        	}
		else {
        		if ((document.webform.RoundOne[1].checked == true) && (document.webform.unsuitable_book[0].checked == false) && (document.webform.unsuitable_book[1].checked == false) && (document.webform.unsuitable_book[2].checked == false) && (document.webform.unsuitable_book[3].checked == false)) {
                		alert("Coordinator: please indicate why this book should not be considered for the first round of judging");
                		document.webform.unsuitable_book[0].focus();
                		return false;
        		}
        	}
	}
}

/****************************************************************/
function ValidateAffiliatedWkshopData() {
//<input type=hidden name="required" value="realname,email,past_affiliate,wkshop_desc,wkshop_url">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if ((document.webform.past_affiliate[0].checked == false) && (document.webform.past_affiliate[1].checked == false)) {
                alert("Please indicate whether or not you have affiliated your workshops with SCN in the past.");
                document.webform.past_affiliate[0].focus();
                return false;
        }
	else {
        	if ((document.webform.past_affiliate[1].checked == true) && (isEmpty(document.webform.past_affiliate_date.value))) {
                	alert("Please tell us when [what year(s)] you affiliated your workshops with SCN.");
                	document.webform.past_affiliate_date.focus();
                	return false;
        	}
		else {
        		if (document.webform.past_affiliate[0].checked == true)
				document.webform.past_affiliate_date.value="n/a";
        	}
        }
        if (isEmpty(document.webform.wkshop_desc.value)) {
		alert("Please enter your workshop description.");
                document.webform.wkshop_desc.focus();
                return false;
        }
        if (isEmpty(document.webform.wkshop_url.value)) {
		alert("Please enter your workshop url.");
                document.webform.wkshop_url.focus();
                return false;
        }
}

/****************************************************************/
function ValidateSorrowData() {
//<input type=hidden name="required" value="realname,email,storytitle,comments">

max_word_count_sorrow=document.webform.max_word_count_sorrow.value;

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.storytitle.value)) {
                alert("Please enter the title of your story.");
                document.webform.storytitle.focus();
                return false;
        }
        if (isEmpty(document.webform.comments.value)) {
                alert("Please enter your story.");
                document.webform.comments.focus();
                return false;
        }
	else {
		wordcount=CountWords4(document.webform.comments,document.webform.remLen,document.webform.errorsorrow,max_word_count_sorrow,document.webform.sorrowerror);
		document.webform.usedLen.value=wordcount;
		if (wordcount > max_word_count_sorrow) {
			alert("Your submission must be no more than " + max_word_count_sorrow + " words (it is currently " + wordcount + " words). It has been shortened -- see the 'overflow' text in the box with the yellow background. Review/revise your submission and resubmit.");
			document.webform.savecomments.value=document.webform.comments.value;
                	document.webform.comments.focus();
//	        	document.webform.okdone.value=1;
                	return false;
        	}
        }
}

function sorrowcount () {
max_word_count_sorrow=document.webform.max_word_count_sorrow.value;

	wordcount=JustCountWords(document.webform.comments,document.webform.remLen,document.webform.errorsorrow,max_word_count_sorrow,document.webform.sorrowerror);
//alert("wordcount: " + wordcount);
	document.webform.usedLen.value=wordcount;
}

/****************************************************************/
function ValidateTWOrderData() {

	orderinfo="";
	price=0;
	if (document.webform.numcopies.value == "")
		document.webform.numcopies.value=0;
	numcopies=parseFloat(document.webform.numcopies.value);
/*
	if (isEmpty(document.webform.numcopies.value) || (numcopies == 0)) {
*/
       	if (numcopies == 0) {
               	alert("Please enter the number of copies you wish to purchase.");
              		document.webform.numcopies.focus();
              		return false;
      		}
     		else if (!isNum(document.webform.numcopies.value)) {
			alert("You entered an invalid number of copies (" + document.webform.numcopies.value + "). Please enter a number.");
			document.webform.numcopies.focus();
			return false;
       	}
	UpdateTWOrderData();
}

/****************************************************************/
function UpdateTWOrderData() {

	orderinfo="";
	price=0;
	if (document.webform.numcopies.value == "")
		numcopies=0;
	else
		numcopies=parseFloat(document.webform.numcopies.value);
	numjournals=numcopies;
	orderinfo=orderinfo + "V15TwAnth ";
	ship_charge=0.00;
	subtotal=0.00;
	journalprice=0.00;
	amtdue=0.00;
	journal_1_9=parseFloat(document.webform.journal_1_9.value);
	journal_10=parseFloat(document.webform.journal_10.value);
	journal_1sh=parseFloat(document.webform.journal_1sh.value);
	journal_2_5sh=parseFloat(document.webform.journal_2_5sh.value);
	journal_6sh=parseFloat(document.webform.journal_6sh.value);
	if (numjournals > 9)
		journalprice=journal_10;
	else
		journalprice=journal_1_9;
	subtotal=numjournals*journalprice;
	if (numjournals > 5)
		ship_charge=journal_6sh;
	else if (numjournals > 1)
		ship_charge=journal_2_5sh;
	else
		ship_charge=journal_1sh;
	amtdue=subtotal+ship_charge;
	document.webform.subtotal.value=sprintf("%01.2f", subtotal);
	document.webform.numjournals.value=numjournals;
	document.webform.journalprice.value=sprintf("%01.2f", journalprice);
	this_ship_charge=sprintf("%01.2f", ship_charge);
	document.webform.ship_charge.value=this_ship_charge;
	document.webform.amtdue.value=sprintf("%01.2f", amtdue);
	document.webform.Qty.value=numjournals;
	orderinfolen=orderinfo.length;
	if (orderinfo.substring(orderinfolen-2,2) == ", ");
		orderinfo=orderinfo.substring(0,orderinfolen-2);
	document.webform.AddOn1.value=orderinfo;
	document.webform.Ship.value=this_ship_charge;
	document.webform.Price.value=price;

}

/****************************************************************/
function ValidateExpMemQData() {

//<input type=hidden name="required" value="realname,email,Phone_Number,City,State,interests,nonrenew_reason_time,nonrenew_reason_needs,nonrenew_reason_cost">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if (document.webform.admin.value == "") {
			if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
				alert("Invalid email address: '" + email + "'");
				document.webform.email.focus();
				return false;
			}
		}
		else {
			isnone = email.substring(0,4);
			if (isnone = "none") {
				document.webform.email.value=document.webform.admin_email.value;
			}
		}
        }
        if (isEmpty(document.webform.Phone_Number.value)) {
                alert("Please enter your Phone Number.");
                document.webform.Phone_Number.focus();
                return false;
        }
        if ((isEmpty(document.webform.City.value)) || (document.webform.State.selectedIndex == 0)) {
                alert("Please enter your City and State/Province.");
                if (isEmpty(document.webform.City.value))
                        document.webform.City.focus();
                else if (document.webform.State.selectedIndex == 0)
                        document.webform.State.focus();
                return false;
        }
//<input type=hidden name="required" value="realname,email,Phone_Number,City,State,interests,nonrenew_reason_time,nonrenew_reason_needs,nonrenew_reason_cost">
	if ((document.webform.interests[0].checked == false) && (document.webform.interests[1].checked == false) && (document.webform.interests[2].checked == false) && (document.webform.interests[3].checked == false) && (document.webform.interests[4].checked == false) && (document.webform.interests[5].checked == false) && (document.webform.interests[6].checked == false) && (document.webform.interests[7].checked == false) && (document.webform.interests[8].checked == false) && (document.webform.interests[9].checked == false)) {
                alert("Please indicate the activities in which you participated.");
                document.webform.interests[0].focus();
                return false;
        }
	if ((document.webform.nonrenew_reason_time[0].checked == false) && (document.webform.nonrenew_reason_time[1].checked == false) && (document.webform.nonrenew_reason_time[2].checked == false) && (document.webform.nonrenew_reason_time[3].checked == false) && (document.webform.nonrenew_reason_time[4].checked == false)) {
                alert("Please indicate your reasons for not renewing.");
                document.webform.nonrenew_reason_time[0].focus();
                return false;
        }
	if ((document.webform.nonrenew_reason_needs[0].checked == false) && (document.webform.nonrenew_reason_needs[1].checked == false) && (document.webform.nonrenew_reason_needs[2].checked == false) && (document.webform.nonrenew_reason_needs[3].checked == false) && (document.webform.nonrenew_reason_needs[4].checked == false)) {
                alert("Please indicate your reasons for not renewing.");
                document.webform.nonrenew_reason_needs[0].focus();
                return false;
        }
	if ((document.webform.nonrenew_reason_cost[0].checked == false) && (document.webform.nonrenew_reason_cost[1].checked == false) && (document.webform.nonrenew_reason_cost[2].checked == false) && (document.webform.nonrenew_reason_cost[3].checked == false) && (document.webform.nonrenew_reason_cost[4].checked == false)) {
                alert("Please indicate your reasons for not renewing.");
                document.webform.nonrenew_reason_cost[0].focus();
                return false;
        }
}

/****************************************************************/
function ValidateConfEvalData1() {
//<input type=hidden name="required" value="realname,email">

	if (document.webform.yourname.selectedIndex == 0) {
                alert("Please select your Name.");
                document.webform.yourname.focus();
                return false;
        }
	else {
		yourinfo=document.webform.yourname.value.split("|");
		realname=yourinfo[0];
		email=yourinfo[1];
		document.webform.realname.value=realname;
		document.webform.realname_old.value=realname;
		document.webform.email.value=email;
		document.webform.email_old.value=email;
        }
//alert("here i am; yourname: " + document.webform.yourname.selectedIndex + "; realname: " + realname + "; email: " + email);
}

/****************************************************************/
function ValidateConfEvalData() {
//<input type=hidden name="required" value="realname,email,conf_website,advance_info,registration,hotel_reservation,meeting_rooms,food,coaching,preconfMBKB,preconfJG,keynote,sat_lunch_pgm,sun_lunch_pgm,workshops,special_interest_tables,open_mic,vendors,auction_merchandise,auction_process,overall_satisfaction">

	if (document.webform.conf_website.selectedIndex == 0) {
		alert("Please rate 'Conference website'");
               	document.webform.conf_website.focus();
               	return false;
       	}
        else if (((document.webform.conf_website.selectedIndex == 1) || (document.webform.conf_website.selectedIndex == 2)) && isEmpty(document.webform.comment_conf_website.value)) {
               	alert("Please describe the reason for your '" + document.webform.conf_website.value + "' rating of 'Conference website'");
               	document.webform.comment_conf_website.focus();
               	return false;
        }
	if (document.webform.advance_info.selectedIndex == 0) {
		alert("Please rate 'Advance information'");
               	document.webform.advance_info.focus();
               	return false;
       	}
        else if (((document.webform.advance_info.selectedIndex == 1) || (document.webform.advance_info.selectedIndex == 2))  && isEmpty(document.webform.comment_advance_info.value)) {
               	alert("Please describe the reason for your '" + document.webform.advance_info.value + "' rating of 'Advance information'");
               	document.webform.comment_advance_info.focus();
               	return false;
        }
	if (document.webform.registration.selectedIndex == 0) {
		alert("Please rate 'On-site conference registration/check-in'");
               	document.webform.registration.focus();
               	return false;
       	}
        else if (((document.webform.registration.selectedIndex == 1) || (document.webform.registration.selectedIndex == 2)) && isEmpty(document.webform.comment_registration.value)) {
		alert("Please describe the reason for your '" + document.webform.registration.value + "' rating of 'On-site conference registration/check-in'");
		document.webform.comment_registration.focus();
		return false;
        }
	if (document.webform.hotel_reservation.selectedIndex == 0) {
		alert("Please rate 'Hotel reservation process'");
               	document.webform.hotel_reservation.focus();
               	return false;
       	}
        else if (((document.webform.hotel_reservation.selectedIndex == 1) || (document.webform.hotel_reservation.selectedIndex == 2)) && isEmpty(document.webform.comment_hotel_reservation.value)) {
               	alert("Please describe the reason for your '" + document.webform.hotel_reservation.value + "' rating of 'Hotel reservation process'");
               	document.webform.comment_hotel_reservation.focus();
               	return false;
        }
	if (document.webform.meeting_rooms.selectedIndex == 0) {
		alert("Please rate 'Meeting rooms'");
               	document.webform.meeting_rooms.focus();
               	return false;
       	}
        else if (((document.webform.meeting_rooms.selectedIndex == 1) || (document.webform.meeting_rooms.selectedIndex == 2)) && isEmpty(document.webform.comment_meeting_rooms.value)) {
               	alert("Please describe the reason for your '" + document.webform.meeting_rooms.value + "' rating of 'Meeting rooms'");
               	document.webform.comment_meeting_rooms.focus();
               	return false;
        }
	if (document.webform.food.selectedIndex == 0) {
		alert("Please rate 'Meals, snacks, restaurant'");
               	document.webform.food.focus();
               	return false;
       	}
        else if (((document.webform.food.selectedIndex == 1) || (document.webform.food.selectedIndex == 2)) && isEmpty(document.webform.comment_food.value)) {
               	alert("Please describe the reason for your '" + document.webform.food.value + "' rating of 'Meals, snacks, restaurant'");
               	document.webform.comment_food.focus();
               	return false;
        }
	if (document.webform.coaching.selectedIndex == 0) {
		alert("Please rate 'Heart-to-Heart Coaching'");
               	document.webform.coaching.focus();
               	return false;
       	}
        else if (((document.webform.coaching.selectedIndex == 1) || (document.webform.coaching.selectedIndex == 2)) && isEmpty(document.webform.comment_coaching.value)) {
               	alert("Please describe the reason for your '" + document.webform.coaching.value + "' rating of 'Heart-to-Heart Coaching'");
               	document.webform.comment_coaching.focus();
               	return false;
        }
	if (document.webform.preconfMBKB.selectedIndex == 0) {
		alert("Please rate 'Matilda Butler/Kendra Bonnett Friday Pre-Conference Workshop'");
               	document.webform.preconfMBKB.focus();
               	return false;
       	}
        else if (((document.webform.preconfMBKB.selectedIndex == 1) || (document.webform.preconfMBKB.selectedIndex == 2)) && isEmpty(document.webform.comment_preconfMBKB.value)) {
               	alert("Please describe the reason for your '" + document.webform.preconfMBKB.value + "' rating of 'Matilda Butler/Kendra Bonnett Friday Pre-Conference Workshop'");
               	document.webform.comment_preconfMBKB.focus();
               	return false;
        }
	if (document.webform.preconfJG.selectedIndex == 0) {
		alert("Please rate 'Jeanne Guy Friday Pre-Conference Workshop'");
               	document.webform.preconfJG.focus();
               	return false;
       	}
        else if (((document.webform.preconfJG.selectedIndex == 1) || (document.webform.preconfJG.selectedIndex == 2)) && isEmpty(document.webform.comment_preconfJG.value)) {
               	alert("Please describe the reason for your '" + document.webform.preconfJG.value + "' rating of 'Jeanne Guy Friday Pre-Conference Workshop'");
               	document.webform.comment_preconfJG.focus();
               	return false;
        }
	if (document.webform.keynote.selectedIndex == 0) {
		alert("Please rate 'Friday night keynote'");
               	document.webform.keynote.focus();
               	return false;
       	}
        else if (((document.webform.keynote.selectedIndex == 1) || (document.webform.keynote.selectedIndex == 2)) && isEmpty(document.webform.comment_keynote.value)) {
               	alert("Please describe the reason for your '" + document.webform.keynote.value + "' rating of 'Friday night keynote'");
               	document.webform.comment_keynote.focus();
               	return false;
        }
	if (document.webform.sat_lunch_pgm.selectedIndex == 0) {
		alert("Please rate 'Saturday lunch program'");
               	document.webform.sat_lunch_pgm.focus();
               	return false;
       	}
        else if (((document.webform.sat_lunch_pgm.selectedIndex == 1) || (document.webform.sat_lunch_pgm.selectedIndex == 2)) && isEmpty(document.webform.comment_sat_lunch_pgm.value)) {
               	alert("Please describe the reason for your '" + document.webform.sat_lunch_pgm.value + "' rating of 'Saturday lunch program'");
               	document.webform.comment_sat_lunch_pgm.focus();
               	return false;
        }
	if (document.webform.sun_lunch_pgm.selectedIndex == 0) {
		alert("Please rate 'Sunday lunch program'");
               	document.webform.sun_lunch_pgm.focus();
               	return false;
       	}
        else if (((document.webform.sun_lunch_pgm.selectedIndex == 1) || (document.webform.sun_lunch_pgm.selectedIndex == 2)) && isEmpty(document.webform.comment_sun_lunch_pgm.value)) {
               	alert("Please describe the reason for your '" + document.webform.sun_lunch_pgm.value + "' rating of 'Sunday lunch program'");
               	document.webform.comment_sun_lunch_pgm.focus();
               	return false;
        }
	if (document.webform.workshops.selectedIndex == 0) {
		alert("Please rate 'Workshops: variety, quality'");
               	document.webform.workshops.focus();
               	return false;
       	}
        else if (((document.webform.workshops.selectedIndex == 1) || (document.webform.workshops.selectedIndex == 2)) && isEmpty(document.webform.comment_workshops.value)) {
               	alert("Please describe the reason for your '" + document.webform.workshops.value + "' rating of 'Workshops: variety, quality'");
               	document.webform.comment_workshops.focus();
               	return false;
        }
	if (document.webform.special_interest_tables.selectedIndex == 0) {
		alert("Please rate 'Special Interest Tables'");
               	document.webform.special_interest_tables.focus();
               	return false;
       	}
        else if (((document.webform.special_interest_tables.selectedIndex == 1) || (document.webform.special_interest_tables.selectedIndex == 2)) && isEmpty(document.webform.comment_special_interest_tables.value)) {
               	alert("Please describe the reason for your '" + document.webform.special_interest_tables.value + "' rating of 'Special Interest Tables'");
               	document.webform.comment_special_interest_tables.focus();
               	return false;
        }
        if ((document.webform.special_interest_tables.selectedIndex != 6) && isEmpty(document.webform.which_special_interest_table.value)) {
               	alert("Please indicate which special interest table(s) you joined.");
               	document.webform.which_special_interest_table.focus();
               	return false;
        }
	if (document.webform.open_mic.selectedIndex == 0) {
		alert("Please rate 'Open Mic'");
               	document.webform.open_mic.focus();
               	return false;
       	}
        else if (((document.webform.open_mic.selectedIndex == 1) || (document.webform.open_mic.selectedIndex == 2)) && isEmpty(document.webform.comment_open_mic.value)) {
               	alert("Please describe the reason for your '" + document.webform.open_mic.value + "' rating of 'Open Mic'");
               	document.webform.comment_open_mic.focus();
               	return false;
        }
	if (document.webform.vendors.selectedIndex == 0) {
		alert("Please rate 'Vendors: quality, variety, price of merchandise'");
               	document.webform.vendors.focus();
               	return false;
       	}
        else if (((document.webform.vendors.selectedIndex == 1) || (document.webform.vendors.selectedIndex == 2)) && isEmpty(document.webform.comment_vendors.value)) {
               	alert("Please describe the reason for your '" + document.webform.vendors.value + "' rating of 'Vendors: quality, variety, price of merchandise'");
               	document.webform.comment_vendors.focus();
               	return false;
        }
	if (document.webform.auction_merchandise.selectedIndex == 0) {
		alert("Please rate 'Silent Auction: quality, variety of merchandise'");
               	document.webform.auction_merchandise.focus();
               	return false;
       	}
        else if (((document.webform.auction_merchandise.selectedIndex == 1) || (document.webform.auction_merchandise.selectedIndex == 2)) && isEmpty(document.webform.comment_auction_merchandise.value)) {
               	alert("Please describe the reason for your '" + document.webform.auction_merchandise.value + "' rating of 'Silent Auction: quality, variety of merchandise'");
               	document.webform.comment_auction_merchandise.focus();
               	return false;
        }
	if (document.webform.auction_process.selectedIndex == 0) {
		alert("Please rate 'Silent Auction: process'");
               	document.webform.auction_process.focus();
               	return false;
       	}
        else if (((document.webform.auction_process.selectedIndex == 1) || (document.webform.auction_process.selectedIndex == 2)) && isEmpty(document.webform.comment_auction_process.value)) {
               	alert("Please describe the reason for your '" + document.webform.auction_process.value + "' rating of 'Silent Auction: process'");
               	document.webform.comment_auction_process.focus();
               	return false;
        }
	if (document.webform.overall_satisfaction.selectedIndex == 0) {
		alert("Please rate 'Your overall level of satisfaction with the conference'");
               	document.webform.overall_satisfaction.focus();
               	return false;
       	}
        else if (((document.webform.overall_satisfaction.selectedIndex == 1) || (document.webform.overall_satisfaction.selectedIndex == 2)) && isEmpty(document.webform.comment_overall_satisfaction.value)) {
               	alert("Please describe the reason for your '" + document.webform.overall_satisfaction.value + "' rating of 'Your overall level of satisfaction with the conference'");
               	document.webform.comment_overall_satisfaction.focus();
               	return false;
        }
        if (isEmpty(document.webform.favorite_workshop.value)) {
                alert("Please answer this question: 'What was your favorite workshop and why?'");
                document.webform.favorite_workshop.focus();
                return false;
        }
        if (isEmpty(document.webform.favorite_presenter.value)) {
                alert("Please answer this question: 'Who was your favorite presenter and why?'");
                document.webform.favorite_presenter.focus();
                return false;
        }
        if (isEmpty(document.webform.what_to_do_different.value)) {
                alert("Please answer this question: 'What should we definitely do differently the next time?'");
                document.webform.what_to_do_different.focus();
                return false;
        }
        if (isEmpty(document.webform.what_to_not_change.value)) {
                alert("Please answer this question: 'What should we absolutely not change?'");
                document.webform.what_to_not_change.focus();
                return false;
        }
        if (isEmpty(document.webform.remember_most.value)) {
                alert("Please answer this question: 'What two or three things will you remember most about the conference?'");
                document.webform.remember_most.focus();
                return false;
        }
}

/****************************************************************/
function ValidateStarBloggerData() {

//<input type=hidden name="required" value="realname,email,blogger">

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
	if (document.webform.blogger.selectedIndex == 0) {
                alert("Please select your favorite Star Blogger.");
                document.webform.blogger.focus();
                return false;
        }
}

/****************************************************************/
function ValidateStarBloggerScreenData() {
//<input type=hidden name="required" value="realname,email,blogname">

	numrequired=document.webform.numrequired.value;

	if (document.webform.boardmember.selectedIndex == 0) {
                alert("Please select your name.");
                document.webform.boardmember.focus();
                return false;
        }
	else {
		yourinfo=document.webform.boardmember.value.split("|");
		realname=yourinfo[0];
		email=yourinfo[1];
		document.webform.realname.value=realname;
		document.webform.email.value=email;
        }
	bloggernames=document.webform['blogger[]'];
	numchosen=countChecked(bloggernames);
	if (numchosen != numrequired) {
               	alert("You selected " + numchosen + " bloggers. Please select your " + numrequired + " favorite Star Bloggers.");
//		document.webform['blogger[0]'].focus();
//		bloggernames[0].focus();
               	return false;
       	}
}

/****************************************************************/
function ValidateCheckPwd() {

        if (isEmpty(document.webform.firstname.value)) {
                alert("Please enter your First Name.");
                document.webform.firstname.focus();
                return false;
        }
        if (isEmpty(document.webform.lastname.value)) {
                alert("Please enter your Last Name.");
                document.webform.lastname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
}

/****************************************************************/
function TotalAdAmt() {
	document.webform.ad_msg_br.value="";
	document.webform.ad_msg_eltr.value="";
	document.webform.ad_msg_combo.value="";
	document.webform.ad_msg_jrnl.value="";
	document.webform.ad_msg_anth.value="";
	document.webform.ad_msg_cp.value="";
	document.webform.ad_msg2_br.value="";
	document.webform.ad_msg2_eltr.value="";
	document.webform.ad_msg2_combo.value="";
	document.webform.ad_msg2_jrnl.value="";
	document.webform.ad_msg2_anth.value="";
	document.webform.ad_msg2_cp.value="";

	intro_period=document.webform.intro_period.value;
	intro_discount=parseFloat(document.webform.intro_discount.value);
	intro_discount=intro_discount/100;
	ad_br_months=parseFloat(document.webform.ad_br_months.value);
	ad_eltr_issues=parseFloat(document.webform.ad_eltr_issues.value);
	ad_jrnl_issues=parseFloat(document.webform.ad_jrnl_issues.value);

	ad_rate_br=parseFloat(document.webform.ad_rate_BR.value);
	ad_rate_br5=parseFloat(document.webform.ad_rate_BR5.value);
	ad_rate_eltr=parseFloat(document.webform.ad_rate_ELTR.value);
	ad_rate_eltr5=parseFloat(document.webform.ad_rate_ELTR5.value);
	ad_rate_combo=parseFloat(document.webform.ad_rate_COMBO.value);
	ad_rate_combo5=parseFloat(document.webform.ad_rate_COMBO5.value);
	ad_rate_jrnl18=parseFloat(document.webform.ad_rate_JRNL_18.value);
	ad_rate_jrnl14=parseFloat(document.webform.ad_rate_JRNL_14.value);
	ad_rate_jrnl12=parseFloat(document.webform.ad_rate_JRNL_12.value);
	ad_rate_jrnl1=parseFloat(document.webform.ad_rate_JRNL_1.value);
	ad_rate_cp18=parseFloat(document.webform.ad_rate_CP_18.value);
	ad_rate_cp14=parseFloat(document.webform.ad_rate_CP_14.value);
	ad_rate_cp12=parseFloat(document.webform.ad_rate_CP_12.value);
	ad_rate_cp1=parseFloat(document.webform.ad_rate_CP_1.value);
	ad_rate_cpcover=parseFloat(document.webform.ad_rate_CP_cover.value);

	multi_issue_jrnl2=parseFloat(document.webform.multi_issue_jrnl2.value);
	multi_issue_jrnl3=parseFloat(document.webform.multi_issue_jrnl3.value);
	multi_issue_jrnl4=parseFloat(document.webform.multi_issue_jrnl4.value);

	member_discount=parseFloat(document.webform.member_discount.value);
	memberornot="non-member ";
	member_discount=member_discount/100;
	if (document.webform.SCN_member[0].checked == true) {
		memberornot="member ";
	}
	else {
		member_discount=0;
	}
	which_rate="";
	ad_amt_combo=0;
	ad_amt_br=0;
	ad_amt_eltr=0;
	ad_amt_jrnl=0;
	net_ad_amt_jrnl=0;
	ad_amt_anth=0;
	ad_amt_cp=0;
/*****
SC-BR or e-letters
*****/
	if ((document.webform.ad_location[0].checked == true) && (document.webform.ad_location[1].checked == true)) {
		this_ad_rate=ad_rate_combo;
		this_ad_rate5=ad_rate_combo5;
		if ((ad_br_months > 4) || (ad_eltr_issues > 4)) {
			this_ad_rate=this_ad_rate5;
			which_rate="reduced ";
		}
		if (ad_br_months > ad_eltr_issues)
			ad_months=ad_br_months;
		else
			ad_months=ad_eltr_issues;
		ad_amt_combo=this_ad_rate*ad_months;
		ad_msg="$" + this_ad_rate + " * " + ad_months + " months (" + which_rate + "rate) = $" + ad_amt_combo;
		document.webform.ad_msg_br.value="";
		document.webform.ad_msg2_br.value="(see Combo Details)";
		document.webform.ad_msg_eltr.value="";
		document.webform.ad_msg2_eltr.value="(see Combo Details)";
		document.webform.ad_msg_combo.value=ad_msg;
		document.webform.ad_msg2_combo.value=ad_msg;
	}
	else if ((ad_br_months > 0) || (ad_eltr_issues > 0)) {
		if (ad_br_months > 0) {
			this_ad_rate=ad_rate_br;
			this_ad_rate5=ad_rate_br5;
			ad_months=ad_br_months;
			if (ad_months > 4) {
				this_ad_rate=this_ad_rate5;
				which_rate="reduced ";
			}
			ad_amt_br=this_ad_rate*ad_months;
			ad_msg="$" + this_ad_rate + " * " + ad_months + " months (" + which_rate + "rate) = $" + ad_amt_br;
			document.webform.ad_msg_br.value=ad_msg;
			document.webform.ad_msg2_br.value=ad_msg;
		}
		else if (ad_eltr_issues > 0) {
			this_ad_rate=ad_rate_eltr;
			this_ad_rate5=ad_rate_eltr5;
			ad_months=ad_eltr_issues;
			if (ad_months > 4) {
				this_ad_rate=this_ad_rate5;
				which_rate="reduced ";
			}
			ad_amt_eltr=this_ad_rate*ad_months;
			ad_msg="$" + this_ad_rate + " * " + ad_months + " months (" + which_rate + "rate) = $" + ad_amt_eltr;
			document.webform.ad_msg_eltr.value=ad_msg;
			document.webform.ad_msg2_eltr.value=ad_msg;
		}

	}
/*****
Journal
*****/
	if (document.webform.ad_location[2].checked == true) {
		this_ad_rate18=ad_rate_jrnl18;
		this_ad_rate14=ad_rate_jrnl14;
		this_ad_rate12=ad_rate_jrnl12;
		this_ad_rate1=ad_rate_jrnl1;
		if (document.webform.ad_size_jrnl[0].checked == true) {
			this_ad_rate=this_ad_rate18;
		}
		else if (document.webform.ad_size_jrnl[1].checked == true) {
			this_ad_rate=this_ad_rate14;
		}
		else if (document.webform.ad_size_jrnl[2].checked == true) {
			this_ad_rate=this_ad_rate12;
		}
		else {
			this_ad_rate=this_ad_rate1;
		}
		ad_amt_jrnl=this_ad_rate*ad_jrnl_issues;

		ad_amt_jrnl_discount_percent=0;
		ad_msg2="";
		if (ad_jrnl_issues >= 4)
			ad_amt_jrnl_discount_percent=multi_issue_jrnl4;
		else if (ad_jrnl_issues >= 3)
			ad_amt_jrnl_discount_percent=multi_issue_jrnl3;
		else if (ad_jrnl_issues >= 2)
			ad_amt_jrnl_discount_percent=multi_issue_jrnl2;

		ad_amt_jrnl_discount=ad_amt_jrnl*(ad_amt_jrnl_discount_percent/100);
		ad_amt_jrnl_discount2=ad_amt_jrnl_discount.toFixed(2);
		net_ad_amt_jrnl=ad_amt_jrnl-ad_amt_jrnl_discount;
		net_ad_amt_jrnl2=net_ad_amt_jrnl.toFixed(2);
		if (ad_jrnl_issues > 1)
			ad_msg2=" - " + ad_amt_jrnl_discount_percent + "% multi-issue discount [$" + ad_amt_jrnl_discount2 + "] = $" + net_ad_amt_jrnl2;

		ad_msg="$" + this_ad_rate + " * " + ad_jrnl_issues + " issues = $" + ad_amt_jrnl + ad_msg2;
		document.webform.ad_msg_jrnl.value=ad_msg;
		document.webform.ad_msg2_jrnl.value=ad_msg;
	}
/*****
Anthology
*****/
	if (document.webform.ad_location[3].checked == true) {
		this_ad_rate18=ad_rate_jrnl18;
		this_ad_rate14=ad_rate_jrnl14;
		this_ad_rate12=ad_rate_jrnl12;
		this_ad_rate1=ad_rate_jrnl1;
		if (document.webform.ad_size_anth[0].checked == true) {
			this_ad_rate=this_ad_rate18;
		}
		else if (document.webform.ad_size_anth[1].checked == true) {
			this_ad_rate=this_ad_rate14;
		}
		else if (document.webform.ad_size_anth[2].checked == true) {
			this_ad_rate=this_ad_rate12;
		}
		else {
			this_ad_rate=this_ad_rate1;
		}
		ad_amt_anth=this_ad_rate;
		ad_msg="$" + this_ad_rate + " * 1 issue = $" + ad_amt_anth;
		document.webform.ad_msg_anth.value=ad_msg;
		document.webform.ad_msg2_anth.value=ad_msg;
	}
/*****
conf. pgm
*****/
	if (document.webform.ad_location[4].checked == true) {
		this_ad_rate18=ad_rate_cp18;
		this_ad_rate14=ad_rate_cp14;
		this_ad_rate12=ad_rate_cp12;
		this_ad_rate1=ad_rate_cp1;
		this_ad_ratecover=ad_rate_cpcover;
		if (document.webform.ad_size_cp[0].checked == true) {
			this_ad_rate=this_ad_rate18;
		}
		else if (document.webform.ad_size_cp[1].checked == true) {
			this_ad_rate=this_ad_rate14;
		}
		else if (document.webform.ad_size_cp[2].checked == true) {
			this_ad_rate=this_ad_rate12;
		}
		else if (document.webform.ad_size_cp[3].checked == true) {
			this_ad_rate=this_ad_rate1;
		}
		else {
			this_ad_rate=this_ad_ratecover;
		}
		ad_amt_cp=this_ad_rate;
		ad_msg="$" + this_ad_rate + " * 1 issue = $" + ad_amt_cp;
		document.webform.ad_msg_cp.value=ad_msg;
		document.webform.ad_msg2_cp.value=ad_msg;
	}

	total_ad_amt=ad_amt_combo+ad_amt_br+ad_amt_eltr+net_ad_amt_jrnl+ad_amt_anth+ad_amt_cp;
	total_ad_amt2=total_ad_amt.toFixed(2);
	ad_amt_discount=total_ad_amt*member_discount;
	ad_amt_discount2=ad_amt_discount.toFixed(2);
	net_ad_amt=total_ad_amt*(1-member_discount);
	net_ad_amt2=net_ad_amt.toFixed(2);

//special introductory offer
	special_offer=document.webform.special_offer.value;
	special_offer_code=document.webform.special_offer_code.value;
	special_offer_code2=document.webform.special_offer_code2.value;
//	if ((!intro_period) || ((special_offer != special_offer_code) && (special_offer != special_offer_code2))) {
	if ((special_offer != special_offer_code) && (special_offer != special_offer_code2)) {
		intro_discount=0;
	}
	ad_amt_discount_intro=net_ad_amt*intro_discount;
	ad_amt_discount2_intro=ad_amt_discount_intro.toFixed(2);
	net_ad_amt_intro=net_ad_amt*(1-intro_discount);
	net_ad_amt2_intro=net_ad_amt_intro.toFixed(2);
//special introductory offer
	ad_amt=net_ad_amt_intro;
	if (member_discount == 0) {
		member_discount_info=""
	}
	else {
		member_discount_info=" - $" + ad_amt_discount2 + " " + memberornot + " discount = $" + net_ad_amt2;
	}
	if (intro_discount == 0) {
		intro_discount_info=""
	}
	else {
		intro_discount_info=" - $" + ad_amt_discount2_intro + " introductory discount = $" + net_ad_amt2_intro;
	}
	ad_msg="$" + total_ad_amt2;
	if ((member_discount > 0) || (intro_discount > 0)) {
		ad_msg=ad_msg + member_discount_info + intro_discount_info;
	}
	document.webform.ad_amount.value=ad_amt.toFixed(2);
	document.webform.ad_amountdue.value=ad_amt.toFixed(2);
	document.webform.ad_amountdue2.value=ad_amt.toFixed(2);
	document.webform.ad_msg.value=ad_msg;
	document.webform.ad_msg2.value=ad_msg;

}

/****************************************************************/
function ValidateAdvData() {
//<input type=hidden name="required" value="realname,email,phone,SCN_member,ad_location,ad_description">
	document.webform.ad_msg_br.value="";
	document.webform.ad_msg_eltr.value="";
	document.webform.ad_msg_combo.value="";
	document.webform.ad_msg_jrnl.value="";
	document.webform.ad_msg_anth.value="";
	document.webform.ad_msg_cp.value="";
	document.webform.ad_msg2_br.value="";
	document.webform.ad_msg2_eltr.value="";
	document.webform.ad_msg2_combo.value="";
	document.webform.ad_msg2_jrnl.value="";
	document.webform.ad_msg2_anth.value="";
	document.webform.ad_msg2_cp.value="";

        if (isEmpty(document.webform.realname.value)) {
                alert("Please enter your Name.");
                document.webform.realname.focus();
                return false;
        }
        if (isEmpty(document.webform.email.value)) {
		alert("Please enter your Email Address.");
                document.webform.email.focus();
                return false;
        }
	else {
		email=document.webform.email.value;
		if ((email.indexOf("@") == -1) || (email.indexOf(".") == -1)) {
			alert("Invalid email address: '" + email + "'");
			document.webform.email.focus();
			return false;
		}
        }
        if (isEmpty(document.webform.phone.value)) {
		alert("Please enter your Phone Number.");
                document.webform.phone.focus();
                return false;
        }
	if ((document.webform.SCN_member[0].checked == false) & (document.webform.SCN_member[1].checked == false)) {
		alert("Please indicate your membership status");
		document.webform.SCN_member[0].focus();
		return false;
	}
	if ((document.webform.ad_location[0].checked == false) && (document.webform.ad_location[1].checked == false) && (document.webform.ad_location[2].checked == false) && (document.webform.ad_location[3].checked == false) && (document.webform.ad_location[4].checked == false)) {
		alert("Please select the location(s) you want to place your ad.");
                document.webform.ad_location[0].focus();
                return false;
	}
	else {
		if (document.webform.ad_location[0].checked == true) {
			if (document.webform.ad_br_months.value < 1) {
				alert("Please enter the number of months to run your ad on the SC-BR website.");
                		document.webform.ad_br_months.focus();
                		return false;
        		}
			else {
				ad_br_months=document.webform.ad_br_months.value;
				if (!isNum(document.webform.ad_br_months.value)) {
                        		alert("You entered a non-numeric value (" + document.webform.ad_br_months.value + ") in the 'number of months to run your SC-BR ad' field; please correct.");
                        		document.webform.ad_br_months.value="";
                        		document.webform.ad_br_months.focus();
                        		return false;
                		}
        		}
        	}
		if (document.webform.ad_location[1].checked == true) {
			if (document.webform.ad_eltr_issues.value < 1) {
				alert("Please enter the number of issues to run your ad in the e-letters.");
                		document.webform.ad_eltr_issues.focus();
                		return false;
        		}
			else {
				ad_eltr_issues=document.webform.ad_eltr_issues.value;
				if (!isNum(document.webform.ad_eltr_issues.value)) {
                        		alert("You entered a non-numeric value (" + document.webform.ad_eltr_issues.value + ") in the 'number of issues to run your e-letter ad' field; please correct.");
                        		document.webform.ad_eltr_issues.value="";
                        		document.webform.ad_eltr_issues.focus();
                        		return false;
                		}
        		}
        	}
		if (document.webform.ad_location[2].checked == true) {
			if (document.webform.ad_jrnl_issues.value < 1) {
				alert("Please enter the number of issues to run your ad in the Journal.");
                		document.webform.ad_jrnl_issues.focus();
                		return false;
        		}
			else {
				ad_jrnl_issues=document.webform.ad_jrnl_issues.value;
				if (!isNum(document.webform.ad_jrnl_issues.value)) {
                        		alert("You entered a non-numeric value (" + document.webform.ad_jrnl_issues.value + ") in the 'number of issues to run your Journal ad' field; please correct.");
                        		document.webform.ad_jrnl_issues.value="";
                        		document.webform.ad_jrnl_issues.focus();
                        		return false;
                		}
        		}
			if ((document.webform.ad_size_jrnl[0].checked == false) && (document.webform.ad_size_jrnl[1].checked == false) && (document.webform.ad_size_jrnl[2].checked == false) && (document.webform.ad_size_jrnl[3].checked == false)) {
				alert("Please select the size ad you want to place in the Journal.");
                		document.webform.ad_size_jrnl[0].focus();
                		return false;
			}
        	}
		else {
			document.webform.ad_size_jrnl[0].checked = false;
			document.webform.ad_size_jrnl[1].checked = false;
			document.webform.ad_size_jrnl[2].checked = false;
			document.webform.ad_size_jrnl[3].checked = false;
        	}
		if (document.webform.ad_location[3].checked == true) {
			if ((document.webform.ad_size_anth[0].checked == false) && (document.webform.ad_size_anth[1].checked == false) && (document.webform.ad_size_anth[2].checked == false) && (document.webform.ad_size_anth[3].checked == false)) {
				alert("Please select the size ad you want to place in the Anthology.");
                		document.webform.ad_size_anth[0].focus();
                		return false;
			}
        	}
		else {
			document.webform.ad_size_anth[0].checked = false;
			document.webform.ad_size_anth[1].checked = false;
			document.webform.ad_size_anth[2].checked = false;
			document.webform.ad_size_anth[3].checked = false;
        	}
		if (document.webform.ad_location[4].checked == true) {
			if ((document.webform.ad_size_cp[0].checked == false) && (document.webform.ad_size_cp[1].checked == false) && (document.webform.ad_size_cp[2].checked == false) && (document.webform.ad_size_cp[3].checked == false) && (document.webform.ad_size_cp[4].checked == false)) {
				alert("Please select the size ad you want to place in the Conference Program Brochure.");
                		document.webform.ad_size_cp[0].focus();
                		return false;
			}
        	}
		else {
			document.webform.ad_size_cp[0].checked = false;
			document.webform.ad_size_cp[1].checked = false;
			document.webform.ad_size_cp[2].checked = false;
			document.webform.ad_size_cp[3].checked = false;
			document.webform.ad_size_cp[4].checked = false;
        	}
        }
	if ((document.webform.ad_location[0].checked == true) || (document.webform.ad_location[1].checked == true)) {
        	if (isEmpty(document.webform.ad_imagelocation.value)) {
			alert("Please enter the url of the image (jpg/gif) to run with your ad.");
                	document.webform.ad_imagelocation.focus();
                	return false;
        	}
        	if (isEmpty(document.webform.ad_link.value)) {
			alert("Please enter the link (your website, blog, etc.) to use with your ad.");
                	document.webform.ad_link.focus();
                	return false;
        	}
        }
	else {
                document.webform.ad_imagelocation.value="";
                document.webform.ad_link.value="";
        }
        if (isEmpty(document.webform.ad_description.value)) {
		alert("Please enter a description of what you are advertising.");
                document.webform.ad_description.focus();
                return false;
        }
        if (!isEmpty(document.webform.special_offer.value)) {
		special_offer=document.webform.special_offer.value;
		special_offer_code=document.webform.special_offer_code.value;
		special_offer_code2=document.webform.special_offer_code2.value;
		if ((special_offer != special_offer_code) && (special_offer != special_offer_code2)) {
			alert("You entered an incorrect special offer code: '" + special_offer + "'. Please provide the correct code.");
                	document.webform.special_offer.focus();
                	return false;
        	}
        }
	thishii="scn";
        if (isEmpty(document.webform.hii.value)) {
		alert("Please enter the answer to the Human Intelligence Identification Question.");
                document.webform.hii.focus();
                return false;
        }
	else {
		hii=document.webform.hii.value;
		if (hii != thishii) {
			alert("You entered an incorrect value: '" + hii + "'. Please provide the correct answer to the required 'Human Intelligence Identification Answer'. This field must be filled in correctly before you can successfully submit the form.");
                	document.webform.hii.focus();
                	return false;
        	}
        }
	document.webform.hiianswer.value=thishii;

	TotalAdAmt();
	net_ad_amt=document.webform.ad_amount.value;
        if (document.webform.okdone.value == 0) {
                alert("Thanks for your ad request! Info on your $" + net_ad_amt + " ad will appear on the next screen.");
//        	document.webform.okdone.value=1;
        }
}

/****************************************************************/
function ValidateWirePeopleOrderData() {

	orderinfo="";
	price=0;
        if ((document.webform.pose1.checked == false) && (document.webform.pose2.checked == false) && (document.webform.pose3.checked == false) && (document.webform.pose4.checked == false) && (document.webform.pose5.checked == false) && (document.webform.pose6.checked == false) && (document.webform.pose7.checked == false) && (document.webform.pose8.checked == false) && (document.webform.pose9.checked == false) && (document.webform.pose10.checked == false) && (document.webform.pose11.checked == false) && (document.webform.pose12.checked == false) && (document.webform.pose13.checked == false) && (document.webform.pose14.checked == false) && (document.webform.pose15.checked == false) && (document.webform.pose16.checked == false) && (document.webform.pose17.checked == false) && (document.webform.pose18.checked == false) && (document.webform.pose19.checked == false) && (document.webform.pose20.checked == false) && (document.webform.pose21.checked == false) && (document.webform.pose22.checked == false) && (document.webform.pose23.checked == false) && (document.webform.pose24.checked == false) && (document.webform.pose25.checked == false) && (document.webform.pose26.checked == false) && (document.webform.pose27.checked == false) && (document.webform.pose28.checked == false) && (document.webform.pose29.checked == false) && (document.webform.pose30.checked == false)) {

                alert("Please select the sculpture(s) you want to purchase.");
                document.webform.pose1.focus();
                return false;
        }
	else {
		numsculptures=0;
		if (document.webform.pose1.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose1, ";
		}
		if (document.webform.pose2.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose2, ";
		}
		if (document.webform.pose3.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose3, ";
		}
		if (document.webform.pose4.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose4, ";
		}
		if (document.webform.pose5.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose5, ";
		}
		if (document.webform.pose6.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose6, ";
		}
		if (document.webform.pose7.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose7, ";
		}
		if (document.webform.pose8.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose8, ";
		}
		if (document.webform.pose9.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose9, ";
		}
		if (document.webform.pose10.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose10, ";
		}
		if (document.webform.pose11.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose11, ";
		}
		if (document.webform.pose12.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose12, ";
		}
		if (document.webform.pose13.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose13, ";
		}
		if (document.webform.pose14.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose14, ";
		}
		if (document.webform.pose15.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose15, ";
		}
		if (document.webform.pose16.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose16, ";
		}
		if (document.webform.pose17.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose17, ";
		}
		if (document.webform.pose18.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose18, ";
		}
		if (document.webform.pose19.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose19, ";
		}
		if (document.webform.pose20.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose20, ";
		}
		if (document.webform.pose21.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose21, ";
		}
		if (document.webform.pose22.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose22, ";
		}
		if (document.webform.pose23.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose23, ";
		}
		if (document.webform.pose24.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose24, ";
		}
		if (document.webform.pose25.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose25, ";
		}
		if (document.webform.pose26.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose26, ";
		}
		if (document.webform.pose27.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose27, ";
		}
		if (document.webform.pose28.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose28, ";
		}
		if (document.webform.pose29.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose29, ";
		}
		if (document.webform.pose30.checked == true) {
			numsculptures++;
			orderinfo=orderinfo + "pose30, ";
		}
		subtotal=0.00;
		sculptureprice=document.webform.Price.value;
		amtdue=0.00;
		amtdue=numsculptures*sculptureprice;
		document.webform.amtdue.value=sprintf("%01.2f", amtdue);
		document.webform.Qty.value=numsculptures;
		document.webform.Qty2.value=numsculptures;
		orderinfolen=orderinfo.length;
		if (orderinfo.substring(orderinfolen-2,2) == ", ");
			orderinfo=orderinfo.substring(0,orderinfolen-2);
		document.webform.AddOn1.value=orderinfo;
        }
}


