function getEEvars(v){
//Get variables from Electric Engines array needed for calculations.
for (i=0;i<EE.length;i++) {
	if (EE[i].HP == ElecHPReq) {
         if (v == "KWH"){
  	    	var ev = EE[i].KWH
         } else if (v == "DMCF"){
            var ev = EE[i].DMCF
         } else if (v == "EHP") {
            var ev = EE[i].EHP
       }
    }
  }

return ev;

}


//Get variables from Arrow Gas Engines array needed for calculations.

function getGEvars(v){
	var EHP = getEEvars("EHP");
	for (i=0;i<GE.length;i++) {
		if (GE[i].HP == EHP) {
			 if (v == "PY"){
				var gv = GE[i].PY
			 }else if (v == "Labor"){
				var gv = GE[i].Labor
			 }else if (v == "Name"){
			   var gv = GE[i].Name
			 }
		}
	}
	return gv;
}


function round(number,x) {
//This function rounds the number passed to the function and returns
//the number of decimal places passed to variable 'x' which defaults
//to 2.
		 x = (!x ? 2 : x);
		 return Math.round(number*Math.pow(10,x))/Math.pow(10,x);
}

