function inputForm_Validator(theForm)
{ 
	if (!theForm.PAYMENTTYPE[0].checked && !theForm.PAYMENTTYPE[1].checked)
	{
		alert("Please select type of payment.");
		theForm.PAYMENTTYPE[0].focus();
		return (false);
	}

	if (theForm.REF1.value == "")
	{
		alert("Please input a value for the \"Guest Name\" field.");
		theForm.REF1.focus();
		return (false);
	}
	else
	{
	             var temp;
	             var ok=""
	             for (var i=0; i<theForm.REF1.value.length; i++)
	              {
 	                 temp =  theForm.REF1.value.substring(i, i+1);
 	                 if ((temp) != " ") ok = ok + temp;
 		}
  		if (ok.length<=0)
  		{
  		    alert("Please input a value for the \"Guest Name\" field.");
		    theForm.REF1.focus();
	                  return (false);
  		} 
             }

	if (!isValidEnglishLetter(theForm.REF1))
	{
		theForm.REF1.value = "";
		theForm.REF1.focus();
		return (false);
	}
	if (theForm.CURRENCY.value == "")
	{
		  		alert("Please select a value for the \"Currency\" field.");
				theForm.CURRENCY.focus();
				return (false);

	}
	if (theForm.amount_int.value == "")
	{
		alert("Please input a value for the \"Amount\" field.");
		theForm.amount_int.value = "";
		theForm.amount_int.focus();
		return (false);
	}
	else
	{
	             var temp;
	             var ok=""
	             for (var i=0; i<theForm.amount_int.value.length; i++)
	              {
 	                 temp =  theForm.amount_int.value.substring(i, i+1);
 	                 if ((temp) != " ") ok = ok + temp;
 		}
  		if (ok.length<=0)
  		{
  		    alert("Please input a value for the \"Amount\" field.");
		    theForm.amount_int.focus();
	                  return (false);
  		} 
              }
	if (!isValidBaht(theForm.amount_int))
	{
		alert("Please input a value for the \"Amount\" field.");
		theForm.amount_int.value = "";
		theForm.amount_int.focus();
		return (false);
	}
	var valid = "0123456789"
	var temp;
	var ok = "";
	for (var i=0; i<theForm.amount_int.value.length; i++) {
		temp = "" + theForm.amount_int.value.substring(i, i+1);
		if (valid.indexOf(temp) != "-1") ok = ok + temp;
		}
	    theForm.AMOUNT.value = ok;

	if (theForm.CURRENCY.value == "392")
	{
		   if (theForm.amount_exp.value != "00")
		   {
				alert("The decimal value must be 00 for japanese YEN ");
				theForm.amount_exp.focus();
				return (false);
		   }
	}
	
	if (theForm.amount_exp.value == "")
	{
		   if (theForm.CURRENCY.value != "392")
		   {
				alert("Please input a value for the \"Amount\" field.");
				theForm.amount_exp.focus();
				return (false);
		   }
	}
	else
	{
	      
				 var temp;
	             var ok=""
	             for (var i=0; i<theForm.amount_exp.value.length; i++)
	              {
 	                 temp =  theForm.amount_exp.value.substring(i, i+1);
 	                 if ((temp) != " ") ok = ok + temp;
 		}
  		if (ok.length<=0)
  		{
  		    alert("Please input a value for the \"Amount\" field.");
		    theForm.amount_exp.focus();
	                  return (false);
  		} 
    }
	if (!isValidOnlyNumber(theForm.amount_exp))
	{
		theForm.amount_exp.value = "00";
		theForm.amount_exp.focus();
		alert("Please input a value for the \"Amount\" field.");
		return (false);
	}

	if (theForm.REF5.value == "")
	{
		alert("Please input a value for the \"Email Address\" field.");
		theForm.REF5.focus();
		return (false);
	}
	else
	{
	             var temp;
	             var ok=""
	             for (var i=0; i<theForm.REF5.value.length; i++)
	              {
 	                 temp =  theForm.REF5.value.substring(i, i+1);
 	                 if ((temp) != " ") ok = ok + temp;
 		}
  		if (ok.length<=0)
  		{
  		    alert("Please input a value for the \"Email Address\" field.");
		    theForm.REF5.focus();
	                  return (false);
  		}
  		
             }

	if (!isValidEnglishLetter(theForm.REF5))
	{
		theForm.REF5.value = "";
		theForm.REF5.focus();
		return (false);
	}

	if (!isValidEmail(theForm.REF5))
	{
		theForm.REF5.value = "";
		theForm.REF5.focus();
		return (false);
	}
	/* Comment By AE

	if (theForm.REF2.value == "")
	{
		alert("Please input a value for the \"Telephone\" field.");
		theForm.REF2.focus();
		return (false);
	}
	else
	{
	             var temp;
	             var ok=""
	             for (var i=0; i<theForm.REF2.value.length; i++)
	              {
 	                 temp =  theForm.REF2.value.substring(i, i+1);
 	                 if ((temp) != " ") ok = ok + temp;
 		}
  		if (ok.length<=0)
  		{
  		    alert("Please input a value for the \"Telephone\" field.");
		    theForm.REF2.focus();
	                  return (false);
  		} 
             }
	if (!isValidPhoneNumber(theForm.REF2))
	{
		theForm.REF2.value = "";
		theForm.REF2.focus();
		return (false);
	}
	*/
	if (!isValidEnglishLetter(theForm.REF3))
	{
		theForm.REF3.value = "";
		theForm.REF3.focus();
		return (false);
	}

	if (!isValidEnglishLetter(theForm.REF4))
	{
		theForm.REF4.value = "";
		theForm.REF4.focus();
		return (false);
	}

	if(parseInt(theForm.CURRENCY.value) == parseInt("392"))
	{
		theForm.AMOUNT.value = theForm.AMOUNT.value; 

	}
	else
	{
		theForm.AMOUNT.value = theForm.AMOUNT.value + theForm.amount_exp.value;
	}
	if (parseInt(theForm.AMOUNT.value) > parseInt("2000000000"))
	{
		alert("amount must <= 20,000,000.00");
		return (false);
		}
    if(parseInt(theForm.CURRENCY.value) == parseInt("392"))
        theForm.AMOUNTEXP10.value = "0"	;
	else
		theForm.AMOUNTEXP10.value = "-2";
}

