function validateRegistrationForm(email, password, confirm, terms){

  if(email == '')
    return "Please fill in the email field.";
  if(password == '' || confirm == '')
    return "Please fill in both password fields.";
  if(password != confirm)
    return "Please ensure your passwords match.";
  if(!terms)
    return "If you have read and agree to the terms of service then please check the check box.";
  return "true";

  
}

function validateLoginForm(userName, password){

  if(userName == '')
    return "Please fill in the email field.";
  if(password == '')
    return "Please fill in the password field.";
  return "true";
  
}

function jsonSanitize(data){
  data = data.replace(/\\/g, "\\\\\\\\");
  data = data.replace(/'/g, "''");
  data = data.replace(/\"/g, "\\\"");
  return data;
}
