 (confirmPassword(action) == false) {
              return false;
          }
          return true;
      }

      // check email for registration
      function validateEmail(email, action) {
          var msg_key = action + "_error";
         if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email)) {
             document.getElementById(msg_key).innerHTML = "";
            return true;
          }
         else{
             document.getElementById(msg_key).innerHTML = "Inv