//
// This file maintains the variables used in the Prime Mover Comparison application.
//
// Electricity defaults
var ElecCost = "0.12";		// Electricity cost / KWH
var ElecSurCh = "0.0062";		// Electricity surcharge
var ElecMRC = "200.00";		// Electric motor rewind charge
var CostFeet = "5.00";		// Cost of installing electrical line per foot
var ElecMHU = "350.00";		// Electric motor hookup charge

// Gas defaults
var GASCost = "1.50";		// Gas Cost / MCF
var GASMotM = "500.00";	// Gas motor maintenance
var GASMotHU = "250.00";	// Gas motor hookup

// Propane defaults, used in Fuel Consumption Calculator
var PropaneCost = "1.00";		// Propane Cost

// Other defaults
var RegWellM = "1000.00";	// Annual Well maintenance

var CalcHPReq = 1;		// Calculate the Horsepower required?   0=No; 1=Yes
var TotalWD = 0;		// Total Well Depth
var TotalFP = 0;		// Total Fluid Produced
var ElecHPReq = 0.0;	// Electric Horsepower Required
var ElecMotOwn = 0;		// Is the electric motor owned?   0=No; 1=Yes
var ArrowGEL = 0.00;	// Arrow Gas Engine List
var GASSold = 1;		// Is the gas being sold?  0=No; 1=Yes
var ElecLineReq = 1;	// Is an electric line required?  0=No; 1=Yes
var FeetReq = 0;		// Feet of electrical line required


//  Setup the Arrow Specialty Cost/Feet specifications within an array
//  To modify or maintain this information, simply add the next element of the array with the
//	appropriate information.
//  NOTE:  The order of the array elements is irrelevant.  The code which cycles through
//	the array to find the right match does so based on horsepower and cycles through
//	all elements of the array.
//  Array elements should be setup in the following order:
//	Cost/Feet
//	Title
//
//  Array elements should be included in quotation marks and pipe (|) delimited.

// Object constructor 
function engineRecord(engine, rpm, hp) { 
   this.engine = engine; 
   this.rpm = rpm; 
   this.hp = hp; 
} 

// The following array allows for entering the RPM and corresponding horsepower for 
//each gas engine.  Scripts that work with this array are able to find all elements
//with a matching engine, and return all available RPM and HP for that engine.  
//For example, to search the array for engine "C-46" will return RPM from 400 through
//800, and HP from 5.5 through 10.
//To add a new entry, the parameters in parentheses after "new engineRecord"must 
//be entered in the following order:
//Engine size (in quotes)
//RPM
//HP    

//Single-Cylider Arrow engines
var engineRPM = new Array(); 
  
engineRPM[0] = new engineRecord("C-46",400,5.5); 
engineRPM[1] = new engineRecord("C-46",450,6.0); 
engineRPM[2] = new engineRecord("C-46",500,6.5); 
engineRPM[3] = new engineRecord("C-46",550,7.0); 
engineRPM[4] = new engineRecord("C-46",600,8.0);
engineRPM[5] = new engineRecord("C-46",650,8.5);
engineRPM[6] = new engineRecord("C-46",700,9.0);
engineRPM[7] = new engineRecord("C-46",750,9.5);
engineRPM[8] = new engineRecord("C-46",800,10.0);

engineRPM[9] = new engineRecord("C-66",350,7.0);
engineRPM[10] = new engineRecord("C-66",400,8.2);
engineRPM[11] = new engineRecord("C-66",450,9.0);
engineRPM[12] = new engineRecord("C-66",500,10.0);
engineRPM[13] = new engineRecord("C-66",550,11.0);
engineRPM[14] = new engineRecord("C-66",600,12.0);
engineRPM[15] = new engineRecord("C-66",650,13.0);
engineRPM[16] = new engineRecord("C-66",700,14.0);

engineRPM[17] = new engineRecord("C-96",300,10.0);
engineRPM[18] = new engineRecord("C-96",350,11.5);
engineRPM[19] = new engineRecord("C-96",400,13.5);
engineRPM[20] = new engineRecord("C-96",450,15.0);
engineRPM[21] = new engineRecord("C-96",500,16.5);
engineRPM[22] = new engineRecord("C-96",550,18.2);
engineRPM[23] = new engineRecord("C-96",600,20.0);

engineRPM[24] = new engineRecord("C-106",300,12.5);
engineRPM[25] = new engineRecord("C-106",350,15.0);
engineRPM[26] = new engineRecord("C-106",400,18.0);
engineRPM[27] = new engineRecord("C-106",450,20.0);
engineRPM[28] = new engineRecord("C-106",500,22.0);
engineRPM[29] = new engineRecord("C-106",550,24.0);
engineRPM[30] = new engineRecord("C-106",600,26.0);
engineRPM[31] = new engineRecord("C-106",650,28.0);
engineRPM[32] = new engineRecord("C-106",700,30.0);
engineRPM[33] = new engineRecord("C-106",750,31.0);
engineRPM[34] = new engineRecord("C-106",800,32.0);

engineRPM[35] = new engineRecord("C-255",350,25.0);
engineRPM[36] = new engineRecord("C-255",400,29.0);
engineRPM[37] = new engineRecord("C-255",450,33.5);
engineRPM[38] = new engineRecord("C-255",500,37.5);
engineRPM[39] = new engineRecord("C-255",550,40.0);
engineRPM[40] = new engineRecord("C-255",600,47.5);
engineRPM[41] = new engineRecord("C-255",650,50.0);
engineRPM[42] = new engineRecord("C-255",700,53.5);
engineRPM[43] = new engineRecord("C-255",750,55.0);

engineRPM[44] = new engineRecord("L-795",300,35.0);
engineRPM[45] = new engineRecord("L-795",350,40.0);
engineRPM[46] = new engineRecord("L-795",400,45.0);
engineRPM[47] = new engineRecord("L-795",450,50.0);
engineRPM[48] = new engineRecord("L-795",500,55.0);
engineRPM[49] = new engineRecord("L-795",550,60.0);
engineRPM[50] = new engineRecord("L-795",600,65.0);

engineRPM[51] = new engineRecord("L-1770",200,60.0);
engineRPM[52] = new engineRecord("L-1770",250,75.0);
engineRPM[53] = new engineRecord("L-1770",300,90.0);
engineRPM[54] = new engineRecord("L-1770",350,100.0);
engineRPM[55] = new engineRecord("L-1770",400,110.0);
engineRPM[56] = new engineRecord("L-1770",450,120.0);

engineRPM[57] = new engineRecord("L-2165",200,70.0);
engineRPM[58] = new engineRecord("L-2165",250,90.0);
engineRPM[59] = new engineRecord("L-2165",300,110.0);
engineRPM[60] = new engineRecord("L-2165",350,125.0);
engineRPM[61] = new engineRecord("L-2165",400,140.0);
engineRPM[62] = new engineRecord("L-2165",450,155.0);

engineRPM[63] = new engineRecord("VR-330",900,26.0);
engineRPM[64] = new engineRecord("VR-330",1000,33.0);
engineRPM[65] = new engineRecord("VR-330",1200,42.0);
engineRPM[66] = new engineRecord("VR-330",1400,52.0);
engineRPM[67] = new engineRecord("VR-330",1600,60.0);
engineRPM[68] = new engineRecord("VR-330",1800,68.0);
engineRPM[69] = new engineRecord("VR-330",2000,74.0);
engineRPM[70] = new engineRecord("VR-330",2200,80.0);


engineRPM[71] = new engineRecord("K6",400,3.0);
engineRPM[72] = new engineRecord("K6",450,3.5);
engineRPM[73] = new engineRecord("K6",500,4.0);
engineRPM[74] = new engineRecord("K6",550,4.0);
engineRPM[75] = new engineRecord("K6",600,4.0);
engineRPM[76] = new engineRecord("K6",650,4.5);
engineRPM[77] = new engineRecord("K6",700,5.0);
engineRPM[78] = new engineRecord("K6",750,5.5);
engineRPM[79] = new engineRecord("K6",800,6.0);
 
//Not being used as of 08/22/01 - Denny Hendrix
var Terrains = new Array();

Terrains[0] = "5|Flat terrain";
Terrains[1] = "7|Hilly terrain";
Terrains[2] = "10|Mountainous";

//  Setup the Arrow Specialty Engine specifications within an array
//  To modify or maintain this information, simply add the next element of the array with the
//	appropriate information.
//  NOTE:  The order of the array elements is irrelevant.  The code which cycles through
//	the array to find the right match does so based on horsepower and cycles through
//	all elements of the array.
//  Array elements should be setup in the following order:
//	Horsepower
//	Name
//	List Price  (stored without a dollar sign, such as XXXXX.XX)
//	Parts/Year  (stored without a dollar sign, such as XXXXX.XX)
//	Labor  (stored without a dollar sign, such as XXXXX.XX)
//  Displacement
//  Array elements should be included in quotation marks and pipe (|) delimited.

// Single-cylinder Arrow engines
var ASEngine = new Array;

ASEngine[0] = "6|K6|5375.00|300.00|450.00|57";
ASEngine[1] = "12|C-46|10952.59|466.23|1110.00|122.7";
ASEngine[2] = "17|C-66|12652.59|500.09|1110.00|195";
ASEngine[3] = "24|C-96|16182.03|613.32|1110.00|327";
ASEngine[4] = "39|C-106|17982.08|824.08|1110.00|376";
ASEngine[5] = "66|C-255|28062.61|1443.37|1665.00|660";
ASEngine[6] = "78|L-795|43732.32|1265.74|1665.00|795";
ASEngine[7] = "125|L-1770|69424.92|1540.13|1850.00|1770";
ASEngine[8] = "155|L-2165|76577.92|1680.54|1850.00|2165";

//ASEngine[0] = "10|C-46|10952.59|466.23|1110.00|122.7";
//ASEngine[1] = "14|C-66|12652.59|500.09|1110.00|195";
//ASEngine[2] = "20|C-96|16182.03|613.32|1110.00|327";
//ASEngine[3] = "32|C-106|17982.08|824.08|1110.00|376";
//ASEngine[4] = "55|C-255|28062.61|1443.37|1665.00|660";
//ASEngine[5] = "65|L-795|43732.32|1265.74|1665.00|795";
//ASEngine[6] = "125|L-1770|69424.92|1540.13|1850.00|1770";
//ASEngine[7] = "155|L-2165|76577.92|1680.54|1850.00|2165";

// Multi-cylinder Arrow engines
//For testing only, don't have real figures yet (09-27-02)
var ASMulti_Cyl_Engine = new Array;
ASMulti_Cyl_Engine[0] = "80|VR-330|12000.00|300.00|500.00|330";

//  Setup the Electric motor specifications within an array
//  To modify or maintain this information, simply add the next element of the array with the
//	appropriate information.
//  NOTE:  The order of the array elements is irrelevant.  The code which cycles through
//	the array to find the right match does so based on horsepower and cycles through
//	all elements of the array.
//  Array elements should be setup in the following order:
//	Electrical Horsepower  (stored with a single decimal place, such as XX.X)
//	KWH/Day
//	Estimated Electric Motor Cost  (stored without a dollar sign, such as XXXXX.XX)
//	Arrow Equivalent Horsepower
//	Estiated MCF of gas produced daily - actually used for Arrow Gas Engine Calculation
//
//  Array elements should be included in quotation marks and pipe (|) delimited.
// 5-15-2003 UPDATED THE MCF FIQURES

var ElecEngine = new Array;

ElecEngine[0] = "2.0|36|672.66|12|1.02";
ElecEngine[1] = "3.0|54|737.11|12|1.02";
ElecEngine[2] = "5.0|90|872.89|12|1.02";
ElecEngine[3] = "7.5|134|1092.78|12|1.27";
ElecEngine[4] = "10.0|179|1487.17|12|1.70";
ElecEngine[5] = "15.0|269|1868.67|12|2.54";
ElecEngine[6] = "20.0|358|2244.72|17|3.88";
ElecEngine[7] = "25.0|448|2712.33|24|4.23";
ElecEngine[8] = "30.0|537|3180.00|24|5.08";
ElecEngine[9] = "40.0|716|4346.00|39|6.77";
ElecEngine[10] = "50.0|895|4876.00|39|8.46";
ElecEngine[11] = "60.0|1074|5181.50|66|10.16";
ElecEngine[12] = "75.0|1343|7494.83|66|12.69";
ElecEngine[13] = "100.0|1790|8473.78|78|16.92";
ElecEngine[14] = "125.0|2238|9453.00|125|21.15";
ElecEngine[15] = "150.0|2686|10432.00|125|25.38";

//ElecEngine[0] = "2.0|36|672.66|10|1.36";
//ElecEngine[1] = "3.0|54|612.94|10|1.36";
//ElecEngine[2] = "5.0|90|705.88|10|1.36";
//ElecEngine[3] = "7.5|134|810.59|10|1.69";
//ElecEngine[4] = "10.0|179|928.24|10|2.26";
//ElecEngine[5] = "15.0|269|928.24|14|3.38";
//ElecEngine[6] = "20.0|358|1410.59|14|4.51";
//ElecEngine[7] = "25.0|448|1522.35|20|5.64";
//ElecEngine[8] = "30.0|537|1677.65|20|6.77";
//ElecEngine[9] = "40.0|716|2089.41|32|9.02";
//ElecEngine[10] = "50.0|895|2594.12|55|11.28";
//ElecEngine[11] = "60.0|1074|2882.35|55|13.54";
//ElecEngine[12] = "75.0|1343|3297.65|55|16.92";
//ElecEngine[13] = "100.0|1790|4376.47|65|22.56";
//ElecEngine[14] = "125.0|2238|5660.00|125|28.20";
//ElecEngine[15] = "150.0|2686|7068.24|125|33.84";


// DO NOT WRITE BELOW THIS !!!!

var GE = new Array();
var GEM = new Array();
var EE = new Array();
var Ter = new Array();

function GEngine(pars) {
	spl = pars.split("|")
	this.HP = spl[0];
	this.Name = spl[1];
	this.Price = spl[2];
	this.PY = spl[3];
	this.Labor = spl[4];
	this.Displacement = spl[5];
}

function GEngineM(pars) {
	spl = pars.split("|")
	this.HP = spl[0];
	this.Name = spl[1];
	this.Price = spl[2];
	this.PY = spl[3];
	this.Labor = spl[4];
	this.Displacement = spl[5];
}

function EEngine(pars) {
	spl = pars.split("|")
	this.HP = spl[0];
	this.KWH = spl[1];
	this.Cost = spl[2];
	this.EHP = spl[3];
	this.DMCF = spl[4];
}

function TerrCost(pars) {
	spl = pars.split("|")
	this.Cost = spl[0];
	this.Title = spl[1];
}

for (x=0;x<ASEngine.length;x++) GE[x] = new GEngine(ASEngine[x]);
for (x=0;x<ASMulti_Cyl_Engine.length;x++) GEM[x] = new GEngineM(ASMulti_Cyl_Engine[x]);
for (x=0;x<ElecEngine.length;x++) EE[x] = new EEngine(ElecEngine[x]);
for (x=0;x<Terrains.length;x++) Ter[x] = new TerrCost(Terrains[x]);


