// JavaScript Document
function check_question() {
missinginfo = "";
field=document.myform
if (field.Enquiry.value == ""){
alert("Sorry, you have forgotten to type in your message !");
} else {
processform();
}
}

function IsNumeric(strString)
//  check for valid numeric strings	
{
   var strValidChars = "0123456789.-+";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
        {
         blnResult = false;
        }
      }
   return blnResult;
}

function processform() {
missinginfo = "";
field=document.myform
if (field.FullName) {
	if ((field.FullName.id == "required") && (field.FullName.value == "")) {
	    missinginfo += "\n     -  Your Full Name Missing";
	}
}

if (field.Tel) {
	if ((field.Tel.id == "required") && !(IsNumeric(field.Tel.value))) {
	    missinginfo += "\n     -  Invalid Contact Number";
	}

}


displaymissingmessage()
}

function displaymissingmessage() {
if (missinginfo != "") {
missinginfo ="_______________________________\n" +
"The field(s) below incorrect or not filled:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
}
else {
document.myform.submit()
}
}
