function ff_validate_date_MMDDYYYY(element, message)
{
   // Regular expression used to check if date is in correct format
     var pattern = /^(0{0,1}[1-9]|1[012])[/](0{0,1}[1-9]|[12][0-9]|3[01])[/](19|20)\d\d$/;
  if(pattern.test(element.value))
   {
      var date_array = element.value.split('/');
      var day = date_array[1];

      // Attention! Javascript consider months in the range 0 - 11
      var month = date_array[0] - 1;
      var year = date_array[2];

      // This instruction will create a date object
      source_date = new Date(year,month,day);

      if(year != source_date.getFullYear())
      {
         return message == '' ? 'Element ' + element.name + ' failed my test' : message;
      }

      if(month != source_date.getMonth())
      {
         return message == '' ? 'Element ' + element.name + ' failed my test' : message;
      }

      if(day != source_date.getDate())
      {
         return message == '' ? 'Element ' + element.name + ' failed my test' : message;
      }
   }
   else
   {
      return message == '' ? 'Element ' + element.name + ' failed my test' : message;
   }

   return '';
}