function validateForm() {
   var errorMsg = '';
   var thisForm = document.myform;
   var reqFields = new Array(15);

   // Help
   if (thisForm.help.value.length == 0) {
      errorMsg += '\n"How can OSI help your company?" needs to be filled in.';
   }
   // Challenges
   if (thisForm.challenges.value.length == 0) {
      errorMsg += '\n"What challenges are you facing?" needs to be filled in.';
   }
   // Name
   if (thisForm.name.value.length == 0) {
      errorMsg += '\n"Name" needs to be filled in.';
   }
   // Company
   if (thisForm.company.value.length == 0) {
      errorMsg += '\n"Company" needs to be filled in.';
   }
   // Email
   if (thisForm.email.value.length > 0) {   
      if (isEmailAddressValid(thisForm.email.value)) {
      }
      else {
         errorMsg += '\nThe email is not valid.';
      }
   }
   else {
         errorMsg += '\nThe email address needs to be filled in.';
   }


	if (errorMsg.length != 0) {
        errorMsg = 'THERE ARE SOME ERRORS TO CORRECT.\n\n' + errorMsg;	
		window.alert(errorMsg);
		return false;
	}
	else {
      thisForm.submit();
      return true;
	}
}
var rfc822_specials = "()<>@,;L\\\"[]";
function isEmailAddressValid(str)
{
    var c, count, domain;

    for (c = 0;  c < str.length;  c++)
    {
        if (str.charAt(c) == "\"" &&
            (!c || str.charAt(c - 1) == "." || str.charCharAt(c - 1) == "\""))
        {
            while (++c < str.length)
            {
                if (str.charAt(c) == "\"") break;
                if (str.charAt(c) == "\\" && (str.charAt(++c) == ' ')) continue;
                if (str.charCodeAt(c) < 32 || str.charCodeAt(c) >= 127)
                    return false;
            }
            if (c++ >= str.length) return false;
            if (str.charAt(c) == "@") break;
            if (str.charAt(c) != ".") return false;
            continue;
        }
        if (str.charAt(c) == "@") break;
        if (str.charCodeAt(c) <= 32 || str.charCodeAt(c) >= 127) return false;
        if (rfc822_specials.indexOf(str.charAt(c)) != -1) return false;
    }
    if (!c || str.charAt(c - 1) == ".") return false;

    if ((domain = ++c) >= str.length) return false;
    count = 0;
    do
    {
        if (str.charAt(c) == ".")
        {
            if (c == domain || str.charAt(c - 1) == ".") return false;
            count++;
        }
        if (str.charCodeAt(c) <= 32 || str.charCodeAt(c) >= 127) return false;
        if (rfc822_specials.indexOf(str.charAt(c)) != -1) return false;
    } while (++c < str.length);

    return (count >= 1 ? true : false);
}