text: /*jslint browser: true, regexp: true, nomen: true, indent:2, white:true, sloppy:true, debug:true */
  /*global exports, require, c, $, jQuery, document, window*/
  /* vim: set ft=javascript: */
  
  (function() {
  
  var lookup, prefixes = {
    "1201":"United State",
    "1202":"United State",
    "1203":"United State",
    "1204":"Canada",
    "1205":"United State",
    "1206":"United State",
    "1207":"United State",
    "1208":"United State",
    "1209":"United State",
    "1210":"United State",
    "1212":"United State",
    "1213":"United State",
    "1214":"United State",
    "1215":"United State",
    "1216":"United State",
    "1217":"United State",
    "1218":"United State",
    "1219":"United State",
    "1224":"United State",
    "1225":"United State",
    "1226":"Canada",
    "1228":"United State",
    "1231":"United State",
    "1236":"Canada",
    "1240":"United State",
    "1242":"Bahamas",
    "1246":"Barbados",
    "1248":"United State",
    "1250":"Canada",
    "1252":"United State",
    "1253":"United State",
    "1254":"United State",
    "1256":"United State",
    "1264":"Anguilla",
    "1267":"United State",
    "1268":"Antigua and Barbuda",
    "1270":"United State",
    "1281":"United State",
    "1284":"British Virgin Islands",
    "1289":"Canada",
    "1301":"United State",
    "1302":"United State",
    "1303":"United State",
    "1304":"United State",
    "1305":"United State",
    "1306":"Canada",
    "1307":"United State",
    "1308":"United State",
    "1309":"United State",
    "1310":"United State",
    "1312":"United State",
    "1313":"United State",
    "1314":"United State",
    "1315":"United State",
    "1316":"United State",
    "1317":"United State",
    "1318":"United State",
    "1319":"United State",
    "1320":"United State",
    "1321":"United State",
    "1323":"United State",
    "1330":"United State",
    "1334":"United State",
    "1336":"United State",
    "1340":"Virgin Islands, US",
    "1345":"Cayman Islands",
    "1347":"United State",
    "1352":"United State",
    "1360":"United State",
    "1361":"United State",
    "1401":"United State",
    "1402":"United State",
    "1403":"Canada",
    "1404":"United State",
    "1405":"United State",
    "1406":"United State",
    "1407":"United State",
    "1408":"United State",
    "1409":"United State",
    "1410":"United State",
    "1412":"United State",
    "1413":"United State",
    "1414":"United State",
    "1415":"United State",
    "1416":"Canada",
    "1417":"United State",
    "1418":"Canada",
    "1419":"United State",
    "1423":"United State",
    "1424":"United State",
    "1425":"United State",
    "1431":"Canada",
    "1435":"United State",
    "1438":"Canada",
    "1440":"United State",
    "1441":"Bermuda",
    "1443":"United State",
    "1450":"Canada",
    "1469":"United State",
    "1473":"Grenada",
    "1480":"United State",
    "1484":"United State",
    "1501":"United State",
    "1502":"United State",
    "1503":"United State",
    "1504":"United State",
    "1505":"United State",
    "1506":"Canada",
    "1507":"United State",
    "1508":"United State",
    "1509":"United State",
    "1510":"United State",
    "1512":"United State",
    "1513":"United State",
    "1514":"Canada",
    "1515":"United State",
    "1516":"United State",
    "1517":"United State",
    "1518":"United State",
    "1519":"Canada",
    "1520":"United State",
    "1530":"United State",
    "1540":"United State",
    "1541":"United State",
    "1559":"United State",
    "1561":"United State",
    "1562":"United State",
    "1570":"United State",
    "1571":"United State",
    "1573":"United State",
    "1580":"United State",
    "1581":"Canada",
    "1587":"Canada",
    "1601":"United State",
    "1602":"United State",
    "1603":"United State",
    "1604":"Canada",
    "1605":"United State",
    "1606":"United State",
    "1607":"United State",
    "1608":"United State",
    "1609":"United State",
    "1610":"United State",
    "1612":"United State",
    "1613":"Canada",
    "1614":"United State",
    "1615":"United State",
    "1616":"United State",
    "1617":"United State",
    "1618":"United State",
    "1619":"United State",
    "1623":"United State",
    "1626":"United State",
    "1630":"United State",
    "1636":"United State",
    "1646":"United State",
    "1647":"Canada",
    "1649":"Turks and Caicos Islands",
    "1650":"United State",
    "1651":"United State",
    "1660":"United State",
    "1661":"United State",
    "1662":"United State",
    "1664":"Montserrat",
    "1669":"United State",
    "1670":"Northern Mariana Islands",
    "1671":"Guam",
    "1678":"United State",
    "1684":"American Samoa",
    "1701":"United State",
    "1702":"United State",
    "1703":"United State",
    "1704":"United State",
    "1705":"Canada",
    "1706":"United State",
    "1707":"United State",
    "1708":"United State",
    "1709":"Canada",
    "1712":"United State",
    "1713":"United State",
    "1714":"United State",
    "1715":"United State",
    "1716":"United State",
    "1717":"United State",
    "1718":"United State",
    "1719":"United State",
    "1720":"United State",
    "1721":"Sint Maarten (Dutch)",
    "1724":"United State",
    "1727":"United State",
    "1732":"United State",
    "1734":"United State",
    "1740":"United State",
    "1757":"United State",
    "1758":"Saint Lucia",
    "1760":"United State",
    "1765":"United State",
    "1767":"Dominica",
    "1770":"United State",
    "1773":"United State",
    "1775":"United State",
    "1778":"Canada",
    "1781":"United State",
    "1784":"Saint Vincent and the Grenadines",
    "1785":"United State",
    "1786":"United State",
    "1800":"Toll Free",
    "1801":"United State",
    "1802":"United State",
    "1803":"United State",
    "1804":"United State",
    "1805":"United State",
    "1806":"United State",
    "1807":"Canada",
    "1808":"Midway Island",
    "1808":"Wake Island",
    "1810":"United State",
    "1812":"United State",
    "1813":"United State",
    "1814":"United State",
    "1815":"United State",
    "1816":"United State",
    "1817":"United State",
    "1818":"United State",
    "1819":"Canada",
    "1828":"United State",
    "1830":"United State",
    "1831":"United State",
    "1832":"United State",
    "1843":"United State",
    "1847":"United State",
    "1849":"Dominican Republic",
    "1850":"United State",
    "1856":"United State",
    "1858":"United State",
    "1860":"United State",
    "1864":"United State",
    "1866":"Toll Free",
    "1867":"Canada",
    "1868":"Trinidad and Tobago",
    "1869":"Saint Kitts and Nevis",
    "1870":"United State",
    "1876":"Jamaica",
    "1877":"Toll Free",
    "1888":"Toll Free",
    "1901":"United State",
    "1902":"Canada",
    "1903":"United State",
    "1904":"United State",
    "1905":"Canada",
    "1906":"United State",
    "1907":"United State",
    "1908":"United State",
    "1909":"United State",
    "1910":"United State",
    "1912":"United State",
    "1913":"United State",
    "1914":"United State",
    "1915":"United State",
    "1916":"United State",
    "1917":"United State",
    "1918":"United State",
    "1919":"United State",
    "1920":"United State",
    "1925":"United State",
    "1931":"United State",
    "1935":"United State",
    "1937":"United State",
    "1939":"Puerto Rico",
    "1940":"United State",
    "1941":"United State",
    "1949":"United State",
    "1952":"United State",
    "1954":"United State",
    "1956":"United State",
    "1970":"United State",
    "1972":"United State",
    "1973":"United State",
    "1978":"United State",
    "20":"Egypt",
    "211":"South Sudan",
    "212":"Morocco",
    "213":"Algeria",
    "216":"Tunisia",
    "218":"Libya",
    "220":"Gambia",
    "221":"Senegal",
    "222":"Mauritania",
    "223":"Mali",
    "224":"Guinea",
    "225":"Cote d'Ivoire",
    "226":"Burkina Faso",
    "227":"Niger",
    "228":"Togo",
    "229":"Benin",
    "230":"Mauritius",
    "231":"Liberia",
    "232":"Sierra Leone",
    "233":"Ghana",
    "234":"Nigeria",
    "235":"Chad",
    "236":"Central African Republic",
    "237":"Cameroon",
    "238":"Cape Verde",
    "239":"Sao Tome and Principe",
    "240":"Equatorial Guinea",
    "241":"Gabon",
    "242":"Congo (Brazzaville)",
    "243":"Congo, The Democratic Republic of the (Zaire)",
    "244":"Angola",
    "245":"Guinea-Bissau",
    "246":"Diego Garcia",
    "247":"Ascension",
    "248":"Seychelles",
    "249":"Sudan",
    "250":"Rwanda",
    "251":"Ethiopia",
    "252":"Somalia",
    "253":"Djibouti",
    "254":"Kenya",
    "255":"Tanzania",
    "256":"Uganda",
    "257":"Burundi",
    "258":"Mozambique",
    "260":"Zambia",
    "261":"Madagascar",
    "262269":"Mayotte",
    "262639":"Mayotte",
    "262":"Reunion",
    "263":"Zimbabwe",
    "264":"Namibia",
    "265":"Malawi",
    "266":"Lesotho",
    "267":"Botswana",
    "268":"Swaziland",
    "269":"Comoros",
    "27":"South Africa",
    "290":"Saint Helena and Tristan da Cunha",
    "291":"Eritrea",
    "297":"Arub",
    "298":"Faroe Islands",
    "299":"Greenland",
    "30":"Greece",
    "31":"Netherlands",
    "32":"Belgium",
    "33":"France",
    "34":"Spain",
    "350":"Gibraltar",
    "351":"Portugal",
    "352":"Luxembourg",
    "353":"Ireland",
    "354":"Iceland",
    "355":"Albania",
    "356":"Malta",
    "357":"Cyprus",
    "358":"Finland",
    "35818":"Aland Islands",
    "359":"Bulgaria",
    "36":"Hungary",
    "370":"Lithuania",
    "371":"Latvia",
    "372":"Estonia",
    "373":"Moldova",
    "374":"Armenia",
    "375":"Belarus",
    "376":"Andorra",
    "377":"Monaco",
    "378":"San Marino",
    "379":"Vatican City State (Holy See)",
    "380":"Ukraine",
    "381":"Serbia",
    "382":"Montenegro",
    "385":"Croatia",
    "386":"Slovenia",
    "387":"Bosnia and Herzegovina",
    "389":"Macedonia",
    "39":"Italy",
    "40":"Romania",
    "41":"Switzerland",
    "420":"Czech Republic",
    "421":"Slovakia",
    "423":"Liechtenstein",
    "43":"Austria",
    "441481":"Guernsey",
    "441624":"Isle of Man",
    "441534":"Jersey",
    "44":"United Kingdom",
    "45":"Denmark",
    "46":"Sweden",
    "47":"Norway",
    "4779":"Svalbard and Jan Mayen",
    "48":"Poland",
    "49":"Germany",
    "500":"Falkland Islands (Malvinas)",
    "501":"Belize",
    "502":"Guatemala",
    "503":"El Salvador",
    "504":"Honduras",
    "505":"Nicaragua",
    "506":"Costa Rica",
    "507":"Panama",
    "508":"Saint Pierre and Miquelon",
    "509":"Haiti",
    "51":"Peru",
    "52":"Mexico",
    "53":"Cuba",
    "5399":"Cuba (Guantanamo Bay)",
    "54":"Argentina",
    "55":"Brazil",
    "56":"Chile",
    "5632":"Easter Island",
    "57":"Colombia",
    "58":"Venezuela",
    "590":"Guadeloupe",
    "591":"Bolivia",
    "592":"Guyana",
    "593":"Ecuador",
    "594":"French Guiana",
    "595":"Paraguay",
    "596":"Martinique",
    "597":"Suriname",
    "598":"Uruguay",
    "5993":"Sint Eustatius",
    "5994":"Saba",
    "5997":"Bonaire",
    "5999":"Curaao",
    "60":"Malaysia",
    "61":"Australia",
    "6189164":"Christmas Island",
    "6189162":"Cocos (Keeling) Islands",
    "62":"Indonesia",
    "63":"Philippines",
    "64":"Chatham Island (New Zealand)",
    "65":"Singapore",
    "66":"Thailand",
    "670":"East Timor",
    "672":"Australian External Territories",
    "6723":"Norfolk Island",
    "673":"Brunei Darussalam",
    "674":"Nauru",
    "675":"Papua New Guinea",
    "676":"Tonga",
    "677":"Solomon Islands",
    "678":"Vanuatu",
    "679":"Fiji",
    "680":"Palau",
    "681":"Wallis and Futuna",
    "682":"Cook Islands",
    "683":"Niue",
    "685":"Samoa",
    "686":"Kiribati",
    "687":"New Caledonia",
    "688":"Tuvalu",
    "689":"French Polynesia",
    "690":"Tokelau",
    "691":"Micronesia, Federated States of",
    "692":"Marshall Islands",
    "7":"Russia",
    "76":"Kazakhstan",
    "77":"Kazakhstan",
    "800":"International Freephone Service",
    "808":"International Shared Cost Service (ISCS)",
    "81":"Japan",
    "82":"South Korea",
    "84":"Vietnam",
    "850":"North Korea",
    "852":"Hong Kong",
    "853":"Macau",
    "855":"Cambodia",
    "856":"Laos",
    "86":"China",
    "870":"Inmarsat SNAC",
    "878":"Universal Personal Telecommunications (UPT)",
    "880":"Bangladesh",
    "881":"Global Mobile Satellite System (GMSS)",
    "8810":"ICO Global (Mobile Satellite Service)",
    "8811":"ICO Global (Mobile Satellite Service)",
    "8812":"Ellipso (Mobile Satellite service)",
    "8813":"Ellipso (Mobile Satellite service)",
    "8816":"Iridium (Mobile Satellite service)",
    "8817":"Iridium (Mobile Satellite service)",
    "8818":"Globalstar (Mobile Satellite Service)",
    "8819":"Globalstar (Mobile Satellite Service)",
    "88213":"EMSAT (Mobile Satellite service)",
    "88216":"Thuraya (Mobile Satellite service)",
    "886":"Taiwan",
    "90":"Turkey",
    "91":"India",
    "92":"Pakistan",
    "93":"Afghanistan",
    "94":"Sri Lanka",
    "95":"Burma",
    "960":"Maldives",
    "961":"Lebanon",
    "962":"Jordan",
    "963":"Syria",
    "964":"Iraq",
    "965":"Kuwait",
    "966":"Saudi Arabia",
    "967":"Yemen",
    "968":"Oman",
    "970":"Palestinian territories",
    "971":"United Arab Emirates",
    "972":"Israel",
    "973":"Bahrain",
    "974":"Qatar",
    "975":"Bhutan",
    "976":"Mongolia",
    "977":"Nepal",
    "98":"Iran",
    "992":"Tajikistan",
    "993":"Turkmenistan",
    "994":"Azerbaijan",
    "995":"Georgia",
    "99544":"Abkhazia",
    "996":"Kyrgyzstan",
    "998":"Uzbekistan"
  };
  
  lookup = function(phone) {
    if (phone.length) {
      var prefix, c = phone.length;
      for (c; c >= 0; c=c-1) {
        prefix = phone.substring(0, c);
        if (prefixes[prefix]) {
          return prefixes[prefix];
        }
      }
    }
  };
  if (typeof exports !== "undefined"){
    exports.lookup = lookup;
  }
  if (typeof window !== "undefined"){
    window.e164 = { lookup : lookup};
  }
  
  })();
  
  
  