/*
 * 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("solar_thermal_design", "solar_thermal_design", false,  Any,  1,  48, "Choose seminars"),
new Array("tekmar_Integrated_controls", "tekmar_Integrated_controls", false,  Any,  1,  48, "Choose seminars"),
new Array("maximizing_boiler_efficiency", "maximizing_boiler_efficiency", false,  Any,  1,  48, "Choose seminars"),
new Array("designing_ECM", "designing_ECM", false,  Any,  1,  48, "Choose seminars"),
new Array("wastewater_pumping", "wastewater_pumping", false,  Any,  1,  48, "Choose seminars"),
new Array("chemical_treatment", "chemical_treatment", false,  Any,  1,  48, "Choose seminars"),
new Array("vertical_stack_fan_coils", "vertical_stack_fan_coils", false,  Any,  1,  48, "Choose seminars"),
new Array("VFD_retrofits",   "VFD_retrofits", false,  Any,  1,  48, "Choose seminars"),
 );

