// here we define all constants

var averageOfficeSpacePerEmployee = 228;//1.3*175;

var averageEmployeeSalary = 35000;

var employeeTurnoverRate = 10; // percentage value

//mkwan

//var recruitmentCostPerEmployee = averageEmployeeSalary/3;

var recruitmentCostPerEmployee = averageEmployeeSalary*1.05;

var costofAdvantageRideshare = 40;

//

var avgSalaryAndIndirectCosts = averageEmployeeSalary*1.5; // per employee







// below are all the functions:

/*

	function getFederalTaxRate(netIncome)

	function getStateTaxRate(stateCode,columnNum)

	function getAverageOfficeSpace()

	function getAnnualRentalRates(cityCode,columnNum)

	function getEmployeeTurnoverRate()

	function getRecruitmentCostPerEmployee()

	function getAvgSalaryAndIndirectCosts()

	function getParkingCosts(typeOfParking)

	function getChangeInTurnover(progNum)

	function getAverageCostPerBicycle(typeOfFacility)

*/



/****************************************************

*	function getFederalTaxRate(netIncome)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Marginal federal corporate tax rate

*				given Net Income

****************************************************/

function getFederalTaxRate(netIncome) {

netIncome = parseInt(netIncome);



	if (netIncome > 18333333) return 35;

	else if (netIncome > 15000000) return 38;

	else if (netIncome > 10000000) return 35;

	else if (netIncome > 335000) return 34;

	else if (netIncome > 100000) return 39;

	else if (netIncome > 75000) return 34;

	else if (netIncome > 50000) return 25;

	else if (netIncome > 1) return 15;

	else return 0;

} // end function getFederalTaxRate(netIncome)











function getFederalEmployeeMarginalIncomeTaxRate(avgEmplSalary) {

avgEmplSalary = parseInt(avgEmplSalary);



	if (avgEmplSalary > 299000) return 39.60;

	else if (avgEmplSalary > 138400) return 36;

	else if (avgEmplSalary > 62200) return 31;

	else if (avgEmplSalary > 56000) return 30;

	else if (avgEmplSalary > 28700) return 28;

	else if (avgEmplSalary > 2650) return 15;

	else return 0;

} // end function getFederalEmployeeMarginalIncomeTaxRate(avgEmplSalary)







/****************************************************

*	function getStateTaxRate(stateCode,columnNum)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Marginal state corporate tax rate

*				(or other values) given state code

****************************************************/

function getStateTaxRate(stateCode,columnNum) {

/* note:   State Corp. Income Tax Rate

			column0 = state

			column1 = Selected Tax Rate	

			column2 = LOW RATE

			column3 = HIGH RATE

			column4 = NUMBER of BRACKETS

			column5 = LOW BRACKET

			column6 = HIGH BRACKET

			column7 = BANK TAX RATES 

*/

	stateCode = stateCode.toUpperCase();

	columnNum = parseInt(columnNum);

	

	var stateData = new Array();

	stateData[0] = "AL~5.0~5~N/A~1~Flat Rate~Flat Rate~6"

	stateData[1] = "AK~5.0~1~9.4~10~10000~90000~1.0-9.4"

	stateData[2] = "AZ~8.0~8.0 (z)~N/A~1~Flat Rate~Flat Rate~8.0 (z)"

	stateData[3] = "AR~3.8~1~6.5~6~3000~100000~1.0-6.5"

	stateData[4] = "CA~8.8~8.84 (c)~N/A~1~Flat Rate~Flat Rate~10.84 (c)"

	stateData[5] = "CO~4.8~4.75~N/A~1~Flat Rate~Flat Rate~4.75"

	stateData[6] = "CT~7.5~7.5 (d)~N/A~1~Flat Rate~Flat Rate~7.5 (d)"

	stateData[7] = "DE~8.7~8.7 (e)~N/A~1~Flat Rate~Flat Rate~1.7-8.7"

	stateData[8] = "FL~5.5~5.5 (f)~N/A~1~Flat Rate~Flat Rate~5.5 (f)"

	stateData[9] = "GA~6.0~6~N/A~1~Flat Rate~Flat Rate~6"

	stateData[10] = "HI~5.4~4.4 (g)~6.4~3~25000~100000~7.92 (g)"

	stateData[11] = "ID~8.0~8.0 (h)~N/A~1~Flat Rate~Flat Rate~8.0 (h)"

	stateData[12] = "IL~7.3~7.3 (I)~N/A~1~Flat Rate~Flat Rate~7.3 (I)"

	stateData[13] = "IN~7.9~7.9 (j)~N/A~1~Flat Rate~Flat Rate~8.5"

	stateData[14] = "IA~9.0~6~12~4~25000~250000~5"

	stateData[15] = "KS~4.0~4.0 (l)~N/A~1~Flat Rate~Flat Rate~2.25 (l)"

	stateData[16] = "KT~6.1~4~8.25~5~25000~250000~(a)"

	stateData[17] = "LA~6.0~4~8~5~25000~200000~(a)"

	stateData[18] = "ME~6.2~3.5 (m)~8.93~4~25000~250000~1"

	stateData[19] = "MD~7.0~7~N/A~1~Flat Rate~Flat Rate~7"

	stateData[20] = "MA~9.5~9.5 (n)~N/A~1~Flat Rate~Flat Rate~10.5 (n)"

	stateData[21] = "MI~2.2~*See Note~*See Note~*See Note~*See Note~*See Note~*See Note"

	stateData[22] = "MN~9.8~9.8 (o)~N/A~1~Flat Rate~Flat Rate~9.8 (o)"

	stateData[23] = "MS~4.0~3~5~3~5000~10000~3.0-5.0"

	stateData[24] = "MO~6.3~6.25~N/A~1~Flat Rate~Flat Rate~7"

	stateData[25] = "MT~6.8~6.75 (p)~N/A~1~Flat Rate~Flat Rate~6.75 (p)"

	stateData[26] = "NE~6.7~5.58~7.81~2~50000~---~(a)"

	stateData[27] = "NV~0.0~N/A~N/A~N/A~N/A~N/A~N/A"

	stateData[28] = "NH~8.0~8.0 (q)~N/A~1~Flat Rate~Flat Rate~8.0 (q)"

	stateData[29] = "NJ~9.0~9.0 (r)~N/A~1~Flat Rate~Flat Rate~9.0 (r)"

	stateData[30] = "NM~6.2~4.8~7.6~3~500000~1000000~4.8-7.6"

	stateData[31] = "NY~8.5~8.5 (s)~N/A~1~Flat Rate~Flat Rate~8.5 (s)"

	stateData[32] = "NC~6.9~6.9 (t)~N/A~1~Flat Rate~Flat Rate~6.9 (t)"

	stateData[33] = "ND~6.8~3~10.5~6~3000~50000~7.0 (b)"

	stateData[34] = "OH~6.8~5.1 (u)~8.5~2~50000~---~(u)"

	stateData[35] = "OK~6.0~6~N/A~1~Flat Rate~Flat Rate~6"

	stateData[36] = "OR~6.6~6.6 (b)~N/A~1~Flat Rate~Flat Rate~6.6 (b)"

	stateData[37] = "PA~10.0~9.99~N/A~1~Flat Rate~Flat Rate~(a)"

	stateData[38] = "RI~9.0~9~N/A~1~Flat Rate~Flat Rate~9.0 (v)"

	stateData[39] = "SC~5.0~5~N/A~1~Flat Rate~Flat Rate~4.5 (w)"

	stateData[40] = "SD~0.0~---~---~---~---~---~1.0-6.0 (b)"

	stateData[41] = "TN~6.0~6~N/A~1~Flat Rate~Flat Rate~6"

	stateData[42] = "TX~4.5~*See Note~*See Note~*See Note~*See Note~*See Note~*See Note"

	stateData[43] = "UT~5.0~5.0 (b)~N/A~1~Flat Rate~Flat Rate~5.0 (b)"

	stateData[44] = "VT~8.4~7.0 (b)~9.75~4~10000~250000~7.0-9.75 (b)"

	stateData[45] = "VA~6.0~6~N/A~1~Flat Rate~Flat Rate~6.0 (x)"

	stateData[46] = "WA~0.0~N/A~N/A~N/A~N/A~N/A~N/A"

	stateData[47] = "WV~9.0~9~N/A~1~Flat Rate~Flat Rate~9"

	stateData[48] = "WI~7.9~7.9~N/A~1~Flat Rate~Flat Rate~7.9"

	stateData[49] = "WY~0.0~N/A~N/A~N/A~N/A~N/A~N/A"

	stateData[50] = "DC~10.0~9.975 (y)~N/A~1~Flat Rate~Flat Rate~9.975 (y)"

	stateData[51] = "NT~6.3~N/A~N/A~N/A~N/A~N/A~N/A"



	var stateEmployee = new Array();	

	stateEmployee[0] = "BLANK"	

	stateEmployee[1] = "AL~Alabama~5"

	stateEmployee[2] = "AK~Alaska~0"

	stateEmployee[3] = "AZ~Arizona~3.95"

	stateEmployee[4] = "AR~Arkansas~4"

	stateEmployee[5] = "CA~California~5.2"

	stateEmployee[6] = "CO~Colorado~4.75"

	stateEmployee[7] = "CT~Connecticut~4.5"

	stateEmployee[8] = "DE~Delaware~4.1"

	stateEmployee[9] = "FL~Florida~0"

	stateEmployee[10] = "GA~Georgia~6"

	stateEmployee[11] = "HI~Hawaii~5.2"

	stateEmployee[12] = "ID~Idaho~8.2"

	stateEmployee[13] = "IL~Illinois~3"

	stateEmployee[14] = "IN~Indiana~3.4"

	stateEmployee[15] = "IA~Iowa~4.2"

	stateEmployee[16] = "KS~Kansas~5"

	stateEmployee[17] = "KT~Kentucky~6"

	stateEmployee[18] = "LA~Louisiana~4"

	stateEmployee[19] = "ME~Maine~8.5"

	stateEmployee[20] = "MD~Maryland~4.85"

	stateEmployee[21] = "MA~Massachusetts~5.85"

	stateEmployee[22] = "MI~Michigan~4.3"

	stateEmployee[23] = "MN~Minnesota~6.6"

	stateEmployee[24] = "MS~Mississippi~5"

	stateEmployee[25] = "MO ~Missouri~6"

	stateEmployee[26] = "MT~Montana~6.5"

	stateEmployee[27] = "NE~Nebraska~4.6"

	stateEmployee[28] = "NV~Nevada~0"

	stateEmployee[29] = "NH~New Hampshire~0"

	stateEmployee[30] = "NJ~New Jersey~3.9"

	stateEmployee[31] = "NM~New Mexico~5"

	stateEmployee[32] = "NY~New York~5.4"

	stateEmployee[33] = "NC~North Carolina~6.3"

	stateEmployee[34] = "ND~North Dakota~7.3"

	stateEmployee[35] = "OH~Ohio~3.8"

	stateEmployee[36] = "OK~Oklahoma~6.75"

	stateEmployee[37] = "OR~Oregon~9"

	stateEmployee[38] = "PA~Pennsylvania~2.8"

	stateEmployee[39] = "RI~Rhode Island~0"

	stateEmployee[40] = "SC~South Carolina~7"

	stateEmployee[41] = "SD~South Dakota~0"

	stateEmployee[42] = "TN~Tennessee~0"

	stateEmployee[43] = "TX~Texas~0"

	stateEmployee[44] = "UT~Utah~7"

	stateEmployee[45] = "VT~Vermont~0"

	stateEmployee[46] = "VA~Virginia~5.75"

	stateEmployee[47] = "WA~Washington~0"

	stateEmployee[48] = "WV~West Virginia~4.7"

	stateEmployee[49] = "WI~Wisconsin~5.7"

	stateEmployee[50] = "WY~Wyoming~0"

	stateEmployee[51] = "DC~District of Columbia~7"

	stateEmployee[52] = "NT~Nationwide~4.3"



	

	var okState = false; // this will capture an errorneous state abbriviation/code

	for (i=0; i<52; i++) {

		if (stateData[i].substring(0,2) == stateCode) { okState = true; break;}

	}

	

	if (!okState) return "0";//alert("error... this is not a valid state...")

	else if (isNaN(columnNum)) alert("error... please enter a valid column number...")

	else {

		var tmpDataArray = stateData[i].split("~");

		var tmpEmployeeArray = stateEmployee[i+1].split("~");	

		var myResult = tmpDataArray[columnNum] + "~" + tmpEmployeeArray[2]

		return myResult;

	}



} // end function getStateTaxRate(stateCode,columnNum)







function getExpectedchangeinturnover(searchString){



	var expectedchangeinturnover = new Array();

	expectedchangeinturnover[0] = "Transit or Vanpool Benefits~1"

	expectedchangeinturnover[1] = "Telecommute~2"

	expectedchangeinturnover[2] = "Parking Cash Out~1"

	expectedchangeinturnover[3] = "Telecommute and Transit or Vanpool Benefits~2"

	expectedchangeinturnover[4] = "Parking Cash Out and Transit or Vanpool Benefits~1"

	expectedchangeinturnover[5] = "Parking Cash Out and Telecommute~3"

	expectedchangeinturnover[6] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits~3"



	var successfulSearch = false;

	

	for (i=0; i<7; i++) {

		tmpResult = expectedchangeinturnover[i].split("~")

		if (tmpResult[0] == searchString) { successfulSearch = true; break;}

	}

	

	var bCount = 0; // counts number of benefits selected

	for (j=0; j<supportBenefits.length;j++) if (supportBenefits[j]=="x" ) bCount ++;

	

	//alert(searchString + "   " + successfulSearch)

	

	if (successfulSearch) {

		if (bCount>1) return (parseFloat(tmpResult[1])+1)

		else return (tmpResult[1])

	}

	else {

		if (bCount>1) return "0"

		else return "0"

	}

}





function getCommuteModel(searchString) {

alert(searchString);

alert("asdfasdfsad");

	var commuteModel = new Array();

	commuteModel[0] = "Transit or Vanpool Benefits + 1 + CBD + Small~16.5~19.9"

	commuteModel[1] = "No Core Program + 1 + CBD + Large~11.2~5.5"

	commuteModel[2] = "No Core Program + 1 + CBD + Medium~11.2~5.5"

	commuteModel[3] = "No Core Program + 1 + CBD + Small~2.0~1.2"

	commuteModel[4] = "No Core Program + 1 + Other + Large~8.4~4.9"

	commuteModel[5] = "No Core Program + 1 + Other + Medium~4.6~2.5"

	commuteModel[6] = "No Core Program + 1 + Other + Small~4.7~3.3"

	commuteModel[7] = "No Core Program + 1 + Urban + Large~8.4~4.9"

	commuteModel[8] = "No Core Program + 1 + Urban + Medium~4.6~2.5"

	commuteModel[9] = "No Core Program + 1 + Urban + Small~4.7~3.3"

	commuteModel[10] = "No Core Program + 2 + CBD + Large~11.2~5.5"

	commuteModel[11] = "No Core Program + 2 + CBD + Medium~4.6~2.5"

	commuteModel[12] = "No Core Program + 2 + CBD + Small~3.1~0.1"

	commuteModel[13] = "No Core Program + 2 + Other + Large~11.2~5.5"

	commuteModel[14] = "No Core Program + 2 + Other + Medium~3.1~1.1"

	commuteModel[15] = "No Core Program + 2 + Other + Small~2.4~0.0"

	commuteModel[16] = "No Core Program + 2 + Urban + Large~8.4~4.9"

	commuteModel[17] = "No Core Program + 2 + Urban + Medium~2.0~1.2"

	commuteModel[18] = "No Core Program + 2 + Urban + Small~2.4~0.0"

	commuteModel[19] = "No Core Program + 3 + CBD + Large~11.2~5.5"

	commuteModel[20] = "No Core Program + 3 + CBD + Medium~4.6~2.5"

	commuteModel[21] = "No Core Program + 3 + CBD + Small~3.1~0.1"

	commuteModel[22] = "No Core Program + 3 + Other + Large~11.2~5.5"

	commuteModel[23] = "No Core Program + 3 + Other + Medium~3.1~1.1"

	commuteModel[24] = "No Core Program + 3 + Other + Small~2.4~0.0"

	commuteModel[25] = "No Core Program + 3 + Urban + Large~11.2~5.5"

	commuteModel[26] = "No Core Program + 3 + Urban + Medium~2.0~1.2"

	commuteModel[27] = "No Core Program + 3 + Urban + Small~2.4~0.0"

	commuteModel[28] = "No Core Program + 4 + CBD + Large~11.2~5.5"

	commuteModel[29] = "No Core Program + 4 + CBD + Medium~4.6~2.5"

	commuteModel[30] = "No Core Program + 4 + CBD + Small~3.1~0.1"

	commuteModel[31] = "No Core Program + 4 + Other + Large~11.2~5.5"

	commuteModel[32] = "No Core Program + 4 + Other + Medium~3.1~1.1"

	commuteModel[33] = "No Core Program + 4 + Other + Small~2.4~0.0"

	commuteModel[34] = "No Core Program + 4 + Urban + Large~11.2~5.5"

	commuteModel[35] = "No Core Program + 4 + Urban + Medium~2.0~1.2"

	commuteModel[36] = "No Core Program + 4 + Urban + Small~2.4~0.0"

	commuteModel[37] = "Parking Cash Out + 1 + CBD + Large~28.2~16.3"

	commuteModel[38] = "Parking Cash Out + 1 + CBD + Medium~28.2~16.3"

	commuteModel[39] = "Parking Cash Out + 1 + CBD + Small~21.6~10.7"

	commuteModel[40] = "Parking Cash Out + 1 + Other + Large~37.7~25.5"

	commuteModel[41] = "Parking Cash Out + 1 + Other + Medium~32.4~17.6"

	commuteModel[42] = "Parking Cash Out + 1 + Other + Small~10.6~6.5"

	commuteModel[43] = "Parking Cash Out + 1 + Urban + Large~37.7~25.5"

	commuteModel[44] = "Parking Cash Out + 1 + Urban + Medium~32.4~17.6"

	commuteModel[45] = "Parking Cash Out + 1 + Urban + Small~10.6~6.5"

	commuteModel[46] = "Parking Cash Out + 2 + CBD + Large~28.2~16.3"

	commuteModel[47] = "Parking Cash Out + 2 + CBD + Medium~32.4~17.6"

	commuteModel[48] = "Parking Cash Out + 2 + CBD + Small~13.0~4.1"

	commuteModel[49] = "Parking Cash Out + 2 + Other + Large~28.2~16.3"

	commuteModel[50] = "Parking Cash Out + 2 + Other + Medium~13.7~6.8"

	commuteModel[51] = "Parking Cash Out + 2 + Other + Small~8.1~2.0"

	commuteModel[52] = "Parking Cash Out + 2 + Urban + Large~37.7~25.5"

	commuteModel[53] = "Parking Cash Out + 2 + Urban + Medium~21.6~10.7"

	commuteModel[54] = "Parking Cash Out + 2 + Urban + Small~8.1~2.0"

	commuteModel[55] = "Parking Cash Out + 3 + CBD + Large~28.2~16.3"

	commuteModel[56] = "Parking Cash Out + 3 + CBD + Medium~32.4~17.6"

	commuteModel[57] = "Parking Cash Out + 3 + CBD + Small~13.0~4.1"

	commuteModel[58] = "Parking Cash Out + 3 + Other + Large~28.2~16.3"

	commuteModel[59] = "Parking Cash Out + 3 + Other + Medium~13.7~6.8"

	commuteModel[60] = "Parking Cash Out + 3 + Other + Small~8.1~2.0"

	commuteModel[61] = "Parking Cash Out + 3 + Urban + Large~28.2~16.3"

	commuteModel[62] = "Parking Cash Out + 3 + Urban + Medium~21.6~10.7"

	commuteModel[63] = "Parking Cash Out + 3 + Urban + Small~8.1~2.0"

	commuteModel[64] = "Parking Cash Out + 4 + CBD + Large~28.2~16.3"

	commuteModel[65] = "Parking Cash Out + 4 + CBD + Medium~32.4~17.6"

	commuteModel[66] = "Parking Cash Out + 4 + CBD + Small~13.0~4.1"

	commuteModel[67] = "Parking Cash Out + 4 + Other + Large~28.2~16.3"

	commuteModel[68] = "Parking Cash Out + 4 + Other + Medium~13.7~6.8"

	commuteModel[69] = "Parking Cash Out + 4 + Other + Small~8.1~2.0"

	commuteModel[70] = "Parking Cash Out + 4 + Urban + Large~28.2~16.3"

	commuteModel[71] = "Parking Cash Out + 4 + Urban + Medium~21.6~10.7"

	commuteModel[72] = "Parking Cash Out + 4 + Urban + Small~8.1~2.0"

	commuteModel[73] = "Parking Cash Out and Telecommute + 1 + CBD + Large~29.0~15.5"

	commuteModel[74] = "Parking Cash Out and Telecommute + 1 + CBD + Medium~29.0~15.5"

	commuteModel[75] = "Parking Cash Out and Telecommute + 1 + CBD + Small~25.0~10.1"

	commuteModel[76] = "Parking Cash Out and Telecommute + 1 + Other + Large~39.4~24.7"

	commuteModel[77] = "Parking Cash Out and Telecommute + 1 + Other + Medium~34.4~16.9"

	commuteModel[78] = "Parking Cash Out and Telecommute + 1 + Other + Small~14.8~5.9"

	commuteModel[79] = "Parking Cash Out and Telecommute + 1 + Urban + Large~39.4~24.7"

	commuteModel[80] = "Parking Cash Out and Telecommute + 1 + Urban + Medium~34.4~16.9"

	commuteModel[81] = "Parking Cash Out and Telecommute + 1 + Urban + Small~14.8~5.9"

	commuteModel[82] = "Parking Cash Out and Telecommute + 2 + CBD + Large~29.0~15.5"

	commuteModel[83] = "Parking Cash Out and Telecommute + 2 + CBD + Medium~34.4~16.9"

	commuteModel[84] = "Parking Cash Out and Telecommute + 2 + CBD + Small~16.9~3.5"

	commuteModel[85] = "Parking Cash Out and Telecommute + 2 + Other + Large~29.0~15.5"

	commuteModel[86] = "Parking Cash Out and Telecommute + 2 + Other + Medium~18.1~6.4"

	commuteModel[87] = "Parking Cash Out and Telecommute + 2 + Other + Small~12.4~1.7"

	commuteModel[88] = "Parking Cash Out and Telecommute + 2 + Urban + Large~39.4~24.7"

	commuteModel[89] = "Parking Cash Out and Telecommute + 2 + Urban + Medium~25.0~10.1"

	commuteModel[90] = "Parking Cash Out and Telecommute + 2 + Urban + Small~12.4~1.7"

	commuteModel[91] = "Parking Cash Out and Telecommute + 3 + CBD + Large~29.0~15.5"

	commuteModel[92] = "Parking Cash Out and Telecommute + 3 + CBD + Medium~34.4~16.9"

	commuteModel[93] = "Parking Cash Out and Telecommute + 3 + CBD + Small~16.9~3.5"

	commuteModel[94] = "Parking Cash Out and Telecommute + 3 + Other + Large~29.0~15.5"

	commuteModel[95] = "Parking Cash Out and Telecommute + 3 + Other + Medium~18.1~6.4"

	commuteModel[96] = "Parking Cash Out and Telecommute + 3 + Other + Small~12.4~1.7"

	commuteModel[97] = "Parking Cash Out and Telecommute + 3 + Urban + Large~29.0~15.5"

	commuteModel[98] = "Parking Cash Out and Telecommute + 3 + Urban + Medium~25.0~10.1"

	commuteModel[99] = "Parking Cash Out and Telecommute + 3 + Urban + Small~12.4~1.7"

	commuteModel[100] = "Parking Cash Out and Telecommute + 4 + CBD + Large~29.0~15.5"

	commuteModel[101] = "Parking Cash Out and Telecommute + 4 + CBD + Medium~34.4~16.9"

	commuteModel[102] = "Parking Cash Out and Telecommute + 4 + CBD + Small~16.9~3.5"

	commuteModel[103] = "Parking Cash Out and Telecommute + 4 + Other + Large~29.0~15.5"

	commuteModel[104] = "Parking Cash Out and Telecommute + 4 + Other + Medium~18.1~6.4"

	commuteModel[105] = "Parking Cash Out and Telecommute + 4 + Other + Small~12.4~1.7"

	commuteModel[106] = "Parking Cash Out and Telecommute + 4 + Urban + Large~29.0~15.5"

	commuteModel[107] = "Parking Cash Out and Telecommute + 4 + Urban + Medium~25.0~10.1"

	commuteModel[108] = "Parking Cash Out and Telecommute + 4 + Urban + Small~12.4~1.7"

	commuteModel[109] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + CBD + Large~30.2~24.7"

	commuteModel[110] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + CBD + Medium~30.2~24.7"

	commuteModel[111] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + CBD + Small~38.4~32.1"

	commuteModel[112] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Other + Large~46.3~43.1"

	commuteModel[113] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Other + Medium~41.3~34.0"

	commuteModel[114] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Other + Small~25.4~22.6"

	commuteModel[115] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Urban + Large~46.3~43.1"

	commuteModel[116] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Urban + Medium~41.3~34.0"

	commuteModel[117] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 1 + Urban + Small~25.4~22.6"

	commuteModel[118] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + CBD + Large~30.2~24.7"

	commuteModel[119] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + CBD + Medium~41.3~34.0"

	commuteModel[120] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + CBD + Small~24.7~16.3"

	commuteModel[121] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Other + Large~30.2~24.7"

	commuteModel[122] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Other + Medium~33.2~27.0"

	commuteModel[123] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Other + Small~18.5~10.1"

	commuteModel[124] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Urban + Large~46.3~43.1"

	commuteModel[125] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Urban + Medium~38.4~32.1"

	commuteModel[126] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 2 + Urban + Small~18.5~10.1"

	commuteModel[127] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + CBD + Large~30.2~24.7"

	commuteModel[128] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + CBD + Medium~41.3~34.0"

	commuteModel[129] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + CBD + Small~24.7~16.3"

	commuteModel[130] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Other + Large~30.2~24.7"

	commuteModel[131] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Other + Medium~33.2~27.0"

	commuteModel[132] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Other + Small~18.5~10.1"

	commuteModel[133] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Urban + Large~30.2~24.7"

	commuteModel[134] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Urban + Medium~38.4~32.1"

	commuteModel[135] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 3 + Urban + Small~18.5~10.1"

	commuteModel[136] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + CBD + Large~30.2~24.7"

	commuteModel[137] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + CBD + Medium~41.3~34.0"

	commuteModel[138] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + CBD + Small~24.7~16.3"

	commuteModel[139] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Other + Large~30.2~24.7"

	commuteModel[140] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Other + Medium~33.2~27.0"

	commuteModel[141] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Other + Small~18.5~10.1"

	commuteModel[142] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Urban + Large~30.2~24.7"

	commuteModel[143] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Urban + Medium~38.4~32.1"

	commuteModel[144] = "Parking Cash Out and Telecommute and Transit or Vanpool Benefits + 4 + Urban + Small~18.5~10.1"

	commuteModel[145] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + CBD + Large~29.4~25.0"

	commuteModel[146] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + CBD + Medium~29.4~25.0"

	commuteModel[147] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + CBD + Small~35.9~32.7"

	commuteModel[148] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Other + Large~45.0~43.4"

	commuteModel[149] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Other + Medium~39.6~34.5"

	commuteModel[150] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Other + Small~22.4~23.6"

	commuteModel[151] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Urban + Large~45.0~43.4"

	commuteModel[152] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Urban + Medium~39.6~34.5"

	commuteModel[153] = "Parking Cash Out and Transit or Vanpool Benefits + 1 + Urban + Small~22.4~23.6"

	commuteModel[154] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + CBD + Large~29.4~25.0"

	commuteModel[155] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + CBD + Medium~39.6~34.5"

	commuteModel[156] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + CBD + Small~21.6~17.2"

	commuteModel[157] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Other + Large~29.4~25.0"

	commuteModel[158] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Other + Medium~30.2~27.8"

	commuteModel[159] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Other + Small~14.6~10.8"

	commuteModel[160] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Urban + Large~45.0~43.4"

	commuteModel[161] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Urban + Medium~35.9~32.7"

	commuteModel[162] = "Parking Cash Out and Transit or Vanpool Benefits + 2 + Urban + Small~14.6~10.8"

	commuteModel[163] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + CBD + Large~29.4~25.0"

	commuteModel[164] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + CBD + Medium~39.6~34.5"

	commuteModel[165] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + CBD + Small~21.6~17.2"

	commuteModel[166] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Other + Large~29.4~25.0"

	commuteModel[167] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Other + Medium~30.2~27.8"

	commuteModel[168] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Other + Small~14.6~10.8"

	commuteModel[169] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Urban + Large~29.4~25.0"

	commuteModel[170] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Urban + Medium~35.9~32.7"

	commuteModel[171] = "Parking Cash Out and Transit or Vanpool Benefits + 3 + Urban + Small~14.6~10.8"

	commuteModel[172] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + CBD + Large~29.4~25.0"

	commuteModel[173] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + CBD + Medium~39.6~34.5"

	commuteModel[174] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + CBD + Small~21.6~17.2"

	commuteModel[175] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Other + Large~29.4~25.0"

	commuteModel[176] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Other + Medium~30.2~27.8"

	commuteModel[177] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Other + Small~14.6~10.8"

	commuteModel[178] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Urban + Large~29.4~25.0"

	commuteModel[179] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Urban + Medium~35.9~32.7"

	commuteModel[180] = "Parking Cash Out and Transit or Vanpool Benefits + 4 + Urban + Small~14.6~10.8"

	commuteModel[181] = "Telecommute + 1 + CBD + Large~14.1~3.2"

	commuteModel[182] = "Telecommute + 1 + CBD + Medium~14.1~3.2"

	commuteModel[183] = "Telecommute + 1 + CBD + Small~8.0~1.1"

	commuteModel[184] = "Telecommute + 1 + Other + Large~13.5~4.1"

	commuteModel[185] = "Telecommute + 1 + Other + Medium~10.0~1.9"

	commuteModel[186] = "Telecommute + 1 + Other + Small~9.8~3.2"

	commuteModel[187] = "Telecommute + 1 + Urban + Large~13.5~4.1"

	commuteModel[188] = "Telecommute + 1 + Urban + Medium~10.0~1.9"

	commuteModel[189] = "Telecommute + 1 + Urban + Small~9.8~3.2"

	commuteModel[190] = "Telecommute + 2 + CBD + Large~14.1~3.2"

	commuteModel[191] = "Telecommute + 2 + CBD + Medium~10.0~1.9"

	commuteModel[192] = "Telecommute + 2 + CBD + Small~8.6~0.3"

	commuteModel[193] = "Telecommute + 2 + Other + Large~14.1~3.2"

	commuteModel[194] = "Telecommute + 2 + Other + Medium~8.5~0.9"

	commuteModel[195] = "Telecommute + 2 + Other + Small~8.2~0.4"

	commuteModel[196] = "Telecommute + 2 + Urban + Large~13.5~4.1"

	commuteModel[197] = "Telecommute + 2 + Urban + Medium~8.0~1.1"

	commuteModel[198] = "Telecommute + 2 + Urban + Small~8.2~0.4"

	commuteModel[199] = "Telecommute + 3 + CBD + Large~14.1~3.2"

	commuteModel[200] = "Telecommute + 3 + CBD + Medium~10.0~1.9"

	commuteModel[201] = "Telecommute + 3 + CBD + Small~8.6~0.3"

	commuteModel[202] = "Telecommute + 3 + Other + Large~14.1~3.2"

	commuteModel[203] = "Telecommute + 3 + Other + Medium~8.5~0.9"

	commuteModel[204] = "Telecommute + 3 + Other + Small~8.2~0.4"

	commuteModel[205] = "Telecommute + 3 + Urban + Large~14.1~3.2"

	commuteModel[206] = "Telecommute + 3 + Urban + Medium~8.0~1.1"

	commuteModel[207] = "Telecommute + 3 + Urban + Small~8.2~0.4"

	commuteModel[208] = "Telecommute + 4 + CBD + Large~14.1~3.2"

	commuteModel[209] = "Telecommute + 4 + CBD + Medium~10.0~1.9"

	commuteModel[210] = "Telecommute + 4 + CBD + Small~8.6~0.3"

	commuteModel[211] = "Telecommute + 4 + Other + Large~14.1~3.2"

	commuteModel[212] = "Telecommute + 4 + Other + Medium~8.5~0.9"

	commuteModel[213] = "Telecommute + 4 + Other + Small~8.2~0.4"

	commuteModel[214] = "Telecommute + 4 + Urban + Large~14.1~3.2"

	commuteModel[215] = "Telecommute + 4 + Urban + Medium~8.0~1.1"

	commuteModel[216] = "Telecommute + 4 + Urban + Small~8.2~0.4"

	commuteModel[217] = "Telecommute and Transit or Vanpool Benefits + 1 + CBD + Large~25.8~31.5"

	commuteModel[218] = "Telecommute and Transit or Vanpool Benefits + 1 + CBD + Medium~25.8~31.5"

	commuteModel[219] = "Telecommute and Transit or Vanpool Benefits + 1 + CBD + Small~20.9~18.5"

	commuteModel[220] = "Telecommute and Transit or Vanpool Benefits + 1 + Other + Large~32.7~36.3"

	commuteModel[221] = "Telecommute and Transit or Vanpool Benefits + 1 + Other + Medium~24.6~24.4"

	commuteModel[222] = "Telecommute and Transit or Vanpool Benefits + 1 + Other + Small~18.9~16.6"

	commuteModel[223] = "Telecommute and Transit or Vanpool Benefits + 1 + Urban + Large~32.7~36.3"

	commuteModel[224] = "Telecommute and Transit or Vanpool Benefits + 1 + Urban + Medium~24.6~24.4"

	commuteModel[225] = "Telecommute and Transit or Vanpool Benefits + 1 + Urban + Small~18.9~16.6"

	commuteModel[226] = "Telecommute and Transit or Vanpool Benefits + 2 + CBD + Large~25.8~31.5"

	commuteModel[227] = "Telecommute and Transit or Vanpool Benefits + 2 + CBD + Medium~24.6~24.4"

	commuteModel[228] = "Telecommute and Transit or Vanpool Benefits + 2 + CBD + Small~15.2~9.8"

	commuteModel[229] = "Telecommute and Transit or Vanpool Benefits + 2 + Other + Large~25.8~31.5"

	commuteModel[230] = "Telecommute and Transit or Vanpool Benefits + 2 + Other + Medium~19.8~15.1"

	commuteModel[231] = "Telecommute and Transit or Vanpool Benefits + 2 + Other + Small~12.8~6.6"

	commuteModel[232] = "Telecommute and Transit or Vanpool Benefits + 2 + Urban + Large~32.7~36.3"

	commuteModel[233] = "Telecommute and Transit or Vanpool Benefits + 2 + Urban + Medium~20.9~18.5"

	commuteModel[234] = "Telecommute and Transit or Vanpool Benefits + 2 + Urban + Small~12.8~6.6"

	commuteModel[235] = "Telecommute and Transit or Vanpool Benefits + 3 + CBD + Large~25.8~31.5"

	commuteModel[236] = "Telecommute and Transit or Vanpool Benefits + 3 + CBD + Medium~24.6~24.4"

	commuteModel[237] = "Telecommute and Transit or Vanpool Benefits + 3 + CBD + Small~15.2~9.8"

	commuteModel[238] = "Telecommute and Transit or Vanpool Benefits + 3 + Other + Large~25.8~31.5"

	commuteModel[239] = "Telecommute and Transit or Vanpool Benefits + 3 + Other + Medium~19.8~15.1"

	commuteModel[240] = "Telecommute and Transit or Vanpool Benefits + 3 + Other + Small~12.8~6.6"

	commuteModel[241] = "Telecommute and Transit or Vanpool Benefits + 3 + Urban + Large~25.8~31.5"

	commuteModel[242] = "Telecommute and Transit or Vanpool Benefits + 3 + Urban + Medium~20.9~18.5"

	commuteModel[243] = "Telecommute and Transit or Vanpool Benefits + 3 + Urban + Small~12.8~6.6"

	commuteModel[244] = "Telecommute and Transit or Vanpool Benefits + 4 + CBD + Large~25.8~31.5"

	commuteModel[245] = "Telecommute and Transit or Vanpool Benefits + 4 + CBD + Medium~24.6~24.4"

	commuteModel[246] = "Telecommute and Transit or Vanpool Benefits + 4 + CBD + Small~15.2~9.8"

	commuteModel[247] = "Telecommute and Transit or Vanpool Benefits + 4 + Other + Large~25.8~31.5"

	commuteModel[248] = "Telecommute and Transit or Vanpool Benefits + 4 + Other + Medium~19.8~15.1"

	commuteModel[249] = "Telecommute and Transit or Vanpool Benefits + 4 + Other + Small~12.8~6.6"

	commuteModel[250] = "Telecommute and Transit or Vanpool Benefits + 4 + Urban + Large~25.8~31.5"

	commuteModel[251] = "Telecommute and Transit or Vanpool Benefits + 4 + Urban + Medium~20.9~18.5"

	commuteModel[252] = "Telecommute and Transit or Vanpool Benefits + 4 + Urban + Small~12.8~6.6"

	commuteModel[253] = "Transit or Vanpool Benefits + 1 + CBD + Large~24.6~36.3"

	commuteModel[254] = "Transit or Vanpool Benefits + 1 + CBD + Medium~25.0~31.0"

	commuteModel[255] = "Transit or Vanpool Benefits + 1 + Other + Large~28.4~42.0"

	commuteModel[256] = "Transit or Vanpool Benefits + 1 + Other + Medium~21.6~24.2"

	commuteModel[257] = "Transit or Vanpool Benefits + 1 + Other + Small~15.5~17.1"

	commuteModel[258] = "Transit or Vanpool Benefits + 1 + Urban + Large~30.2~37.6"

	commuteModel[259] = "Transit or Vanpool Benefits + 1 + Urban + Medium~22.7~26.7"

	commuteModel[260] = "Transit or Vanpool Benefits + 1 + Urban + Small~15.1~17.5"

	commuteModel[261] = "Transit or Vanpool Benefits + 2 + CBD + Large~24.1~34.1"

	commuteModel[262] = "Transit or Vanpool Benefits + 2 + CBD + Medium~21.5~25.7"

	commuteModel[263] = "Transit or Vanpool Benefits + 2 + CBD + Small~10.5~12.1"

	commuteModel[264] = "Transit or Vanpool Benefits + 2 + Other + Large~24.3~35.8"

	commuteModel[265] = "Transit or Vanpool Benefits + 2 + Other + Medium~14.5~15.8"

	commuteModel[266] = "Transit or Vanpool Benefits + 2 + Other + Small~7.0~7.3"

	commuteModel[267] = "Transit or Vanpool Benefits + 2 + Urban + Large~26.1~31.4"

	commuteModel[268] = "Transit or Vanpool Benefits + 2 + Urban + Medium~17.1~19.5"

	commuteModel[269] = "Transit or Vanpool Benefits + 2 + Urban + Small~7.2~8.0"

	commuteModel[270] = "Transit or Vanpool Benefits + 3 + CBD + Large~24.3~32.4"

	commuteModel[271] = "Transit or Vanpool Benefits + 3 + CBD + Medium~21.7~23.8"

	commuteModel[272] = "Transit or Vanpool Benefits + 3 + CBD + Small~11.1~10.7"

	commuteModel[273] = "Transit or Vanpool Benefits + 3 + Other + Large~24.4~34.0"

	commuteModel[274] = "Transit or Vanpool Benefits + 3 + Other + Medium~14.7~14.2"

	commuteModel[275] = "Transit or Vanpool Benefits + 3 + Other + Small~7.8~6.5"

	commuteModel[276] = "Transit or Vanpool Benefits + 3 + Urban + Large~26.2~29.6"

	commuteModel[277] = "Transit or Vanpool Benefits + 3 + Urban + Medium~17.3~17.8"

	commuteModel[278] = "Transit or Vanpool Benefits + 3 + Urban + Small~8.2~7.2"

	commuteModel[279] = "Transit or Vanpool Benefits + 4 + CBD + Large~24.3~33.4"

	commuteModel[280] = "Transit or Vanpool Benefits + 4 + CBD + Medium~22.2~25.2"

	commuteModel[281] = "Transit or Vanpool Benefits + 4 + CBD + Small~11.7~12.1"

	commuteModel[282] = "Transit or Vanpool Benefits + 4 + Other + Large~25.1~35.7"

	commuteModel[283] = "Transit or Vanpool Benefits + 4 + Other + Medium~15.7~15.8"

	commuteModel[284] = "Transit or Vanpool Benefits + 4 + Other + Small~8.5~7.9"

	commuteModel[285] = "Transit or Vanpool Benefits + 4 + Urban + Large~26.9~31.2"

	commuteModel[286] = "Transit or Vanpool Benefits + 4 + Urban + Medium~18.1~19.4"

	commuteModel[287] = "Transit or Vanpool Benefits + 4 + Urban + Small~8.8~8.5"	



	var successfulSearch = false;

	

	for (i=0; i<288; i++) {

		tmpResult = commuteModel[i].split("~")

		if (tmpResult[0] == searchString) { successfulSearch = true; break;}

	}



	if (successfulSearch) {

		return (tmpResult[1] + "~" + tmpResult[2])

	}

	else {

		alert("Unsuccessful match:" + searchString + " does not exist in this model version.")

		return "0~0"

	}

}





/****************************************************

*	function getAverageOfficeSpace()

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Average office space per employee

****************************************************/

function getAverageOfficeSpace() {

	return averageOfficeSpacePerEmployee;

} // end function getAverageOfficeSpace()





/****************************************************

*	function function getAnnualRentalRates(cityCode,columnNum)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Average annual 

*				rental rates per square foot ($ / (Sq. Ft.-year))

****************************************************/

function getAnnualRentalRates(cityCode,columnNum) {

/* note:

			column0 = city code -- please use the provided city code

			column1 = CBD

			column2 = SUBURBAN 

*/

	cityCode = cityCode.toUpperCase();

	columnNum = parseInt(columnNum);

	

	var cityData = new Array();

	cityData[0] = "BOS~42.24~23.61" 	// Boston

	cityData[1] = "NY1~42.7~n/a" 		// New York (downtown)

	cityData[2] = "NY2~55.62~n/a"		// New York (midtown)

	cityData[3] = "DCC~36.31~23.31" 	// Washington, DC

	cityData[4] = "SFR~61.21~33.97" 	// SanFrancisco

	cityData[5] = "SEA~36.87~24.46" 	// Seattle

	cityData[6] = "ACY~18.76~17.97" 	// Average City



	

	var okCity = false; // this will capture an errorneous city code

	for (i=0; i<7; i++) {

		if (cityData[i].substring(0,3) == cityCode) { okCity = true; break;}

	}

	

	if (!okCity) alert("error... please enter a valid city code...")

	else if (isNaN(columnNum)) alert("error... please enter a valid column number...")

	else {

		var tmpDataArray = cityData[i].split("~");

		return tmpDataArray[columnNum]

	}	



} // end function getAnnualRentalRates(cityCode,columnNum)





/****************************************************

*	function getEmployeeTurnoverRate()

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Employee turnover rate

****************************************************/

function getEmployeeTurnoverRate() {

	return employeeTurnoverRate;

} // end function getEmployeeTurnoverRate()





/****************************************************

*	function getRecruitmentCostPerEmployee()

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Recruitment cost per employee

****************************************************/

function getRecruitmentCostPerEmployee() {

	return recruitmentCostPerEmployee;

} // end function getRecruitmentCostPerEmployee()





/****************************************************

*	function getAvgSalaryAndIndirectCosts()

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Average Salary and 

*				Indirect Costs per employee ($/year)

****************************************************/

function getAvgSalaryAndIndirectCosts() {

	return avgSalaryAndIndirectCosts;

} // end function getAvgSalaryAndIndirectCosts()





/****************************************************

*	function function getAnnualRentalRates(typeOfParking)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Default Values for Parking Costs ($/month)

****************************************************/

function getParkingCosts(typeOfParking) {

/* note:

			column0 = Type of Parking -- only the first three letters will be used

			column1 = Average Cost ($/month)

*/

	typeOfParking = typeOfParking.toUpperCase();

	

	var parkingData = new Array();

	parkingData[0] = "SURFACE~50" 	

	parkingData[1] = "STRUCTURE~145" 		

	parkingData[2] = "UNDERGROUND~200"



	

	var okParkingType = false; // this will capture an errorneous parking type

	for (i=0; i<3; i++) {

		if (parkingData[i].substring(0,3) == typeOfParking.substring(0,3)) 

			{ okParkingType = true; break;}

	}

	

	if (!okParkingType) alert("error... please enter a valid type of parking...")

	else {

		var tmpDataArray = parkingData[i].split("~");

		return tmpDataArray[1]

	}	



} // end function getParkingCosts(typeOfParking)





/****************************************************

*	function function getChangeInTurnover(progNum)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Change in turnover 

*				before and after program is instituted

****************************************************/

function getChangeInTurnover(progNum) {

/* note:

			column0 = program number -- see below for more info

			column1 = percentage change

*/

	progNum = parseInt(progNum);

	

	var progData = new Array();

	progData[0] = "1~0" 	// Transit/Vanpool Vouchers

	progData[1] = "2~2" 	// Telecommuting

	progData[2] = "3~1"		// Parking Cashout	

	progData[3] = "4~2" 	// Transit/Vanpool Vouchers AND Telecommuting

	progData[4] = "5~1" 	// Transit/Vanpool Vouchers AND Parking Cashout	

	progData[5] = "6~2.5" 	// Telecommuting AND Parking Cashout

	progData[6] = "7~2.6" 	// Transit/Vanpool Vouchers, Telecommuting, AND Parking Cashout



	

	if (progNum>6 || progNum<1 ||  isNaN(progNum)) 

		alert("error... please enter a valid program number...")

	else {

		var tmpDataArray = progData[progNum-1].split("~");

		return tmpDataArray[1]

	}	



} // end function getChangeInTurnover(progNum)







/****************************************************

*	function function getAverageCostPerBicycle(typeOfFacility)

*	Created: 	4/23/2001

*	Author:		Yassen Bakalov

*	Modified:	____

* 	Comments:	Use this function to get the Average Cost per Bicycle

****************************************************/

function getAverageCostPerBicycle(typeOfFacility) {

/* note:

			column0 = Type of Type of Bike Facility -- only the first three letters will be used

			column1 = Average Cost per Bicycle

*/

	typeOfFacility = typeOfFacility.toUpperCase();

	

	var facilityData = new Array();

	facilityData[0] = "RACK~100" 	

	facilityData[1] = "LOCKER~800" 		



	

	var okFacilityType = false; // this will capture an errorneous facility type

	for (i=0; i<2; i++) {

		if (facilityData[i].substring(0,3) == typeOfFacility.substring(0,3)) 

			{ okFacilityType = true; break;}

	}

	

	if (!okFacilityType) alert("error... please enter a valid parking type...")

	else {

		var tmpDataArray = facilityData[i].split("~");

		return tmpDataArray[1]

	}	



} // end function getAverageCostPerBicycle(typeOfFacility)





//var v_CO = 19.63 * (2.205/1000);

//var v_CO = 11.414149413669 * (2.205/1000);    	// CN 5/9/06 - new value

var v_CO = 11.87900903 * (2.205/1000);    	// CN 9/5/06 - new value



//var v_VOC = 2.08 * (2.205/1000);

//var v_VOC = 0.549632055029817 * (2.205/1000);	// CN 5/9/06 - new value

var v_VOC = 0.405602378 * (2.205/1000);	// CN 9/5/06 - new value



//var v_NOx = 2.04 * (2.205/1000);

//var v_NOx = 1.02602624146418 * (2.205/1000);	// CN 5/9/06 - new value

var v_NOx = 0.786324702 * (2.205/1000);	// CN 9/5/06 - new value



var v_PM = 0.04 * (2.205/1000);

var v_SOx = 0.09 * (2.205/1000);



//var v_CO2 = 501 * (2.205/1000);

//var v_CO2 = 421.429090700608 * (2.205/1000);	// CN 5/9/06 - new value

var v_CO2 = 444.5922212 * (2.205/1000);	// CN 9/5/06 - new value



var v_CH4 = 0.065 * (2.205/1000);

var v_N20 = 0.071 * (2.205/1000);

function getCO(){ return v_CO; }

function getVOC(){ return v_VOC; }

function getNOx(){ return v_NOx; }

function getPM(){ return v_PM; }

function getSOx(){ return v_SOx; }

function getCO2(){ return v_CO2; }

function getCH4(){ return v_CH4; }

function getN20(){ return v_N20; }



// -- new stuff (added 11/12/01)





// --------------- Assumptions  -------------------------

//Type of Area -> Drive Alone,Carpool,Vanpool,Transit,Bicycle,Pedestrian,Other,Total, sum of first four

var areaType = new Array();

areaType[0] = new Array(0.606,0.2,0.008,0.1,0.005,0.07,0.011,1,0.914); //CBD   row 63 on Primary workbook

areaType[1] = new Array(0.746,0.13,0.006,0.053,0.004,0.05,0.011,1,0.935); //Urban

areaType[2] = new Array(0.834,0.09,0.002,0.04,0.003,0.02,0.011,1,0.966); //Suburban





// --------------- Transit / Vanpool Benefits  -------------------------

var transitVanpoolValue = new Array(20,30,32.50,40,50,60,70,80,90,100);



tmpData = new Array(-5.165151515,-3.67273,-2.90303,-8.336363636,-6.18788,-5.07727,-9.19394,-6.91667,-5.70606,-11.7742,-9.21515,-7.56364,-15.2955,-12.5712,-10.6667,-18.8121,-16.3939,-14.1818,-22.1333,-20.3121,-17.9803,-25.0758,-24.1803,-21.8621,-27.7515,-27.953,-25.8106,-30.1152,-31.3758,-29.6258)

var transitVanpoolTrip = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3)

	transitVanpoolTrip[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);



tmpData = new Array(6.8,4.4,3.3,10.9,7.4,5.5,12.1,8.3,6.3,15.5,11.1,8.5,20.2,15.2,11.8,24.9,19.7,15.7,29.4,24.6,20,33.6,29.4,24.4,37.4,34.2,28.9,40.8,38.6,33.1)

var transitVanpoolIncrease = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	transitVanpoolIncrease[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

	

tmpData = new Array(-0.5,-0.2,-0.1,-1,-0.4,-0.1,-1,-0.4,-0.1,-1.3,-0.6,-0.2,-1.7,-0.9,-0.2,-2.1,-1.2,-0.3,-2.5,-1.4,-0.5,-2.8,-1.7,-0.6,-3.1,-1.9,-0.7,-3.4,-2.3,-0.8)

var transitVanpoolBicycle = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	transitVanpoolBicycle[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);







// --------------- Parking Cash Out  -------------------------

var parkingCashOutValue = new Array(20,30,32.50,40,50,60,70,80,90,100);



tmpData = new Array(-6.277272727,-5.30303,-3.76515,-9.587878788,-8.11515,-5.95606,-10.4258,-8.9697,-6.54848,-12.8273,-11.2348,-8.4303,-16.1576,-14.5379,-11.0591,-19.2333,-17.8773,-13.8788,-22.2545,-21.2712,-17.0152,-25.05,-24.5561,-20.1636,-27.5455,-27.8152,-23.3742,-29.9864,-30.8288,-26.6848)

var parkingCashOutTrip = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	parkingCashOutTrip[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);



tmpData = new Array(3.2,2.2,1.8,4.9,3.6,2.9,5.4,3.9,3.3,6.6,4.9,4.2,8.4,6.5,5.6,10.1,8.1,7.1,11.6,9.7,8.6,13.1,11.3,10.4,14.5,12.9,12.1,15.7,14.5,13.8)

var parkingCashOutIncrease = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	parkingCashOutIncrease[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);



tmpData = new Array(2.4,2.1,1,3.7,3.3,1.6,4,3.6,1.9,5.1,4.6,2.4,6.4,6,3.2,7.9,7.5,4.2,9.4,9,5.2,10.9,10.6,6.4,12.2,12.1,7.7,13.5,13.7,9)

var parkingCashOutBicycle = new Array(); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	parkingCashOutBicycle[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);



	

	

// --------------- Telecommuting  -------------------------

// it is generated in the getTelecommuting() function





// --------------- Supporting benefits -------------------------

tmpData = new Array(); // FORMAT: Vehicle Trip Reduction (3), Transit/Vanpool Increase (3), Bicycle/Walk Increase (3)

var guaranteedRideHomeBenefit = new Array(-2.028787879,-2.492424242,-2.70152,1.9,2.1,2.2,0,0,0); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	guaranteedRideHomeBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

tmpData = new Array()

var rideshareCarpoolMatchingBenefit = new Array(-0.23636,-0.39091,-0.39091,-0.1,-0.1,0,0,0,0); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	rideshareCarpoolMatchingBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

tmpData = new Array()

var employeePaidPreTaxTransitVanpoolBenefit = new Array(-5.16515,-3.67273,-2.90303,6.8,4.4,3.3,-0.5,-0.2,-0.1); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	employeePaidPreTaxTransitVanpoolBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

tmpData = new Array()

var shuttlesFromTransitBenefit = new Array(-1.973,-1.3,-1.0,2.5,1.5,1.2,-0.2,-0.1,0.0); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	shuttlesFromTransitBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

tmpData = new Array()

var preferredParkingForCarpoolsVanpoolsBenefit = new Array(-0.7,-0.6,-0.5,-0.1,0.0,0.0,-0.2,-0.1,0.0); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	preferredParkingForCarpoolsVanpoolsBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

tmpData = new Array()

var securebicycleparkingandshowersBenefit = new Array(-0.3,-0.4,-0.4,-0.1,0.0,0.0,0.5,0.5,0.5); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	securebicycleparkingandshowersBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);

var discountscouponsforbikewalkersBenefit = new Array(-1.481818182,-1.190909091,-0.645454545,-0.2,-0.1,0,1.9,1.4,0.7); tmpCounter = 0;

for (i=0; i<tmpData.length; i+=3) 

	discountscouponsforbikewalkersBenefit[tmpCounter++] = new Array(tmpData[i],tmpData[i+1],tmpData[i+2]);







// --------------- Data Retrieval Functions  -------------------------



function getTransitVanpool(b_value,b_location){

	b_value = parseFloat(b_value); if (isNaN(b_value)) b_value = 0;

	b_location = parseInt(b_location); if (isNaN(b_location)) b_location = 0;

	var nRecords = transitVanpoolValue.length - 1;

	for (i=0; i<nRecords; i++) {

		if (transitVanpoolValue[i]>=b_value) break;	

	}

	//alert("..."+b_value+ ":" + b_location+ "   " + i + ">"+ transitVanpoolTrip)

	returnArray = new Array((-1)*transitVanpoolTrip[i][b_location],transitVanpoolIncrease[i][b_location],transitVanpoolBicycle[i][b_location])

	

	return returnArray;

	//if (b_location > transitVanpoolValue[i].length) document.forms[0].lookup.value= ""

	//else document.forms[0].lookup.value= transitVanpoolTrip[i][b_location]

}



function getParkingCashOut(b_value,b_location){

	b_value = parseFloat(b_value); if (isNaN(b_value)) b_value = 0;

	b_location = parseInt(b_location); if (isNaN(b_location)) b_location = 0;

	var nRecords = parkingCashOutValue.length - 1;

	for (i=0; i<nRecords; i++) {

		if (parkingCashOutValue[i]>=b_value) break;	

	}

	

	returnArray = new Array((-1)*parkingCashOutTrip[i][b_location],parkingCashOutIncrease[i][b_location],parkingCashOutBicycle[i][b_location])

	

	return returnArray;

}



function getTelecommuting(b_value,b_location){

	b_value = parseFloat(b_value); if (isNaN(b_value)) b_value = 0;

	b_location = parseInt(b_location); if (isNaN(b_location)) b_location = 0;

	

	var noTrip = b_value;

	var driveAlone = (-1)*(areaType[b_location][0]/areaType[b_location][8])*noTrip;

	var carpool = (-1)*(areaType[b_location][1]/areaType[b_location][8])*noTrip;

	var vanpool = (-1)*(areaType[b_location][2]/areaType[b_location][8])*noTrip;

	var transit = (-1)*(areaType[b_location][3]/areaType[b_location][8])*noTrip;

	var bicycle = 0;

	var pedestrian = 0;

	var other = 0;

	

	

	var telecommutingTrip = (-1)*(driveAlone + (carpool/2.2) + (vanpool/6));

	var telecommutingIncrease = vanpool + transit;

	var telecommutingBicycle = bicycle + pedestrian;

	/*

	alert(telecommutingTrip);

	alert(telecommutingIncrease);

	alert(telecommutingBicycle);

	*/

	

	returnArray = new Array(telecommutingTrip,telecommutingIncrease,telecommutingBicycle)

	//alert(returnArray)

	

	return returnArray;

	//if (b_location > 2) document.forms[0].lookup.value= ""

	//else document.forms[0].lookup.value= telecommutingTrip;

}



function getSupportingBenefit(b_index,b_location){

	b_index = parseInt(b_index); if (isNaN(b_index)) b_index = 0;

	b_location = parseInt(b_location); if (isNaN(b_location)) b_location = 0;

	

	var currentBenefit = null;

	if (b_index==-1) currentBenefit = guaranteedRideHomeBenefit; // Required Benefit 

	else if (b_index==0) currentBenefit = rideshareCarpoolMatchingBenefit;

	else if (b_index==2) currentBenefit = employeePaidPreTaxTransitVanpoolBenefit;

	else if (b_index==4) currentBenefit = shuttlesFromTransitBenefit;

	else if (b_index==5) currentBenefit = preferredParkingForCarpoolsVanpoolsBenefit;

	else if (b_index==6) currentBenefit = securebicycleparkingandshowersBenefit;

	else if (b_index==7) currentBenefit = discountscouponsforbikewalkersBenefit;

	

	returnArray = new Array((-1)*currentBenefit[b_location],currentBenefit[b_location+3],currentBenefit[b_location+6])

	

	return returnArray;

}