function GetSelectValue(TheSelect){
var the_index = TheSelect.selectedIndex;
return TheSelect.options[the_index].value;
}

var cellArray = [  //              Cap,     Res,     Wgt,     Volt,   MaxI,
['A123 - 2300 LiNP 15/20C',        2300,   .009,     2.54,    3.3,     46],
['AnyRc Lipo 1700',                1700,   .06,      1.4,     3.7,	0],
['Apogee 830',                      850,   .012,     .61,     3.7,      0],
['Apogee 1050',                    1050,   .012,     .76,     3.7,	0],
['Apogee 1570',                    1570,   .012,     1.27,    3.7,	0],
['Apogee 2480',                    2480,   .012,     1.67,    3.7,	0],
['BlackLine 1700 35C',             1700,   .0089,     1.16,   3.7,     60],
['BlackLine 2200 35C',             2200,   .0071,     2.05,   3.7,     77],
['BlackLine 2600 35C',             2600,   .0058,     2.47,   3.7,     91],
['BlackLine 3200 35C',             3200,   .0048,     3.39,   3.7,    112],
['BlackLine 3800 35C',             3800,   .0038,     3.60,   3.7,    133],
['BlackLine 4400 35C',             4400,   .0033,     4.31,   3.7,    154],
['Dualsky XPower 1000 25C',        1000,   .030,      1.06,   3.7,     25],
['Dualsky XPower 2200 25C',        1000,   .009,      1.94,   3.7,     55],
['ePower 450 15/20C',               450,   .0276,    .353,    3.7,	9],
['ePower 700 12/18C',               700,   .0336,    .493,    3.7,     12],
['ePower 1000HP 10/16C',           1000,   .044,     .847,    3.7,     16],
['ePower 1000HPT 12/18C',          1000,   .015,     .883,    3.7,     18],
['ePower 1200XP 15/25C',           1200,   .015,     1.01,    3.7,     30],
['ePower 1250HPT 12/15C',          1250,   .015,     .953,    3.7,     19],
['ePower 1500XP 15/25C',           1500,   .012,     1.34,    3.7,     38],
['ePower 1700HP 10/15C',           1700,   .025,     1.34,    3.7,     26],
['ePower 1800XP 15/25C',           1800,   .01,      1.586,   3.7,     45],
['ePower 2500XP 15/25C',           2500,   .0096,    2.256,   3.7,     63],
['ePower 3700XP 15/25C',           3700,   .0049,    3.35,    3.7,     93],
['ePower 5000XP 15/25C',           5000,   .0032,    4.234,   3.7,    125],
['E-Tec ET-0250',                   250,   .09,      .2,      3.7,	0],
['E-Tec ET-0700',                   700,   .042,     .53,     3.7,	0],
['E-Tec ET-1200',                  1200,   .033,     .85,     3.7,	0],
['E-Tec ET-1200HD',                1200,   .032,     .93,     3.7,	0],
['FlightPower 400 20C',	            400,   .0037,    .65,     3.7,	8],
['FlightPower 800 20C',	            800,   .0023,    .85,     3.7,     16],
['FlightPower 1200 20C',	   1200,   .012,     1.27,    3.7,     24],
['FlightPower 1500 20C',	   1500,   .0098,    1.27,    3.7,     30],
['FlightPower 1800 20C',	   1800,   .0063,    1.71,    3.7,     36],
['FlightPower 2100 20C',	   2100,   .01,      2.24,    3.7,     42],
['FlightPower 2500 20C',	   2500,   .0065,    2.51,    3.7,     50],
['FlightPower 3300 20C',	   3300,   .0038,    3.34,    3.7,     66],
['FlightPower 3700 20C',	   3700,   .0037,    3.5,     3.7,     74],
['Gold Peak GP750 NiMH',	    750,   .06,       .5,    1.25,	0],
['Gold Peak GP3300 NiMH 12C',	   3300,   .005,     2.19,   1.25,     40],
['Gold Peak GP3700 NiMH 12C',	   3700,   .005,     2.4,    1.25,     45],
['G. Planes Electrifly 300 20C',    300,   .06,       .28,    3.7,	6],
['G. Planes Electrifly 640 20C',    640,   .022,      .6,     3.7,     13],
['G. Planes Electrifly 910 20C',    910,   .018,      .88,    3.7,     18],
['G. Planes Electrifly 1250 20C',  1250,   .0115,    1.02,    3.7,     25],
['G. Planes Electrifly 1500 20C',  1500,   .011,     1.23,    3.7,     30],
['G. Planes Electrifly 2100 20C',  2100,   .0075,    1.83,    3.7,     42],
['G. Planes Electrifly 3200 20C',  3200,   .0045,    2.75,    3.7,     64],
['G. Planes Electrifly 5000 20C',  5000,   .003,     4.3,     3.7,    100],
['Hecell HE23AF 1050 NiMH',        1050,   .025,      .71,   1.25,	0],
['Hecellusa 1100 NiMH',            1100,    .01,      .7,    1.25,	0],
['Hyperion HP-LVX 0300 20C',        300,   .056,      .32,    3.7,	6],
['Hyperion HP-LCL 0350 26C',        350,   .073,      .4,     3.7,	9],
['Hyperion HP-LVX 0400 20C',        400,   .042,      .46,    3.7,	8],
['Hyperion HP-LVX 0800 20C',        800,   .021,      .53,    3.7,     16],	
['Hyperion HP-LCL 0950 25C',        950,   .027,      .98,    3.7,     24],
['Hyperion HP-LVX 1200 20C',       1200,   .014,      1.13,   3.7,     24],
['Hyperion HP-LVX 1500 20C',       1500,   .011,      1.34,   3.7,     30],
['Hyperion HP-LVX 1800 20C',       1800,   .0093,     1.5,    3.7,     36],
['Hyperion HP-LVX 2000 20C',       2000,   .0084,     1.64,   3.7,     40],
['Hyperion HP-LVX 2100 20C',       2100,   .008,      1.88,   3.7,     42],
['Hyperion HP-LCL 2100 16C',       2100,   .012,      1.43,   3.7,     34],
['Hyperion HP-LVX 2200 20C',       2200,   .0076,     1.98,   3.7,     44],
['Hyperion HP-LVX 2500 20C',       2500,   .0067,     2.17,   3.7,     50],
['Hyperion HP-LVX 3300 20C',       3300,   .0005,     2.89,   3.7,     66],
['Hyperion HP-LVX 3700 20C',       3700,   .0045,     3.16,   3.7,     74],
['Hyperion HP-LVX 4350 20C',       4350,   .0038,     3.69,   3.7,     87],
['Hyperion HP-LCL 4000 20C',       2100,   .0064,    3.65,    3.7,     80],
['Hyperion HP-LCL 4200 16C',       4200,   .0061,    3.2,     3.7,     67],
['Hyperion HP-LCL 4800 20C',       4800,   .0053,    4.32,    3.7,     96],
['Hyperion HP-LVX 5000 20C',       5000,   .0033,    4.3,     3.7,    100],
['Kokam 145 8C',		    145,   .019,     .12,     3.7,    1.2],
['Kokam 340',                       340,   .02,      .36,     3.7,	0],
['Kokam 360SHD 20C',                360,   .0688,    .39,     3.7,    7.2],
['Kokam 630',                       630,   .04,      .58,     3.7,	0],
['Kokam 640SHD 15C',                640,   .044,     .6,      3.7,    9.6],
['Kokam 730SHD 20C',                730,   .0257,    .74,     3.7,     15],
['Kokam 910SHD 15C',                920,   .0275,    .81,     3.7,     14],
['Kokam 1020',                     1020,   .06,      .72,     3.7,	0],
['Kokam 1100 5C',		   1100,   .02,      11.1,    3.7,    5.5],
['Kokam 1200 2C',		   1200,   .06,      .82,     3.7,    4.2],
['Kokam 1250 15C', 		   1250,   .012,     1.16,    3.7,     19],
['Kokam 1250 20C',		   1250,   .027,     1.26,    3.7,     25],
['Kokam 1500',		           1500,   .027,     1.15,    3.7,	0],
['Kokam 1500 10C',		   1500,   .017,     1.15,    3.7,     15],
['Kokam 1500 2S',                  1500,   .015,     1.24,    3.7,	0],
['Kokam 1500 8/16C',               1500,   .019,     1.15,    3.7,     24],
['Kokam 2000 10C',		   2000,   .017,     1.62,    3.7,     20],
['Kokam 2000 15/30C',              2000,   .012,     1.79,    3.7,     60],
['Kokam 2000SHD 15C',              2000,   .0178,    1.84,    3.7,     30],
['Kokam 2100 20/40C',		   2100,   .01,      2.41,    3.7,     84],
['Kokam 2100SHD 20C',              2100,   .0114,    2.37,    3.7,     42],
['Kokam 3100 5C',		   3100,   .02,      3.03,    3.7,     16],
['Kokam 3200 20C', 		   3200,   .01,      2.91,    3.7,     64],
['Kokam 3200SHD 20C',	           3200,   .008,     2.83,    3.7,     64],
['Kokam 3200H5 25C',	           3200,   .004,     3.14,    3.7,     80],
['Kokam 4000H 20C',	           4000,   .0025,    3.67,    3.7,     80],
['Kokam 4000H5 20/25C',	           4000,   .0025,    3.67,    3.7,    100],
['Kokam 4800H 15C',	           4000,   .0034,    4.06,    3.7,     75],
['Kokam 5000H 25C',	           5000,   .0025,    4.59,    3.7,    125],
['Lipoly.de 1800',                 1800,   .0183,    1.45,    3.7,	0],
['LiteStorm  350CL 20/30C',	    350,   .028,     .46,     3.7,   10.5],  
['LiteStorm  950CL 20/30C',	    950,   .0145,    .917,    3.7,     29],
['LiteStorm 1200VX 20/25C',	   1200,   .015,     1.165,   3.7,     30],
['LiteStorm 1600CL 20/30C',	   1600,   .0113,    1.305,   3.7,     48],
['LiteStorm 2100CL 16/22C',	   2100,   .01,	     1.587,   3.7,     46],
['LiteStorm 2100VX 20/25C',	   2100,   .01,	     1.975,   3.7,     53],
['LiteStorm 2200VX 20/25C',	   2200,   .009,     2.045,   3.7,     55],
['LiteStorm 2500CL 20/30C',	   2500,   .008,     2.221,   3.7,     75],
['LiteStorm 2500VX 20/25C',	   2500,   .007,     2.224,   3.7,     63],
['LiteStorm 3200CL 20/30C',	   3200,   .0075,    2.892,   3.7,     96],
['LiteStorm 4000CL 20/30C',	   4000,   .0045,    3.705,   3.7,    120],
['LiteStorm 4350VX 20/25C',	   4350,   .0042,    3.88,    3.7,    109],
['LiteStorm 4800CL 20/30C',	   4800,   .0042,    4.41,    3.7,    144],
['LiteStorm 5000VX 20/25C',	   5000,   .0032,    4.445,   3.7,    125],
['Panasonic 2000 NiMH',            1950,   .0055,    1.48,   1.25,	0],
['Panasonic 3000 NiMH',            2900,   .0055,    2.01,   1.25,	0],
['Panasonic 3000 Sq NiMH',         3300,   .0055,    2.43,   1.25,	0],
['Panasonic HHR150AA',             1500,   .02,      .92,    1.25,	0], 
['Panasonic HHR300SCU',            3000,   .004,     1.94,   1.25,	0],
['Poly-Quest 300',                  300,   .216,     .3,      3.7,	0],
['Poly-Quest 300XP 20C',            300,   .098,     .32,     3.7,	6],
['Poly-Quest 400XP 15C',            400,   .075,     .49,     3.7,	6],
['Poly-Quest 800XP 13C',            800,   .038,     .78,     3.7,     10],
['Poly-Quest 880',                  880,   .0813,    .64,     3.7,	0],
['Poly-Quest 1200XP 15C',          1200,   .018,     .99,     3.7,     18],
['Poly-Quest 1800',                1800,   .0287,    1.48,    3.7,	0],
['Poly-Quest 1800XP 15C',          1800,   .012,     1.45,    3.7,     27],
['Poly-Quest 2000XQ 20C',          2000,   .006,     1.87,    3.7,     40],
['Poly-Quest 2100XP 15C',          2100,   .012,     1.66,    3.7,     32],
['Poly-Quest 2150XP 15C',          2150,   .010,     1.84,    3.7,     32],
['Poly-Quest 2500XP 15C',          2500,   .0085,    2.12,    3.7,     38],
['Poly-Quest 2600',                2600,   .0221,    1.92,    3.7,	0],
['Poly-Quest 3200XQ 20C',          3200,   .004,     3.07,    3.7,     64],
['Poly-Quest 3300XP 15C',          3300,   .006,     2.68,    3.7,     50],
['Poly-Quest 3500',	           3500,   .0108,    2.86,    3.7,	0],
['Poly-Quest 3700XP 15C',          3700,   .0055,    3.0,     3.7,     56],
['Poly-Quest 3800Mn 15C',          3800,   .0041,    3.71,    3.7,     57],
['Poly-Quest 4400',                4400,   .0107,    3.15,    3.7,	0],
['Poly-Quest 4500XQ 20C',          4500,   .0035,    4.41,    3.7,     90],
['Poly-Quest 5000XP 15C',          5000,   .0026,    4.59,    3.7,     75],
['Poly-Quest 6000XP 15C',          6000,   .0024,    6.14,    3.7,     90],
['Radio Shack 700 NiMH',           750,    .03,      .46,    1.25,	0],
['Radio Shack 1420 NiMH',         1380,   .0235,    .85,     1.25,	0],
['Radio Shack 1800 NiMH',         1800,   .022,     .92,     1.25,	0],
['Saft 3000 NiMH',                2600,   .009,     2.05,    1.25,	0],
['Sanyo 50AAA',                     50,   .055,     .14,     1.25,	0],
['Sanyo 110AA',                    110,   .03,      .25,     1.25,	0],
['Sanyo 250AAA',                   250,   .024,     .39,     1.25,	0],
['Sanyo 270AA',                    270,   .015,     .49,     1.25,	0],
['Sanyo 500AR',                    500,   .009,     .67,     1.25,	0],
['Sanyo 600AA',                    600,   .012,     .81,     1.25,	0],
['Sanyo 600AE',                    600,   .01,      .63,     1.25,	0],
['Sanyo 700AR',                    700,   .007,     .99,     1.25,	0],
['Sanyo 720AAA NiMH',              720,   .04,      .44,     1.25,	0],
['Sanyo 800AR',                    800,   .006,     1.17,    1.25,	0],
['Sanyo 1000AE',                  1000,   .008,     1.09,    1.25,	0],
['Sanyo 1000AAU',                 1000,   .018,     .81,     1.25,	0],
['Sanyo 1000SCR',                 1000,   .0045,    1.48,    1.25,	0],
['Sanyo 1100AAE',                 1100,   .0135,    1.17,    1.25,	0],
['Sanyo 1100AE',                  1100,   .009,     .99,     1.25,	0],
['Sanyo 1100SCR',                 1100,   .0043,    1.52,    1.25,	0],
['Sanyo 1250SCR',                 1250,   .005,     1.5,     1.25,	0],
['Sanyo CP-1300SCR',      	  1300,   .0074,    1.16,    1.25,	0],
['Sanyo 1400AE',                  1400,   .0115,    1.09,    1.25,	0],
['Sanyo 1400SCR',                 1400,   .004,     1.86,    1.25,	0],
['Sanyo 1700SCR',                 1700,   .004,     1.89,    1.25,	0],
['Sanyo 1700SCRC',                1700,   .004,     1.91,    1.25,	0],
['Sanyo 1900SCR',                 1900,   .004,     1.96,    1.25,	0],
['Sanyo RC2000',                  2000,   .0035,    1.99,    1.25,	0],
['Sanyo 2000SCR',                 2000,   .004,     2.05,    1.25,	0],
['Sanyo 2200 NiMH',               2000,   .006,     1.4,     1.25,	0],
['Sanyo RC2400',                  2400,   .0032,    2.08,    1.25,	0],
['Sanyo CP-2400SCR',              2300,   .0053,    2.05,    1.25,	0],
['Sanyo 3000CR',                  3000,   .0032,    2.96,    1.25,	0],
['Sanyo RC3000 NiMH',             3000,   .0035,    2.08,    1.25,	0],
['Tadiran Lithium-Metal',          800,   .08,       .6,     1.25,	0],
['Tanic 350',                      350,   .070,      .42,     3.7,	0],
['Tanic 470',                      470,   .040,      .44,     3.7,	0],
['Tanic 520',                      520,   .018,      .39,     3.7,	0],
['Tanic 830',                      830,   .053,      .64,     3.7,	0],
['Tanic 780',                      780,   .022,      .71,     3.7,	0],
['Tanic 1050',                    1050,   .041,      .78,     3.7,	0],
['Tanic 1550',                    1550,   .0301,    1.17,     3.7,	0],
['Tanic 2150',                    2150,   .0228,    1.52,     3.7,	0],
['Tanic 2200',                    2200,   .012,     1.45,     3.7,	0],
['Tanic 2220',                    2220,   .0195,    1.52,     3.7,	0],
['Tanic 2450',                    2450,   .019,     1.7,      3.7,	0],
['Tanic 2500',                    2500,   .018,     1.84,     3.7,	0],
['Tanic 3650',                    3650,   .0055,    3.21,     3.7,	0],
['Tanic 5000',                    5000,   .0026,    4.59,     3.7,	0],
['ThunderPower 480 12/16C',	   480,   .03,      .387,     3.7,	8],
['ThunderPower 730 12/16C',	   730,   .0164,     .53,     3.7,     12],
['ThunderPower 900 12/16C',	   900,   .03,      .705,     3.7,     15],
['ThunderPower 1320 13/20C',	  1320,   .03,      .987,     3.7,     27],
['ThunderPower 2100 15/20C',	  2100,   .0086,   1.624,     3.7,     42],
['ThunderPower 2070SX 25/50C',	  2070,   .0084,    1.87,     3.7,    104],
['ThunderPower 3850SXL 22/50C',   3850,   .0032,    3.35,     3.7,    193],
['ThunderPower 5000SX 22/50C',	  5000,   .0026,   4.305,     3.7,    250]
];

var motorArray = [  //        Kv,       Rm,      Io,     Imax,   Wgt,    Ki,    Krpm,     Rk,   Vo,
['Above All 2813-18',         1200,     .075,	 1.2,	 25,	 1.94,	 1.55,   1.05,    60,  8.2],
['Align BL450S 1000Kv',       1000,     .23,	.45,	 14,	 1.7,	 1.55,    1.0,    30,   8],    	
['Align BL450S 1500Kv',	      1500,     .115,	.5,	 15,     1.7,    1.55,    1.0,    30,	8],
['ARC-20-27-80', 	      4500,     .1,	.57,      0,     1.03,   1.55,    1.1,	  60,	8],
['ARC-20-34-110',	      3100,     .12,     .46,     0,     1.38,   1.55,    1.1,	  60,	8],
['ARC-20-34-130',	      4600,     .05,     .87,     0,     1.38,   1.55,    1.1,	  60,	8],
['Astro C035 #603',	      2765,     .04,     2.5,     30,     6.0,   1.55,    1.1,	  60,	8],
['Astro C05 #605',	      2125,     .045,    2.5,     30,     7.5,   1.55,    1.1, 	  60,	8],
['Astro C15 #615',	      1488,     .069,    2,       25,     8.0,   1.55,    1.1,	  60,	8],
['Astro C25 #625',	       971,     .093,    2,       30,     11,    1.55,    1.1,	  60,	8],
['Astro C40 #640',	       682,     .121,    2,       30,     13,    1.55,    1.1,	  60,	8],
['Astro C60P #661',	       347,     .103,    2.5,     30,     22,    1.55,    1.1,	  60,	8],	     
['Aveox 1005/2Y',	      6173,     .018,    1.5,     0,      3.1,   1.45,   1.1,	  60,	8],
['Aveox 1005/3Y',             4115,     .041,    1,       0,      3.1,   1.45,   1.0,	  60,	8],
['Aveox 1005/4Y',	      3086,     .073,    .7,      0,      3.1,   1.45,   1.0, 	  60,	8],	
['Aveox 1005/5Y',	      2469,     .114,    .6,      0,      3.1,   1.55,   1.0,	  60,	8],
['Aveox 1010/1Y',             5955,     .006,    1.8,     0,      4.6,   1.40,    1.2,	  60,	8], 
['Aveox 1010/1.5Y',           3970,     .014,    1.2,     0,      4.5,   1.50,   1.05,	  60,	8],
['Aveox 1010/2Y',	      2978,     .024,    .9,      0,      4.6,   1.56,   1.0,	  60,	8],
['Aveox 1010/3Y',	      1985,     .054,    .6,      0,      4.6,   1.58,   1.06,	  60,	8],
['Aveox 1010/4Y',             1489,     .096,    .44,     0,      4.6,   1.43,   1.0,	  60,	8],
['Aveox 27/13/2',	      4686,     .018,    1.68,    30,     2.86,  1.47,   1.0,	  60,	8],
['Aveox 27/13/3',	      3124,     .041,    1.12,   30,      2.86,  1.55,   1.0,	  60,	8], 
['Aveox 27/13/4',	      2343,     .073,    .84,    23,      2.86,  1.55,   1.0,	  60,	8],
['Aveox 27/13/5',	      1874,     .114,    .67,    15,      2.86,  1.58,   1.0,	  60,	8],
['Aveox 27/26/1',	      4686,     .006,    3,      90,      4.34,  1.48,   1.0,	  60,	8],
['Aveox 27/26/1.5',	      3124,     .014,    2,      60,      4.34,  1.51,   1.3,	  60,	8],
['Aveox 27/26/2',             2343,     .024,    1.5,    45,      4.34,  1.57,   1.1,	  60,	8], 
['Aveox 27/26/3',	      1562,     .054,    1,      30,      4.34,  1.57,   1.1,	  60,	8],
['Aveox 27/26/4',	      1172,     .096,    .75,    23,      4.34,  1.55,   1.0,	  60,	8],
['Aveox 27/39/1',	      3124,     .007,    2.3,    90,      5.7,   1.55,   1.0,	  60,	8],
['Aveox 27/39/1.5',	      2083,     .016,    1.53,   60,      5.7,   1.55,   1.0,	  60,	8],
['Aveox 27/39/2',	      1562,     .028,    1.15,   45,      5.7,   1.55,   1.1,	  60,	8],
['Aveox 27/39/3',	      1041,     .063,    .77,    30,      5.7,   1.55,   1.0,	  60,	8],
['Aveox 27/39/4',	       781,     .112,    .58,    23,      5.7,   1.55,   1.0,	  60,	8],
['AXI 2204/54',		      1398,     .355,    .36,    6.5,     .86,   1.50,   1.15,	  35,	8],
['AXI 2208/20 Gold Line',     1830,     .090,    1.0,    16,      1.59,  1.55,   1.04,	  80,	8],
['AXI 2208/26 Gold Line',     1426,     .160,    .62,    11,      1.59,  1.60,   1.0,	  80,	8],
['AXI 2208/34 Gold Line',     1089,     .27,     .4,     8,       1.59,  1.55,   1.05,	  60,	8],
['AXI 2212/20 Gold Line',     1150,     .140,    .7,     16,      2.01,  1.58,   1.0,	  60,	8],
['AXI 2212/26 Gold Line',      944,     .210,    .45,    12,      2.01,  1.58,   1.0,	  85,	8],
['AXI 2212/34 Gold Line',      691,     .32,     .31,    10,      2.01,  1.55,   1.0,	  60,	8],
['AXI 2808/16 Gold Line',     1864,     .074,    1.68,   25,      2.68,  1.55,   1.1,	  10,	9],  
['AXI 2808/20 Gold Line',     1493,     .089,    1.1,    25,      2.75,  1.54,   1.17,	  13,	9],
['AXI 2808/24 Gold Line',     1225,     .115,    1.1,    25,      2.75,  1.54,   1.1,	  55,	8],
['AXI 2814/10 Gold Line',     1720,     .037,    2.3,    40,      3.74,  1.52,   1.1,	  60,	8],
['AXI 2814/12 Gold Line',     1439,     .053,    1.8,    35,      3.74,  1.54,   1.05,	  58,	8],
['AXI 2820/10 Gold Line',     1152,     .039,    2.5,    42,      5.33,  1.42,   1.1,	  50,	8],
['AXI 2820/12 Gold Line',      990,     .042,    1.7,    37,      5.33,  1.50,   1.15,	  60,	8],
['AXI 2826/10 Gold Line',      924,     .053,    1.8,    42,      6.39,  1.55,   1.15,	  50,	8], 
['AXI 2826/12 Gold Line',      745,     .056,    1.25,   37,      6.39,  1.53,   1.1,	  60,	8],//
['AXI 2826/14 Gold Line',      640,     .080,    1.44,   37,      6.39,  1.50,   1.0,	  60,  15],

['E-flite 400-37',	      3700, 	.160,	 0.8,	 15,	  2.4,   1.56,   1.1,     30,   8],
['E-Flite 480 BL 1020',	      1020, 	.070,	 1.1,	 22,	  3.07,  1.56,   1.1,     30,   8],
['E-flite Power 10 BL',	      1100, 	.063,	 2.1,	 30,	  4.31,  1.50,   1.1,     40,  10],
['E-flite Power 15 BL',	       950, 	.035,	 2.0,	 34,	  5.37,  1.53,   1.05,    40,  10],
['E-flite Power 32 BL',	       867, 	.057,	 2.4,	 60,	  7.06,  1.30,   1.05,    40,  10],
['E-flite Power 46 BL',	       705, 	.032,	 5.0,	 55,	 10.59,  1.30,   1.1,     40,  15],
['Electrifly RimFire 28-22-1380',1380,  .370,    .4,      9,      .96,   1.25,   1.0,	  30, 7.4],
['Electrifly RimFire 28-26-1000',1000,  .165,    .7,     12,      1.45,  1.25,   1.30,    30, 7.4],
['Electrifly RimFire 28-26-1300',1300,  .155,    .9,     15,      1.45,  1.38,   1.02,    19, 7.4],
['Electrifly RimFire 28-26-1600',1600,  .098,    1.0,    17,      1.45,  1.50,   1.02,    15, 7.4],
['Electrifly RimFire 28-30-750',  740,  .185,    .6,     10,      1.91,  1.25,   1.3,     13, 7.4],
['Electrifly RimFire 28-30-950',  940,  .098,    .7,     14,      1.91,  1.28,   1.35,    12, 7.4],
['Electrifly RimFire 28-30-1250',1250,  .120,    .9,     18,      1.91,  1.50,   1.1,     13, 7.4],
['Electrifly RimFire 28-30-1450',1450,  .065,    1.07,   23,      1.91,  1.55,   1.01,    13, 7.4],
['Electrifly RimFire 35-30-950',  940,  .065,    .8,     20,      2.51,  1.45,   1.35,    15,  11],
['Electrifly RimFire 35-30-1250',1250,  .115,    1.2,    30,      2.51,  1.40,   1.0,     15,  11],
['Electrifly RimFire 35-36-1000',1000,  .055,    1.4,    40,      3.6,   1.45,   1.0,     13,  11],
['Electrifly RimFire 35-36-1200',1200,  .047,    1.8,    45,      3.6,   1.48,   1.0,     13,  11],
['Electrifly RimFire 35-36-1500',1500,  .030,    2.6,    50,      3.6,   1.25,   1.0,     13,  11],
['Electrifly RimFire 35-48-700',  670,  .025,    1.4,    35,      6.0,   1.40,   1.4,     6, 14,8],

['Mini AC 1215/16',	      3800,     .086,    1.4,    18,      1.7,   1.55,   1.3,	  60,	8],
['Mini AC 1215/20',           3000,     .117,    1.1,    16,      1.73,  1.55,   1.4,	  60,	8],
['Mini AC Extreme',           6370,     .045,    3.9,    28,      2.72,  1.50,   1.0,	  60,	8],
['MP Jet AC 25/35-20',        3850,     .1,      1.34,   25,      2.54,  1.55,   1.0,	  60,	8],                    
['Goldberg Turbo 550',        2528,     .085,    2,      60,      7.8,   1.55,   1.0,	  60,	8],
['Graupner Sp280 6V',         2320,     1.12,    .28,    8,       1.5,   1.50,    1.1,	  50,	6],
['Graupner Sp300 6V',         4833,     .214,    .7,     12,      1.8,   1.55,    1.1,	  50,	8],  
['Graupner Sp400 6V',         3000,     .303,    .7,     12,      2.6,   1.55,    1.15,	  15,	6],
['Graupner Sp400 7.2V',       2277,     .450,    .5,     18,      2.6,   1.55,    1.15,   28, 7.2],
['Graupner Sp480 7.2V',       2350,     .298,    1.1,    20,      3.7,   1.40,    1.16,	  32, 7.2],
['Graupner Sp480 Race 7.2V',  2936,     .155,    2.0,    20,      3.7,   1.53,    1.05,	  18, 7.2],
['Graupner Sp500 Race 7.2V',  2985,     .105,    2.5,    20,      5.7,   1.55,    1.05,	  18, 7.2],
['Graupner Sp600 7.2V',       2437,     .112,    2.0,    25,      6.9,   1.53,    1.06,	  15, 7.2],
['Graupner Sp600 8.4V',       1780,     .150,    1.8,    25,      7.8,   1.55,    1.05,	  25, 8.4],
['Graupner Sp600 9.6V',       1470,     .201,    1.0,    30,      6.9,   1.52,    1.08,	  40, 9.6],
['Graupner Sp700 Race 9.6V',  1875,     .120,    3.0,    25,      11.5,  1.55,    1.08,	  60, 9.6],// 
['G. P. Goldfire',            2441,     .094,    2,      25,      7.6,   1.55,    1.0,	  60,	8], 
['G. P. Thrustmaster',        2168,     .18,     1.5,    25,      7.6,   1.55,    1.0,	  60,	8],

['Hacker A20-12XL',           1050,     .050,    1.5,    20,      2.97,  1.55,    1.15,	  26, 7.3],
['Hacker A20-20L',            1057,     .142,    .92,    19,      2.01,  1.52,    1.1,	  30,10.6],
['Hacker A20-22L',             920,     .158,    .8,     17,      2.01,  1.48,    1.04,	  26,	8],
['Hacker A20-26M',            1130,     .160,    .8,     15,      1.48,  1.52,    1.15,	  26,	8],
['Hacker A30-10L',            1100,     .030,    2.3,    40,      5.08,  1.52,    1.15,   26,8.75],
['Hacker A30-10XL',            860,     .040,    1.78,   42,      6.25,  1.52,    1.15,   26,10.2],
['Hacker A50-12L',             350,     .036,    2.3,    70,     18.0,   1.55,    1.05,   60, 8.4],
['Hacker A50-12S',             492,     .027,    3.2,    55,     13.94,  1.55,    1.05,   60, 8.4],
['Hacker A50-14L',             302,     .032,    2.0,    70,     18.0,   1.55,    1.05,   20, 8.4],
['Hacker A50-14S',             425,     .035,    2.3,    55,     13.94,  1.55,    1.05,   20, 8.4],
['Hacker A50-16S',             380,     .052,    2.2,    70,     13.94,  1.55,    1.05,   20, 8.4],
['Hacker B20-12L',            4600,     .053,    1.1,    20,      1.8,   1.52,    1.05,	  26,	8],
['Hacker B20-15L',            3700,     .085,    .7,     15,      1.8,   1.52,    1.1,	  26,	8],
['Hacker B20-18L',            3065,     .125,    .4,     12,      1.8,   1.52,    1.1,	  26,	8],
['Hacker B40-16S',            2663,     .0379,   .83,    20,      4.6,   1.53,    1.1,	  60,	8],

['Himax HC2808-0860',          860,     .255,    .36,    11,      1.83,  1.55,    1.05,   60,	8], 
['Himax HC2808-0980',          980,     .22,     .4,     12,      1.83,  1.50,    1.09,	  60,	8],   
['Himax HC2808-1160',         1160,     .15,     .6,     15,      1.83,  1.55,    1.05,	  60,	8],
['Himax HC2812-0650',          650,     .285,    .36,    11,      2.26,  1.55,    1.05,	  60,	8],
['Himax HC2812-0850',          850,     .169,    .6,     14,      2.26,  1.55,    1.05,	  60,	8],
['Himax HC2812-1080',         1080,     .111,    .75,    15,      2.26,  1.55,    1.05,	  60,	8],
['Himax HC2816-0890',          890,     .119,    .8,     18,      2.72,  1.55,    1.05,	  60,	8],
['Himax HC2816-1220',         1200,     .071,    1.4,    25,      2.72,  1.55,    1.1,	  30,  10],//
['Himax HC3510-1100',         1100,     .055,    1.2,    30,      3.14,  1.55,    1.05,	  60,	8],
['Himax HC3510-1540',         1540,     .029,    1.8,    42,      3.14,  1.55,    1.05,	  60,	8],
['Himax HC3516-0840',         0840,     .051,    1.5,    37,      4.73,  1.55,    1.05,	  60,	8],
['Himax HC3516-1130',         1130,     .03,     1.8,    48,      4.73,  1.55,    1.05,	  60,	8],
['Himax HC3516-1350',         1350,     .023,    2.3,    56,      4.73,  1.55,    1.05,	  60,	8],
['Himax HC3522-0700',          700,     .049,    1.3,    40,      5.71,  1.53,    1.05,	  60,	8],       
['Himax HC3522-0990',          990,     .027,    2.2,    54,      5.71,  1.53,    1.05,	  60,	8],
['Himax HC3528-0800',          800,     .031,    1.7,    54,      6.95,  1.30,    1.0,	  60,	8],    
['Himax HC3528-1000',         1000,     .02,     2.6,    68,      6.95,  1.50,    1.05,	  60,	8],
['Hyperion Z-2205-34',        1500,     .34,     .5,      8,      1.04,  1.52,    1.0,	  60,	8],
['Hyperion Z-2205-38',        1300,     .42,     .38,     7,      1.04,  1.59,    1.0,	  40,	8],  
['Hyperion Z-2209-26',        1100,     .170,    .65,    11,      1.47,  1.57,    1.0,	  38,	8],
['Hyperion Z-2209-32',         900,     .240,    .55,    10,      1.47,  1.52,    1.05,	  32,	8],
['Hyperion Z-2213-20',        1010,     .150,    .65,    14,      1.87,  1.58,    1.0,	  32,	8],
['Hyperion Z-2213-24',         850,     .175,    .60,    12,      1.87,  1.56,    1.0,	  28,	8],
['Hyperion Z-3007-26',        1228,     .085,    1.11,   28,      2.65,  1.50,    1.05,	  16,	8],
['Hyperion Z-3007-30',        1033,     .095,    1.2,    25,      2.65,  1.50,    1.02,	  16,	8],
['Hyperion Z-3013-14',        1080,     .048,    2.5,    40,      3.88,  1.50,    1.0,	  23,	8],    
['Hyperion Z-3013-16',         985,     .059,    2.0,    36,      3.88,  1.50,    1.05,	  18,	8],
['Hyperion Z-3019-10',        1230,     .031,    2.42,   46,      5.01,  1.51,    1.02,	 5.3,	8],
['Hyperion Z-3019-12',         900,     .034,    2.35,   42,      5.01,  1.55,    1.05,	 5.3,	8],
['Hyperion Z-3025-08',         985,     .036,    4.8,    65,      6.56,  1.50,    1.05,	   5,  10],//
['Hyperion Z-3025-10',         815,     .025,    2.3,    46,      6.56,  1.55,    1.0,	  60,	8],
['Jeti Phasor 15-3',          2300,     .025,    2.5,    35,      4.8,   1.50,    1.3,	  60,	8],
['Jeti Phasor 15-4',          1800,     .042,    1.9,    32,      4.8,   1.50,    1.2,	  60,	8],
['Jeti Phasor 30-3',          1200,     .034,    2.8,    35,      4.8,   1.50,    1.2,	  60,	8],

['KDA20-34S',                 1850,     .330,    .72,     9,      1.06,  1.50,    1.05,	  20,  11],
['KDA2217/20',                 875,     .195,    1.0,    22,      2.51,  1.50,    1.0,	  20,12.4],
['KDA KB2835-35',             2350,     .190,    1.0,    20,      3.21,  1.50,    1.05,	  20,   7],

['Kontronik FUN400-23',       2300,     .058,    .5,     30,      3.88,  1.55,    1.0,	  60,	8],
['Kontronik FUN400-42',       4000,     .017,    2.0,    50,      3.88,  1.40,    1.1,	  40,   7],
['Kyosho AP-29L',             4099,     .0907,   3.5,    30,      5.5,   1.55,    1.05,	  60,	8],
['Kyosho AP-29L meas',        3914,     .034,    3.8,    35,      5,     1.55,    1.05,	  60,	8],
['Kyosho Atomic Force',       3531,     .035,    2.94,   30,      6.3,   1.55,    1.05,	  60,	8], 
['Kyosho EndoPlasma',         3785,     .022,    2.5,    30,      6.3,   1.55,    1.05,	  60,	8],
['Kyosho LeMans 480 Gold',    2500,     .076,    1.1,    30,      6.25,  1.55,    1.05,	  60,	8],
['Kyosho LeMans DMC20BB',     4939,     .054,    .54,    30,      6.3,   1.55,    1.05,	  60,	8],
['Kyosho Magnetic Mayhem',    2260,     .0667,   1.37,   30,       8,    1.55,    1.05,	  60,	8],  
['MEC Turbo 10 GT',           3400,     .038,    2.3,    35,       10,   1.55,    1.05,	  60,	8],
['MEC Turbo 10 Plus',         4850,     .025,    3.4,    35,       11,   1.55,    1.05,	  60,	8],      
['Multiplex Permax BL-X22-13',1350,    .280,    .45,    12,      1.13,   1.46,    1.05,	  60,  10],
['Multiplex Permax BL-X22-18',1790,    .195,    .75,    15,      1.13,   1.44,    1.05,	  60,  10],
['Multiplex Permax BL-X22-23',2300,    .080,    .85,    18,      1.13,   1.42,    1.05,	  60,  10],
['Multiplex Permax 280 7.2V', 2417,     .553,     .3,   4.5,       1.6,  1.55,    1.0,	  60, 7.2],
['Multiplex Permax 280 BB',   4464,     .429,     .7,     8,       1.9,  1.50,    1.0,	  60,	8],
['Multiplex Permax 400 6V',   2946,     .357,    .73,     7,       2.6,  1.55,    .98,	  60,	6],
['Multiplex Permax 400 7.2V', 2268,     .473,    .70,     8,       2.6,  1.55,    .98,	  60, 7.2],
['Multiplex Permax 450 Turbo',2189,     .138,    1.2,    25,       4.9,  1.55,    1.05,	  60,	8],
['Multiplex Permax 480 7.2V', 2459,     .312,    .92,    12,       3.3,  1.50,    1.02,	  60, 7.2],
['Medusa MR-012-030-4000',    3940,     .386,     .3,     6,       .53,  1.53,    1.05,	  50,	8],//
['Medusa MR-012-030-5300',    5230,     .228,     .43,    7,       .53,  1.53,    1.01,	  50,	8],//
['Medusa MR-028-032-1200',    1200,     .185,     .35,   15,      2.47,  1.48,    1.05,	  40,	8],//
['Medusa MR-028-032-1500',    1490,     .118,    .5,     19,      2.47,  1.50,    1.02,   30,	8],// 
['Medusa MR-028-032-1900',    1890,     .085,    .65,    23,      2.47,  1.48,    1.03,	  40,	8],//
['Medusa MR-028-032-2400',    2390,     .050,    .85,    28,      2.47,  1.53,    1.0,	  30,	8],//
['Medusa MR-028-032-2800',    2790,     .040,     1.0,   30,      2.47,  1.52,    1.05,	  30,	8],//
['Mega ACn 16-15-4',          2300,     .045,     1.1,   20,      2.7,   1.87,    1.0,	  50,	8],//    
['Mega ACn 16-15-5',          1800,     .060,    .80,    20,      2.7,   1.80,    1.0,	  50,	8],//
['Mega ACn 16-15-6',          1500,     .112,    .79,    18,      2.7,   1.80,    1.0,	  50,  12],//
['Mega ACn 16-15-8',          1230,     .176,    .33,    15,      2.7,   1.78,    1.0,	  50, 8.2],//
['Mega ACn 22-20-4',          1550,     .055,    1.8,    50,      5.82,  1.70,    1.0,	  50,  14],//
['Mega ACn 22-30-3',          1300,     .042,    1.11,   70,      7.79,  1.80,    1.0,	  50, 8.6],//
['PJS 550 E',                  802,     .1,      1.0,    0,       1.9,   1.35,    1.1,	  60,	8],
['PJS 550 R',                 1225,     .22,    1.5,     0,       1.9,   1.45,    1.1,	  60,	8],
['Plettenberg Freestyle 20',  1461,     .149,   .93,     0,       2.65,  1.35,    1.1,	  60,	8],
['Plettenberg Freestyle 24',  1183,     .240,   .82,     0,       2.65,  1.45,    1.05,	  60,	8],
['Plettenberg Freestyle XL',   942,     .095,   1.05,    0,       5,     1.55,    1.05,	  60,	8],
['Plettenberg Orbit 10-22',   1080,     .064,   1.8,    35,       4.77,  1.30,    1.1,	  60,  11],
['Plettenberg Orbit 15-14',   1100,     .035,   2.5,    55,       6.18,  1.35,    1.1,	  60,  11], 
['Plettenberg Orbit 20-14',    810,     .040,   1.8,     0,       7.59,  1.53,    1.06,	  50,10.5],
['Plettenberg Typhoon 6-20',  1600,     .133,   .7,     12,       1.52,  1.41,    1.2,	  60,	8],
['Scorpion 2208-34',  	      1206,     .290,   .42,    15,       1.41,  1.30,    1.1,	  30,   7],
['Scorpion 2212-26',  	       994,     .230,   .51,    15,       1.79,  1.40,    1.0,	  30,   7],
['Scorpion 2215-22',  	       987,     .195,   .64,    18,       2.16,  1.40,    1.02,	  30,   7],//
['Scorpion 3008-28',  	      1253,     .072,   1.38,   38,       3.03,  1.31,    1.32,	  60,   9],
['Scorpion 3008-32',  	      1080,     .098,   1.0,    33,       3.07,  1.30,    1.4,	  60,   9],
['Scorpion 3014-16',  	      1180,     .038,   2.23,   57,       4.33,  1.38,    1.4,	  60,   9],
['Scorpion 3014-18',  	      1064,     .043,   1.53,   52,       4.33,  1.38,    1.0,	  60,10.5],
['Scorpion 3020-12',  	      1088,     .030,   2.24,   76,       5.36,  1.30,    1.4,	  60,   9],
['Scorpion 3020-14',  	       931,     .045,   1.85,   71,       5.18,  1.25,    1.2,	  60,  10],
['Scorpion 3026-8',  	      1212,     .020,   3.45,   95,       6.68,  1.30,    1.3,	  60,  10],
['Scorpion 3026-10',  	       980,     .025,   2.64,   90,       6.72,  1.25,    1.3,	  60,  10],
['Scorpion 3026-12',  	       840,     .034,   2.22,   85,       6.68,  1.28,    1.2,	  60,  10],

['TowerPro TP2409_12D',       1600,     .071,   1.4,    25,       2.23,  1.50,    1.05,	  60,   8],
['Turnigy C3542-1450 14p',    1400,     .044,   1.85,   55,       4.73,  1.45,    1.0,    30, 7.1],
['Turnigy 2213-20',            920,     .280,    .75,   19,       2.08,  1.45,    1.05,   40,  12],
['Turnigy 2217-16',           1120,     .133,   1.15,   23,       2.51,  1.45,    1.0,    40,11.5],
['Turnigy 2217-20',            940,     .190,    .94,   22,       2.51,  1.45,    1.0,    40, 12.4],
['Turnigy 2826-1650',         1570,     .163,    1.3,   16,       1.59,  1.47,    1.05,   40,  11],
['Turnigy 2830-800',           960,     .245,    .86,   14,       2.01,  1.50,    1.05,    8,  12],
['Turnigy 42-60 600',          620,     .085,    6.0,   50,       9.81,  1.55,    1.05,    8,  15],
['Turnigy 50-45 890',          900,     .060,    2.0,   55,       9.18,  1.55,    1.0,     8,   5],
['Turnigy 50-55A 400',         500,     .110,    2.7,   68,      10.59,  1.50,    1.05,    8,  16],
['Turnigy 50-55B 600',         550,     .045,    5.0,   80,      10.59,  1.45,    1.05,    8,18.5],
['Turnigy 80-100-A 180',       180,     .050,    3.5,  150,      55.41,  1.50,    1.07,    7,  20],

['Uberall Nippy 0508/73',      720,     .422,   .45,     5,       1.34,  1.30,   1.3,	  50,	8],// 
['Uberall Nippy 0808/98',      970,     .255,   .7,      8,       1.4,   1.30,   1.4,	  50,	8],//
['Uberall Nippy 1208/180',    1700,     .195,   .5,      0,       2.4,   1.30,   1.4,	  50,	8],
['Uberall Nippy 1812/100',    1020,     .064,   1.5,     0,       2.2,   1.40,   1.4,	  50,	8],  
['Uberall Nippy 2510/114',    1140,     .079,   2.0,     0,       2.2,   1.50,   1.0,	  50,	8]
];


var EscArray = [  //             Res,         Imax,              Wgt,
['Airtronics 96334',		.0025,		20,		  .5],	
['Astro 204',                   .005,       	50,        	 1.1],
['Astro 204D',      		.002,	    	60,       	1.06],
['Astro 210',			.003,		45,		 .74],
['Astro 211',			.002,		75,		 .89],
['Astro 215',			.003,		30,		 .32],
['Astro 217',			.005,		30,		 .53],
['Astro 217D',			.003,		35,		 .53],
['Astro 800',			.02,		15,		 .70], 
['Astro 801',			.01,		25,		 .80], 
['Astro 805',			.012,		30,		 .75], 
['Aveox A-15',			.0036,		15,		 .20],
['Aveox A-55',			.0018,		55,		 .30],
['Aveox EZ30',			.014,		30,		 1.6],	 
['Aveox H160',			.007,		60,		 2.0], 
['Aveox H160C/CM',		.0057,		70,		 2.0], 
['Aveox H260', 			.007,		60,		 2.0],
['Aveox H260C/CM',		.0057,		70,		 2.0], 
['Aveox H360C/CM',		.004,		90,		 2.0],	 
['Aveox L130', 			.0014,		35,		 1.6],
['Aveox L160',			.007,		60,		 2.0], 
['Aveox L160C/CM', 		.004,		70,		 2.0],
['Aveox L260', 			.007,		60,		 2.0],
['Aveox L260C/CM',		.004,		70,		 2.0], 
['Aveox L360C/CM', 		.004,		90,		 4.0],
['Aveox M160',			.007,		60,		 2.0],	 
['Aveox M160C/CM',		.004,		70,		 2.0],	 
['Aveox SH-24', 		.0028,		25,		 1.7],	
['Aveox SH-48',			.0028,		40,		 1.7],	 
['Aveox SH-48 BEC', 		.0028,		45,		 1.7],
['C. Creations Dragon 35',	.0055,		35,		  .8],		 
['C. Creations Dragon 55',	.0023,		55,		 1.2], 
['C. Creations Griffin 40',	.0012,		40,		  .9],
['C. Creations Griffin 50',	.0011,		50,		 .75],	
['C. Creations Griffin 55',	.001,		55,		 1.0],
['C. Creations Pegasus 35',	.0015,		35,		 .75],	
['C. Creations Phoenix 10', 	.0013,		10,		 .21], 
['C. Creations Phoenix 25',	.0065,		25,		 .37], 
['C. Creations Phoenix 35',     .0045,		35,		  .9],
['C. Creations Phoenix 45',	.0026,		45,		 1.0], 
['C. Creations Phoenix 60',	.0012,		60,		 2.0], 
['C. Creations Phoenix 80', 	.001,		80,		 2.1],
['C. Creations Phoenix 125', 	.0006,	       125,		 3.2],	
['C. Creations Pixie 14',	.0045,		14,		  .3],
['C. Creations Pixie 20P',	.0025,		20,		  .3],
['C. Creations Pixie 7',	.009,		 7,		 .11],	
['C. Creations Pixie 7P',	.007,		 7,		  .1],
['C. Creations Pixie Lite',	.0045,		14,	         .07],
['C. Creations Sprite 20',	.004,		20,		  .4],
['C. Creations Sprite 25',	.0025,		25,		  .5],
['C. Creations ThunderBird 18',	.0065,		18,		  .6],
['C. Creations ThunderBird 36',	.0049,		36,		 .71],
['C. Creations ThunderBird 54',	.0049,		54,		 1.2],
['Great Planes C05',		.011,		 5,		 .21],
['Great Planes C10',		.0055,		10,		 .27],
['Great Planes C20',		.0036,		20,		  .6],
['Great Planes C30',		.0028,		30,		  .7],
['Great Planes C50',		.0018,		50,		 1.2],
['G. Planes Electrifly BL-8',	.013,		 8,		 .42],
['G. Planes Electrifly BL-12',	.0075,		12,		 .42],
['G. Planes Electrifly SS-8',	.05,	         8,		 .39],
['G. Planes Electrifly SS-12',	.030,		12,		 .49],
['G. Planes Electrifly SS-25',	.015,		25,		 .92],
['G. Planes Electrifly SS-35',	.010,		35,		1.13],
['G. Planes Electrifly SS-45',	.008,		45,		1.76],
['Hacker 06-3P',		.012,		 6,		 .42],
['Hacker 18-3P',		.007,		18,		 .53], 
['Jeti 08-3P',			.0013,		 8,		 .55],
['Jeti 150',			.003,	       140,		 1.9],	
['Jeti eco',			.003,		18,		 .71],
['Jeti 30-3P',			.004,		30,		 1.0],
['Jeti Advance 70-3P Opto',	.003,		70,		1.34],
['Jeti JES 350',		.003,		35,		  .6],
['Jeti JES 020',		.003,		20,		 .53],
['Jeti JES 18-3P',		.003,		18,		 .53],
['Jeti 77 Opti',		.001,		77,		 2.0],
['Jomar Mini-Max',		.014,		30,		 1.2],
['Jomar Sport-Max',		.009,		40,		 1.4],
['Kontronik 3SL 70-6-18',	.004,		70,		1.24],
['Kontronik Beat 40-6-12',	.0056,		40,		1.17],
['Kontronik Beat 55-6-18',	.0043,		55,		1.17],
['Kontronik Beat 70-6-12',	.0021,		70,		 1.3],
['Kontronik Beat 80-6-18',	.0021,		80,		1.32],
['Kontronik Smile 40-6-12',	.0056,		40,		 1.3],	
['Master 70 B Flight',		.001,	       105,		1.41],
['MaxCim Maxu35A-21',		.015,		60,		 3.0],
['MaxCim Maxu35A-25NB',		.013,		65,		 3.0],
['MaxCim Maxu35C-21',		.009,		65,		 3.0],
['MaxCim Maxu35C-25NB',		.012,		65,		 3.0],
['Medusa Fusion ESC-2430BB',	.0013,		30,		1.48],	
['Medusa Fusion ESC-2440BB',	.001,		40,		1.63],
['Medusa Fusion ESC-2450BB',	.0008,		50,		1.66],
['Medusa Spectrum ESC-1210BB',	.004,		10,		 .39],
['Medusa Spectrum ESC-1218BB',	.002,		10,		 .64],
['Medusa Spectrum ESC-1230BB',	.0013,		30,		 .99],
['Medusa Spectrum ESC-1240BB',  .001,		40,		1.17],
['Medusa Spectrum ESC-1250BB',  .0008,		50,		1.24],
['MGM ComPro 2512-3',		.0039,		25,		 .71],
['MGM 1210',			.0126,		12,		 .39],
['MGM 4012',			.0026,		40,		1.17],
['Microdrive M10P',		.014,		10,		 .71],	
['Microdrive M20P',		.0035,		20,		 .71],
['Microdrive M30P',		.0018,		40,		1.24],
['NES-050',			.025,		 4,		 .14],
['NES-110',			.02,		11,		 .57],
['NES-140-compact',		.02,		14,		 .57],	
['NES-180',			.009,		18,		  .6],
['NES-350',			.004,		35,		 .88],
['RipMax Xtra 05',		.011,		 5,		 .21],
['RipMax Xtra 12',		.0055,		12,		 .28],
['RipMax Xtra 22',		.0038,		22,		  .6],	
['RipMax Xtra 30',		.0028,		30,		 .74],		
['RipMax Xtra 40',		.0018,		40,		 1.2],
['RipMax Xtra 50',		.0014,		50,		1.34],
['RipMax Xtra 60',		.0011,		60,	        1.24],
['Schulze future-11.20e',	.008,		20,		 .62], 
['Schulze future-11.30e',	.007,		30,		 .72],
['Schulze future-11.40Ke',	.004,		40,		1.24], 
['Schulze future-11.40KWe', 	.004,		40,		1.31],
['Schulze future-12.36e', 	.007,		36,		1.45],
['Schulze future-12.46e', 	.0046,		46,		1.45],
['Schulze future-12.46We', 	.0046,		46,		1.48],
['Schulze future-12.97Fe', 	.0016,		97,		1.55],
['Schulze future-18.129F', 	.0004,	       129,		1.55],
['Schulze future-18.129FW',	.0008,	       129,		1.59],
['Schulze future-18.36', 	.007,		36,		1.17],
['Schulze future-18.46K',	.0046,		46,		1.45], 
['Schulze future-18.46WK',	.0046,		50,		1.66], 
['Schulze future-18.61',	.0026,		61,		1.27], 
['Schulze future-18.97F', 	.0016,		97,		1.55],
['Schulze future-18.97FW',	.0016,		97,		1.59],
['Schulze future-18.97KFW', 	.0016,		97,		2.58],
['Schulze future-24.40K', 	.006,		40,		1.45],
['Schulze future-24.89F', 	.001,		89,		1.55],
['Schulze future-32.170W', 	.0018,	       170,		6.89],
['Schulze future-32.28K', 	.016,		28,		1.45],
['Schulze future-32.40K',	.0074,		40,		1.45], 
['Schulze future-32.55', 	.0054,		55,		1.70],
['Schulze future-32.55WK',	.0054,		62,		2.12], 
['Schulze future-32.80F', 	.0024,		80,		1.55],
['Schulze future-32.80FWK',	.0024,		95,		2.23], 
['Schulze future-40.70', 	.0036,		70,		1.80],
['Schulze future-40.70WK', 	.0036,		83,		2.51],
['Schulze future-9.06ek', 	.033,		 6,		 .21],
['Schulze future-9.12ek',	.015,		12,		 .21], 
['Schulze future-25b',		.005,		25,		  .6], 
['Schulze future-45be',		.0022,		45,		1.48], 
['Schulze mcf31-47be',		.0033,		47,		 .74],
['Schulze mcf31-47bo',		.0033,		47,		 .74],
['Schulze mcf31-52bo',		.0027,		52,		 .74],
['Schulze mcf43-110bo',		.002,	       110,		1.17],
['Schulze mcf43-70be',		.0025,		70,		1.17],
['Schulze mcf43-75bo',		.002,		75,		1.17],
['Schulze smart-47bo',		.0033,		47,		 .74],
['Schulze smart-52bo',		.0027,		47,		 .74],
['Schulze smart-70be',		.0025,		70,		1.17],
['Schulze smart-75be',		.002,		75,		1.17],
['Stefan 1-Fet BEC',		.01,		12,		  .9],
['Stefan 4-Fet BEC Brake',  	.0025,		48,		1.20],
['Stefan 4-Fet Brake',		.007,		40,		 1.0],
['Stefan Light 1-Fet BEC',	.01,		12,		  .6],
['TMM 40',			.0025,		40,		1.55]
];


var propArray = [  //   	Tconst, Pconst,	Diam, Pich,
['Aeronaut 6x5 fixed E-prop',	.90,	.70,	6,	5],
['Aeronaut 6.5x4 fixed E-prop',	.84,	.68,	6.5,	4],
['Aeronaut 7x7 fixed E-prop',	.90,	.82,	7,	7],
['Aeronaut 8.5x5 fixed E-prop',	.66,	.53,	8.5,	5],
['Aeronaut 8.5x6 fixed E-prop',	.78,	.60,	8.5,	6],
['Aeronaut 8.5x7 fixed E-prop',	.89,	.70,	8.5,	7],
['Aeronaut 9x5 fixed E-prop',	1.1,	.98,	9,	5],
['Aeronaut 9.5x5 fixed E-prop',	.86,	.62,	9.5,	5],
['Aeronaut 9.5x6 fixed E-prop', .8,	.63,	9.5,	6],
['Aeronaut 9.5x7 fixed E-prop', .85,	.68,	9.5,	7],
['Aeronaut 10x6 fixed E-prop',	.78,	.62,	10,	6],
['Aeronaut 10x7 fixed E-prop',	.97,	.65,	10,	7],
['Aeronaut 10x8 fixed E-prop',	1.0,	.84,	10,	8],
['Aeronaut 12x7 C Fold 42',	.71,	.49,	12,	7],
['Aeronaut 13x6.5 C Fold 42',	.91,	.44,	13,   6.5],
['Aeronaut 13.5x7 C Fold 42',	.73,	.44,	13.5,   7],
['Aeronaut 14x7 C Fold 42',	.74,	.62,	14,     7],
['Aeronaut 8x5 CAM Fold 42',	.81,	.72,	8,	5],
['Aeronaut 9x5 CAM Fold 42',	.77,	.70,	9,	5],
['Aeronaut 9x7 CAM Fold 42',	.80,	.81,	9,	7],
['Aeronaut 9.5x5 CAM Fold 42',  .89,	.72,	9.5,	5],
['Aeronaut 10x6 CAM Fold 42',	.69,	.54,	10,	6],
['Aeronaut 11x6 CAM Fold 42',	.93,	.71,	11,	6],
['Aeronaut 11x7 CAM Fold 42',	.77,	.60,	11,	7],
['Aeronaut 11x8 CAM Fold 42',	.78,	.59,	11,	8],
['Aeronaut 12x8 CAM Fold 42',	.84,	.64,	12,	8],
['Aeronaut 12x9 CAM Fold 42',	.89,	.67,	12,	9],
['Aeronaut 13x8 CAM Fold 42',	.70,	.52,	13,	8],
['Aeronaut 13x11 CAM Fold 42',	.79,	.59,	13,    11],
['Aeronaut 14x8 CAM Fold 42',	.94,	.74,	14,     8],
['Align 5x3',			.67,	.54,	5,	3],
['Align 4.2x2',	       		1.15,	.94,	4.2,	2],
['APC E 4.1x4.1',      	        1.10,	.96,	4.1,  4.1],
['APC E 4.5x4.1',      	        1.09,	.94,	4.5,  4.1],
['APC E 4.7x4.2',		.95,	.81,	4.7,  4.2],
['APC E 4.75x4.75',		1.0,    .87,   4.75, 4.75],
['APC E 4.75x5.5',		1.05,   1.0,   4.75,  5.5],
['APC E 5x5',			.88,	.93,	5,	5],
['APC E 5.25x4.75',		.90,	.84,   5.25, 4.75],
['APC E 5.5x4.5',     		.87,	.85,   5.5,   4.5],
['APC E 6x4',			.88,	.73,	6,	4],
['APC E 6x5.5',			.98,	.84,	6,    5.5],
['APC E 7x5',	       		1.1,	.83,	7,	5],
['APC E 8x4',	       		1.02,	.85,	8,	4],//
['APC E 8x6',	       		1.1,   1.02,	8,	6],//
['APC E 8x8',	       		1.15,  1.11,	8,	8],//
['APC E 9x4.5',	       		1.01,	.78,	9,    4.5],//
['APC E 9x6',			 .98,	.75,	9,	6],//
['APC E 9x7.5',			1.08,	.95,	9,    7.5],//
['APC E 10x5',			.97,	.74,   10,      5],//
['APC E 10x7',          	.92,	.71,   10,	7],//
['APC E 11x5.5',		.92,	.72,   11,    5.5],
['APC E 11x7',	        	.88,	.69,   11,	7],//
['APC E 11x8',          	.86,    .81,   11,	8],//
['APC E 11x8.5',          	.90,    .72,   11,    8.5],//
['APC E 12x6',			.95,	.71,   12,	6],//
['APC E 12x8',    		.87,	.67,   12,	8],//
['APC E 12x12',    		.99,	.67,   12,     12],//
['APC E 13x4',         	       1.15,    .66,   13,   	4],//
['APC E 13x6',         	        .90,    .58,   13,   	6],//
['APC E 13x6.5',       		.92,    .67,   13,    6.5],//
['APC E 13x8',			.87, 	.59,   13,	8],//
['APC E 14x7',	        	.91,	.60,   14,	7],//
['APC E 14x10',			.88,	.63,   14,     10],//
['APC E 15x8',			.93,	.71,   15,      8],//
['APC E 16x8',		       1.08,	.69,   16,      8],
['APC E 17x8',		        .94,	.61,   17,      8],
['APC E 17x10',		        .80,	.64,   17,     10],
['APC E 18x8',		       1.08,	.71,   18,      8],
['APC E 20x10',		        .98,	.62,   20,     10],
['APC E 22x10',		        .94,	.56,   22,     10],
['APC Sport 10x6',		.80,	.71,   10,      6],//
['APC Sport 11x5',          	.98,	.68,   11,	5],//
['APC Sport 11x6',	        .88,	.72,   11,	6],//
['APC Sport 11x8',          	.90,    .79,   11,	8],//
['APC Sport 12x7',		.81,	.69,   12,	7],//
['APC Sport 13x7',       	.84,    .62,   13,      7],//
['APC Sport 15x8',      	.89,    .67,   15,      8],//
['APC Sport 16x8',      	.95,    .68,   16,      8],
['APC Sport 16x10',      	.80,    .65,   16,     10],
['APC Sport 16x12',      	.85,    .67,   16,     12],
['APC Sport 18x6',             1.12,    .65,   18,      6],
['APC SF 7x4',          	1.03,   .95,    7,      4],
['APC SF 7x5',          	1.07,   .95,    7,      5],
['APC SF 7x6',          	1.25,   .93,    7,	6],
['APC SF 8x3.8',        	1.3,	1.17,   8,    3.8],
['APC SF 8x6',          	1.53,	1.45,   8,	6],
['APC SF 9x3.8',        	1.3,	1.0,	9,    3.8],
['APC SF 9x4.7',        	1.1,    .85,    9,    4.7],
['APC SF 9x6',			1.5,	1.25,   9,      6],
['APC SF 10x3.8',		1.47,	1.17,  10,    3.8],
['APC SF 10x4.7',		1.4,	 .95,  10,    4.7],
['APC SF 10x7',         	1.45,   1.3,   10,      7],
['APC SF 11x4.7',       	1.4,     .95,  11,    4.7],
['APC SF 11x7',         	1.4,	1.07,  11,      7],
['APC SF 12x3.8',         	1.5,    1.18,  12,    3.8],
['APC SF 12x6',         	1.48,    1.2,  12,      6],
['Dymond-E 15x8',      	        .93,    .74,   15,      8],
['Graupner CAM Speed 4.7x4.7',	1.02,    1.1,  4.7,   4.7],
['Graupner Nylon 5x2',	         .22,    .88,    5,     2],
['Graupner CAM Speed 5.2x5.2',	 .96,	 .85,  5.2,   5.2],
['Graupner CAM Speed 5.5x4.3',	 .82,	 .83,  5.5,   4.3],
['Graupner Speed 5.5x5.5',	 .95,	 .83,  5.5,   5.5],
['Graupner Speed 6x5.5',	 .91,	 .72,    6,   5.5],
['Graupner Speed 6x6',	 	1.0,	 .74,    6,     6],
['Graupner Speed 6.5x6.5',       .82,    .71,  6.5,   6.5],
['Graupner Speed 7x7',	 	 .8,	 .7,     7,     7],
['Graupner CAM Folding 8x6',	 .83,	 .75,    8,     6],
['Graupner CAM Folding 9x6',	 .88,	 .75,    9,     6],
['Graupner CAM Folding 10x6',	 .77,	 .63,   10,     6],
['Graupner CAM Folding 11x6',	 .8,	 .65,   11,     6],
['Graupner CAM Folding 12x6',	 .81,	 .6,    12,     6],
['Graupner CAM Folding 13x7',	 .81,	 .58,   13,     7],
['Graupner CAM Folding 14x9.5',	 .85,	 .52,   14,   9.5],
['Graupner CAM Folding 16x10',	 .61,	 .53,   16,    10],
['Graupner Slim 8x4',		 .94,	 1.4,    8,     4],
['Graupner Slim 9x5',		 .82,	 .72,    9,     5],
['Graupner Slim 10x6',		 1.01,	 .9,    10,     6],
['Graupner Slim 10x8',	         1.11,	 .95,   10,     8],
['GWS 2.5x0.8',			 1.0,	 1.0,  2.5,   0.8],
['GWS 2.5x1.0',			 .89,	 1.1,  2.5,   1.0],
['GWS HD 3x2',			 1.15,	  1.5,   3,     2],
['GWS HD 3x3',			 1.4,	  1.7,   3,     3],
['GWS HD 4x2.5',	         .92,	  1.0,   4,   2.5],
['GWS HD 4x4',	                 1.23,	 1.0,    4,     4],
['GWS HD 4.5x3',	         .94,	 .82,  4.5,     3],
['GWS HD 4.5x4',	         1.16,	 .75,  4.5,     4],
['GWS HD 5x3',			 .81,	  .70,   5,     3],
['GWS HD 5x4.3',		 1.2,	  .85,   5,   4.3],
['GWS HD 6x3',			 .84,	  .65,   6,     3],
['GWS HD 7x3.5',	         .65,	  .44,   7,   3.5],
['GWS HD 8x4',			 .88,	  .62,   8,     4],
['GWS HD 9x5',			 .95,	  .66,   9,     5],
['GWS HD 10x6',			 .80,	  .57,  10,     6],
['GWS HD 11x7',		         .90,	  .60,  11,     7],
['GWS RS 6x5',			 1.29,	  .96,   6,     5],
['GWS RS 7x6',			 1.32,	  1.22,  7,     6],
['GWS RS 8x4.3',		 1.07,	   .76,  8,   4.3],
['GWS RS 8x6',			 1.06,	  1.04,  8,     6],
['GWS RS 9x4.7',		 1.21,	   .89,  9,   4.7],
['GWS RS 9x7',			 1.31,	   .96,  9,     7],
['GWS RS 10x4.7',		 1.38,	  1.1,  10,   4.7],
['Günter 4.9x4.3',		 1.33,	  1.2,  4.9,  4.3],
['Günter 5x4.3',		 1.31,	  .74,    5,  4.3],
['Günter 5.1x4.3',		 1.47,	  .96,  5.1,  4.3],
['Zagi Carbon 5.1x4.9',		 1.11,	  1.14, 5.1,  4.9]
];


function loadDropDown(formObj){
    
var typ = formObj.esctype;
   var i,a;
  
   for (i=0; i <EscArray.length; i++){
      a = EscArray[i];
      typ.options[i+1] = new Option(a[0],i+1,false,false);
   }

var typ = formObj.motornum;
 
   for (i=0; i <motorArray.length; i++){
      a = motorArray[i];
      typ.options[i+1] = new Option(a[0],i+1,false,false);
   }

var typ = formObj.celltype;
 
  for (i=0; i <cellArray.length; i++){
      a = cellArray[i];
      typ.options[i+1] = new Option(a[0],i+1,false,false);
   }

var typ = formObj.proptype;
   var i,a;
  
   for (i=0; i <propArray.length; i++){
      a = propArray[i];
      typ.options[i+1] = new Option(a[0],i+1,false,false);
   }
}

function motorcalcs(){

with (document.inputform){
if (par.value == 0) { par.value = 1 }
TheCellNum = GetSelectValue(celltype) - 1;
if (TheCellNum >= 0 ) {
TheCellRc = cellArray[TheCellNum][2];
TheCellCap = cellArray[TheCellNum][1];
TheCellWeight = cellArray[TheCellNum][3];
TheCellVe = cellArray[TheCellNum][4];
TheCellMaxI = cellArray[TheCellNum][5];
outCellCap.value = TheCellCap;
outCellOz.value = TheCellWeight;
outCellRes.value = TheCellRc;
Vcell.value = TheCellVe;
MaxI.value = TheCellMaxI*par.value;
metric_outCellOz.value = round(outCellOz.value * 28.34952,1);
};
outPackOz.value = round(outCellOz.value * numcells.value * par.value,1);
outPackgr.value = round(metric_outCellOz.value * numcells.value * par.value,0);
outPackV.value = round(Vcell.value * numcells.value,2);
outCellRes.value = outCellRes.value/par.value;
TheCellCap = outCellCap.value;
TheCellWeight = outCellOz.value;
TheCellMaxI = MaxI.value*par.value;
MaxI.value = MaxI.value*par.value;
if (TheCellMaxI == 0 ) { MaxI.value = "n.a." }
if (outPackV.value < 7) { alert('Most motors and speed controllers require at least 7 Volts') }

TheMotorNum = GetSelectValue(motornum)-1;
if ( TheMotorNum >= 0 )	{
TheMotorNoLoad = motorArray[TheMotorNum][3];
TheMotorKv = motorArray[TheMotorNum][1];
TheMotorRes = round(motorArray[TheMotorNum][2],5);	
TheMotorMaxI = motorArray[TheMotorNum][4];
TheMotorKt = round(1352/TheMotorKv,3);
MotorKi = motorArray[TheMotorNum][6];
MotorKrpm = motorArray[TheMotorNum][7];
MotorRk = motorArray[TheMotorNum][8];
MotorVo = motorArray[TheMotorNum][9];
motoroz.value = motorArray[TheMotorNum][5];
metric_motoroz.value = round(motoroz.value * 28.34952,1);
} else {
TheMotorNoLoad = outIo.value;
TheMotorKv = outKv.value;
TheMotorRes = outRm.value;				
TheMotorMaxI = outIMax.value;
MotorVo = outVo.value;
TheMotorKt = round(1352/TheMotorKv,3);
MotorKi = 1.55;
MotorKrpm = 1.05;
MotorRk = 60;
}
outKv.value = TheMotorKv;
outKt.value = round(TheMotorKt,3);
outRm.value = TheMotorRes;
outIo.value = TheMotorNoLoad;
outIMax.value = round(TheMotorMaxI,1);
outVo.value = MotorVo;
if (TheMotorMaxI == 0 ) { outIMax.value = "n.a." }
}
escalcs();
}
function escalcs() {
with (document.inputform) {
TheEscNum = GetSelectValue( esctype ) - 1;
if (TheEscNum >= 0 ){
Resc.value = EscArray[TheEscNum][1];
Amp.value = EscArray[TheEscNum][2];
escoz.value = EscArray[TheEscNum][3];
metric_escoz.value = round(escoz.value * 28.34952,1);
}}
propcalcs();
}
function propcalcs() {
with (document.inputform) {
ThePropNum = GetSelectValue( proptype ) - 1;
if (ThePropNum >= 0 ){ 
tconst.value = propArray[ThePropNum][1]; 
pconst.value = propArray[ThePropNum][2];
propdiameter.value = propArray[ThePropNum][3];
proppitch.value = propArray[ThePropNum][4];
metric_propdiameter.value = Math.round(10*( propdiameter.value * 2.54 ))/10;
metric_proppitch.value = Math.round(10*( proppitch.value * 2.54 ))/10;
}
if (tconst.value <= 0) {tconst.value = 1.0}
if (pconst.value <= 0) {pconst.value = 1.0} 
if (propblades.value <= 0) {propblades.value = 2}
effdiameter = propdiameter.value * Math.pow(propblades.value/2,.2);
outEffDiameter= round(effdiameter,2);
}
CalcPropMotorCurrent();
}
function CalcPropMotorCurrent() {
with (document.inputform) {
effdiameter = outEffDiameter;
MotorIo = outIo.value;
MotorKv = outKv.value;
MotorRm = outRm.value;
MotorIO = (1*outIo.value) + ((Vcell.value*numcells.value-outVo.value)/MotorRk);
gear = gearratio.value;
if ( gearratio.value > 1 ) {gear = gearratio.value * .98}
if ( effdiameter <= 0 || proppitch.value <= 0 ) {Imotor = MotorIO;
} else {
tempg = (baro.value/29.92)*((460+59)/(460+1*temp.value)) * pconst.value * MotorKi * Math.pow(effdiameter,4) * proppitch.value * (Math.pow(12,-5)*1E-9) * Math.pow((MotorKv/gear),3);		
tempr = (outCellRes.value * numcells.value) + (1* Resc.value) + (1 * MotorRm);
Vbatt = Vcell.value * numcells.value;		
tempb = (-2 * tempr * Vbatt - 1 / tempg ) / (tempr * tempr);
tempc = ( Math.pow(Vbatt,2) + MotorIO / tempg ) / (tempr * tempr);
if (tempb* tempb/4 > tempc ) {
tempz = Math.sqrt(Math.pow(tempb,2)/4- tempc);
tempi1 = -tempb/2 + tempz;
tempi2 = -tempb/2 - tempz;
if (tempi2 > 0) {
Imotor = tempi2;
} else {
Imotor = tempi1;
}} else {
Imotor = 0;
}}
Warning1.value = "";
Warning2.value = "";
Warning3.value = "";
outImotor.value = round(Imotor,1);
if (Imotor > outIMax.value) { 
alert("Motor Max Current exceeded!");
Warning1.value = " Motor Max Current exceeded!" 
}
if (Imotor > Amp.value) { 
alert("ESC Max Current exceeded!");
Warning2.value = " ESC Max Current exceeded!" 
}
if (Imotor > MaxI.value) { 
alert("Battery Max Current exceeded!");
Warning3.value = " Battery Max Current exceeded!" 
}
outDuration.value = round( ((outCellCap.value * par.value/1000) / Imotor ) * 60 * 1.05,2);
} 
CalcMotorValues();
}
function CalcMotorValues() {
with (document.inputform) {
MotorIo = outIo.value;
MotorKv = outKv.value;
MotorRm = outRm.value;
 
VoltsToMotor = (1 * Vcell.value * numcells.value)-((1 * outCellRes.value * numcells.value * outImotor.value )+ (1* Resc.value * outImotor.value));
WattsIn = round( VoltsToMotor * outImotor.value,1);
MotorRPM = MotorKv * ( VoltsToMotor - ( outImotor.value * MotorRm *(1 + .039*(Math.pow(outImotor.value,2))/(metric_motoroz.value*2)) * MotorKrpm)); 
FELoss = VoltsToMotor * MotorIO;
CULoss = Math.pow(outImotor.value,2) * MotorRm *(1 + .039*(Math.pow(outImotor.value,2))/(metric_motoroz.value*2));
WattsOut = round(WattsIn - (1 * FELoss + CULoss ),2);
if ( WattsOut <= 0 ) { WattsOut = 0 }; 
PctEff = round((WattsOut / WattsIn) * 100,1);
if ( PctEff <= 0 ) { PctEff = 0 }; 
Pheat = WattsIn-WattsOut;
outVmotor.value = round(VoltsToMotor,2);
outWin.value = round(WattsIn,1);
outWout.value = round(WattsOut,1);
outPctEff.value = round(PctEff,1);
outRPM.value = round(MotorRPM,0);
effdiameter = outEffDiameter;
if ( gearratio.value <= 0 ) { gearratio.value = 1 }
proprpm = MotorRPM / gearratio.value;

Tgrams = Math.round((baro.value/29.92)*((460+59)/(460+1*temp.value)) * tconst.value * proppitch.value * Math.pow(effdiameter,3) * Math.pow(proprpm / 1000,2.1) * 28.34952 * 0.858 / 10000);
if ( proppitch.value/propdiameter.value >= 0.6) {
Tgrams = Math.round((baro.value/29.92)*((460+59)/(460+1*temp.value)) * tconst.value * propdiameter.value * 0.6 * Math.pow(effdiameter,3) * Math.pow(proprpm / 1000,2.1) * 28.34952 * 0.858 / 10000);
}
Tkg = Tgrams / 1000;
Tn = Tkg * 9.80665;
Tlbs = Tn / 4.44822161526;
StaticToz = Tlbs * 16;
Propwatts = (baro.value/29.92)*((460+59)/(460+1*temp.value)) * pconst.value * Math.pow(effdiameter/12,4) * (proppitch.value / 12 ) * Math.pow(proprpm / 1000,3);
HP = Propwatts / 745.699871582;
Pitchspeed = proprpm * proppitch.value * .00094697;
mpspeed = Pitchspeed * 1.609344;
ThrustatSpeed = 16 * 375 * Propwatts / ( 746 * Pitchspeed );
outmpspeed.value = round(mpspeed,0);
outPropRpm.value = round(proprpm,0);
outPropSThrust.value = round(StaticToz,1);
outPropSThTgrams.value = round(Tgrams,0);
fspeed.value = Math.round(proprpm * proppitch.value * .001042);
metric_fspeed.value = Math.round(fspeed.value * 1.609344);
//tipspeed = effdiameter*3.1416/12*proprpm*60/5280;
//speedOfsound = Math.pow(temp.value*1 + 460,.5)*33.4;
//mspeed.value = round(tipspeed/speedOfsound,3);
mspeed.value = Math.round(1000* (effdiameter*3.1416*.083333333*proprpm*60)/(5280 * Math.pow(temp.value*1 + 460,.5)*33.4))/1000;
outPitchSpeed.value = round(Pitchspeed,1);
outPowersysOz.value = round((( 1 * motoroz.value) + ( 1 * outPackOz.value ) + ( 1 * escoz.value))*1.1,1);
outPowersysgr.value = round(outPowersysOz.value * 28.34952,0);
Warning4.value = ""; 
if ( (1*outPropSThrust.value) < outPowersysOz.value ) {Warning4.value = " Static Thrust < Power System Weight!"}

Calculate();
}}
function imp_name( metric_name ){
var Position = metric_name.indexOf("_");
var LastChar = metric_name.length;
return metric_name.substring( Position + 1, LastChar );
}
function entered_oz( theinput)  {
var metric_val = Math.round (10*( theinput.value / .0353 ))/10;
eval("document.inputform.metric_"+theinput.name).value = metric_val;
return true;
}
function entered_gm( theinput ) {
var imp_value = Math.round (100*( theinput.value * .0353))/100;
var impname = imp_name( theinput.name );
eval("document.inputform."+impname).value = imp_value;
return true;
}
function entered_inches( theinput ) {
var metric_val = Math.round(10*( theinput.value * 2.54 ))/10;
eval("document.inputform.metric_"+theinput.name).value = metric_val;
return true;
}
function entered_cm( theinput ) {
var imp_value = Math.round(10*( theinput.value / 2.54 ))/10;
var impname = imp_name( theinput.name );
eval("document.inputform."+impname).value = imp_value;
return true;
}
function altitude_m() {
with (document.inputform) {
alt.value = Math.round(metric_alt.value * 3.28083);
baro.value = Math.round(10*(Math.pow(2.71828,1*(73546-alt.value)/21640)))/10;		
metric_baro.value = Math.round(baro.value*33.86388);
}return true;
}
function altitude_ft() {
with (document.inputform) {
metric_alt.value = Math.round(alt.value / 3.28083);
baro.value = Math.round(10*(Math.pow(2.71828,1*(73546-alt.value)/21640)))/10;		
metric_baro.value = Math.round(baro.value*33.86388);
}return true;
}
function entered_farn( theinput ) {
var entered_cent = 0;
entered_cent = Math.round(10*((theinput.value - 32)/1.8))/10;
eval("document.inputform.metric_"+theinput.name).value = entered_cent;
return true;
}
function entered_cent( theinput ) {
var entered_farn = 0;
var impname = imp_name( theinput.name );
entered_farn = Math.round(10*( theinput.value * 1.8+32))/10;
eval("document.inputform."+impname).value = entered_farn;
return true;
}
function entered_mb( theinput ) {
var entered_hg = 0;
var impname = imp_name( theinput.name );
entered_hg = Math.round(100*(theinput.value / 33.86388))/100;
eval("document.inputform."+impname).value = entered_hg;
return true;
}
function entered_hg( theinput ) {
var entered_mb = 0;
entered_mb = Math.round(theinput.value * 33.86388);
eval("document.inputform.metric_"+theinput.name).value = entered_mb;
return true;
}
function calc_baro(){
var av_baro=0;
var met_av_baro=0;
with (document.inputform) {
if (alt.value >= 0) {
baro.value = Math.round(10*(metric_baro.value/33.86388))/10;		
metric_baro.value = Math.round(baro.value*33.86388);
}}return true;
}
function round( Thevalue, Places ) {
return (Math.round( Thevalue * Math.pow(10,Places) ) / Math.pow(10,Places));
}

function Calculate() {

with (document.inputform) {

 var MyGraph = new XYGraph();
 var MyLine1 = new XYLine();
 var MyLine2 = new XYLine();
 var MyLine3 = new XYLine();
 var MyLine4 = new XYLine();

 xmin = Number(inputform.outIo.value)*1.3;
 scalef = Number(inputform.outScale.value);
 ymax=100; ymin=0;

if (outImotor.value < 8) { xmax = 10 };
if ((outImotor.value > 8) && ( outImotor.value < 20)) { xmax = 20 };
if ((outImotor.value > 20) && ( outImotor.value < 40)) { xmax = 40 };
if ((outImotor.value > 40) && ( outImotor.value < 60)) { xmax = 60 };
if ((outImotor.value > 60) && ( outImotor.value < 80)) { xmax = 80 }; 
if ((outImotor.value > 80) && ( outImotor.value < 100)) { xmax = 100 }; 
if (outImotor.value > 100) { xmax = 200 };

 MyGraph.gheight=300; 
 MyGraph.gwidth=480;

// Efficiency
len = 50;
for (i=0; i<=len; i++) {
x = i/(len)*(xmax-xmin)+xmin;
MyLine2.x[i] = x;
VoltsToMotor = (1 * Vcell.value * numcells.value)-((1 * outCellRes.value * numcells.value * x )+ (1* Resc.value * x));
FELoss = VoltsToMotor * MotorIO;
CULoss = Math.pow(x,2) * MotorRm *(1 + .039*(Math.pow(x,2))/(metric_motoroz.value*2));
WattsIn = round( VoltsToMotor * x,1);
WattsOut = round(WattsIn - (1 * FELoss + CULoss ),2);
if ( WattsOut <= 0 ) { WattsOut = 0 };
MyLine2.y[i] = round((WattsOut / WattsIn) * 100,2);
MyLine2.labels[i] = (MyLine2.x[i]).toFixed(1)+", "+(MyLine2.y[i]).toFixed(1);
}

//Output Power
len = 25;
for (i=0; i<=len; i++) {
x = i/(len)*(xmax-xmin)+xmin;
MyLine1.x[i] = x;
MyLine4.x[i] = x;
VoltsToMotor = (1 * Vcell.value * numcells.value)-((1 * outCellRes.value * numcells.value * x )+ (1* Resc.value * x));
FELoss = VoltsToMotor * MotorIO;
CULoss = Math.pow(x,2) * MotorRm *(1 + .039*(Math.pow(x,2))/(metric_motoroz.value*2));
WattsIn = round( VoltsToMotor * x,1);
WattsOut = round(WattsIn - (1 * FELoss + CULoss ),2);
if ( WattsOut <= 0 ) { WattsOut = 0 }; 
MyLine1.y[i] = WattsOut/scalef;
MyLine1.labels[i] = (MyLine1.x[i]).toFixed(1)+", "+(MyLine1.y[i]).toFixed(1);

// Motor Heating
if ( WattsOut > 0 ) { 
MyLine4.y[i] = (WattsIn-WattsOut)/scalef;
MyLine4.labels[i] = (MyLine1.x[i]).toFixed(1)+", "+(MyLine1.y[i]).toFixed(1);};
}

//Motor RPM
len = 15;
for (i=0; i<=len; i++) {
x = i/(len)*(xmax-xmin)+xmin;
MyLine3.x[i] = x;
VoltsToMotor = (1 * Vcell.value * numcells.value)-((1 * outCellRes.value * numcells.value * x )+ (1* Resc.value * x));
MotorRPM = MotorKv * ( VoltsToMotor - ( x * MotorRm *(1 + .039*(Math.pow(x,2))/(metric_motoroz.value*2)) * MotorKrpm));
if ( MotorRPM <= 0 ) { MotorRPM = 0 };
MyLine3.y[i] = MotorRPM/1000;
MyLine3.labels[i] = (MyLine3.x[i]).toFixed(1)+", "+(MyLine3.y[i]).toFixed(1);
}

//MyGraph.title="";
MyGraph.xaxis="Amps";
MyGraph.yaxis="";
MyGraph.xscale=xmax/20;

MyLine1.VMLpointshapetype="none";
MyLine1.VMLstroke="weight='1pt'; color='black'; dashstyle='solid';";

MyLine2.VMLpointshapetype="none";
MyLine2.VMLstroke="weight='1pt'; color='blue'; dashstyle='solid';";

MyLine3.VMLpointshapetype="none";
MyLine3.VMLstroke="weight='1pt'; color='green'; dashstyle='solid';";

MyLine4.VMLpointshapetype="none";
MyLine4.VMLstroke="weight='1pt'; color='red'; dashstyle='solid';";
	
MyGraph.Plot(MyLine1, MyLine2, MyLine3, MyLine4);

// draw intercept points
var MyLabel = new Label();
MyLabel.x = outImotor.value; MyLabel.y = 0;
MyLabel.pointsize="4";
MyLabel.pointfillcolor="red";
MyLabel.labelcolor="black";
MyLabel.label = "";
MyLabel.labelsize = "";
MyGraph.Drawlabel(MyLabel);

MyLabel.x = outImotor.value; MyLabel.y = outWout.value/scalef;
MyLabel.pointfillcolor="red";
MyLabel.labelcolor="black";
MyLabel.pointsize="4";
MyGraph.Drawlabel(MyLabel);

MyLabel.x = outImotor.value; MyLabel.y = outPctEff.value;
MyLabel.pointfillcolor="red";
MyLabel.labelcolor="blue";
MyLabel.pointsize="4";
MyGraph.Drawlabel(MyLabel);

MyLabel.x = outImotor.value; MyLabel.y = outRPM.value/1000;
MyLabel.pointfillcolor="red";
MyLabel.labelcolor="green";
MyLabel.pointsize="4";
MyGraph.Drawlabel(MyLabel);

MyLabel.x = outImotor.value; MyLabel.y = Pheat/scalef;
MyLabel.pointfillcolor="red";
MyLabel.labelcolor="red";
MyLabel.pointsize="4";
MyGraph.Drawlabel(MyLabel);

graphdiv.innerHTML = MyGraph;
}}
