function verify(frm) {
   var themessage = "You are required to complete the following fields: ";
   //alert(document.form.first_name);
   if (frm.form.first_name.value=="") {
      themessage = themessage + "\nFirst Name";
   }
   if (frm.form.last_name.value=="") {
      themessage = themessage + "\nLast Name";
   }
   if (frm.form.company.value=="") {
      themessage = themessage + "\nCompany";
   }
   if (frm.form.email.value=="") {
      themessage = themessage + "\nE-mail";
   }
//alert if fields are empty and cancel form submit
   if (themessage == "You are required to complete the following fields: ") {
      if (frm.form.wp_link.value != "") {
         window.open (frm.form.wp_link.value,'new_window');
      }
      frm.form.submit();
      return true;
   } else {
        alert(themessage);
        return false;
   }
}
