// validate for special characters
function isValidChar(inputStr){
	var iChars = "!@#$%^&*()+=-_[]\\\';,./{}|\":<>?~`";
        for(var i = 0; i < inputStr.length; i++){
        	if(iChars.indexOf(inputStr.charAt(i)) != -1){
				return false;}}
	return true;}
// validate for special characters EXCEPT the email sign "@", the "-", the "_", and the period "."
function isValidChar2(inputStr){
	var iChars = "!#$%^&*()+=[]\\\';,/{}|\":<>?~`";
        for(var i = 0; i < inputStr.length; i++){
        	if(iChars.indexOf(inputStr.charAt(i)) != -1){
				return false;}}
	return true;}
// validate whether string contains spaces
function checkForSpaces(inputStr){
	for(var i = 0; i < inputStr.length; i++){ 
		if(inputStr.charAt(0)==" "){ 
			return false;}
		if(inputStr.charAt(i) == " "){ 
			return false;}
		if(inputStr.charAt(inputStr.length-1)==" "){
			return false;}}
	return true;}
// validate at least one Number in String
function hasNumChar(inputStr){
	var noalpha = /^[a-zA-Z]*$/;
	if(noalpha.test(inputStr)){
		return false;}
	return true;}
// validate at least one Letter in String
function hasAlphaChar(inputStr){
	var nonums = /^[0-9]*$/;
	if(nonums.test(inputStr)){
		return false;}
	return true;}
// query a buttongroup and find the selected button value
function getSelectedValue(buttonGroup){
	for (var buttonvalue = 0; buttonvalue < buttonGroup.length; buttonvalue++){
		if (buttonGroup[buttonvalue].checked){
			return buttonvalue;}}
	return false;}
// create a list of classes
function getClasses(buttonGroup){
	var CreateList = new String("");
	for (var buttonvalue = 0; buttonvalue < buttonGroup.length; buttonvalue++){
		if (buttonGroup[buttonvalue].checked){
			CreateList += buttonGroup[buttonvalue].value + "\n";}}
	return CreateList;}
// determine whether a text field on a form is empty
function isEmpty(inputStr){
	if (inputStr == null || inputStr == ""){
		return true;}
	return false;}
// determine whether a string contains only positive integers
function isPosInteger(inputValue){
	inputStr = inputValue.toString()
	for (var digit = 0; digit < inputStr.length; digit++){
		var oneChar = inputStr.charAt(digit);
		if (oneChar < "0" || oneChar > "9"){
			return false;}}
	return true;}
// determine whether a field that is supposed to receive only numeric input actually contains only positive integers
// by calling the "isPosInteger" function
function validateNumber(inputValue){
	var inputStr = "";
	inputStr = (inputValue);
	if (!isPosInteger(inputStr)){
		return true;}
	return false;}
// validate social security format
function validateValue(ssn){
	var matchArr = ssn.match(/^(\d{3})-?\d{2}-?\d{4}$/);
	var numDashes = ssn.split('-').length - 1;
	if (matchArr == null || numDashes == 1){
		return false;}
	else if (parseInt(matchArr[1],10)==0){
		return false;}
	else {
		return true;}}
//validate eMail addresses
function validateEmail(EmailValue){
	var bFormValidate = new Boolean(true);
	var at="@"
	var dot="."
	var lat=EmailValue.indexOf(at)
	var lstr=EmailValue.length
	var ldot=EmailValue.indexOf(dot)
	if (EmailValue.indexOf(at)==-1){
		bFormValidate = false;}
	if (EmailValue.indexOf(at)==-1 || EmailValue.indexOf(at)==0 || EmailValue.indexOf(at)==lstr){
		bFormValidate = false;}
	if (EmailValue.indexOf(dot)==-1 || EmailValue.indexOf(dot)==0 || EmailValue.indexOf(dot)==lstr){
		bFormValidate = false;}
	 if (EmailValue.indexOf(at,(lat+1))!=-1){
		bFormValidate = false;}
	 if (EmailValue.substring(lat-1,lat)==dot || EmailValue.substring(lat+1,lat+2)==dot){
		bFormValidate = false;}
	 if (EmailValue.indexOf(dot,(lat+2))==-1){
		bFormValidate = false;}
	 if (EmailValue.indexOf(" ")!=-1){
		bFormValidate = false;}
	return bFormValidate;}
// validate the main "contact us" form
function validateForm1(){
	// establish the variables
	var Form = "";
	var NameValue = "";
	var EmailValue = "";
	var validRegExp = "";
	var CommentValue = "";
	var GroupValue1	= "";
	var GroupValue2 = "";
	var GroupValue3 = "";
	var AlertMessage = "";
	var bFormValidate = "";
	// assign initial values to the variables
	Form = document.forms[0];
	NameValue = Form.name.value;
	EmailValue = Form.email.value;
	CommentValue = Form.comments.value;
	GroupValue1 = getSelectedValue(Form.ibew);
	bFormValidate = Boolean(true);
	if(GroupValue1 == "0"){
		GroupValue2 = "Local 164 Main Offices";
		GroupValue3 = "joanf@ibewlocal164.com"}
	else if(GroupValue1 == "1"){
		GroupValue2 = "The Joint Board Offices";
		GroupValue3 = "robertf@ibewlocal164.com"}
	else if(GroupValue1 == "2"){
		GroupValue2 = "The JATC Offices"
		GroupValue3 = "jatc@ibewlocal164.com";}
	Form.directto.value = GroupValue2;
	Form.directto2.value = GroupValue3;
	// establish the beginning message that should be included in the alert message -
	AlertMessage = "We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n";
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if (isEmpty(NameValue)){
		AlertMessage += "Your name\n";
		bFormValidate = false;}
	// check to see if they've asked to join the mailing list
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail address\n";
		bFormValidate = false;}
	else{
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
		if(EmailValue.search(validRegExp) == -1){
			AlertMessage += "A properly formatted eMail address\n";
			bFormValidate = false;}}
	// check to see if any comments have been provided
	if(isEmpty(CommentValue)){
		AlertMessage += "Comments regarding the reason for your inquiry\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\n\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
// validate the organizing form
function validateForm2(){
	// establish the variables
	var Form = "";
	var NameValue = "";
	var EmailValue = "";
	var validRegExp = "";
	var AreaCodeValue = "";
	var PhonePrefixValue = "";
	var PhoneMainValue = "";
	var AlertMessage = "";
	var bFormValidate = "";
	// assign initial values to the variables
	Form = document.forms[0];
	NameValue = Form.Name.value;
	EmailValue = Form.email.value;
	AreaCodeValue = Form.areacode.value;
	PhonePrefixValue = Form.phonepre.value;
	PhoneMainValue = Form.phonemain.value;
	bFormValidate = Boolean(true);
	// establish the beginning message that should be included in the alert message -
	AlertMessage = "We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n";
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if (isEmpty(NameValue)){
		AlertMessage += "Your name\n";
		bFormValidate = false;}
	// validate the phone number
	// first whether it's empty and second, whether it contains only a numeric value
	// then add to the alert message and set the form validation to "false"
	if (isEmpty(AreaCodeValue) || isEmpty(PhonePrefixValue) || isEmpty(PhoneMainValue)){
		AlertMessage += "A complete or properly formatted phone number\n";
		bFormValidate = false;}
	// check to see if they've asked to join the mailing list
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail address\n";
		bFormValidate = false;}
	else{
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
		if(EmailValue.search(validRegExp) == -1){
			AlertMessage += "A properly formatted eMail address\n";
			bFormValidate = false;}}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\n\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
// validate the class registration form
function validateForm3(){
	// establish the variables
	var Form = "";
	var NameValue = "";
	var EmailValue = "";
	var MCardValue = "";
	var IDValue = "";
	var IDCompare = "";
	var Classes = "";
	var AlertMessage = "";
	var bFormValidate = "";
	// assign initial values to the variables
	Form = document.forms[0];
	NameValue = Form.name.value;
	EmailValue = Form.email.value;
	MCardValue = Form.cardnum.value;
	IDValue = Form.id.value;
	IDCompare = "/^\d{3}\-?\d{2}\-?\d{4}$/";
	Classes = getClasses(Form.ClassSelected);
	bFormValidate = Boolean(true);
	document.forms[0].classlist.value = Classes;
	// establish the beginning message that should be included in the alert message -
	AlertMessage = "We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n";
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if (isEmpty(NameValue)){
		AlertMessage += "Your name\n";
		bFormValidate = false;}
	// if the "Union Member Card #" field is empty, add to the alert message and set the form validation to "false"
	if (isEmpty(MCardValue)){
		AlertMessage += "A Union Member Card number\n";
		bFormValidate = false;}
	// if the "ID# " field is empty, add to the alert message and set the form validation to "false"
	if (isEmpty(IDValue)){
		AlertMessage += "A Social Security number\n";
		bFormValidate = false;}
	else{
			if(validateValue( IDValue) == false){
			AlertMessage += "A properly formatted Social Security number\n(Example: \"123-45-6789\")\n";
			bFormValidate = false;}}
	// check to see if they've asked to join the mailing list
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail address\n";
		bFormValidate = false;}
	else{
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
		if(EmailValue.search(validRegExp) == -1){
			AlertMessage += "A properly formatted eMail address\n";
			bFormValidate = false;}}
	// warn if no classes were selected
	if(Classes != ""){
		alert("Classes you have registered for are: \n" + Form.classlist.value);}
	else{
		AlertMessage += "You have not selected any classes\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\n\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
//validate site registration form
function validateReg(){
	var Form 			= document.forms[0];
	var NameValue 		= new String(Form.lastname.value);
	var EmailValue 		= new String(Form.email.value);
	var ID1 			= new String(Form.ssndigits.value);
	var RegMonth		= Form.regdobmonth.options[Form.regdobmonth.selectedIndex].value;
	var RegDay			= Form.regdobday.options[Form.regdobday.selectedIndex].value;
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if(isEmpty(NameValue)){
		AlertMessage += "Your name\n";
		bFormValidate = false;}
	// if the "ID# " field is empty, add to the alert message and set the form validation to "false"
	if(isEmpty(ID1)){
		AlertMessage += "The last 4 digits of your SSN\n";
		bFormValidate = false;}	
	// if the birthday month or day have not been selected, all to the alert message and set the form validation to "false"
	if(RegMonth == ""){
		AlertMessage += "Your Birth Month\n";
		bFormValidate = false;}
	if(RegDay == ""){
		AlertMessage += "Your Birth Day\n";
		bFormValidate = false;}
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail Address\n";
		bFormValidate = false;}
	else if(!validateEmail(EmailValue)){
		AlertMessage += "A properly formatted eMail Address\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
//validate email verification form
function validateReg3(){
	var Form 			= document.forms[0];
	var EmailValue 		= new String(Form.email.value);
	var CodeValue		= new String(Form.regcode.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail Address\n";
		bFormValidate = false;}
	else if(!validateEmail(EmailValue)){
		AlertMessage += "A properly formatted eMail Address\n";
		bFormValidate = false;}
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if(isEmpty(CodeValue)){
		AlertMessage += "Your Registration Code\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
// validate password/password reminder form
function validateRegFinal(){
	var Form 			= document.forms[0];
	var Pass1Value		= new String(Form.password1.value);
	var Pass2Value		= new String(Form.password2.value);
	var RemQuestion		= Form.pwquestion.options[Form.pwquestion.selectedIndex].value;
	var RemAnswer		= new String(Form.pwanswer.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if((isEmpty(Pass1Value))||(isEmpty(Pass2Value))){
		AlertMessage += "One of your password fields was left blank\n";
		bFormValidate = false;}
	else{
		if(!(Form.password1.value == Form.password2.value)){
			AlertMessage += "You did not enter the same value in both password fields\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}
		else if(Pass1Value.length < 6){
			AlertMessage += "Your password was less than 6 characters long\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}		
		else{
			if((!isValidChar(Pass1Value))){
			AlertMessage += "You entered an invalid character in your password field\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}
			else if((!checkForSpaces(Pass1Value))){
			AlertMessage += "You entered a space in your password field\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}
			else if(!hasNumChar(Pass1Value)){
			AlertMessage += "Your password did not contain at least 1 number\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}
			else if(!hasAlphaChar(Pass1Value)){
			AlertMessage += "Your password did not contain at least 1 letter\n";
			bFormValidate = false;
			Form.password1.value = "";
			Form.password2.value = "";}}
		}
	// if the "reminder question" has not been chosen, add to the alert message and set the form validation to "false"
	if(RemQuestion == ""){
		AlertMessage += "You did not select a reminder question\n";
		bFormValidate = false;}
	// if the "reminder answer" has not been provided, add to the alert message and set the form validation to "false"
	if(isEmpty(RemAnswer)){
		AlertMessage += "You did not answer your reminder question\n";}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
//validate help request form
function validateHelp(){
	var Form 			= document.forms[0];
	var EmailValue		= new String(Form.email.value);
	var RemQuestion		= Form.pwquestion.options[Form.pwquestion.selectedIndex].value;
	var RemAnswer		= new String(Form.pwanswer.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if((isEmpty(EmailValue))){
		AlertMessage += "Your eMail address\n";
		bFormValidate = false;}
	else if((!isValidChar2(EmailValue))){
		AlertMessage += "You entered an invalid character in the eMail address field\n";
		bFormValidate = false;}
	else if(!validateEmail(EmailValue)){
		AlertMessage += "A properly formatted eMail Address\n";
		bFormValidate = false;}
	// if the "reminder question" has not been chosen, add to the alert message and set the form validation to "false"
	if(RemQuestion == ""){
		AlertMessage += "You did not select a reminder question\n";
		bFormValidate = false;}
	// if the "reminder answer" has not been provided, add to the alert message and set the form validation to "false"
	if(isEmpty(RemAnswer)){
		AlertMessage += "You did not answer your reminder question\n";}
	else if((!isValidChar(RemAnswer))){
		AlertMessage += "You entered an invalid character in the Answer field\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}
function validateLogin()
{
	var Form 			= document.forms[0];
	var EmailValue		= new String(Form.ibewuser.value);
	var PasswordValue	= new String(Form.ibewpw.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if((isEmpty(EmailValue)))
	{
		AlertMessage += "Your UserName\n";
		bFormValidate = false;
	}
	else if((!isValidChar2(EmailValue)))
	{
		AlertMessage += "You entered an invalid character in the UserName field\n";
		bFormValidate = false;
	}
	else if(!validateEmail(EmailValue))
	{
		AlertMessage += "A properly formatted UserName\n";
		bFormValidate = false;
	}
	if((isEmpty(PasswordValue)))
	{
		AlertMessage += "Your Password\n";
		bFormValidate = false;
	}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false)
	{
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");
	}
	//otherwise, process the form
	if (bFormValidate == true)
	{
		Form.submit();
	}
}
function updatePWCheckbox()
{
	var Form			= document.forms[0];
	var eMailValue		= Form.ibew_new_email.value;
	var eMailCheckbox	= Form.update_email;
	if(isEmpty(eMailValue))
	{
		eMailCheckbox.checked = false;
	}
	else
	{
		eMailCheckbox.checked = true;
	}
}
function updatePWCheckbox2()
{
	var Form				= document.forms[0];
	var passwordValue		= Form.ibewpw.value;
	var passwordCheckbox	= Form.update_pwd;
	if(isEmpty(passwordValue))
	{
		passwordCheckbox.checked = false;
	}
	else
	{
		passwordCheckbox.checked = true;
	}
}
function updatePWCheckbox3()
{
	var Form				= document.forms[0];
	var questionvalue		= Form.pwquestion.options[Form.pwquestion.selectedIndex].value;
	var initQValue			= Form.qvalue.value;
	var reminderCheckbox	= Form.update_reminder;
	if(questionvalue == initQValue)
	{
		reminderCheckbox.checked = false;
	}
	else
	{
		reminderCheckbox.checked = true;
	}
}
function updatePWCheckbox3a()
{
	var Form				= document.forms[0];
	var answervalue			= Form.pwanswer.value;
	var initAValue			= Form.avalue.value;
	var reminderCheckbox	= Form.update_reminder;
	if(answervalue == initAValue)
	{
		reminderCheckbox.checked = false;
	}
	else
	{
		reminderCheckbox.checked = true;
	}
	//alert("answervalue is " + answervalue + " and initAValue is " + initAValue);
}
// validate the edit login information form
function validateUpdate()
{
	var Form 			= document.forms[0];
	var eMailNewValue	= new String(Form.ibew_new_email.value);
	var Pass1Value		= new String(Form.ibewpw.value);
	var Pass2Value		= new String(Form.ibewpw2.value);
	var RemQuestion		= Form.pwquestion.options[Form.pwquestion.selectedIndex].value;
	var RemQuestion1	= new String("");
	var RemAnswer		= new String(Form.pwanswer.value);
	var eMailBox		= Form.update_email;
	var pwdBox			= Form.update_pwd;
	var reminderBox		= Form.update_reminder;
	var initQValue		= Form.qvalue.value;
	var initAValue		= Form.avalue.value;
	var AlertMessage	= new String("");
	var ConfirmMessage	= new String("");
	var bFormValidate	= new Boolean(true);	
	
	if((!eMailBox.checked)&&(!pwdBox.checked)&&(!reminderBox.checked))
	{
		AlertMessage = "You did not change any of your log-in information.\nIf you wish to keep your original eMail and password\ndata,use the \"Leave This Screen\" button at the\nbottom of the form. If this was in error,\n";
		bFormValidate = false;
	}
	else
	{	
		AlertMessage		= "We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n";
		ConfirmMessage		= "Here is the information you are about to send.\nIf it is not correct, select \"Cancel\" and re-enter\nyour information. Otherwise, select \"Submit\".\n\n";

		if(eMailBox.checked)
		{
			if(isEmpty(eMailNewValue))
			{
			AlertMessage += "You didn't supply a new eMail address\n(Uncheck the \"Change My Email\" Box if you\nwould like to keep your existing eMail address)\n";
			bFormValidate = false;
			}
			else if(!validateEmail(eMailNewValue))
			{
			AlertMessage += "A properly formatted eMail Address\n";
			bFormValidate = false;
			}
			else
			{
				ConfirmMessage += "new Email Address: " + eMailNewValue + "\n";
			}
		}
		if(pwdBox.checked)
		{
			if((isEmpty(Pass1Value))||(isEmpty(Pass2Value)))
			{
			AlertMessage += "One of your password fields was left blank\n(Uncheck the \"Change My Password\" Box if you\nwould like to keep your existing Password)\n";
			bFormValidate = false;
			}
			else
			{
				if(!(Form.ibewpw.value == Form.ibewpw2.value))
				{
					AlertMessage += "You did not enter the same value in both password fields";
					bFormValidate = false;
					Form.ibewpw.value = "";
					Form.ibewpw2.value = "";
				}
				else if(Pass1Value.length < 6)
				{
					AlertMessage += "Your password was less than 6 characters long\n";
					bFormValidate = false;
					Form.ibewpw.value = "";
					Form.ibewpw2.value = "";
				}		
				else
				{
					if((!isValidChar(Pass1Value)))
					{
						AlertMessage += "You entered an invalid character in your password field\n";
						bFormValidate = false;
						Form.ibewpw.value = "";
						Form.ibewpw2.value = "";
					}
					else if((!checkForSpaces(Pass1Value)))
					{
						AlertMessage += "You entered a space in your password field\n";
						bFormValidate = false;
						Form.ibewpw.value = "";
						Form.ibewpw2.value = "";
					}
					else if(!hasNumChar(Pass1Value))
					{
						AlertMessage += "Your password did not contain at least 1 number\n";
						bFormValidate = false;
						Form.ibewpw.value = "";
						Form.ibewpw2.value = "";
					}
					else if(!hasAlphaChar(Pass1Value))
					{
						AlertMessage += "Your password did not contain at least 1 letter\n";
						bFormValidate = false;
						Form.ibewpw.value = "";
						Form.ibewpw2.value = "";
					}
					else
					{
						ConfirmMessage += "new Password: " + Pass1Value + "\n";
					}
				}
			}
		}
		if(reminderBox.checked)
		{
			// if the "reminder question" has not been chosen, add to the alert message and set the form validation to "false"
			if((RemQuestion == initQValue)&&(RemAnswer == initAValue))
			{
				AlertMessage += "You did not enter new Reminder Information\n(Uncheck the \"Change My Reminder\" Box if you\nwould like to keep your existing reminder info)\n";
				bFormValidate = false;
			}
			else
			{
				// if the "reminder answer" has not been provided, add to the alert message and set the form validation to "false"
				if(isEmpty(RemAnswer))
				{
					AlertMessage += "You did not provide a new reminder answer\n";
				}
				else
				{
					if(RemQuestion != initQValue)
					{
						switch(RemQuestion.toLowerCase().valueOf())
						{
							case "sch":
								RemQuestion1		= "High School Name";
								break;
							case "mom":
								RemQuestion1		= "Mother's Maiden Name";
								break;
							case "pet":
								RemQuestion1		= "Favorite Pet's Name";
								break;
							case "dad":
								RemQuestion1		= "Father's Middle Name";
								break;
							case "spt":
								RemQuestion1		= "Favorite Sports Team";
								break;
							case "mov":
								RemQuestion1		= "Favorite Movie";
								break;
						}
						ConfirmMessage += "new Reminder Question: " + RemQuestion1 + "\n";
					}
					if(RemAnswer != initAValue)
					{
						ConfirmMessage += "New Reminder Answer: " + RemAnswer + "\n";
					}
				}
			}
		}
	}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false)
	{
		alert(AlertMessage+ "Please check the form, and then click the\n\"Submit\" button again. Thanks.");
	}
	//otherwise, process the form
	if (bFormValidate == true)
	{
		//otherwise, process the form
		var GoAhead = confirm(ConfirmMessage)
		if (GoAhead)
		{
			Form.submit();
			}
		else
		{
			return false;
		}
	}
}
//validate email verification form
function validateUpdate2(){
	var Form 			= document.forms[0];
	var EmailValue 		= new String(Form.email.value);
	var CodeValue		= new String(Form.regcode.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail Address\n";
		bFormValidate = false;}
	else if(!validateEmail(EmailValue)){
		AlertMessage += "A properly formatted eMail Address\n";
		bFormValidate = false;}
	// if the "name" field is empty, add to the alert message and set the form validation to "false"
	if(isEmpty(CodeValue)){
		AlertMessage += "Your Update Code\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}

