var ERROR_MESSAGES = new Array( 
  'The data are incorrect, please check them.',   
  'The check in date must be previous to the checkout date.',    
  'The arrival date cannot be before today’s date.',  
  'Please, complete the dates.' 
  );
  
function getErrorMessage(code)
{
  if(code>ERROR_MESSAGES.length-1) code = 0;
  return ERROR_MESSAGES[code];
}