//manuel villanueva 5/26/06
function ftInCm(form) {var ft = Math.abs(form.ft.value);var inCm = Math.abs(form.inCm.value);if((form.inCm.value==null || form.inCm.value=="" || isNaN(form.inCm.value))&& form.choice[1].checked ){form.answer.value="?";form.solution.value="?";var text1 = "\"convert to foot, inch\" is selected.";var text2 = "\nPlease enter centimeters in the appropriate box.";var text3 = "\nUse numbers only. Use a period for decimal place.";alert(text1 + text2 + text3);form.inCm.focus();form.inCm.select();return false;}else if((form.ft.value==null || (form.ft.value=="" && form.inCm.value=="" )|| isNaN(form.ft.value) || form.inCm.value==null || isNaN(form.inCm.value))&& form.choice[0].checked){form.answer.value="?";form.solution.value="?";var text1 = "\"convert to centimeters\" is selected.";var text2 = "\nPlease enter feet and or inches in the appropriate boxes.";var text3 = "\nUse numbers only. Use a period for decimal place.";alert(text1 + text2 + text3);}else if((form.inCm.value==null || form.inCm.value=="" || isNaN(form.inCm.value))&& form.choice[1].checked ){form.answer.value="?";form.solution.value="?";var text1 = "\"convert centimeters to foot, inch\" is selected.";var text2 = "\nPlease enter centimeters in the appropriate box.";var text3 = "\nUse numbers only. Use a period for decimal place.";alert(text1 + text2 + text3);form.inCm.focus();form.inCm.select();return false;}else if  ((form.choice[0].checked)&& (ft <= 0)) {var formula = inCm *2.54;var answer = Math.round(formula*10)/10;form.answer.value = inCm + "\" = " + answer + " cm";form.solution.value = inCm + "\" · 2.54 = " + answer + " cm";}else if  (form.choice[0].checked && (form.inCm.value == "")) {var formula = ft * 12 * 2.54;var answer = Math.round(formula*10)/10;var inch = Math.round((ft*12)*10)/10;text1 = "(";text2 = "\' · 12\") = ";text3 = "\"\n";text4 = "\" · 2.54 = ";text5 = " cm";form.answer.value = ft + "\' = " + answer + " cm";form.solution.value = text1 + ft + text2 + inch + text3 + inch + text4 + answer + text5;}else if  (form.choice[0].checked){var eft = eval(ft);var eInCm = eval(inCm);var formula = (eft*12 + eInCm)*2.54;var answer = Math.round(formula*10)/10;var inch = Math.round((eft*12)*10)/10 + eInCm;text1 = "(";text2 = "\' · 12\") + ";text3 = "\" = ";text4 = "\"\n";text5 = "\" · 2.54 = ";text6 = " cm";form.answer.value = ft + "\' " + inCm + "\" = "+ answer + " cm";form.solution.value = text1 + ft + text2 + inCm + text3 + inch + text4 + inch + text5 + answer + text6;}else if ((form.choice[1].checked)&& (inCm < 30.48)) {var f1 = inCm * 0.3937008;var f2 = Math.round(f1*10)/10;form.answer.value = inCm + " cm = " + f2 + "\"";form.solution.value = inCm + " cm · 0.3937008 = " + f2 + "\"";}else {var f1 = inCm * 0.3937008;var f2 = f1 / 12;var f3 = f1 % 12;var f4 = parseInt(f2);var f5 = Math.round(f3*10)/10;var f6 = Math.round(f1*10)/10;var text1 = "\"\n";var text2 = "\"";var text3 = " ÷ 12 = ";var text4 = "\' remainder ";var text5 = "\nor ";var answer = f4 + "\' " + f5 +"\"";form.answer.value = inCm + " cm = " + answer;form.solution.value = inCm + " cm · 0.3937008 = " + f6 + text1 + f6 + text2 + text3 + f4 + text4 + f5 + text2 + text5 + answer;}}