// JavaScript Document

//validate each required box on the form

<!-- hide code from all browsers
function initialcaps(string2convert){ //Declare the function
var slice1 = string2convert.slice(0,1); //Takes first character in string2convert and sticks it in variable slice 1
var slice2 = string2convert.slice(1,string2convert.length); //This takes the rest of the string and sticks it in slice 2
var convertedstring;
slice1 = slice1.toUpperCase(); //Uppercases the first slice (first letter)
slice2 = slice2.toLowerCase(); //Lowercases the rest of the string
convertedstring = slice1 + slice2; //concatenates the two pieces back together
return convertedstring; //Returns the converted string
}
function upinitialcap() {
	var cityinitcap = new String(document.passwordform.city.value);
	document.passwordform.city.value = initialcaps(cityinitcap);
}
function validate()
	{
if(document.passwordform.membername.value == ""){alert("Please fill in your first and last name.");
	document.passwordform.membername.focus();
	return false;
	}
if(document.passwordform.address.value == ""){alert("Please fill in your Street Address or Post Office Box.");
	document.passwordform.address.focus();
	return false;
}

if(document.passwordform.state.value == ""){alert("Please fill in your State Abbreviation.");
	document.passwordform.state.focus();
	return false;
}
if(document.passwordform.zip.value == ""){alert("Please fill in your Zipcode.");
	document.passwordform.zip.focus();
	return false;
}
if(document.passwordform.email.value == ""){alert("Please fill in your Email Address.");
	document.passwordform.email.focus();
	return false;
}
if(document.passwordform.email.value.indexOf("@") == "-1" || document.passwordform.email.value.indexOf(".") == "-1")
{
alert("Your email address is incorrect. Please retype your email address."); 
	document.passwordform.email.focus();
	return false;
}

else
	
{	document.passwordform.submit();
}
	}


	
//  -->

