function checkFields(theform) {
missinginfo = "";
var valid = "0123456789";
var ok = "yes";
var temp;
var tempcode;
var illegalChars = /\t/;
//var illegalSpace =/\t\;

if (document.form.titlename.options[document.form.titlename.selectedIndex].value == "Please Select" ) {
missinginfo += "\n     -  Title ";
}

//===============
if (document.form.customername.value == "") {
missinginfo += "\n     -  Name";
}
else if (illegalChars.test(document.form.customername.value)) {

       missinginfo +=  "\n     -  The Name contains illegal characters. Please Don't use SPACE between your name characters.";
    }
 else
   {
      for (var i=0; i<document.form.customername.value.length; i++)
       {
          tempcode = "" + document.form.customername.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) >= "0")
          {
          missinginfo += "\n     -  Invalid Name";
          }
    }
	
//===============		
if (document.form.customercountry.options[document.form.customercountry.selectedIndex].value == "Please Select" ) {
missinginfo += "\n     -  Country";
}

//===============
if (document.form.customertelephone.value == "") {
missinginfo += "\n     -  No. Telephone";
}
else if (illegalChars.test(document.form.customertelephone.value)) {

       missinginfo +=  "\n     -  The Telephone contains illegal characters.";
    }
 else
   {
      for (var i=0; i<document.form.customertelephone.value.length; i++)
       {
          tempcode = "" + document.form.customertelephone.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) == "-1")
          {
          missinginfo += "\n     -  Invalid Telephone, Please enter numeric value";
          }
    }

//===============	
if (document.form.customeremail.value == "")
{
  missinginfo += "\n     -  E-mail Address";
}
else if ((document.form.customeremail.value == "") || (document.form.customeremail.value.indexOf('@') == -1) ||(document.form.customeremail.value.indexOf('.') == -1))
{
  missinginfo += "\n     -  Invalid E-mail Address";
}
//===============
if (document.form.adult.value == "") {
missinginfo += "\n     -  No. Adult";
}
else if (illegalChars.test(document.form.adult.value)) {

       missinginfo +=  "\n     -  The No of Adult contains illegal characters.";
    }
 else
   {
      for (var i=0; i<document.form.adult.value.length; i++)
       {
          tempcode = "" + document.form.adult.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) == "-1")
          {
          missinginfo += "\n     -  Invalid No of Adult, Please enter numeric value";
          }
    }
//===============	
if (document.form.children.value == "") {
missinginfo += "\n     -  No. Children";
}
else if (illegalChars.test(document.form.children.value)) {

       missinginfo +=  "\n     -  The No of Children contains illegal characters.";
    }
 else
   {
      for (var i=0; i<document.form.children.value.length; i++)
       {
          tempcode = "" + document.form.children.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) == "-1")
          {
          missinginfo += "\n     -  Invalid No of Children, Please enter numeric value";
          }
    }
//===============	
if (document.form.infant.value == "") {
missinginfo += "\n     -  No. Infant";
}
else if (illegalChars.test(document.form.infant.value)) {

       missinginfo +=  "\n     -  The No of Infant contains illegal characters.";
    }
 else
   {
      for (var i=0; i<document.form.infant.value.length; i++)
       {
          tempcode = "" + document.form.infant.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) == "-1")
          {
          missinginfo += "\n     -  Invalid No of Infant, Please enter numeric value";
          }
    }
//===============
if (document.form.roomtype.value == "") {
missinginfo += "\n     -  Roomtype";
}
else if (illegalChars.test(document.form.roomtype.value)) {

       missinginfo +=  "\n     -  The Roomtype contains illegal characters. ";
    }
 else
   {
      for (var i=0; i<document.form.roomtype.value.length; i++)
       {
          tempcode = "" + document.form.roomtype.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) >= "0")
          {
          missinginfo += "\n     -  Invalid Roomtype";
          }
    }	
//===============		
if (document.form.noroom.value == "") {
missinginfo += "\n     -  No. Room";
}
else if (illegalChars.test(document.form.noroom.value)) {

       missinginfo +=  "\n     -  The no of room contains illegal characters.";
    }
 else
   {
      for (var i=0; i<document.form.noroom.value.length; i++)
       {
          tempcode = "" + document.form.noroom.value.substring(i, i+1);
       }
         if (valid.indexOf(tempcode) == "-1")
          {
          missinginfo += "\n     -  Invalid no of room, Please enter numeric value";
          }
    }
//===============		
if (document.form.term.checked == false) {
missinginfo += "\n     -  Term";
}
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else 
{
return true;
}

}

