jQuery.payment
There are several incorrect assumptions about this library  Cards can be up to 19 digits
  Bin ranges are constantly updated, so cardType in static code is a broken concept.
  I expect in the future American Express will issues cards longer then 15 digits.
  Minimun card length is 13 digits not 10

I don't feel like validating the luhn check, but historically I've seen systems that don't correctly handle the luhn check of variable sizes.Edit: Reference material http://en.wikipedia.org/wiki/Bank_card_number
If you are actually getting into credit card processing, please talk to your acquirer about data feeds of this type of info on bin ranges.Edit 2: Wikipedia claims Maestro has 12 digit cards, but I've never seen one in the wild, I could be wrong about 13, but it's the assumption we've made processing international payments.