   var bttype = new Array(1);
   bttype[0] = new Array(3);
   bttype[0][0] = 'Airboat';
   bttype[0][1] = 'AIR';
   bttype[0][2] = 'X';
   bttype[1] = new Array(3);
   bttype[1][0] = 'Bowrider';
   bttype[1][1] = 'B/R';
   bttype[1][2] = 'P';
   bttype[2] = new Array(3);
   bttype[2][0] = 'Bass';
   bttype[2][1] = 'BASS';
   bttype[2][2] = 'P';
   bttype[3] = new Array(3);
   bttype[3][0] = 'Buoy Tender';
   bttype[3][1] = 'BUOY';
   bttype[3][2] = 'P';
   bttype[4] = new Array(3);
   bttype[4][0] = 'Camper';
   bttype[4][1] = 'CAMPR';
   bttype[4][2] = 'P';
   bttype[5] = new Array(3);
   bttype[5][0] = 'Canoe';
   bttype[5][1] = 'CANOE';
   bttype[5][2] = 'X';
   bttype[6] = new Array(3);
   bttype[6][0] = 'Cabin Cruiser';
   bttype[6][1] = 'CBNCR';
   bttype[6][2] = 'P';
   bttype[7] = new Array(3);
   bttype[7][0] = 'Convertible';
   bttype[7][1] = 'CNV';
   bttype[7][2] = 'P';
   bttype[8] = new Array(3);
   bttype[8][0] = 'Commercial';
   bttype[8][1] = 'COMM';
   bttype[8][2] = 'P';
   bttype[9] = new Array(3);
   bttype[9][0] = 'Cruiser';
   bttype[9][1] = 'CR';
   bttype[9][2] = 'P';
   bttype[10] = new Array(3);
   bttype[10][0] = 'Cruiser w/Cockpit';
   bttype[10][1] = 'CRCPT';
   bttype[10][2] = 'P';
   bttype[11] = new Array(3);
   bttype[11][0] = 'Catamaran';
   bttype[11][1] = 'CT';
   bttype[11][2] = 'S';
   bttype[12] = new Array(3);
   bttype[12][0] = 'Center Console Fisherman';
   bttype[12][1] = 'CTRCN';
   bttype[12][2] = 'P';
   bttype[13] = new Array(3);
   bttype[13][0] = 'Cuddy';
   bttype[13][1] = 'CUD';
   bttype[13][2] = 'P';
   bttype[14] = new Array(3);
   bttype[14][0] = 'Double Cabin';
   bttype[14][1] = 'DC';
   bttype[14][2] = 'P';
   bttype[15] = new Array(3);
   bttype[15][0] = 'Double Cabin Cockpit';
   bttype[15][1] = 'DCCPT';
   bttype[15][2] = 'P';
   bttype[16] = new Array(3);
   bttype[16][0] = 'Double Cabin Flush Deck';
   bttype[16][1] = 'DCFD';
   bttype[16][2] = 'P';
   bttype[17] = new Array(3);
   bttype[17][0] = 'Double Cabin Motor Yacht';
   bttype[17][1] = 'DCMY';
   bttype[17][2] = 'P';
   bttype[18] = new Array(3);
   bttype[18][0] = 'Deck Style Boat';
   bttype[18][1] = 'DECK';
   bttype[18][2] = 'P';
   bttype[19] = new Array(3);
   bttype[19][0] = 'Dinghy';
   bttype[19][1] = 'DGY';
   bttype[19][2] = 'X';
   bttype[20] = new Array(3);
   bttype[20][0] = 'Downeast';
   bttype[20][1] = 'DNEST';
   bttype[20][2] = 'P';
   bttype[21] = new Array(3);
   bttype[21][0] = 'Express';
   bttype[21][1] = 'EXP';
   bttype[21][2] = 'P';
   bttype[22] = new Array(3);
   bttype[22][0] = 'Express Fisherman';
   bttype[22][1] = 'EXPSF';
   bttype[22][2] = 'P';
   bttype[23] = new Array(3);
   bttype[23][0] = 'Flybridge & Half Tower';
   bttype[23][1] = 'F+H';
   bttype[23][2] = 'P';
   bttype[24] = new Array(3);
   bttype[24][0] = 'Flybridge & Marlin Tower';
   bttype[24][1] = 'F+M';
   bttype[24][2] = 'P';
   bttype[25] = new Array(3);
   bttype[25][0] = 'Flush Deck';
   bttype[25][1] = 'FD';
   bttype[25][2] = 'P';
   bttype[26] = new Array(3);
   bttype[26][0] = 'Flush Deck Cruiser';
   bttype[26][1] = 'FDCR';
   bttype[26][2] = 'P';
   bttype[27] = new Array(3);
   bttype[27][0] = 'Flush Deck Pilothouse';
   bttype[27][1] = 'FDPH';
   bttype[27][2] = 'P';
   bttype[28] = new Array(3);
   bttype[28][0] = 'Floating Home';
   bttype[28][1] = 'FH';
   bttype[28][2] = 'H';
   bttype[29] = new Array(3);
   bttype[29][0] = 'Flats Fisherman';
   bttype[29][1] = 'FLATS';
   bttype[29][2] = 'P';
   bttype[30] = new Array(3);
   bttype[30][0] = 'Fisherman';
   bttype[30][1] = 'FSH';
   bttype[30][2] = 'P';
   bttype[31] = new Array(3);
   bttype[31][0] = 'Houseboat';
   bttype[31][1] = 'HB';
   bttype[31][2] = 'H';
   bttype[32] = new Array(3);
   bttype[32][0] = 'Ice Boat';
   bttype[32][1] = 'ICE';
   bttype[32][2] = 'X';
   bttype[33] = new Array(3);
   bttype[33][0] = 'Jon Boat';
   bttype[33][1] = 'JON';
   bttype[33][2] = 'P';
   bttype[34] = new Array(3);
   bttype[34][0] = 'Jetski';
   bttype[34][1] = 'JTSKI';
   bttype[34][2] = 'X';
   bttype[35] = new Array(3);
   bttype[35][0] = 'Kayak';
   bttype[35][1] = 'KAYAK';
   bttype[35][2] = 'X';
   bttype[36] = new Array(3);
   bttype[36][0] = 'Launch';
   bttype[36][1] = 'LNCH';
   bttype[36][2] = 'P';
   bttype[37] = new Array(3);
   bttype[37][0] = 'Long Range Cruiser';
   bttype[37][1] = 'LRC';
   bttype[37][2] = 'P';
   bttype[38] = new Array(3);
   bttype[38][0] = 'LRC Motor Yacht';
   bttype[38][1] = 'LRMY';
   bttype[38][2] = 'P';
   bttype[39] = new Array(3);
   bttype[39][0] = 'LRC Motor Yacht w/Cockpit';
   bttype[39][1] = 'LRMYC';
   bttype[39][2] = 'P';
   bttype[40] = new Array(3);
   bttype[40][0] = 'LRC w/Raised Pilothouse';
   bttype[40][1] = 'LRPH';
   bttype[40][2] = 'P';
   bttype[41] = new Array(3);
   bttype[41][0] = 'LRC w/Raised Pilothouse & Cockpit';
   bttype[41][1] = 'LRPHC';
   bttype[41][2] = 'P';
   bttype[42] = new Array(3);
   bttype[42][0] = 'LRC w/Raised Aft Deck';
   bttype[42][1] = 'LRRD';
   bttype[42][2] = 'P';
   bttype[43] = new Array(3);
   bttype[43][0] = 'LRC w/Raised Aft Deck & Cockpit';
   bttype[43][1] = 'LRRDC';
   bttype[43][2] = 'P';
   bttype[44] = new Array(3);
   bttype[44][0] = 'LRC Sedan';
   bttype[44][1] = 'LRSDN';
   bttype[44][2] = 'P';
   bttype[45] = new Array(3);
   bttype[45][0] = 'LRC w/Trunk Cabin';
   bttype[45][1] = 'LRTC';
   bttype[45][2] = 'P';
   bttype[46] = new Array(3);
   bttype[46][0] = 'LRC w/Trunk Cabin & Cockpit';
   bttype[46][1] = 'LRTCC';
   bttype[46][2] = 'P';
   bttype[47] = new Array(3);
   bttype[47][0] = 'Motorsailer';
   bttype[47][1] = 'MS';
   bttype[47][2] = 'S';
   bttype[48] = new Array(3);
   bttype[48][0] = 'Marlin Tower';
   bttype[48][1] = 'MT';
   bttype[48][2] = 'P';
   bttype[49] = new Array(3);
   bttype[49][0] = 'Motor Yacht';
   bttype[49][1] = 'MY';
   bttype[49][2] = 'P';
   bttype[50] = new Array(3);
   bttype[50][0] = 'Motor Yacht w/Cockpit';
   bttype[50][1] = 'MYCPT';
   bttype[50][2] = 'P';
   bttype[51] = new Array(3);
   bttype[51][0] = 'Motor Yacht w/Deckhouse';
   bttype[51][1] = 'MYDKH';
   bttype[51][2] = 'P';
   bttype[52] = new Array(3);
   bttype[52][0] = 'Motor Yacht w/Flush Deck';
   bttype[52][1] = 'MYFD';
   bttype[52][2] = 'P';
   bttype[53] = new Array(3);
   bttype[53][0] = 'Motor Yacht w/Pilothouse';
   bttype[53][1] = 'MYPH';
   bttype[53][2] = 'P';
   bttype[54] = new Array(3);
   bttype[54][0] = 'Motor Yacht w/Ext. Deckhouse';
   bttype[54][1] = 'MYXDH';
   bttype[54][2] = 'P';
   bttype[55] = new Array(3);
   bttype[55][0] = 'Offshore';
   bttype[55][1] = 'OFF';
   bttype[55][2] = 'P';
   bttype[56] = new Array(3);
   bttype[56][0] = 'Open Fish';
   bttype[56][1] = 'OPFSH';
   bttype[56][2] = 'P';
   bttype[57] = new Array(3);
   bttype[57][0] = 'Overnighter';
   bttype[57][1] = 'OVNTR';
   bttype[57][2] = 'P';
   bttype[58] = new Array(3);
   bttype[58][0] = 'Pedal Boat';
   bttype[58][1] = 'PEDAL';
   bttype[58][2] = 'X';
   bttype[59] = new Array(3);
   bttype[59][0] = 'Pilothouse';
   bttype[59][1] = 'PH';
   bttype[59][2] = 'P';
   bttype[60] = new Array(3);
   bttype[60][0] = 'Pram';
   bttype[60][1] = 'PRAM';
   bttype[60][2] = 'X';
   bttype[61] = new Array(3);
   bttype[61][0] = 'Personal Watercraft';
   bttype[61][1] = 'PW';
   bttype[61][2] = 'P';
   bttype[62] = new Array(3);
   bttype[62][0] = 'Racing Runabout';
   bttype[62][1] = 'RACE';
   bttype[62][2] = 'P';
   bttype[63] = new Array(3);
   bttype[63][0] = 'Runabout';
   bttype[63][1] = 'RNBT';
   bttype[63][2] = 'P';
   bttype[64] = new Array(3);
   bttype[64][0] = 'Row Boat';
   bttype[64][1] = 'ROW';
   bttype[64][2] = 'X';
   bttype[65] = new Array(3);
   bttype[65][0] = 'Sailboat - Aft Cockpit';
   bttype[65][1] = 'SA/AC';
   bttype[65][2] = 'S';
   bttype[66] = new Array(3);
   bttype[66][0] = 'Sailboat - Center Cockpit';
   bttype[66][1] = 'SA/CC';
   bttype[66][2] = 'S';
   bttype[67] = new Array(3);
   bttype[67][0] = 'Sailboat - Cruising';
   bttype[67][1] = 'SA/CR';
   bttype[67][2] = 'S';
   bttype[68] = new Array(3);
   bttype[68][0] = 'Sailboat - One Design';
   bttype[68][1] = 'SA/OD';
   bttype[68][2] = 'S';
   bttype[69] = new Array(3);
   bttype[69][0] = 'Sailboat - Racer Cruiser';
   bttype[69][1] = 'SA/RC';
   bttype[69][2] = 'S';
   bttype[70] = new Array(3);
   bttype[70][0] = 'Sailboat - Aft Cockpit';
   bttype[70][1] = 'SACAC';
   bttype[70][2] = 'S';
   bttype[71] = new Array(3);
   bttype[71][0] = 'Sailboat - Center Cockpit';
   bttype[71][1] = 'SACCC';
   bttype[71][2] = 'S';
   bttype[72] = new Array(3);
   bttype[72][0] = 'Sailboat w/ Dual Steering';
   bttype[72][1] = 'SACDS';
   bttype[72][2] = 'S';
   bttype[73] = new Array(3);
   bttype[73][0] = 'Sailboat - Inside Steering';
   bttype[73][1] = 'SACIS';
   bttype[73][2] = 'S';
   bttype[74] = new Array(3);
   bttype[74][0] = 'Sailboat w/ Pilot House';
   bttype[74][1] = 'SACPH';
   bttype[74][2] = 'S';
   bttype[75] = new Array(3);
   bttype[75][0] = 'Sailboat - Canoe/Kayak';
   bttype[75][1] = 'SADCN';
   bttype[75][2] = 'S';
   bttype[76] = new Array(3);
   bttype[76][0] = 'Sailboat - Dinghy';
   bttype[76][1] = 'SADDG';
   bttype[76][2] = 'S';
   bttype[77] = new Array(3);
   bttype[77][0] = 'Sailboat - Day Sailer';
   bttype[77][1] = 'SADDS';
   bttype[77][2] = 'S';
   bttype[78] = new Array(3);
   bttype[78][0] = 'Sailboat - Pram';
   bttype[78][1] = 'SADPM';
   bttype[78][2] = 'S';
   bttype[79] = new Array(3);
   bttype[79][0] = 'Sailboat';
   bttype[79][1] = 'SAIL';
   bttype[79][2] = 'S';
   bttype[80] = new Array(3);
   bttype[80][0] = 'Sailboat - Racer/Cruiser';
   bttype[80][1] = 'SARAC';
   bttype[80][2] = 'S';
   bttype[81] = new Array(3);
   bttype[81][0] = 'Sailboat - Center Ckpt Racer/Cruis';
   bttype[81][1] = 'SARCC';
   bttype[81][2] = 'S';
   bttype[82] = new Array(3);
   bttype[82][0] = 'Sailboat - One Design';
   bttype[82][1] = 'SAROD';
   bttype[82][2] = 'S';
   bttype[83] = new Array(3);
   bttype[83][0] = 'Sailboard';
   bttype[83][1] = 'SBD';
   bttype[83][2] = 'S';
   bttype[84] = new Array(3);
   bttype[84][0] = 'Sail,Cruising-Dckhs-Aft Ckpt';
   bttype[84][1] = 'SCDAC';
   bttype[84][2] = 'S';
   bttype[85] = new Array(3);
   bttype[85][0] = 'Sail,Cruising-Dckhs-Ctr&Aft Ckpts';
   bttype[85][1] = 'SCDCA';
   bttype[85][2] = 'S';
   bttype[86] = new Array(3);
   bttype[86][0] = 'Sail,Cruising-Dckhs-Ctr Ckpt';
   bttype[86][1] = 'SCDCC';
   bttype[86][2] = 'S';
   bttype[87] = new Array(3);
   bttype[87][0] = 'Sail,Cruising-Aft Ckpt';
   bttype[87][1] = 'SCFAC';
   bttype[87][2] = 'S';
   bttype[88] = new Array(3);
   bttype[88][0] = 'Sail,Cruising-Ctr&Aft Ckpts';
   bttype[88][1] = 'SCFCA';
   bttype[88][2] = 'S';
   bttype[89] = new Array(3);
   bttype[89][0] = 'Sail,Cruising-Ctr Ckpt';
   bttype[89][1] = 'SCFCC';
   bttype[89][2] = 'S';
   bttype[90] = new Array(3);
   bttype[90][0] = 'Sail,Cruising-Plths-Aft Ckpt';
   bttype[90][1] = 'SCPAC';
   bttype[90][2] = 'S';
   bttype[91] = new Array(3);
   bttype[91][0] = 'Sail,Cruising-Plths-Bridge';
   bttype[91][1] = 'SCPBR';
   bttype[91][2] = 'S';
   bttype[92] = new Array(3);
   bttype[92][0] = 'Sail,Cruising-Plths-Ctr&Aft Ckpts';
   bttype[92][1] = 'SCPCA';
   bttype[92][2] = 'S';
   bttype[93] = new Array(3);
   bttype[93][0] = 'Sail,Cruising-Plths-Ctr Ckpt';
   bttype[93][1] = 'SCPCC';
   bttype[93][2] = 'S';
   bttype[94] = new Array(3);
   bttype[94][0] = 'Sail,Cruising-Plths-Only';
   bttype[94][1] = 'SCPHO';
   bttype[94][2] = 'S';
   bttype[95] = new Array(3);
   bttype[95][0] = 'Sedan Cruiser';
   bttype[95][1] = 'SDN';
   bttype[95][2] = 'P';
   bttype[96] = new Array(3);
   bttype[96][0] = 'Sedan Sport Fisherman';
   bttype[96][1] = 'SDNSF';
   bttype[96][2] = 'P';
   bttype[97] = new Array(3);
   bttype[97][0] = 'Sport Fisherman';
   bttype[97][1] = 'SF';
   bttype[97][2] = 'P';
   bttype[98] = new Array(3);
   bttype[98][0] = 'Rowing Shell';
   bttype[98][1] = 'SHELL';
   bttype[98][2] = 'X';
   bttype[99] = new Array(3);
   bttype[99][0] = 'Ski Boat';
   bttype[99][1] = 'SKI';
   bttype[99][2] = 'P';
   bttype[100] = new Array(3);
   bttype[100][0] = 'Motorsailer-Plths-Ctr&Aft Ckpts';
   bttype[100][1] = 'SMPAC';
   bttype[100][2] = 'S';
   bttype[101] = new Array(3);
   bttype[101][0] = 'Motorsailer-Plths-Bridge';
   bttype[101][1] = 'SMPBR';
   bttype[101][2] = 'S';
   bttype[102] = new Array(3);
   bttype[102][0] = 'Motorsailer-Plths-Ctr&Aft Ckpts';
   bttype[102][1] = 'SMPCA';
   bttype[102][2] = 'S';
   bttype[103] = new Array(3);
   bttype[103][0] = 'Motorsailer-Plths-Ctr Ckpt';
   bttype[103][1] = 'SMPCC';
   bttype[103][2] = 'S';
   bttype[104] = new Array(3);
   bttype[104][0] = 'Motorsailer-Plths-Only';
   bttype[104][1] = 'SMPHO';
   bttype[104][2] = 'S';
   bttype[105] = new Array(3);
   bttype[105][0] = 'Sport Cruiser';
   bttype[105][1] = 'SPTCR';
   bttype[105][2] = 'P';
   bttype[106] = new Array(3);
   bttype[106][0] = 'Sail,Racer/Cruiser-Aft Ckpt';
   bttype[106][1] = 'SRCAC';
   bttype[106][2] = 'S';
   bttype[107] = new Array(3);
   bttype[107][0] = 'Sail,Racer/Cruiser-Ctr&Aft Ckpts';
   bttype[107][1] = 'SRCCA';
   bttype[107][2] = 'S';
   bttype[108] = new Array(3);
   bttype[108][0] = 'Sail,Racer/Crusier-Ctr Ckpt';
   bttype[108][1] = 'SRCCC';
   bttype[108][2] = 'S';
   bttype[109] = new Array(3);
   bttype[109][0] = 'Sail,Racer/Cruiser-One Design';
   bttype[109][1] = 'SROAC';
   bttype[109][2] = 'S';
   bttype[110] = new Array(3);
   bttype[110][0] = 'Sail,Racer Only-Aft Ckpt';
   bttype[110][1] = 'SRRAC';
   bttype[110][2] = 'S';
   bttype[111] = new Array(3);
   bttype[111][0] = 'Sail,Racer Only-Aft Ckpt-Dkpt';
   bttype[111][1] = 'SRRAD';
   bttype[111][2] = 'S';
   bttype[112] = new Array(3);
   bttype[112][0] = 'Submarine';
   bttype[112][1] = 'SUB';
   bttype[112][2] = 'X';
   bttype[113] = new Array(3);
   bttype[113][0] = 'Triple Cabin Motor Yacht';
   bttype[113][1] = 'TCMY';
   bttype[113][2] = 'P';
   bttype[114] = new Array(3);
   bttype[114][0] = 'Half Tower';
   bttype[114][1] = 'TH';
   bttype[114][2] = 'P';
   bttype[115] = new Array(3);
   bttype[115][0] = 'Trimaran';
   bttype[115][1] = 'TM';
   bttype[115][2] = 'S';
   bttype[116] = new Array(3);
   bttype[116][0] = 'Trawler Motor Yacht';
   bttype[116][1] = 'TRMY';
   bttype[116][2] = 'P';
   bttype[117] = new Array(3);
   bttype[117][0] = 'Trawler Motor Yacht w/Cockpit';
   bttype[117][1] = 'TRMYC';
   bttype[117][2] = 'P';
   bttype[118] = new Array(3);
   bttype[118][0] = 'Trawler w/Raised Pilothouse';
   bttype[118][1] = 'TRPH';
   bttype[118][2] = 'P';
   bttype[119] = new Array(3);
   bttype[119][0] = 'Trawler w/Raised Plths & Cockpit';
   bttype[119][1] = 'TRPHC';
   bttype[119][2] = 'P';
   bttype[120] = new Array(3);
   bttype[120][0] = 'Trawler w/Raised Aft Deck';
   bttype[120][1] = 'TRRD';
   bttype[120][2] = 'P';
   bttype[121] = new Array(3);
   bttype[121][0] = 'Trawler w/Raised Aft Deck & Ckpt';
   bttype[121][1] = 'TRRDC';
   bttype[121][2] = 'P';
   bttype[122] = new Array(3);
   bttype[122][0] = 'Trawler Sedan';
   bttype[122][1] = 'TRSDN';
   bttype[122][2] = 'P';
   bttype[123] = new Array(3);
   bttype[123][0] = 'Trawler w/Trunk Cabin';
   bttype[123][1] = 'TRTC';
   bttype[123][2] = 'P';
   bttype[124] = new Array(3);
   bttype[124][0] = 'Trawler w/Trunk Cabin & Cockpit';
   bttype[124][1] = 'TRTCC';
   bttype[124][2] = 'P';
   bttype[125] = new Array(3);
   bttype[125][0] = 'Trawler';
   bttype[125][1] = 'TRWL';
   bttype[125][2] = 'P';
   bttype[126] = new Array(3);
   bttype[126][0] = 'Tugboat';
   bttype[126][1] = 'TUG';
   bttype[126][2] = 'P';
   bttype[127] = new Array(3);
   bttype[127][0] = 'Utility';
   bttype[127][1] = 'UTL';
   bttype[127][2] = 'P';
   bttype[128] = new Array(3);
   bttype[128][0] = 'Walkthru Windshield';
   bttype[128][1] = 'W/T';
   bttype[128][2] = 'P';
   bttype[129] = new Array(3);
   bttype[129][0] = 'Weekender';
   bttype[129][1] = 'WKNDR';
   bttype[129][2] = 'P';
   bttype[130] = new Array(3);
   bttype[130][0] = 'Yacht Fisherman';
   bttype[130][1] = 'YTFS';
   bttype[130][2] = 'P';
   var toprig = new Array(1);
   toprig[0] = new Array(3);
   toprig[0][0] = 'Cat Rig';
   toprig[0][1] = 'CAT';
   toprig[0][2] = 'S';
   toprig[1] = new Array(3);
   toprig[1][0] = 'Cutter Rig';
   toprig[1][1] = 'CUT';
   toprig[1][2] = 'S';
   toprig[2] = new Array(3);
   toprig[2][0] = 'Enclosed Flybridge';
   toprig[2][1] = 'FBE';
   toprig[2][2] = 'A';
   toprig[3] = new Array(3);
   toprig[3][0] = 'Enclosed Pilothouse';
   toprig[3][1] = 'EPH';
   toprig[3][2] = 'A';
   toprig[4] = new Array(3);
   toprig[4][0] = 'Enclosed Pilothouse w/Flybrdg';
   toprig[4][1] = 'EPF';
   toprig[4][2] = 'A';
   toprig[5] = new Array(3);
   toprig[5][0] = 'Enclosed Pilothouse w/Sun Deck';
   toprig[5][1] = 'EPS';
   toprig[5][2] = 'A';
   toprig[6] = new Array(3);
   toprig[6][0] = 'Flybridge';
   toprig[6][1] = 'FB';
   toprig[6][2] = 'A';
   toprig[7] = new Array(3);
   toprig[7][0] = 'Flybridge w/Half Tower';
   toprig[7][1] = 'F+H';
   toprig[7][2] = 'A';
   toprig[8] = new Array(3);
   toprig[8][0] = 'Flybridge w/Marlin Tower';
   toprig[8][1] = 'F+M';
   toprig[8][2] = 'A';
   toprig[9] = new Array(3);
   toprig[9][0] = 'Flybridge w/Tuna Tower';
   toprig[9][1] = 'F+T';
   toprig[9][2] = 'A';
   toprig[10] = new Array(3);
   toprig[10][0] = 'Gaff Rig';
   toprig[10][1] = 'GAF';
   toprig[10][2] = 'S';
   toprig[11] = new Array(3);
   toprig[11][0] = 'Hard Top';
   toprig[11][1] = 'HT';
   toprig[11][2] = 'A';
   toprig[12] = new Array(3);
   toprig[12][0] = 'Hard Top w/Half Tower';
   toprig[12][1] = 'H+H';
   toprig[12][2] = 'A';
   toprig[13] = new Array(3);
   toprig[13][0] = 'Hard Top w/Marlin Tower';
   toprig[13][1] = 'H+M';
   toprig[13][2] = 'A';
   toprig[14] = new Array(3);
   toprig[14][0] = 'Hard Top w/Tuna Tower';
   toprig[14][1] = 'H+T';
   toprig[14][2] = 'A';
   toprig[15] = new Array(3);
   toprig[15][0] = 'Ketch Rig';
   toprig[15][1] = 'KTH';
   toprig[15][2] = 'S';
   toprig[16] = new Array(3);
   toprig[16][0] = 'Lateen (or Gunter) Rig';
   toprig[16][1] = 'LAT';
   toprig[16][2] = 'S';
   toprig[17] = new Array(3);
   toprig[17][0] = 'Open';
   toprig[17][1] = 'OP';
   toprig[17][2] = 'A';
   toprig[18] = new Array(3);
   toprig[18][0] = 'Open w/Half Tower';
   toprig[18][1] = 'TH';
   toprig[18][2] = 'A';
   toprig[19] = new Array(3);
   toprig[19][0] = 'Open w/Marlin Tower';
   toprig[19][1] = 'MT';
   toprig[19][2] = 'A';
   toprig[20] = new Array(3);
   toprig[20][0] = 'Open w/Radar Arch';
   toprig[20][1] = 'RA';
   toprig[20][2] = 'A';
   toprig[21] = new Array(3);
   toprig[21][0] = 'Open w/Soft Top (Bimini Top)';
   toprig[21][1] = 'ST';
   toprig[21][2] = 'A';
   toprig[22] = new Array(3);
   toprig[22][0] = 'Open w/T-Top';
   toprig[22][1] = 'TTP';
   toprig[22][2] = 'A';
   toprig[23] = new Array(3);
   toprig[23][0] = 'Open w/Tuna Tower';
   toprig[23][1] = 'TT';
   toprig[23][2] = 'A';
   toprig[24] = new Array(3);
   toprig[24][0] = 'Schooner';
   toprig[24][1] = 'SCH';
   toprig[24][2] = 'S';
   toprig[25] = new Array(3);
   toprig[25][0] = 'Sloop Rig';
   toprig[25][1] = 'SLP';
   toprig[25][2] = 'S';
   toprig[26] = new Array(3);
   toprig[26][0] = 'Square Sail Rig';
   toprig[26][1] = 'SQ';
   toprig[26][2] = 'S';
   toprig[27] = new Array(3);
   toprig[27][0] = 'Yawl Rig';
   toprig[27][1] = 'YWL';
   toprig[27][2] = 'S';
   var lastclass = 'P';
   
   function setBtTypeList(rule,seltype) 
   { 
	   var i;
	   var nextOption = 1;
	   var chosen = 0;
	   while (document.formQuery.bttype.length > 1) 
	   {
	      document.formQuery.bttype[1] = null;
	   }
	   rule = rule.charAt(0);
	   rule.toUpperCase();
	   for (i=0; i < bttype.length; i++)
	   {
		   if (bttype[i][2] == rule)
			{
		     	if (bttype[i][1] == seltype)
		   		{
		   			chosen = nextOption;
		   		}
			   	else
			   	{
			   		// DO NOTHING
			   	}
			
		        newOpt = new Option(bttype[i][0], bttype[i][1]);
		   		document.formQuery.bttype[nextOption] = newOpt;
		   		nextOption = nextOption + 1;
		   }
	   }
   	   document.formQuery.bttype.options[chosen].selected = true;
   }
   
   function setTopRig(topRigclass,seltop)
   { 
	   var i;
	   var nextOption = 1;
	   var chosen = 0;
	   topRigclass = topRigclass.charAt(0);
	   topRigclass.toUpperCase();
	   if ( topRigclass != "S") 
	   {
	   	 rule = "A";
	   }
	   else 
	   {
	   	 rule = "S";
	   }
	   while (document.formQuery.toprig.length > 1) 
	   {
	   	  document.formQuery.toprig[1] = null;
	   }
	   for (i=0; i < toprig.length; i++)
	   {
		    if (toprig[i][2] == rule)
		   {
			      if (toprig[i][1] == seltop)
				   {
				   chosen = nextOption;
				   }
				   else
				   {
				   // DO NOTHINHG
				   }
			      newOpt = new Option(toprig[i][0], toprig[i][1]);
				   document.formQuery.toprig[nextOption] = newOpt;
				   nextOption = nextOption + 1;
		   }
	   }
	   document.formQuery.toprig.options[chosen].selected = true;
   }
   
   function bttypechangeSB()
   {
	  var newvalue = document.formQuery.Category.value;
	  setBtTypeList(newvalue);
	  setTopRig(newvalue);
	  lastclass=newvalue;
   }

	
   function bttypechange()
   {
	   var newvalue;
	   newvalue = lastclass;
	   for (i=0; i <= 3; i++)
	   {
		   if (document.formQuery.Category[i].checked)
		   {
		   newvalue = document.formQuery.Category[i].value;
		   }
	   }
	   newvalue = document.formQuery.Category.value;
	   
	   if (newvalue.toUpperCase() != lastclass.toUpperCase())
	   {
		   setBtTypeList(newvalue);
		   setTopRig(newvalue);
		   lastclass=newvalue;
	   }   
   }
   
   function setImage(imageName,newSrc)
   {
	   document.images[imageName].src=newSrc;
   }

function ValidateFields()
	{
	   var errmsg="";
	   // validate here
	   if (document.formQuery.mfgname.value=='') errmsg=errmsg + 'Manufacturer name is required.\n';
	   if (document.formQuery.loaft.value=='') errmsg=errmsg + 'Length over all ft. is required.\n';
	   if (document.formQuery.loaft.value !='')
	   	{
		   if(isNaN(document.formQuery.loaft.value))
		   {
			   errmsg=errmsg + 'Length over all ft. must be a number.\n';
		   }
		}
	   if (document.formQuery.loain.value !='')
	   {
	   	if(isNaN(document.formQuery.loain.value))
		{
			errmsg=errmsg + 'Length over all in. must be a number.\n';
		}
	   }
	   if (document.formQuery.mdlyear.value =='') errmsg=errmsg + 'Model year is required.\n';
	   if (document.formQuery.mdlyear.value !='' && (document.formQuery.mdlyear.value < 1900 || document.formQuery.mdlyear.value > lclmaxyear)) errmsg=errmsg + 'Model year must be between 1900 and '+lclmaxyear+'.\n';
	   if (document.formQuery.mdlyear.value !='')
	   {
	   	if(isNaN(document.formQuery.mdlyear.value))	
		{
			errmsg=errmsg + 'Model year must be a number.\n';
		}
	   }	
	   if (document.formQuery.enghp.value !='')
	   {
	   	if(isNaN(document.formQuery.enghp.value))
		{
			errmsg=errmsg + 'Engine HP must be a number.\n';
		}
	   }
	   if (errmsg!="")
	   {
	      alert ('The following error(s) occurred.\n\n' + errmsg + '\nPlease correct and try again.\n');
	      return false;
	   }	  
  	   else
          return true;
	}  
	
function submitForm()	
{
	
	if (document.formQuery.Submit.value != 'Please Wait')
	{
		if (ValidateFields()==true)
			{
				document.formQuery.Submit.value = 'Please Wait';
		      	document.formQuery.submit();
		    }
	}	
}


   function MM_findObj(n, d) { //v4.0
   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
   if(!x && document.getElementById) x=document.getElementById(n); return x;
   }
   
   function MM_validateForm() { //v4.1
   var i,p,q,nm,desc,test,num,min,max,errors='',args=MM_validateForm.arguments;
   for (i=0; i<(args.length-2); i+=4) { desc=args[i+3]; test=args[i+2]; val=MM_findObj(args[i]);
   if (val) { nm=val.name; if ((val=val.value)!="") {
   if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
   if (p<1 || p==(val.length-1)) errors+='- '+desc+' must contain an e-mail address.\n';
   } else if (test!='R') {
   if (isNaN(val)) 
   {
   errors+='- '+desc+' must contain a number.\n';
   }
   else
   {  
   if (test.indexOf('inRange') != -1) 
   {
   p=test.indexOf(':');
   min=parseFloat( test.substring(8,p)  );
   max=parseFloat( test.substring(p+1) );
   if (val < min || val > max)
   {
   errors+='- '+desc+' must contain a number between '+min+' and '+max+'.\n';
   }
   }
   }
   } } else if (test.charAt(0) == 'R') errors += '- '+ desc +' is required.\n'; }
   } if (errors) alert('The following error(s) occurred:\n'+errors);
   document.MM_returnValue = (errors ==  '')
   }   
   