/*
 * Javascript form validator
 * Field specification array.
 * Ray Taylor
 */

/*
 * Field array structure:
 * FieldArray[n] = (ID, Name, Required, Format, MinLength, MaxLength ErrorMessage)
 *      HTML ID of element,
 *      User-friendly name of input, 
 *      required (true or false), 
 *      regular expression to check format, one of:
 *        Any -- allows anything; used for required fields of no specific format
 *        Alpha -- allows only letters and spaces
 *        AlphaNumeric -- allows letters, digits, and underscores, but no spaces
 *        Numeric -- allows digits only
 *        RealNumeric -- allows digits and one decimal
 *        Email -- e-mail address
 *        URL -- allows anything, but not ://, so no http://, https://, or ftp:// prefix.
 *      minimum length, 
 *      maximum length,
 *      error message for invalid format);
 */
var ID = 0, NAME = 1, REQUIRED = 2, FORMAT = 3, MINLENGTH = 4, MAXLENGTH = 5, ERRORMESSAGE = 6;

var FieldArray = new Array(
  new Array("name",       "Name/Title",             true, Any,  0,  64, "Please enter your name/title."),
  new Array("company",     "Company",            false,  Any,  0,  32, "Please enter your company name."),
  new Array("branch",   "Branch",                false,  Any,  0,  64, "Please enter your branch."),
  new Array("address",       "Address",      true,  Any,  0,  32, "Please enter your address."),
  new Array("phone",    "Phone #",                  true,  Any,  1, 128, "Please enter your phone number."),
  new Array("fax",    "Fax #",                  false,  Any,  1, 255, "Please enter your company address."),
  new Array("email",       "Email Address", true,  Any,  1,  48, "Please enter your email address."),
    new Array("centrifugal_pump_basics",       "Centrifugal Pump Basics", false,  Any,  1,  48, "Choose seminars"),
new Array("dos_donts_centrifugal_pump_basics",       "Do’s & Don’ts of Servicing Centrifugal Pumps", false,  Any,  1,  48, "Choose seminars"),
new Array("basic_heat_transfer",       "Basic Heat Transfer", false,  Any,  1,  48, "Choose seminars"),
new Array("parts_smart",       "Parts Smart", false,  Any,  1,  48, "Choose seminars"),
new Array("pumping_for_plumbing",       "Pumping Considerations for Plumbing	 Systems", false,  Any,  1,  48, "Choose seminars"),
new Array("efficient_boiler_plant_design",       "Efficient Boiler Plant Design", false,  Any,  1,  48, "Choose seminars"),
new Array("water_heating_sizing_piping",       "Water Heating Sizing, Piping, Controls 	and Safety", false,  Any,  1,  48, "Choose seminars"),
new Array("variable_speed_pumping_applications",       "Variable Speed Pumping Applications", false,  Any,  1,  48, "Choose seminars"),
new Array("modern_hydronics_basic",       "Modern Hydronics", false,  Any,  1,  48, "Choose seminars"),
new Array("steam_systems_basics",       "Steam Systems Basics", false,  Any,  1,  48, "Choose seminars"),
new Array("systems_balance",       "Systems Balance", false,  Any,  1,  48, "Choose seminars"),
new Array("hi_rise_pumping",       "Hi-Rise Pumping Considerations", false,  Any,  1,  48, "Choose seminars"),
new Array("green_concepts",       "Green Concepts", false,  Any,  1,  48, "Choose seminars")
  );
