function rigid_uncheck() {
	if (document.machselect.rigid.checked == true) {
		document.machselect.compliant.checked = false;
		temp_rigid = true;
		temp_compliant = false;
	} // end if
} // end function uncheck

function compliant_uncheck() {
	if (document.machselect.compliant.checked == true){
		document.machselect.rigid.checked = false;
		temp_compliant = true;
		temp_rigid = false;
	} // end if
} // end function compliant uncheck

function display(info) {
	max = (parseInt(document.machselect.max_weight.value));
	min = (parseInt(document.machselect.min_weight.value));
	vert = (parseInt(document.machselect.vert_travel.value));
	hor = (parseInt(document.machselect.hor_travel.value));
	list = "";
	cap = (parseInt(0));
	
	if (min > max) {
		cap = min;
	} // end if

	if (max > min) {
		cap = max;
	} // end if

	if (document.machselect.rigid.checked == true) {
		if (((cap * 1.3) > 2000) || (hor > 120)) {
			list = "Cannot size Rigid machine with given information.";
		} // end if
		else {
			// test for tpa-5
			if (((cap * 1.3) < 501) && (vert < 56) && (hor < 113)) {
				list = list + "TPA-5\n";
			} // end if
			// test for tpa-10
 			if (((cap * 1.3) < 1001) && (vert < 56) && (hor < 113)) {
				list = list + "TPA-10\n";
			} // end if
			// test for tpa-15
 			if (((cap * 1.3) < 1501) && (vert < 56) && (hor < 114)) {
				list = list + "TPA-15\n";
			} // end if
			// test for tta-3
 			if (((cap * 1.3) < 301) && (vert < 25) && (hor < 73)) {
				list = list + "TTA-3\n";
			} // end if
			// test for tta-5
 			if (((cap * 1.3) < 501) && (vert < 25) && (hor < 73)) {
				list = list + "TTA-5\n";
			} // end if
			// test for ajb-60 with hoist
 			if (((cap * 1.3) < 401) && (hor < 121)) {
				list = list + "AJB-60 with Hoist\n";
			} // end if
			// test for ajb-90 with hoist
 			if (((cap * 1.3) < 601) && (hor < 121)) {
				list = list + "AJB-90 with Hoist\n";
			} // end if
			// test for ajb-120 with hoist
 			if (((cap * 1.3) < 801) && (hor < 121)) {
				list = list + "AJB-120 with Hoist\n";
			} // end if
			// test for ajb-200 with hoist
 			if (((cap * 1.3) < 1301) && (hor < 121)) {
				list = list + "AJB-200 with Hoist\n";
			} // end if
			// test for ajb-300 with hoist
 			if (((cap * 1.3) < 2001) && (hor < 121)) {
				list = list + "AJB-300 with Hoist\n";
			} // end if
			// test for jib crane with hoist
 			if (((cap * 1.3) < 2001) && (hor < 121)) {
				list = list + "Jib Crane with Hoist\n";
			} // end if
		} // end else
		if ((parseInt(list)) == 0) {
			list = "Cannot size Rigid machine with given information."
		} // end if
	} // end rigid if
	if (document.machselect.compliant.checked == true){
		if (((cap * 1.3) > 900) || (vert > 100) && (hor > 144)) {
			list = "Cannot size Compliant machine with given information.";
		} // end if
		else {
			// test for ata-300
 			if (((cap * 1.3) < 301) && (vert < 25) && (hor < 73)) {
				list = list + "ATA-300\n";
			} // end if
			// test for ata-500
 			if (((cap * 1.3) < 501) && (vert < 25) && (hor < 73)) {
				list = list + "ATA-500\n";
			} // end if
			// test for max-120
 			if (((cap * 1.3) < 121) && (vert < 81) && (hor == 0)) {
				list = list + "MAX-120\n";
			} // end if
			// test for max-120 with ajb-60
 			if (((cap * 1.3) < 121) && (vert < 81) && (hor < 121)) {
				list = list + "MAX-120 with AJB-60\n";
			} // end if
			// test for max-200
 			if (((cap * 1.3) < 201) && (vert < 81) && (hor == 0)) {
				list = list + "MAX-200\n";
			} // end if
			// test for max-200 with AJB-60
 			if (((cap * 1.3) < 201) && (vert < 81) && (hor < 121)) {
				list = list + "MAX-200 with AJB-60\n";
			} // end if
			// test for max-300
 			if (((cap * 1.3) < 301) && (vert < 81) && (hor == 0)) {
				list = list + "MAX-300\n";
			} // end if
			// test for max-300 with ajb-60
 			if (((cap * 1.3) < 301) && (vert < 81) && (hor < 121)) {
				list = list + "MAX-300 with AJB-60\n";
			} // end if
			// test for lodearm-3030
 			if (((cap * 1.3) < 201) && (vert < 37) && (hor < 96)) {
				list = list + "LodeArm-3030\n";
			} // end if
			else {
				// test for lodearm-3030
 				if (((cap * 1.3) < 181) && (vert < 40) && (hor < 99)) {
					list = list + "LodeArm-3030\n";
				} // end if
				else {
					// test for lodearm-3030
 					if (((cap * 1.3) < 161) && (vert < 43) && (hor < 102)) {
						list = list + "LodeArm-3030\n";
					} // end if
					else {
						// test for lodearm-3030
 						if (((cap * 1.3) < 146) && (vert < 46) && (hor < 105)) {
							list = list + "LodeArm-3030\n";
						} // end if
						else {
							// test for lodearm-3030
 							if (((cap * 1.3) < 131) && (vert < 49) && (hor < 108)) {
								list = list + "LodeArm-3030\n";
							} // end if
							else {
								// test for lodearm-3030
 								if (((cap * 1.3) < 116) && (vert < 52) && (hor < 111)) {
									list = list + "LodeArm-3030\n";
								} // end if
								else {
									// test for lodearm-3030
 									if (((cap * 1.3) < 101) && (vert < 55) && (hor < 114)) {
										list = list + "LodeArm-3030\n";
									} // end if
								} // end else
							} // end else
						} // end else
					} // end else
				} // end else
			} // end else
			// test for lodearm-4500
 			if (((cap * 1.3) < 201) && (vert < 26) && (hor < 96)) {
				list = list + "LodeArm-4500\n";
			} // end if
			else {
				// test for lodearm-4500
 				if (((cap * 1.3) < 181) && (vert < 28) && (hor < 99)) {
					list = list + "LodeArm-4500\n";
				} // end if
				else {
					// test for lodearm-4500
 					if (((cap * 1.3) < 161) && (vert < 30) && (hor < 102)) {
						list = list + "LodeArm-4500\n";
					} // end if
					else {
						// test for lodearm-4500
 						if (((cap * 1.3) < 146) && (vert < 32) && (hor < 105)) {
							list = list + "LodeArm-4500\n";
						} // end if
						else {
							// test for lodearm-4500
 							if (((cap * 1.3) < 131) && (vert < 34) && (hor < 108)) {
								list = list + "LodeArm-4500\n";
							} // end if
							else {
								// test for lodearm-4500
 								if (((cap * 1.3) < 116) && (vert < 36) && (hor < 111)) {
									list = list + "LodeArm-4500\n";
								} // end if
								else {
									// test for lodearm-4500
 									if (((cap * 1.3) < 101) && (vert < 38) && (hor < 114)) {
										list = list + "LodeArm-4500\n";
									} // end if
								} // end else
							} // end else
						} // end else
					} // end else
				} // end else
			} // end else
			// test for lodearm II
 			if (((cap * 1.3) < 201) && (vert < 26) && (hor < 47)) {
				list = list + "LodeArm-II\n";
			} // end if
			else {
				// test for lodearm II
 				if (((cap * 1.3) < 181) && (vert < 28) && (hor < 52)) {
					list = list + "LodeArm-II\n";
				} // end if
				else {
					// test for lodearm II
		 			if (((cap * 1.3) < 161) && (vert < 30) && (hor < 56)) {
						list = list + "LodeArm-II\n";
					} // end if
					else {
						// test for lodearm II
		 				if (((cap * 1.3) < 146) && (vert < 32) && (hor < 60)) {
							list = list + "LodeArm-II\n";
						} // end if
						else {
							// test for lodearm II
		 					if (((cap * 1.3) < 131) && (vert < 34) && (hor < 65)) {
								list = list + "LodeArm-II\n";
							} // end if
							else {
								// test for lodearm II
		 						if (((cap * 1.3) < 116) && (vert < 36) && (hor < 69)) {
									list = list + "LodeArm-II\n";
								} // end if
								else {
									// test for lodearm II
						 			if (((cap * 1.3) < 101) && (vert < 38) && (hor < 73)) {
										list = list + "LodeArm-II\n";
									} // end if
								} // end else
							} // end else
						} // end else
					} // end else
				} // end else
			} // end else
			// test for vl-5
 			if (((cap * 1.3) < 501) && (vert < 49) && (hor == 0)) {
				list = list + "VL-5\n";
			} // end if
			// test for vl-5 with AJB-90
			if (((cap * 1.3) < 501) && (vert < 49) && (hor < 121)) {
				list = list + "VL-5 with AJB-90\n";
			} // end if
			// test for vl-6
			if (((cap * 1.3) < 601) && (vert < 49) && (hor == 0)) {
				list = list + "VL-6\n";
			} // end if
			// test for vl-6 with AJB-120
			if (((cap * 1.3) < 601) && (vert < 49) && (hor < 121)) {
				list = list + "VL-6 with AJB-120\n";
			} // end if
			// test for g-66
			if (((cap * 1.3) < 408) && (vert < 45) && (hor < 67)) {
				list = list + "SAM G-66 without Parallel Linkage\n";
			} // end if
			// test for g-78
			if (((cap * 1.3) < 348) && (vert < 54) && (hor < 79)) {
				list = list + "SAM G-78 without Parallel Linkage\n";
			} // end if
			// test for g-96
			if (((cap * 1.3) < 282) && (vert < 67) && (hor < 97)) {
				list = list + "SAM G-96 without Parallel Linkage\n";
			} // end if
			// test for g-112
			if (((cap * 1.3) < 238) && (vert < 78) && (hor < 113)) {
				list = list + "SAM G-112 without Parallel Linkage\n";
			} // end if
			// test for g-126
			if (((cap * 1.3) < 199) && (vert < 88) && (hor < 127)) {
				list = list + "SAM G-126 without Parallel Linkage\n";
			} // end if
			// test for g-66 with parallel linkage
			if (((cap * 1.3) < 370) && (vert < 45) && (hor < 67)) {
				list = list + "SAM G-66 with Parallel Linkage\n";
			} // end if
			// test for g-78 with parallel linkage
			if (((cap * 1.3) < 326) && (vert < 54) && (hor < 79)) {
				list = list + "SAM G-78 with Parallel Linkage\n";
			} // end if
			// test for g-96 with parallel linkage
			if (((cap * 1.3) < 254) && (vert < 67) && (hor < 97)) {
				list = list + "SAM G-96 with Parallel Linkage\n";
			} // end if
			// test for g-112 with parallel linkage
			if (((cap * 1.3) < 199) && (vert < 78) && (hor < 113)) {
				list = list + "SAM G-112 with Parallel Linkage\n";
			} // end if
			// test for g-126 with parallel linkage
			if (((cap * 1.3) < 150) && (vert < 88) && (hor < 127)) {
				list = list + "SAM G-126 with Parallel Linkage\n";
			} // end if
			// test for k-66
			if (((cap * 1.3) < 733) && (vert < 45) && (hor < 67)) {
				list = list + "SAM K-66 without Parallel Linkage\n";
			} // end if
			// test for k-78
			if (((cap * 1.3) < 606) && (vert < 54) && (hor < 79)) {
				list = list + "SAM K-78 without Parallel Linkage\n";
			} // end if
			// test for k-96
			if (((cap * 1.3) < 496) && (vert < 67) && (hor < 97)) {
				list = list + "SAM K-96 without Parallel Linkage\n";
			} // end if
			// test for k-112
			if (((cap * 1.3) < 414) && (vert < 78) && (hor < 113)) {
				list = list + "SAM K-112 without Parallel Linkage\n";
			} // end if
			// test for k-126
			if (((cap * 1.3) < 359) && (vert < 88) && (hor < 127)) {
				list = list + "SAM K-126 without Parallel Linkage\n";
			} // end if
			// test for k-66 with parallel linkage
			if (((cap * 1.3) < 683) && (vert < 45) && (hor < 67)) {
				list = list + "SAM K-66 with Parallel Linkage\n";
			} // end if
			// test for k-78 with parallel linkage
			if (((cap * 1.3) < 551) && (vert < 54) && (hor < 79)) {
				list = list + "SAM K-78 with Parallel Linkage\n";
			} // end if
			// test for k-96 with parallel linkage
			if (((cap * 1.3) < 441) && (vert < 67) && (hor < 97)) {
				list = list + "SAM K-96 with Parallel Linkage\n";
			} // end if
			// test for k-112 with parallel linkage
			if (((cap * 1.3) < 353) && (vert < 78) && (hor < 113)) {
				list = list + "SAM K-112 with Parallel Linkage\n";
			} // end if
			// test for k-126 with parallel linkage
			if (((cap * 1.3) < 297) && (vert < 88) && (hor < 127)) {
				list = list + "SAM K-126 with Parallel Linkage\n";
			} // end if
			// test for p-66
			if (((cap * 1.3) < 991) && (vert < 45) && (hor < 67)) {
				list = list + "SAM P-66 without Parallel Linkage\n";
			} // end if
			// test for p-78
			if (((cap * 1.3) < 821) && (vert < 54) && (hor < 79)) {
				list = list + "SAM P-78 without Parallel Linkage\n";
			} // end if
			// test for p-96
			if (((cap * 1.3) < 678) && (vert < 67) && (hor < 97)) {
				list = list + "SAM P-96 without Parallel Linkage\n";
			} // end if
			// test for p-112
			if (((cap * 1.3) < 562) && (vert < 78) && (hor < 113)) {
				list = list + "SAM P-112 without Parallel Linkage\n";
			} // end if
			// test for p-126
			if (((cap * 1.3) < 518) && (vert < 88) && (hor < 127)) {
				list = list + "SAM P-126 without Parallel Linkage\n";
			} // end if
			// test for p-144
			if (((cap * 1.3) < 425) && (vert < 88) && (hor < 127)) {
				list = list + "SAM P-144 without Parallel Linkage\n";
			} // end if
					// test for p-66
			if (((cap * 1.3) < 936) && (vert < 45) && (hor < 67)) {
				list = list + "SAM P-66 with Parallel Linkage\n";
			} // end if
			// test for p-78
			if (((cap * 1.3) < 760) && (vert < 54) && (hor < 79)) {
				list = list + "SAM P-78 with Parallel Linkage\n";
			} // end if
			// test for p-96
			if (((cap * 1.3) < 612) && (vert < 67) && (hor < 97)) {
				list = list + "SAM P-96 with Parallel Linkage\n";
			} // end if
			// test for p-112
			if (((cap * 1.3) < 502) && (vert < 78) && (hor < 113)) {
				list = list + "SAM P-112 with Parallel Linkage\n";
			} // end if
			// test for p-126 with parallel linkage
			if (((cap * 1.3) < 441) && (vert < 88) && (hor < 127)) {
				list = list + "SAM P-126 with Parallel Linkage\n";
			} // end if
			// test for p-144 with parallel linkage
			if (((cap * 1.3) < 342) && (vert < 88) && (hor < 127)) {
				list = list + "SAM P-144 with Parallel Linkage\n";
			} // end if
			// test for ls-100
			if (((cap * 1.3) < 568) && (vert < 67) && (hor < 101)) {
				list = list + "SAM LS-100 without Parallel Linkage\n";
			} // end if
			// test for ls-116
			if (((cap * 1.3) < 480) && (vert < 78) && (hor < 117)) {
				list = list + "SAM LS-100 without Parallel Linkage\n";
			} // end if
			// test for ls-100 with parallel linkage
			if (((cap * 1.3) < 518) && (vert < 67) && (hor < 101)) {
				list = list + "SAM LS-100 with Parallel Linkage\n";
			} // end if
			// test for ls-100
			if (((cap * 1.3) < 430) && (vert < 67) && (hor < 101)) {
				list = list + "SAM LS-116 with Parallel Linakage";
			} // end if
		} // end else	
		if ((parseInt(list)) == 0) {
			list = "Cannot size Compliant machine with given information."
		} // end if
	} // end compliant if
	document.machselect.textdisplay.value = list;
} // end function

function clear_textarea(info) {
	document.machselect.textdisplay.value = "";
} // end function

function clear_all(info) {
	document.machselect.max_weight.value = "0";
	document.machselect.min_weight.value = "0";
	document.machselect.vert_travel.value = "0";
	document.machselect.hor_travel.value = "0";
	document.machselect.textdisplay.value = "";
	document.machselect.rigid.checked = false;
	document.machselect.compliant.checked = false;
} // end function

function undo_clear(info) {
	document.machselect.max_weight.value = max;
	document.machselect.min_weight.value = min;
	document.machselect.vert_travel.value = vert;
	document.machselect.hor_travel.value = hor;
	document.machselect.textdisplay.value = list;
	document.machselect.rigid.checked = temp_rigid;
	document.machselect.compliant.checked = temp_compliant;
} // end function