IE = document.all;
var redo = false;

function setup_fields(form) {
	with (form) {
		if (typeof(FirstName) == "object") {
			FirstName.xmin = 1;
			FirstName.maxLength = 25;
			FirstName.xlabel = "First Name";
			FirstName.onkeypress = hitReturn;
			FirstName.xvalidate = isString;
			FirstName.xerror = showError;
			FirstName.xerrmsg = "Your First Name is required for this contact form -- please enter your First Name now.";
		}
		if (typeof(LastName) == "object") {
			LastName.xmin = 2;
			LastName.maxLength = 25;
			LastName.xlabel = "Last Name";
			LastName.onkeypress = hitReturn;
			LastName.xvalidate = isString;
			LastName.xerror = showError;
			LastName.xerrmsg = "Your Last Name is required for this contact form -- please enter your full last name now.";
		}
		if (typeof(Email) == "object") {
			Email.xmin = 1;
			Email.maxLength = 50;
			Email.xlabel = "Email";
			Email.onkeypress = editEmail;
			Email.xvalidate = isEmail;
			Email.xerror = showError;
			Email.xerrmsg1 = "The Email Address you entered, \"";
			Email.xerrmsg2 = "\" is not formatted correctly.\nPlease re-enter your Email Address now using this format: name@somewhere.com.";
		}
		if (typeof(Email2) == "object") {
			Email2.xmin = 1;
			Email2.maxLength = 50;
			Email2.xlabel = "Email2";
			Email2.onkeypress = editEmail;
			Email2.xvalidate = isEmail2;
			Email2.xerror = showError;
			Email2.xerrmsg1 = "The Email Address you entered, \"";
			Email2.xerrmsg2 = "\" is not formatted correctly.\nPlease re-enter your Email Address to confirm.";
		}
		if (typeof(Address) == "object") {
			Address.xmin = 1;
			Address.maxLength = 50;
			Address.xlabel = "Address";
			Address.onkeypress = hitReturn;
			Address.xvalidate = isString;
			Address.xerror = showError;
			Address.xerrmsg = "Your Street Address is required for this contact form -- please enter your street address now.";
		} 
		if (typeof(City) == "object") {
			City.xmin = 3;
			City.maxLength = 30;
			City.xlabel = "City";
			City.onkeypress = hitReturn;
			City.xvalidate = isString;
			City.xerror = showError;
			City.xerrmsg = "Please make sure the City you entered is at least 3 characters.";
		}
		if (typeof(State) == "object") {
			State.xmin = 1;
			State.maxLength = 30;
			State.xlabel = "State";
			State.onkeypress = hitReturn;
			State.xvalidate = isString;
			State.xerror = showError;
			State.xerrmsg = "Please select your State/Province.";
		}
		if (typeof(Zip) == "object") {
			Zip.xmin = 5;
			Zip.xeditmax = 5;
			Zip.maxLength = 5;
			Zip.xlabel = "Zip";
			Zip.onkeypress = editPostal;
			Zip.xvalidate = isPostal;
			Zip.xerror = showError;
			Zip.xerrmsg = "Please make sure the Zip Code you entered is 5 digits long.";
		}
		if (typeof(Phone) == "object") {
			Phone.xmin = 10;
			Phone.xeditmax = 10;
			Phone.maxLength = 15;
			Phone.xlabel = "Phone";
			Phone.xvalidate = isPhone;
			Phone.xerror = showError;
			Phone.xerrmsg = "The Phone Number you entered is incomplete.  Please enter your full Phone Number -- including area code.";
		}
		if (typeof(HearAboutUs) == "object") {
			HearAboutUs.xmin = 1;
			HearAboutUs.maxLength = 30;
			HearAboutUs.xlabel = "Hearaboutus";
			HearAboutUs.onkeypress = hitReturn;
			HearAboutUs.xvalidate = isString;
			HearAboutUs.xerror = showError;
			HearAboutUs.xerrmsg = "Please select how you heard about us.";
		}
		if (typeof(HearAboutUs_Specify) == "object") {
			HearAboutUs_Specify.xmin = 1;
			HearAboutUs_Specify.maxLength = 30;
			HearAboutUs_Specify.xlabel = "HearAboutUs_Specify";
			HearAboutUs_Specify.onkeypress = hitReturn;
			HearAboutUs_Specify.xvalidate = isString;
			HearAboutUs_Specify.xerror = showError;
			HearAboutUs_Specify.xerrmsg = "Please specify how you heard about us";
		}
		if (typeof(Comments) == "object") {
			Comments.xmin = 1;
			Comments.maxLength = 2500;
			Comments.xlabel = "Comments";
			Comments.onkeypress = hitReturn;
			Comments.xvalidate = isString;
			Comments.xerror = showError;
			Comments.xerrmsg = "Please enter your comments.";
		}
	}
	
	return;
}