function ValidateForm (theForm)
{
            // Create an empty string to hold the error messages.
            errorString = '';      
   
            // Each time there's an error, add an error message
            if(IsEmpty(theForm.first_name))
            {
               errorString += '<li>Please provide your first name.</li>';
               theForm.first_name.style.border="1px solid red";
            }
            else
               theForm.first_name.style.border="";

            if(IsEmpty(theForm.last_name))
            {
               errorString += '<li>Please provide your last name.</li>';
               theForm.last_name.style.border="1px solid red";
            }
            else
               theForm.last_name.style.border="";
         
            if(IsEmpty(theForm.email)) // || !verifyEmail(theForm.email) )
            {
               errorString += '<li>A valid email address is required.</li>';
               theForm.email.style.border="1px solid red";
            }
            else
               theForm.email.style.border="";

            if(IsEmpty(theForm.visit_start))
            {
               errorString += '<li>Please provide the start of your visit.</li>';
               theForm.visit_start.style.border="1px solid red";
            }
            else
               theForm.visit_start.style.border="";


            // If the error string is empty, there were no errors.
            if ( errorString == '') 
            {
               // Form processing
               theForm.flag.value = "true";
            
               return true;
            }
            else
            {
               // The error string had something in it

               errorString = "<p>Please check the following and try again:<ul>" + errorString + "</ul></p>";

               oFormError = document.getElementById("form_error");

               oFormError.innerHTML = errorString;

               oFormError.style.display = "table-cell";

               theForm.flag.value= "false";

               return false;
            }
         }

