      var imageMap = [ // table contains value of w for ed 1 of the corresponding ad
        // data comes from http://pilot.familysearch.org/recordsearch/v1/collection/1463113/waypoint/2641?disableNoCache=true&noHttpError=true&cb=1248403314867
        2642, // ad 1, has 21 eds
        2663, // ad 2, has 22 eds
        2685, // ad 3, has 17 eds
        2702, // ad 4, has 29 eds, ed 29 is missing in their xml file
        2731, // ad 5, has 25 eds
        2756, // ad 6, has 25 eds
        2781, // ad 7, has 39 eds, see table below
        2820, // ad 8, has 16 eds
        2836, // ad 9, has 18 eds
        2854, // ad 10, has 26 eds, ed 26 is missing in their xml file
        2879, // ad 11, has 27 eds
//        2880, // ad 11, has 26 eds
        2906, // ad 12, has 28 eds
        2934, // ad 13, has 28 eds
        2962, // ad 14, has 22 eds
        2984, // ad 15, has 20 eds
        3004, // ad 16, has 27 eds
        3031, // ad 17, has 25 eds
        3056, // ad 18, has 38 eds
        3094, // ad 19, has 21 eds
        3115, // ad 20, has 32 eds
        3147 // ad 21, has 34 eds
      ];

      var imageMap7 = [
        2781, // ed 1
        2809, // ed 2
        2810, // ed 3
        2811, // ed 4
        2812, // ed 5
        2813, // ed 6
        2782, // ed 7
        2783, // ed 8
        2814, // ed 9
        2815, // ed 10
        2816, // ed 11
        2817, // ed 12
        2784, // ed 13
        2785, // ed 14
        2818, // ed 15
        2786, // ed 16
        2787, // ed 17
        2819, // ed 18
        2788, // ed 19
        2789, // ed 20
        2790, // ed 21
        2791, // ed 22
        2792, // ed 23
        2793, // ed 24
        2794, // ed 25
        2795, // ed 26
        2796, // ed 27
        2797, // ed 28
        2798, // ed 29
        2799, // ed 30
        2800, // ed 31
        2801, // ed 32
        2802, // ed 33
        2803, // ed 34
        2804, // ed 35
        2805, // ed 36
        2806, // ed 37
        2807, // ed 38
        2808 // ed 39
      ];

      function DisplayImages(ad, ed) {
        var c = 1463113;
        var w;
        if (ad == 7) {
          w = imageMap7[ed-1]
        } else {
          w = imageMap[ad-1] -1 + ed;
        }
        var url = "http://pilot.familysearch.org/recordsearch/start.html#p=imageBrowser;c=" + c + ";w="+w;
        window.open(url);
      }

