// *********************// check if textfield contains a number	  function gIsaNumber(boxName)    {   var fieldString = boxName.value   var okChars = "0123456789.-,$%";   var strChar;   var strCheck = true;   var fieldNumber = "" ;   var count ;if (fieldString.length == 0) {boxName.value = 0}else {   for (count = 0; count < fieldString.length && strCheck == true; count++) {     strChar = fieldString.charAt(count);     if (okChars.indexOf(strChar) == -1) {strCheck = false;}     else if (strChar == ",") {strChar ="" ;}  	 else if (strChar == "$") {strChar ="" ;} 	 else if (strChar == "%") {strChar ="" ;}	 else {fieldNumber = fieldNumber + strChar ;}	 }  // end For .. Next	 if (strCheck) {boxName.value = fieldNumber;}	 else {	 gShowError(boxName) ;     alert("Please replace this non numeric value!");	 } // end if	 } // end else	 return strCheck ;   } // end function// *********************// ensure that number in textfield is read as a numberfunction gReadNumber(inputVar){var varValue ;if (inputVar >= 0) {varValue = Math.abs(inputVar) ;}else {varValue = - Math.abs(inputVar) ;}return varValue ;}// *********************// focus on errant textfield	  function gShowError(boxName)    {     boxName.select() ;   boxName.focus() ;   }   // *********************// This function uses gIsaNumber(boxName) to check the cotents of each input boxfunction gCheckInput ()    {  var count ;var numCheck ;var check = true ;for (count = 0; count < document.inputForm.elements.length -1; count++) {if (document.inputForm.elements[count].type == "text") { // only look at text fieldsnumCheck = gIsaNumber(document.inputForm.elements[count]) ;if (!numCheck) {check = false;}}}return check   } // end function// *********************// this function formats dollar amounts to change// $.56 to $0.56// $-4.76 to -$4.76// the input value X is a number that has been rounded to the desired number of placesfunction gPrintMoney (X) {var msgif (X < -1) {msg = "-$" + Math.abs(X) ;}else if (X < 0) {msg = "-$0" + Math.abs(X) ;}else if (X < 1) {msg = "$0" + X ;}else {msg = "$" + X ;}return msg;}  // end function// *********************function gPrintRow(col1, col2, col3, col4, col5) {document.write("<TR> <TD>", col1,"</TD><TD>", col2,"</TD><TD>", col3,"</TD> <TD>", col4,"</TD> <TD>", col5,"</TD></TR>\n");}  // end function// *********************