﻿var ISBN;
if (!ISBN) {
    ISBN = {};
}

(function() {

    if(!ISBN.isbnInfo)
    {
        ISBN.isbnInfo = [
                    { groupNumber: 0, area: "English speaking area", publishingNumbers: [{ start: 00, end: 19},{start:200,end:699},{start:7000,end:8499},{start:85000, end:89999},{start:900000, end:949999},{start:9500000,end:9999999}]},
                    { groupNumber: 1, area: "English speaking area", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 399 },{ start: 4000, end: 5499 },{ start: 55000, end: 86979 },{ start: 869800, end: 998999}]},
                    { groupNumber: 2, area: "French speaking area", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 349 },{ start: 35000, end: 39999 },{ start: 400, end: 699 },{ start: 7000, end: 8399 },{ start: 84000, end: 89999 },{ start: 900000, end: 949999 },{ start: 9500000, end: 9999999}]},
                    { groupNumber: 3, area: "German speaking area", publishingNumbers: [{ start: 00, end: 02 },{ start: 030, end: 033 },{ start: 0340, end: 0369 },{ start: 03700, end: 03999 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 949999 },{ start: 9500000, end: 9999999}]},
                    { groupNumber: 4, area: "Japan", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 949999 },{ start: 9500000, end: 9999999}]},
                    { groupNumber: 5, area: "Russian Federation", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 420 },{ start: 4210, end: 4299 },{ start: 430, end: 430 },{ start: 4310, end: 4399 },{ start: 440, end: 440 },{ start: 4410, end: 4499 },{ start: 450, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 909999 },{ start: 91000, end: 91999 },{ start: 9200, end: 9299 },{ start: 93000, end: 94999 },{ start: 9500, end: 9799 },{ start: 98000, end: 98999 },{ start: 9900000, end: 9909999 },{ start: 9910, end: 9999}]},
                    { groupNumber: 600, area: "Iran", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 499 },{ start: 5000, end: 8999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 601, area: "Kazakhstan", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 7999 },{ start: 80000, end: 84999 },{ start: 85, end: 99}]},
                    { groupNumber: 602, area: "Indonesia", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 603, area: "Saudi Arabia", publishingNumbers: [{ start: 00, end: 04 },{ start: 500, end: 799 },{ start: 8000, end: 8999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 604, area: "Vietnam", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 89 },{ start: 900, end: 979 },{ start: 9800, end: 9999}]},
                    { groupNumber: 605, area: "Turkey", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 399 },{ start: 4000, end: 5999 },{ start: 60000, end: 89999}]},
                    { groupNumber: 606, area: "Romania", publishingNumbers: [{ start: 0, end: 0 },{ start: 500, end: 799 },{ start: 8000, end: 9199 },{ start: 92000, end: 99999}]},
                    { groupNumber: 607, area: "Mexico", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 749 },{ start: 7500, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 7, area: "China, People's Republic", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 499 },{ start: 5000, end: 7999 },{ start: 80000, end: 89999 },{ start: 900000, end: 999999}]},
                    { groupNumber: 80, area: "Czech Republic; Slovakia", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 999999}]},
                    { groupNumber: 81, area: "India", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 999999}]},
                    { groupNumber: 82, area: "Norway", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8999 },{ start: 90000, end: 98999 },{ start: 990000, end: 999999}]},
                    { groupNumber: 83, area: "Poland", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 60000, end: 69999 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 999999}]},
                    { groupNumber: 84, area: "Spain", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 9000, end: 9199 },{ start: 920000, end: 923999 },{ start: 92400, end: 92999 },{ start: 930000, end: 949999 },{ start: 95000, end: 96999 },{ start: 9700, end: 9999}]},
                    { groupNumber: 85, area: "Brazil", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 60000, end: 69999 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 979999 },{ start: 98000, end: 99999}]},
                    { groupNumber: 86, area: "Serbia and Montenegro", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 599 },{ start: 6000, end: 7999 },{ start: 80000, end: 89999 },{ start: 900000, end: 999999}]},
                    { groupNumber: 87, area: "Denmark", publishingNumbers: [{ start: 00, end: 29 },{ start: 400, end: 649 },{ start: 7000, end: 7999 },{ start: 85000, end: 94999 },{ start: 970000, end: 999999}]},
                    { groupNumber: 88, area: "Italian speaking area", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 6000, end: 8499 },{ start: 85000, end: 89999 },{ start: 900000, end: 949999 },{ start: 95000, end: 99999}]},
                    { groupNumber: 89, area: "Korea", publishingNumbers: [{ start: 00, end: 24 },{ start: 250, end: 549 },{ start: 5500, end: 8499 },{ start: 85000, end: 94999 },{ start: 950000, end: 999999}]},
                    { groupNumber: 90, area: "Netherlands, Belgium (Flemish)", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 499 },{ start: 5000, end: 6999 },{ start: 70000, end: 79999 },{ start: 800000, end: 849999 },{ start: 8500, end: 8999 },{ start: 900000, end: 909999 },{ start: 940000, end: 949999}]},
                    { groupNumber: 91, area: "Sweden", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 49 },{ start: 500, end: 649 },{ start: 7000, end: 7999 },{ start: 85000, end: 94999 },{ start: 970000, end: 999999}]},
                    { groupNumber: 92, area: "International Publishers (Unesco, EU), European Community Organizations", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 79 },{ start: 800, end: 899 },{ start: 9000, end: 9499 },{ start: 95000, end: 98999 },{ start: 990000, end: 999999}]},
                    { groupNumber: 93, area: "India-no ranges fixed yet", publishingNumbers: [] }, 
                    { groupNumber: 950, area: "Argentina", publishingNumbers: [{ start: 00, end: 49 },{ start: 500, end: 899 },{ start: 9000, end: 9899 },{ start: 99000, end: 99999}]},
                    { groupNumber: 951, area: "Finland", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 54 },{ start: 550, end: 889 },{ start: 8900, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 952, area: "Finland", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 499 },{ start: 5000, end: 5999 },{ start: 60, end: 65 },{ start: 6600, end: 6699 },{ start: 67000, end: 69999 },{ start: 7000, end: 7999 },{ start: 80, end: 94 },{ start: 9500, end: 9899 },{ start: 99000, end: 99999}]},
                    { groupNumber: 953, area: "Croatia", publishingNumbers: [{ start: 0, end: 0 },{ start: 150, end: 549 },{ start: 55000, end: 59999 },{ start: 6000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 954, area: "Bulgaria", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 799 },{ start: 8000, end: 8999 },{ start: 90000, end: 92999 },{ start: 9300, end: 9999}]},
                    { groupNumber: 955, area: "Sri Lanka", publishingNumbers: [{ start: 0, end: 0 },{ start: 1000, end: 1999 },{ start: 20, end: 54 },{ start: 550, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 956, area: "Chile", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 9999}]},
                    { groupNumber: 957, area: "Taiwan, China", publishingNumbers: [{ start: 00, end: 02 },{ start: 0300, end: 0499 },{ start: 2000, end: 2099 },{ start: 21, end: 27 },{ start: 28000, end: 30999 },{ start: 31, end: 43 },{ start: 440, end: 819 },{ start: 8200, end: 9699 },{ start: 97000, end: 99999}]},
                    { groupNumber: 958, area: "Colombia", publishingNumbers: [{ start: 00, end: 59 },{ start: 600, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 959, area: "Cuba", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499}]},
                    { groupNumber: 960, area: "Greece", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 659 },{ start: 6600, end: 6899 },{ start: 690, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 99999}]},
                    { groupNumber: 961, area: "Slovenia", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 6000, end: 8999 },{ start: 90000, end: 94999}]},
                    { groupNumber: 962, area: "Hong Kong", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 86999 },{ start: 8700, end: 8999 },{ start: 900, end: 999}]},
                    { groupNumber: 963, area: "Hungary", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 9000, end: 9999}]},
                    { groupNumber: 964, area: "Iran", publishingNumbers: [{ start: 00, end: 14 },{ start: 150, end: 249 },{ start: 2500, end: 2999 },{ start: 300, end: 549 },{ start: 5500, end: 8999 },{ start: 90000, end: 96999 },{ start: 970, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 965, area: "Israel", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 7000, end: 7999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 966, area: "Ukraine", publishingNumbers: [{ start: 00, end: 14 },{ start: 1500, end: 2999 },{ start: 300, end: 699 },{ start: 7000, end: 8999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 967, area: "Malaysia", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 499 },{ start: 5000, end: 5999 },{ start: 60, end: 89 },{ start: 900, end: 989 },{ start: 9900, end: 9989 },{ start: 99900, end: 99999}]},
                    { groupNumber: 968, area: "Mexico", publishingNumbers: [{ start: 400, end: 499 },{ start: 5000, end: 7999 },{ start: 800, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 969, area: "Pakistan", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 39 },{ start: 400, end: 799 },{ start: 8000, end: 9999}]},
                    { groupNumber: 970, area: "Mexico", publishingNumbers: [{ start: 600, end: 899 },{ start: 9000, end: 9099 },{ start: 91000, end: 96999 },{ start: 9700, end: 9999}]},
                    { groupNumber: 971, area: "Philippines?", publishingNumbers: [{ start: 000, end: 019 },{ start: 0300, end: 0599 },{ start: 500, end: 849 },{ start: 8500, end: 9099 },{ start: 91000, end: 99999}]},
                    { groupNumber: 972, area: "Portugal", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 54 },{ start: 550, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 973, area: "Romania", publishingNumbers: [{ start: 0, end: 0 },{ start: 100, end: 169 },{ start: 1700, end: 1999 },{ start: 20, end: 54 },{ start: 550, end: 759 },{ start: 7600, end: 8499 },{ start: 85000, end: 88999 },{ start: 8900, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 974, area: "Thailand", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 699 },{ start: 7000, end: 8499 },{ start: 85000, end: 89999 },{ start: 90000, end: 94999 },{ start: 9500, end: 9999}]},
                    { groupNumber: 975, area: "Turkey", publishingNumbers: [{ start: 00000, end: 00999 },{ start: 250, end: 599 },{ start: 6000, end: 9199 },{ start: 92000, end: 98999 },{ start: 990, end: 999}]},
                    { groupNumber: 976, area: "Caribbean Community", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 59 },{ start: 600, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 977, area: "Egypr", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 499 },{ start: 5000, end: 6999 },{ start: 700, end: 999}]},
                    { groupNumber: 978, area: "Nigeria", publishingNumbers: [{ start: 000, end: 199 },{ start: 2000, end: 2999 },{ start: 30000, end: 79999 },{ start: 8000, end: 8999 },{ start: 900, end: 999}]},
                    { groupNumber: 979, area: "Indonesia", publishingNumbers: [{ start: 000, end: 099 },{ start: 1000, end: 1499 },{ start: 15000, end: 19999 },{ start: 20, end: 29 },{ start: 3000, end: 3999 },{ start: 400, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 980, area: "Venezuela", publishingNumbers: [{ start: 00, end: 19 },{ start: 200, end: 599 },{ start: 6000, end: 9999}]},
                    { groupNumber: 981, area: "Singapore", publishingNumbers: [{ start: 00, end: 11 },{ start: 120, end: 299 },{ start: 3000, end: 9999}]},
                    { groupNumber: 982, area: "South Pacific", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 699 },{ start: 70, end: 89 },{ start: 9000, end: 9999}]},
                    { groupNumber: 983, area: "Malaysia", publishingNumbers: [{ start: 00, end: 01 },{ start: 020, end: 199 },{ start: 2000, end: 3999 },{ start: 40000, end: 44999 },{ start: 45, end: 49 },{ start: 50, end: 79 },{ start: 800, end: 899 },{ start: 9000, end: 9899 },{ start: 99000, end: 99999}]},
                    { groupNumber: 984, area: "Bangladesh", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 799 },{ start: 8000, end: 8999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 985, area: "Belarus", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 599 },{ start: 6000, end: 8999 },{ start: 90000, end: 99999}]},
                    { groupNumber: 986, area: "Taiwan, China", publishingNumbers: [{ start: 00, end: 11 },{ start: 120, end: 559 },{ start: 5600, end: 7999 },{ start: 80000, end: 99999}]},
                    { groupNumber: 987, area: "Argentina", publishingNumbers: [{ start: 00, end: 09 },{ start: 1000, end: 1999 },{ start: 20000, end: 29999 },{ start: 30, end: 49 },{ start: 500, end: 899 },{ start: 9000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 988, area: "Hongkong", publishingNumbers: [{ start: 00, end: 16 },{ start: 17000, end: 19999 },{ start: 200, end: 799 },{ start: 8000, end: 9699 },{ start: 97000, end: 99999}]},
                    { groupNumber: 989, area: "Portugal", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 54 },{ start: 550, end: 799 },{ start: 8000, end: 9499 },{ start: 95000, end: 99999}]},
                    { groupNumber: 9937, area: "Nepal", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 49 },{ start: 500, end: 799 },{ start: 8000, end: 9999}]},
                    { groupNumber: 9938, area: "Tunisia", publishingNumbers: [{ start: 00, end: 79 },{ start: 800, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 9939, area: "Armenia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9940, area: "Montenegro", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 49 },{ start: 500, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9941, area: "Georgia", publishingNumbers: [{ start: 0, end: 0 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9942, area: "Ecuador", publishingNumbers: [{ start: 00, end: 89 },{ start: 900, end: 994 },{ start: 9950, end: 9999}]},
                    { groupNumber: 9943, area: "Uzbekistan", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 399 },{ start: 4000, end: 9999}]},
                    { groupNumber: 9944, area: "Turkey", publishingNumbers: [{ start: 0, end: 2 },{ start: 300, end: 499 },{ start: 5000, end: 5999 },{ start: 60, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 9945, area: "Dominican Republic", publishingNumbers: [{ start: 00, end: 00 },{ start: 010, end: 079 },{ start: 400, end: 569 },{ start: 57, end: 57 },{ start: 580, end: 849 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9946, area: "Korea, P.D.R.", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 39 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9947, area: "Algeria", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 9948, area: "United Arab Emirates", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 849 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9949, area: "Estonia", publishingNumbers: [{ start: 0, end: 0 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9950, area: "Palestine", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 840 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9951, area: "Kosova", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 849 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9952, area: "Azerbaijan", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 39 },{ start: 400, end: 799 },{ start: 8000, end: 9999}]},
                    { groupNumber: 9953, area: "Lebanon", publishingNumbers: [{ start: 0, end: 0 },{ start: 400, end: 599 },{ start: 60, end: 89 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9954, area: "Morocco", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 39 },{ start: 400, end: 799 },{ start: 8000, end: 9999}]},
                    { groupNumber: 9955, area: "Lithuania", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 929 },{ start: 9300, end: 9999}]},
                    { groupNumber: 9956, area: "Cameroon", publishingNumbers: [{ start: 0, end: 0 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9957, area: "Jordan", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 699 },{ start: 70, end: 84 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9958, area: "Bosnia and Herzegovina", publishingNumbers: [{ start: 0, end: 0 },{ start: 500, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9959, area: "Libya", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 79 },{ start: 800, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 9960, area: "Saudi Arabia", publishingNumbers: [{ start: 00, end: 59 },{ start: 600, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9961, area: "Algeria", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 69 },{ start: 700, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 9962, area: "Panama", publishingNumbers: [{ start: 00, end: 54 },{ start: 5500, end: 5599 },{ start: 56, end: 59 },{ start: 600, end: 849 },{ start: 8500, end: 9999}]},
                    { groupNumber: 9963, area: "Cyprus", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 54 },{ start: 550, end: 749 },{ start: 7500, end: 9999}]},
                    { groupNumber: 9964, area: "Ghana", publishingNumbers: [{ start: 0, end: 6 },{ start: 70, end: 94 },{ start: 950, end: 999}]},
                    { groupNumber: 9965, area: "Kazakhstan", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9966, area: "Kenya", publishingNumbers: [{ start: 00, end: 69 },{ start: 7000, end: 7499 },{ start: 750, end: 959 },{ start: 9600, end: 9999}]},
                    { groupNumber: 9967, area: "Kyrgyzstan", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9968, area: "Costa Rica", publishingNumbers: [{ start: 00, end: 49 },{ start: 500, end: 939 },{ start: 9400, end: 9999}]},
                    { groupNumber: 9970, area: "Uganda", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9971, area: "Singapore", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 89 },{ start: 900, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9972, area: "Peru", publishingNumbers: [{ start: 00, end: 09 },1,{ start: 200, end: 249 },{ start: 2500, end: 2999 },{ start: 30, end: 59 },{ start: 600, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9973, area: "Tunisia", publishingNumbers: [{ start: 0, end: 05 },{ start: 060, end: 089 },{ start: 0900, end: 0999 },{ start: 700, end: 969 },{ start: 9700, end: 9999}]},
                    { groupNumber: 9974, area: "Uruguay", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 54 },{ start: 550, end: 749 },{ start: 7500, end: 9499 },{ start: 95, end: 99}]},
                    { groupNumber: 9975, area: "Moldova", publishingNumbers: [{ start: 0, end: 0 },{ start: 100, end: 399 },{ start: 4000, end: 4499 },{ start: 45, end: 89 },{ start: 900, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 9976, area: "Tanzania", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 89 },{ start: 900, end: 989 },{ start: 9990, end: 9999}]},
                    { groupNumber: 9977, area: "Costa Rica", publishingNumbers: [{ start: 00, end: 89 },{ start: 900, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9978, area: "Ecuador", publishingNumbers: [{ start: 00, end: 29 },{ start: 300, end: 399 },{ start: 40, end: 94 },{ start: 950, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9979, area: "Iceland", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 64 },{ start: 650, end: 659 },{ start: 66, end: 75 },{ start: 760, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9980, area: "Papua New Guinea", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 89 },{ start: 900, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9981, area: "Morocco", publishingNumbers: [{ start: 00, end: 09 },{ start: 100, end: 159 },{ start: 1600, end: 1999 },{ start: 20, end: 79 },{ start: 800, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 9982, area: "Zambia", publishingNumbers: [{ start: 00, end: 79 },{ start: 800, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9983, area: "Gambia", publishingNumbers: [{ start: 80, end: 94 },{ start: 950, end: 989 },{ start: 9900, end: 9999}]},
                    { groupNumber: 9984, area: "Latvia", publishingNumbers: [{ start: 00, end: 49 },{ start: 500, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9985, area: "Estonia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 899 },{ start: 9000, end: 9999}]},
                    { groupNumber: 9986, area: "Lithuania", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 899 },{ start: 9000, end: 9399 },{ start: 940, end: 969 },{ start: 97, end: 99}]},
                    { groupNumber: 9987, area: "Tanzania", publishingNumbers: [{ start: 00, end: 39 },{ start: 400, end: 879 },{ start: 8800, end: 9999}]},
                    { groupNumber: 9988, area: "Ghana", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 54 },{ start: 550, end: 749 },{ start: 7500, end: 9999}]},
                    { groupNumber: 9989, area: "Macedonia", publishingNumbers: [{ start: 0, end: 0 },{ start: 100, end: 199 },{ start: 2000, end: 2999 },{ start: 30, end: 59 },{ start: 600, end: 949 },{ start: 9500, end: 9999}]},
                    { groupNumber: 99901, area: "Bahrain", publishingNumbers: [{ start: 00, end: 49 },{ start: 500, end: 799 },{ start: 80, end: 99}]},
                    { groupNumber: 99902, area: "Gabon-no ranges fixed yet", publishingNumbers: [] }, 
                    { groupNumber: 99903, area: "Mauritius", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99904, area: "Netherlands Antilles; Aruba, Neth. Ant", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99905, area: "Bolivia", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99906, area: "Kuwait", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 699 },{ start: 70, end: 89 }]},
                    { groupNumber: 99908, area: "Malawi", publishingNumbers: [{ start: 0, end: 0 },{ start: 900, end: 999}]},
                    { groupNumber: 99909, area: "Malta", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 94 },{ start: 950, end: 999}]},
                    { groupNumber: 99910, area: "Sierra Leone", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99911, area: "Lesotho", publishingNumbers: [{ start: 00, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99912, area: "Botswana", publishingNumbers: [{ start: 0, end: 3 },{ start: 400, end: 599 },{ start: 60, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99913, area: "Andorra", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 35 },{ start: 600, end: 604}]},
                    { groupNumber: 99914, area: "Suriname", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 89 },{ start: 900, end: 949}]},
                    { groupNumber: 99915, area: "Maldives", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99916, area: "Namibia", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 69 },{ start: 700, end: 999}]},
                    { groupNumber: 99917, area: "Brunei Darussalam", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99918, area: "Faroe Islands", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99919, area: "Benin", publishingNumbers: [{ start: 0, end: 2 },{ start: 40, end: 69 },{ start: 900, end: 999}]},
                    { groupNumber: 99920, area: "Andorra", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99921, area: "Qatar", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 69 },{ start: 700, end: 799 },{ start: 90, end: 99}]},
                    { groupNumber: 99922, area: "Guatemala", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 69 },{ start: 700, end: 999}]},
                    { groupNumber: 99923, area: "El Salvador", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99924, area: "Nicaragua", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99925, area: "Paraguay", publishingNumbers: [{ start: 0, end: 3 },{ start: 40, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99926, area: "Honduras", publishingNumbers: [{ start: 0, end: 0 },{ start: 600, end: 999}]},
                    { groupNumber: 99927, area: "Albania", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99928, area: "Georgia", publishingNumbers: [{ start: 0, end: 0 },{ start: 800, end: 999}]},
                    { groupNumber: 99929, area: "Mongolia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99930, area: "Armenia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99931, area: "Seychelles", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99932, area: "Malta", publishingNumbers: [{ start: 0, end: 0 },{ start: 600, end: 699 },{ start: 80, end: 99}]},
                    { groupNumber: 99933, area: "Nepal", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99934, area: "Dominican Republic", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99935, area: "Haiti", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 699 },{ start: 90, end: 99}]},
                    { groupNumber: 99936, area: "Bhutan", publishingNumbers: [{ start: 0, end: 0 },{ start: 600, end: 999}]},
                    { groupNumber: 99937, area: "Macau", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99938, area: "Srpska", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 59 },{ start: 600, end: 899 },{ start: 90, end: 99}]},
                    { groupNumber: 99939, area: "Guatemala", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99940, area: "Georgia", publishingNumbers: [{ start: 0, end: 0 },{ start: 700, end: 999}]},
                    { groupNumber: 99941, area: "Armenia", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99942, area: "Sudan", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99943, area: "Alsbania", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99944, area: "Ethiopia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99945, area: "Namibia", publishingNumbers: [{ start: 0, end: 5 },{ start: 60, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99946, area: "Nepal", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99947, area: "Tajikistan", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 69 },{ start: 700, end: 999}]},
                    { groupNumber: 99948, area: "Eritrea", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99949, area: "Mauritius", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 89 },{ start: 900, end: 999}]},
                    { groupNumber: 99950, area: "Cambodia", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99951, area: "Congo-no ranges fixed yet", publishingNumbers: [] },  
                    { groupNumber: 99952, area: "Mali", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99953, area: "Paraguay", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99954, area: "Bolivia", publishingNumbers: [{ start: 0, end: 2 },{ start: 30, end: 69 },{ start: 700, end: 999}]},
                    { groupNumber: 99955, area: "Srpska", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 59 },{ start: 600, end: 899 },{ start: 90, end: 99}]},
                    { groupNumber: 99956, area: "Albania", publishingNumbers: [{ start: 00, end: 59 },{ start: 600, end: 999}]},
                    { groupNumber: 99957, area: "Malta", publishingNumbers: [{ start: 0, end: 1 },{ start: 20, end: 79 },{ start: 800, end: 999}]},
                    { groupNumber: 99958, area: "Bahrain", publishingNumbers: [{ start: 0, end: 4 },{ start: 50, end: 94 },{ start: 950, end: 999}]}
                    ];
    }

    if(typeof ISBN.validateISBN !== "function")
    {
        ISBN.validateISBN = function (isbn) {
            isbn = this.unformat(isbn);
            if (isbn.length == 10)
                return this.validateISBN10(isbn);
            else if (isbn.length == 13)
                return this.validateISBN13(isbn);
            return false;
        };
    }

    if(typeof ISBN.validateISBN10 !== "function")
    {
        ISBN.validateISBN10 = function (isbn) {
            if (isbn.length != 10)
                return false;
            var t = 0;
            var i = 0;
            for (i = 0; i < 10; i++) {
                var d = parseInt(isbn[i]);
                if (isNaN(d))
                    return false;
                var m = 0;
                if (i == 9)
                    m = 1
                else
                    m = 10 - i;
                t += d * m;
            }
            return t % 11 == 0;
        };
    }
   
    if(typeof ISBN.validateISBN13 !== "function")
    {
        ISBN.validateISBN13 = function (isbn) {
            if (isbn.length != 13)
                return false;
            var t = 0;
            for (var i = 0; i < 12; i++) {
                var d = parseInt(isbn[i]);
                if (isNaN(d))
                    return false;
                var m = (i + 1) % 2 == 0 ? 3 : 1;
                t += d * m;
            }
            var c = parseInt(isbn[12]);
            if (isNaN(c))
                return false;
            var r = (10 - (t % 10)) % 10;
            return r == c;
        };
    }

    if(typeof String.prototype.trim !== "function")
    {
        String.prototype.trim = function() {
    
              return this.replace(/(^\s*)|(\s*$)/g, ""); //find and remove spaces from left and right hand side of string
        };
    }

    if(typeof ISBN.formatISBN !== "function")
    {
        ISBN.formatISBN = function (isbn) {
            if (isbn == null || isbn.length == 0)
                return "";
            var parts = isbn.split(",");
            for (var i = 0; i < parts.length; i++) {
                var s = parts[i].trim();
                if (this.validateISBN(s)) {
                    s = this.unformat(s);
                    if (s.length == 13)
                        parts[i] = s.substr(0, 3) + "-" + this.formatISBN10(s.substr(3));
                    else
                        parts[i] = this.formatISBN10(s);
                }
                else
                    parts[i] = s;
            }
            return parts.join(", ");
        };
    }

    if(typeof ISBN.formatISBN10 !== "function")
    {
        ISBN.formatISBN10 = function (isbn) {
            for(var i = 0; i < this.isbnInfo.length; i++)
            {
                var info = this.isbnInfo[i];
                var g = info.groupNumber.toString();
                if(isbn.indexOf(g) == 0)
                {
                    for(var j = 0; j < info.publishingNumbers.length; j++)
                    {
                        var range = info.publishingNumbers[j];
                        var spn = isbn.substr(g.length, range.end.toString().length);
                        var pn = parseInt(spn);
                        if(pn >= range.start && pn <= range.end)
                        {
                            isbn = isbn.substr(0, g.length) + "-" + isbn.substr(g.length, spn.length) + "-" + isbn.substr(g.length + spn.length);
                            isbn = isbn.substr(0, 11) + "-" + isbn.substr(11);
                            return isbn;
                        }
                    }
                }
            }
            return isbn;
        };
    }

    if(typeof ISBN.unformat !== "function")
    {
        ISBN.unformat = function (isbn) {
            if (isbn != null) {
                var parts = isbn.split(",");
                for (var i = 0; i < parts.length; i++) {
                    var ret = "";
                    for (var j = 0; j < parts[i].length; j++) {
                        var c = parts[i].substr(j, 1);
                        if (c.match(/[0-9a-z]/i) != null)
                            ret += c;
                    }
                    parts[i] = ret;
                }
                return parts.join(", ");
            }
            return null;
        };
    }

    if (typeof ISBN.isGroup !== "function") {
        ISBN.isGroup = function (isbn, groupNumber) {
            if (isbn == null || isbn.length == 0)
                return false;
            if (this.validateISBN(isbn)) {
                isbn = this.formatISBN(isbn);
                return isbn.indexOf(groupNumber.ToString()) == 0;
            }
            return false;
        };
    }
}());
