         var imageCount = 0;
         var nrOfImages = 0;
         var url = new Array();
         var almshouse = new Array();
         var bridge = new Array();
         var building = new Array();
         var statue = new Array();
         var tile = new Array();
         var view = new Array();
         var wall = new Array();

         almshouse[0] = new imageRecord("hlem-oorschot1-tn.jpg", "Almshouse Hofje van Oorschot");
         almshouse[1] = new imageRecord("hlem-bakenesser2-tn.jpg", "Almshouse Bakenesserkamer,<br>entrance");
         almshouse[2] = new imageRecord("hlem-bakenesser1-tn.jpg", "Almshouse Bakenesserkamer,<br>detail of entrance");

         bridge[0] = new imageRecord("hlem-langebrug-tn.jpg", "Langebrug, modern liftbridge");
         bridge[1] = new imageRecord("hlem-melkbrug1-tn.jpg", "Liftbridge called Melkbrug<br>opposite Teylers Museum");

         building[0] = new imageRecord("hlem-grotemarkt1-tn.jpg", "Grote Markt with townhall");
         building[1] = new imageRecord("hlem-grotemarkt3-tn.jpg", "Tower of St. Bavo Church");
         building[2] = new imageRecord("hlem-grotemarkt4-tn.jpg", "Tower of St. Bavo Church,<br>wrapped in scaffolding");
         building[3] = new imageRecord("hlem-waag1-tn.jpg", "De Waag and Teylers Museum,<br>general view");
         building[4] = new imageRecord("hlem-waag2-tn.jpg", "De Waag, detail of roof");
         building[5] = new imageRecord("hlem-teylers1-tn.jpg", "Front of Teylers Museum");
         building[6] = new imageRecord("hlem-tboom1-tn.jpg", "Ten Boom museum");
         building[7] = new imageRecord("hlem-grhoutstr3-tn.jpg", "Verweijhal, information");
         building[8] = new imageRecord("hlem-welgelegen1-tn.jpg", "Paviljoen Welgelegen,<br>front view");
         building[9] = new imageRecord("hlem-welgelegen2-tn.jpg", "Paviljoen Welgelegen,<br>detail of front");

         statue[0] = new imageRecord("hlem-grhoutstr1-tn.jpg", "Grote Houtstraat 110,<br>little statue against wall");
         statue[1] = new imageRecord("hlem-grotemarkt2-tn.jpg", "Statue of Laurens Jansz. Coster");

         tile[0] = new imageRecord("hlem-station1-tn.jpg", "Tile picture in Haarlem Station");
         tile[1] = new imageRecord("hlem-station2-tn.jpg", "Tile picture in Haarlem Station");

         view[0] = new imageRecord("hlem-vend-tn.jpg", "Gedempte Oude Gracht with<br>V&D Department store");

         wall[0] = new imageRecord("hlem-grhoutstr2-tn.jpg", "Grote Houtstraat, top of building");
         wall[1] = new imageRecord("hlem-mcdonalds-tn.jpg", "Grote Houtstraat, McDonalds,<br>detail of wall");
         wall[2] = new imageRecord("hlem-spaarne1-tn.jpg", "Wood cutting above door");
         wall[3] = new imageRecord("hlem-nieuwegr1-tn.jpg", "Front of house at Nieuwe Gracht");

         function imageRecord(imageURL, altText) {
            this.imageURL = imageURL;
            this.altText = altText;
         }

         function URLRecord(imageURL, altText) {
            this.imageURL = imageURL;
            this.altText = altText;
         }

         function fullImage(imageName) {
	    var fullImageWin = window.open("","imageWin", "location=no, menubar=no, toolbar=no, width=650");
            var splittedName = imageName.split("-tn.");
            var fullImageName = splittedName.join(".");
//	    bodie.style.backgroundColor = "#363636";
            var htmlRef = fullImageWin.document.getElementsByTagName("html")[0];
            var bodyRef = fullImageWin.document.getElementsByTagName("body")[0];
            var hoofd = fullImageWin.document.createElement("head");
	    htmlRef.insertBefore(hoofd, bodyRef);
            var headRef = fullImageWin.document.getElementsByTagName("head")[0];
            var titel = fullImageWin.document.createElement("title");
	    var titelText = fullImageWin.document.createTextNode(fullImageName);
            titel.appendChild(titelText);
	    headRef.appendChild(titel);
	    var image = fullImageWin.document.createElement("img");
	    image.setAttribute("src", fullImageName);
	    bodyRef.appendChild(image);
	 }

         function writeImages(subject, nrOfImages) {
            var doc = parent.hlmFrameR.document.open();
            var d = document.getElementsByTagName("html")[0];
	    alert(d);
            doc.write('<html><head><style type="text/css">\n');
            doc.write('body { font-family: Verdana; color: white; background-color: #363636 }\n');
            doc.write('table { border-style: solid; border-width: thin; border-color: red }\n');
            doc.write('td { border-style: solid; border-width: thin; border-color: #363636; text-align: center }\n');
            doc.write('td.text { vertical-align: top; text-align: left }\n');
            doc.write('td.image:hover { border-style: solid; border-width: thin; border-color: silver }\n');
            doc.write('</style><script src="haarlem.js"></script></head><body><h2>' + subject + '</h2><table>');
            for (i=0; i < nrOfImages; i++) { 
               doc.write('<tr><td class="image"><img src="' + url[i].imageURL + '" onClick="javascript:fullImage(\''+ url[i].imageURL +'\')"></td>');
               doc.write('<td class="text">' + url[i].altText + '</td>');
            }   
            doc.write('</table></body></html>');
            doc.close();
         }

         function processSubject(subject) {
            nrOfImages = 0;
            if (subject == "Almshouses") {
               for (elCount = 0; elCount < almshouse.length; elCount++) {
                  url[nrOfImages++] = new URLRecord(almshouse[elCount].imageURL, almshouse[elCount].altText);
               }
            }
            if (subject == "Bridges") {
               for (elCount = 0; elCount < bridge.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(bridge[elCount].imageURL, bridge[elCount].altText);
               }
            }
            if (subject == "Buildings") {
               for (elCount = 0; elCount < building.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(building[elCount].imageURL, building[elCount].altText);
               }
            }
            if (subject == "Statues") {
               for (elCount = 0; elCount < statue.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(statue[elCount].imageURL, statue[elCount].altText);
               }
            }
            if (subject == "Tiles") {
               for (elCount = 0; elCount < tile.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(tile[elCount].imageURL, tile[elCount].altText);
               }
            }
            if (subject == "Views") {
               for (elCount = 0; elCount < view.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(view[elCount].imageURL, view[elCount].altText);
               }
            }
            if (subject == "Walls") {
               for (elCount = 0; elCount < wall.length; elCount++) {
                   url[nrOfImages++] = new URLRecord(wall[elCount].imageURL, wall[elCount].altText);
               }
            }
            writeImages(subject, nrOfImages);
         }

