// JavaScript Document
function calculate(){
	//document.form1.yourFee.value = "Updating Fee Structure.";
	//get selected index property from the list in the form size
	 ind = document.form1.size.selectedIndex;
	 //get patient name
	 //patientName = document.form1.name.value;
	 //based on the selected index from the form list gat the selected value and send it to case structure below
	 householdSize = document.form1.size.options[ind].value;
	 //get checked option
	 monthlyIncome = document.form1.incomeType[0].checked;
	 yearlyIncome = document.form1.incomeType[1].checked;
	 //get the income amount from the form
	 incomeAmount = document.form1.incomeAmount.value;
	 //set fee answers
	 answerL0 = "Cuota mínima de $20.00 por cada visita al consultorio. \n\nSe cargará una cuota mínima de $5.00 por cada procedimiento de laboratorio ";
	 answerL1 = "Cuota mínima de $20.00 ó 20% de los cargos regulares, lo que sea mayor, por cada visita al consultorio.\n\n Un 20% del cargo por laboratorio se cobrará por cada procedimiento de laboratorio";
	 answerL2 = "Cuota mínima de $20.00 ó 40% de los cargos regulares, lo que sea mayor, por cada visita al consultorio.\n\n Un 40% del cargo por laboratorio se cobrará por cada procedimiento de laboratorio";
	 answerL3 = "Cuota mínima de $20.00 ó 60% de los cargos regulares, lo que sea mayor, por cada visita al consultorio.\n\n Un 60% del cargo por laboratorio se cobrará por cada procedimiento de laboratorio";
	 answerL4 = "Cuota mínima de $20.00 u 80% de los cargos regulares, lo que sea mayor, por cada visita al consultorio. \n\nUn 80% del cargo por laboratorio se cobrará por cada procedimiento de laboratorio";
	 answerL5 = "Cuota mínima de $20.00 ó 100% de los cargos regulares, lo que sea mayor, por cada visita al consultorio.\n\n Un 100% del cargo por laboratorio se cobrará por cada procedimiento de laboratorio";
	
	 
	//set up the income guidelines using array for every level
	//Monthly income for L0 
	//last update july 2007
	monthlyL0 = new Array(9);
		monthlyL0[0] = 851;
		monthlyL0[1] = 1141;
		monthlyL0[2] = 1431;
		monthlyL0[3] = 1721;
		monthlyL0[4] = 2011;
		monthlyL0[5] = 2301;
		monthlyL0[6] = 2591;
		monthlyL0[7] = 2881;
		monthlyL0[8] = 3171;
		monthlyL0[9] = 3461;
	//Annuall income for L0 
	yearlyL0 = new Array(9);
		yearlyL0[0] = 10210;
		yearlyL0[1] = 13690;
		yearlyL0[2] = 17170;
		yearlyL0[3] = 20650;
		yearlyL0[4] = 24130;
		yearlyL0[5] = 27610;
		yearlyL0[6] = 31090;
		yearlyL0[7] = 34570;
		yearlyL0[8] = 38050;
		yearlyL0[9] = 41530;
	//Annuall income for L1 
	yearlyL1 = new Array(9);
		yearlyL1[0] = yearlyL0[0]*1.25;
		yearlyL1[1] = yearlyL0[1]*1.25;
		yearlyL1[2] = yearlyL0[2]*1.25;
		yearlyL1[3] = yearlyL0[3]*1.25;
		yearlyL1[4] = yearlyL0[4]*1.25;
		yearlyL1[5] = yearlyL0[5]*1.25;
		yearlyL1[6] = yearlyL0[6]*1.25;
		yearlyL1[7] = yearlyL0[7]*1.25;
		yearlyL1[8] = yearlyL0[8]*1.25;
		yearlyL1[9] = yearlyL0[9]*1.25;
    //Annuall income for L2 
	yearlyL2 = new Array(9);
		yearlyL2[0] = yearlyL0[0]*1.5;
		yearlyL2[1] = yearlyL0[1]*1.5;
		yearlyL2[2] = yearlyL0[2]*1.5;
		yearlyL2[3] = yearlyL0[3]*1.5;
		yearlyL2[4] = yearlyL0[4]*1.5;
		yearlyL2[5] = yearlyL0[5]*1.5;
		yearlyL2[6] = yearlyL0[6]*1.5;
		yearlyL2[7] = yearlyL0[7]*1.5;
		yearlyL2[8] = yearlyL0[8]*1.5;
		yearlyL2[9] = yearlyL0[9]*1.5;
	//Annuall income for L3 
	yearlyL3 = new Array(9);
		yearlyL3[0] = yearlyL0[0]*1.75;
		yearlyL3[1] = yearlyL0[1]*1.75;
		yearlyL3[2] = yearlyL0[2]*1.75;
		yearlyL3[3] = yearlyL0[3]*1.75;
		yearlyL3[4] = yearlyL0[4]*1.75;
		yearlyL3[5] = yearlyL0[5]*1.75;
		yearlyL3[6] = yearlyL0[6]*1.75;
		yearlyL3[7] = yearlyL0[7]*1.75;
		yearlyL3[8] = yearlyL0[8]*1.75;
		yearlyL3[9] = yearlyL0[9]*1.75;
	//Annuall income for L4 
	yearlyL4 = new Array(9);
		yearlyL4[0] = yearlyL0[0]*2;
		yearlyL4[1] = yearlyL0[1]*2;
		yearlyL4[2] = yearlyL0[2]*2;
		yearlyL4[3] = yearlyL0[3]*2;
		yearlyL4[4] = yearlyL0[4]*2;
		yearlyL4[5] = yearlyL0[5]*2;
		yearlyL4[6] = yearlyL0[6]*2;
		yearlyL4[7] = yearlyL0[7]*2;
		yearlyL4[8] = yearlyL0[8]*2;
		yearlyL4[9] = yearlyL0[9]*2;
	//Annuall income for L5 
	yearlyL5 = new Array(9);
		yearlyL5[0] = (yearlyL0[0]*2)+1;
		yearlyL5[1] = (yearlyL0[1]*2)+1;
		yearlyL5[2] = (yearlyL0[2]*2)+1;
		yearlyL5[3] = (yearlyL0[3]*2)+1;
		yearlyL5[4] = (yearlyL0[4]*2)+1;
		yearlyL5[5] = (yearlyL0[5]*2)+1;
		yearlyL5[6] = (yearlyL0[6]*2)+1;
		yearlyL5[7] = (yearlyL0[7]*2)+1;
		yearlyL5[8] = (yearlyL0[8]*2)+1;
		yearlyL5[9] = (yearlyL0[9]*2)+1;
	//Monthly income for L1 
	monthlyL1 = new Array(9);
		monthlyL1[0] = yearlyL1[0]/12;
		monthlyL1[1] = yearlyL1[1]/12;
		monthlyL1[2] = yearlyL1[2]/12;
		monthlyL1[3] = yearlyL1[3]/12;
		monthlyL1[4] = yearlyL1[4]/12;
		monthlyL1[5] = yearlyL1[5]/12;
		monthlyL1[6] = yearlyL1[6]/12;
		monthlyL1[7] = yearlyL1[7]/12;
		monthlyL1[8] = yearlyL1[8]/12;
		monthlyL1[9] = yearlyL1[9]/12;

	//Monthly income for L2 
	monthlyL2 = new Array(9);
		monthlyL2[0] = yearlyL2[0]/12;
		monthlyL2[1] = yearlyL2[1]/12;
		monthlyL2[2] = yearlyL2[2]/12;
		monthlyL2[3] = yearlyL2[3]/12;
		monthlyL2[4] = yearlyL2[4]/12;
		monthlyL2[5] = yearlyL2[5]/12;
		monthlyL2[6] = yearlyL2[6]/12;
		monthlyL2[7] = yearlyL2[7]/12;
		monthlyL2[8] = yearlyL2[8]/12;
		monthlyL2[9] = yearlyL2[9]/12;

	//Monthly income for L3 
	monthlyL3 = new Array(9);
		monthlyL3[0] = yearlyL3[0]/12;
		monthlyL3[1] = yearlyL3[1]/12;
		monthlyL3[2] = yearlyL3[3]/12;
		monthlyL3[3] = yearlyL3[3]/12;
		monthlyL3[4] = yearlyL3[4]/12;
		monthlyL3[5] = yearlyL3[5]/12;
		monthlyL3[6] = yearlyL3[6]/12;
		monthlyL3[7] = yearlyL3[7]/12;
		monthlyL3[8] = yearlyL3[8]/12;
		monthlyL3[9] = yearlyL3[9]/12;
	//Monthly income for L4 
	monthlyL4 = new Array(9);
		monthlyL4[0] = yearlyL4[0]/12;
		monthlyL4[1] = yearlyL4[1]/12;
		monthlyL4[2] = yearlyL4[2]/12;
		monthlyL4[3] = yearlyL4[3]/12;
		monthlyL4[4] = yearlyL4[4]/12;
		monthlyL4[5] = yearlyL4[5]/12;
		monthlyL4[6] = yearlyL4[6]/12;
		monthlyL4[7] = yearlyL4[7]/12;
		monthlyL4[8] = yearlyL4[8]/12;
		monthlyL4[9] = yearlyL4[9]/12;

	//Monthly income for L5 
	monthlyL5 = new Array(9);
		monthlyL5[0] = monthlyL4[0]
		monthlyL5[1] = monthlyL4[1]
		monthlyL5[2] = monthlyL4[2]
		monthlyL5[3] = monthlyL4[3]
		monthlyL5[4] = monthlyL4[4]
		monthlyL5[5] = monthlyL4[5]
		monthlyL5[6] = monthlyL4[6]
		monthlyL5[7] = monthlyL4[7]
		monthlyL5[8] = monthlyL4[8]
		monthlyL5[9] = monthlyL4[9]

		
	//chose what to calculate based on index(householdsize) received from the form
	switch(householdSize) {
		case "1":
			//do comparison
			if (monthlyIncome == true){
				//check monthly income
				if(incomeAmount > monthlyL5[0] || incomeAmount <= monthlyL5[0] && incomeAmount > monthlyL4[0]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[0] && incomeAmount <= monthlyL4[0] && incomeAmount > monthlyL3[0]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[0] && incomeAmount <= monthlyL4[0] && incomeAmount <= monthlyL3[0] && incomeAmount > monthlyL2[0]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[0] && incomeAmount <= monthlyL4[0] && incomeAmount <= monthlyL3[0] && incomeAmount <= monthlyL2[0] && incomeAmount > monthlyL1[0]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[0] && incomeAmount <= monthlyL4[0] && incomeAmount <= monthlyL3[0] && incomeAmount <= monthlyL2[0] && incomeAmount <= monthlyL1[0] && incomeAmount > monthlyL0[0]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[0] && incomeAmount <= monthlyL4[0] && incomeAmount <= monthlyL3[0] && incomeAmount <= monthlyL2[0] && incomeAmount <= monthlyL1[0] && incomeAmount <= monthlyL0[0]) document.form1.yourFee.value = answerL0;
			
			}else{
				//check yearly income
				if(incomeAmount > yearlyL5[0] || incomeAmount <= yearlyL5[0] && incomeAmount > yearlyL4[0]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[0] && incomeAmount <= yearlyL4[0] && incomeAmount > yearlyL3[0]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[0] && incomeAmount <= yearlyL4[0] && incomeAmount <= yearlyL3[0] && incomeAmount > yearlyL2[0]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[0] && incomeAmount <= yearlyL4[0] && incomeAmount <= yearlyL3[0] && incomeAmount <= yearlyL2[0] && incomeAmount > yearlyL1[0]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[0] && incomeAmount <= yearlyL4[0] && incomeAmount <= yearlyL3[0] && incomeAmount <= yearlyL2[0] && incomeAmount <= yearlyL1[0] && incomeAmount > yearlyL0[0]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[0] && incomeAmount <= yearlyL4[0] && incomeAmount <= yearlyL3[0] && incomeAmount <= yearlyL2[0] && incomeAmount <= yearlyL1[0] && incomeAmount <= yearlyL0[0]) document.form1.yourFee.value = answerL0;
			
				}
			break;
		case "2":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[1] || incomeAmount <= monthlyL5[1] && incomeAmount > monthlyL4[1]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[1] && incomeAmount <= monthlyL4[1] && incomeAmount > monthlyL3[1]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[1] && incomeAmount <= monthlyL4[1] && incomeAmount <= monthlyL3[1] && incomeAmount > monthlyL2[1]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[1] && incomeAmount <= monthlyL4[1] && incomeAmount <= monthlyL3[1] && incomeAmount <= monthlyL2[1] && incomeAmount > monthlyL1[1])  document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[1] && incomeAmount <= monthlyL4[1] && incomeAmount <= monthlyL3[1] && incomeAmount <= monthlyL2[1] && incomeAmount <= monthlyL1[1] && incomeAmount > monthlyL0[1]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[1] && incomeAmount <= monthlyL4[1] && incomeAmount <= monthlyL3[1] && incomeAmount <= monthlyL2[1] && incomeAmount <= monthlyL1[1] && incomeAmount <= monthlyL0[1]) document.form1.yourFee.value = answerL0;
			}else{
				if(incomeAmount > yearlyL5[1] || incomeAmount <= yearlyL5[1] && incomeAmount > yearlyL4[1]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[1] && incomeAmount <= yearlyL4[1] && incomeAmount > yearlyL3[1]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[1] && incomeAmount <= yearlyL4[1] && incomeAmount <= yearlyL3[1] && incomeAmount > yearlyL2[1]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[1] && incomeAmount <= yearlyL4[1] && incomeAmount <= yearlyL3[1] && incomeAmount <= yearlyL2[1] && incomeAmount > yearlyL1[1]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[1] && incomeAmount <= yearlyL4[1] && incomeAmount <= yearlyL3[1] && incomeAmount <= yearlyL2[1] && incomeAmount <= yearlyL1[1] && incomeAmount > yearlyL0[1]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[1] && incomeAmount <= yearlyL4[1] && incomeAmount <= yearlyL3[1] && incomeAmount <= yearlyL2[1] && incomeAmount <= yearlyL1[1] && incomeAmount <= yearlyL0[1]) document.form1.yourFee.value = answerL0;

			}
			break;
		case "3":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[2] || incomeAmount <= monthlyL5[2] && incomeAmount > monthlyL4[2]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[2] && incomeAmount <= monthlyL4[2] && incomeAmount > monthlyL3[2]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[2] && incomeAmount <= monthlyL4[2] && incomeAmount <= monthlyL3[2] && incomeAmount > monthlyL2[2]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[2] && incomeAmount <= monthlyL4[2] && incomeAmount <= monthlyL3[2] && incomeAmount <= monthlyL2[2] && incomeAmount > monthlyL1[2]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[2] && incomeAmount <= monthlyL4[2] && incomeAmount <= monthlyL3[2] && incomeAmount <= monthlyL2[2] && incomeAmount <= monthlyL1[2] && incomeAmount > monthlyL0[2]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[2] && incomeAmount <= monthlyL4[2] && incomeAmount <= monthlyL3[2] && incomeAmount <= monthlyL2[2] && incomeAmount <= monthlyL1[2] && incomeAmount <= monthlyL0[2]) document.form1.yourFee.value = answerL0;
			}else{
				if(incomeAmount > yearlyL5[2] || incomeAmount <= yearlyL5[2] && incomeAmount > yearlyL4[2]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[2] && incomeAmount <= yearlyL4[2] && incomeAmount > yearlyL3[2]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[2] && incomeAmount <= yearlyL4[2] && incomeAmount <= yearlyL3[2] && incomeAmount > yearlyL2[2]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[2] && incomeAmount <= yearlyL4[2] && incomeAmount <= yearlyL3[2] && incomeAmount <= yearlyL2[2] && incomeAmount > yearlyL1[2]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[2] && incomeAmount <= yearlyL4[2] && incomeAmount <= yearlyL3[2] && incomeAmount <= yearlyL2[2] && incomeAmount <= yearlyL1[2] && incomeAmount > yearlyL0[2]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[2] && incomeAmount <= yearlyL4[2] && incomeAmount <= yearlyL3[2] && incomeAmount <= yearlyL2[2] && incomeAmount <= yearlyL1[2] && incomeAmount <= yearlyL0[2]) document.form1.yourFee.value = answerL0;

			}
			break;
		case "4":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[3] || incomeAmount <= monthlyL5[3] && incomeAmount > monthlyL4[3]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[3] && incomeAmount <= monthlyL4[3] && incomeAmount > monthlyL3[3]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[3] && incomeAmount <= monthlyL4[3] && incomeAmount <= monthlyL3[3] && incomeAmount > monthlyL2[3]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[3] && incomeAmount <= monthlyL4[3] && incomeAmount <= monthlyL3[3] && incomeAmount <= monthlyL2[3] && incomeAmount > monthlyL1[3]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[3] && incomeAmount <= monthlyL4[3] && incomeAmount <= monthlyL3[3] && incomeAmount <= monthlyL2[3] && incomeAmount <= monthlyL1[3] && incomeAmount > monthlyL0[3]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[3] && incomeAmount <= monthlyL4[3] && incomeAmount <= monthlyL3[3] && incomeAmount <= monthlyL2[3] && incomeAmount <= monthlyL1[3] && incomeAmount <= monthlyL0[3]) document.form1.yourFee.value = answerL0;
			}else{
				if(incomeAmount > yearlyL5[3] || incomeAmount <= yearlyL5[3] && incomeAmount > yearlyL4[3]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[3] && incomeAmount <= yearlyL4[3] && incomeAmount > yearlyL3[3]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[3] && incomeAmount <= yearlyL4[3] && incomeAmount <= yearlyL3[3] && incomeAmount > yearlyL2[3]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[3] && incomeAmount <= yearlyL4[3] && incomeAmount <= yearlyL3[3] && incomeAmount <= yearlyL2[3] && incomeAmount > yearlyL1[3]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[3] && incomeAmount <= yearlyL4[3] && incomeAmount <= yearlyL3[3] && incomeAmount <= yearlyL2[3] && incomeAmount <= yearlyL1[3] && incomeAmount > yearlyL0[3]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[3] && incomeAmount <= yearlyL4[3] && incomeAmount <= yearlyL3[3] && incomeAmount <= yearlyL2[3] && incomeAmount <= yearlyL1[3] && incomeAmount <= yearlyL0[3]) document.form1.yourFee.value = answerL0;
			}
			break;
		case "5":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[4] || incomeAmount <= monthlyL5[4] && incomeAmount > monthlyL4[4]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[4] && incomeAmount <= monthlyL4[4] && incomeAmount > monthlyL3[4]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[4] && incomeAmount <= monthlyL4[4] && incomeAmount <= monthlyL3[4] && incomeAmount > monthlyL2[4]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[4] && incomeAmount <= monthlyL4[4] && incomeAmount <= monthlyL3[4] && incomeAmount <= monthlyL2[4] && incomeAmount > monthlyL1[4]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[4] && incomeAmount <= monthlyL4[4] && incomeAmount <= monthlyL3[4] && incomeAmount <= monthlyL2[4] && incomeAmount <= monthlyL1[4] && incomeAmount > monthlyL0[4]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[4] && incomeAmount <= monthlyL4[4] && incomeAmount <= monthlyL3[4] && incomeAmount <= monthlyL2[4] && incomeAmount <= monthlyL1[4] && incomeAmount <= monthlyL0[4]) document.form1.yourFee.value = answerL0;
			}else{
				if(incomeAmount > yearlyL5[4] || incomeAmount <= yearlyL5[4] && incomeAmount > yearlyL4[4]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[4] && incomeAmount <= yearlyL4[4] && incomeAmount > yearlyL3[4]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[4] && incomeAmount <= yearlyL4[4] && incomeAmount <= yearlyL3[4] && incomeAmount > yearlyL2[4]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[4] && incomeAmount <= yearlyL4[4] && incomeAmount <= yearlyL3[4] && incomeAmount <= yearlyL2[4] && incomeAmount > yearlyL1[4]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[4] && incomeAmount <= yearlyL4[4] && incomeAmount <= yearlyL3[4] && incomeAmount <= yearlyL2[4] && incomeAmount <= yearlyL1[4] && incomeAmount > yearlyL0[4]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[4] && incomeAmount <= yearlyL4[4] && incomeAmount <= yearlyL3[4] && incomeAmount <= yearlyL2[4] && incomeAmount <= yearlyL1[4] && incomeAmount <= yearlyL0[4]) document.form1.yourFee.value = answerL0;

			}
			break;
		case "6":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[5] || incomeAmount <= monthlyL5[5] && incomeAmount > monthlyL4[5]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[5] && incomeAmount <= monthlyL4[5] && incomeAmount > monthlyL3[5]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[5] && incomeAmount <= monthlyL4[5] && incomeAmount <= monthlyL3[5] && incomeAmount > monthlyL2[5]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[5] && incomeAmount <= monthlyL4[5] && incomeAmount <= monthlyL3[5] && incomeAmount <= monthlyL2[5] && incomeAmount > monthlyL1[5]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[5] && incomeAmount <= monthlyL4[5] && incomeAmount <= monthlyL3[5] && incomeAmount <= monthlyL2[5] && incomeAmount <= monthlyL1[5] && incomeAmount > monthlyL0[5]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[5] && incomeAmount <= monthlyL4[5] && incomeAmount <= monthlyL3[5] && incomeAmount <= monthlyL2[5] && incomeAmount <= monthlyL1[5] && incomeAmount <= monthlyL0[5]) document.form1.yourFee.value = answerL0;
			}else{
				if(incomeAmount > yearlyL5[5] || incomeAmount <= yearlyL5[5] && incomeAmount > yearlyL4[5]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[5] && incomeAmount <= yearlyL4[5] && incomeAmount > yearlyL3[5]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[5] && incomeAmount <= yearlyL4[5] && incomeAmount <= yearlyL3[5] && incomeAmount > yearlyL2[5]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[5] && incomeAmount <= yearlyL4[5] && incomeAmount <= yearlyL3[5] && incomeAmount <= yearlyL2[5] && incomeAmount > yearlyL1[5]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[5] && incomeAmount <= yearlyL4[5] && incomeAmount <= yearlyL3[5] && incomeAmount <= yearlyL2[5] && incomeAmount <= yearlyL1[5] && incomeAmount > yearlyL0[5]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[5] && incomeAmount <= yearlyL4[5] && incomeAmount <= yearlyL3[5] && incomeAmount <= yearlyL2[5] && incomeAmount <= yearlyL1[5] && incomeAmount <= yearlyL0[5]) document.form1.yourFee.value = answerL0;

			}
			break;
		case "7":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[6] || incomeAmount <= monthlyL5[6] && incomeAmount > monthlyL4[6]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[6] && incomeAmount <= monthlyL4[6] && incomeAmount > monthlyL3[6]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[6] && incomeAmount <= monthlyL4[6] && incomeAmount <= monthlyL3[6] && incomeAmount > monthlyL2[6]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[6] && incomeAmount <= monthlyL4[6] && incomeAmount <= monthlyL3[6] && incomeAmount <= monthlyL2[6] && incomeAmount > monthlyL1[6]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[6] && incomeAmount <= monthlyL4[6] && incomeAmount <= monthlyL3[6] && incomeAmount <= monthlyL2[6] && incomeAmount <= monthlyL1[6] && incomeAmount > monthlyL0[6]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[6] && incomeAmount <= monthlyL4[6] && incomeAmount <= monthlyL3[6] && incomeAmount <= monthlyL2[6] && incomeAmount <= monthlyL1[6] && incomeAmount <= monthlyL0[6]) document.form1.yourFee.value = answerL0;		
			}else{
				if(incomeAmount > yearlyL5[6] || incomeAmount <= yearlyL5[6] && incomeAmount > yearlyL4[6]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[6] && incomeAmount <= yearlyL4[6] && incomeAmount > yearlyL3[6]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[6] && incomeAmount <= yearlyL4[6] && incomeAmount <= yearlyL3[6] && incomeAmount > yearlyL2[6]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[6] && incomeAmount <= yearlyL4[6] && incomeAmount <= yearlyL3[6] && incomeAmount <= yearlyL2[6] && incomeAmount > yearlyL1[6]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[6] && incomeAmount <= yearlyL4[6] && incomeAmount <= yearlyL3[6] && incomeAmount <= yearlyL2[6] && incomeAmount <= yearlyL1[6] && incomeAmount > yearlyL0[6]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[6] && incomeAmount <= yearlyL4[6] && incomeAmount <= yearlyL3[6] && incomeAmount <= yearlyL2[6] && incomeAmount <= yearlyL1[6] && incomeAmount <= yearlyL0[6]) document.form1.yourFee.value = answerL0;

			}
			break;
		case "8":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[7] || incomeAmount <= monthlyL5[7] && incomeAmount > monthlyL4[7]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[7] && incomeAmount <= monthlyL4[7] && incomeAmount > monthlyL3[7]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[7] && incomeAmount <= monthlyL4[7] && incomeAmount <= monthlyL3[7] && incomeAmount > monthlyL2[7]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[7] && incomeAmount <= monthlyL4[7] && incomeAmount <= monthlyL3[7] && incomeAmount <= monthlyL2[7] && incomeAmount > monthlyL1[7]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[7] && incomeAmount <= monthlyL4[7] && incomeAmount <= monthlyL3[7] && incomeAmount <= monthlyL2[7] && incomeAmount <= monthlyL1[7] && incomeAmount > monthlyL0[7]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[7] && incomeAmount <= monthlyL4[7] && incomeAmount <= monthlyL3[7] && incomeAmount <= monthlyL2[7] && incomeAmount <= monthlyL1[7] && incomeAmount <= monthlyL0[7]) document.form1.yourFee.value = answerL0;		
			}else{
				if(incomeAmount > yearlyL5[7] || incomeAmount <= yearlyL5[7] && incomeAmount > yearlyL4[7]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[7] && incomeAmount <= yearlyL4[7] && incomeAmount > yearlyL3[7]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[7] && incomeAmount <= yearlyL4[7] && incomeAmount <= yearlyL3[7] && incomeAmount > yearlyL2[7]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[7] && incomeAmount <= yearlyL4[7] && incomeAmount <= yearlyL3[7] && incomeAmount <= yearlyL2[7] && incomeAmount > yearlyL1[7]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[7] && incomeAmount <= yearlyL4[7] && incomeAmount <= yearlyL3[7] && incomeAmount <= yearlyL2[7] && incomeAmount <= yearlyL1[7] && incomeAmount > yearlyL0[7]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[7] && incomeAmount <= yearlyL4[7] && incomeAmount <= yearlyL3[7] && incomeAmount <= yearlyL2[7] && incomeAmount <= yearlyL1[7] && incomeAmount <= yearlyL0[7]) document.form1.yourFee.value = answerL0;			
			}
			break;
		case "9":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[8] || incomeAmount <= monthlyL5[8] && incomeAmount > monthlyL4[8]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[8] && incomeAmount <= monthlyL4[8] && incomeAmount > monthlyL3[8]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[8] && incomeAmount <= monthlyL4[8] && incomeAmount <= monthlyL3[8] && incomeAmount > monthlyL2[8]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[8] && incomeAmount <= monthlyL4[8] && incomeAmount <= monthlyL3[8] && incomeAmount <= monthlyL2[8] && incomeAmount > monthlyL1[8]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[8] && incomeAmount <= monthlyL4[8] && incomeAmount <= monthlyL3[8] && incomeAmount <= monthlyL2[8] && incomeAmount <= monthlyL1[8] && incomeAmount > monthlyL0[8]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[8] && incomeAmount <= monthlyL4[8] && incomeAmount <= monthlyL3[8] && incomeAmount <= monthlyL2[8] && incomeAmount <= monthlyL1[8] && incomeAmount <= monthlyL0[8]) document.form1.yourFee.value = answerL0;		
			}else{
				if(incomeAmount > yearlyL5[8] || incomeAmount <= yearlyL5[8] && incomeAmount > yearlyL4[8]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[8] && incomeAmount <= yearlyL4[8] && incomeAmount > yearlyL3[8]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[8] && incomeAmount <= yearlyL4[8] && incomeAmount <= yearlyL3[8] && incomeAmount > yearlyL2[8]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[8] && incomeAmount <= yearlyL4[8] && incomeAmount <= yearlyL3[8] && incomeAmount <= yearlyL2[8] && incomeAmount > yearlyL1[8]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[8] && incomeAmount <= yearlyL4[8] && incomeAmount <= yearlyL3[8] && incomeAmount <= yearlyL2[8] && incomeAmount <= yearlyL1[8] && incomeAmount > yearlyL0[8]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[8] && incomeAmount <= yearlyL4[8] && incomeAmount <= yearlyL3[8] && incomeAmount <= yearlyL2[8] && incomeAmount <= yearlyL1[8] && incomeAmount <= yearlyL0[8]) document.form1.yourFee.value = answerL0;
			}
			break;
		case "10":
			//do comparison
			if (monthlyIncome == true){
				if(incomeAmount > monthlyL5[9] || incomeAmount <= monthlyL5[9] && incomeAmount > monthlyL4[9]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= monthlyL5[9] && incomeAmount <= monthlyL4[9] && incomeAmount > monthlyL3[9]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= monthlyL5[9] && incomeAmount <= monthlyL4[9] && incomeAmount <= monthlyL3[9] && incomeAmount > monthlyL2[9]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= monthlyL5[9] && incomeAmount <= monthlyL4[9] && incomeAmount <= monthlyL3[9] && incomeAmount <= monthlyL2[9] && incomeAmount > monthlyL1[9]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= monthlyL5[9] && incomeAmount <= monthlyL4[9] && incomeAmount <= monthlyL3[9] && incomeAmount <= monthlyL2[9] && incomeAmount <= monthlyL1[9] && incomeAmount > monthlyL0[9]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= monthlyL5[9] && incomeAmount <= monthlyL4[9] && incomeAmount <= monthlyL3[9] && incomeAmount <= monthlyL2[9] && incomeAmount <= monthlyL1[9] && incomeAmount <= monthlyL0[9]) document.form1.yourFee.value = answerL0;		
			}else{
				if(incomeAmount > yearlyL5[9] || incomeAmount <= yearlyL5[9] && incomeAmount > yearlyL4[9]) document.form1.yourFee.value = answerL5;
				if(incomeAmount <= yearlyL5[9] && incomeAmount <= yearlyL4[9] && incomeAmount > yearlyL3[9]) document.form1.yourFee.value = answerL4;
				if(incomeAmount <= yearlyL5[9] && incomeAmount <= yearlyL4[9] && incomeAmount <= yearlyL3[9] && incomeAmount > yearlyL2[9]) document.form1.yourFee.value = answerL3;
				if(incomeAmount <= yearlyL5[9] && incomeAmount <= yearlyL4[9] && incomeAmount <= yearlyL3[9] && incomeAmount <= yearlyL2[9] && incomeAmount > yearlyL1[9]) document.form1.yourFee.value = answerL2;
				if(incomeAmount <= yearlyL5[9] && incomeAmount <= yearlyL4[9] && incomeAmount <= yearlyL3[9] && incomeAmount <= yearlyL2[9] && incomeAmount <= yearlyL1[9] && incomeAmount > yearlyL0[9]) document.form1.yourFee.value = answerL1;
				if(incomeAmount <= yearlyL5[9] && incomeAmount <= yearlyL4[9] && incomeAmount <= yearlyL3[9] && incomeAmount <= yearlyL2[9] && incomeAmount <= yearlyL1[9] && incomeAmount <= yearlyL0[9]) document.form1.yourFee.value = answerL0;
			}
			break;
		default:
			window.alert("Ocurrió un error. Por favor inténtelo de nuevo ");
		}
	
}
 function checkValues(){
	if (chkNumeric(document.form1.incomeAmount.value) == false) 
      {
      alert("Usted ingresó:" + document.form1.incomeAmount.value + ". Sólo se permiten números y un punto.  \n \t\t Por favor inténtelo de nuevo. ");
      }
 }
 
 function chkNumeric(sText){
   
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

var arImages=new Array();
function Preload() {
 var temp = Preload.arguments; 
 for(x=0; x < temp.length; x++) {
  arImages[x]=new Image();
  arImages[x].src=Preload.arguments[x];
 }
}

