/***************************************************************************
* Create a photo object                                                    *
***************************************************************************/
function photo(id, galleries_id, photo_ref, section_code, src, width, height, caption, thumbnail, thumbnail_width, thumbnail_height, home, gallery, description, takendate, photographer, location) {
	this.id = id;
	this.galleries_id = galleries_id;
	this.photo_ref = photo_ref;
	this.section_code = section_code;
	this.src = src;
	this.width = width;
	this.height = height;
	this.caption = caption;
	this.thumbnail = thumbnail;
	this.thumbnail_width = thumbnail_width;
	this.thumbnail_height = thumbnail_height;
	this.home = home;
	this.gallery = gallery;
	this.description = description;
	this.takendate = takendate;
	this.photographer = photographer;
	this.location = location;
}
/***************************************************************************
* Create a gallery object                                                  *
***************************************************************************/

function gallery(id,featured_images,title,section_code) {
	this.id = id;
	this.featured_images = featured_images;
	this.title = title;
	this.section_code = section_code;}

/***************************************************************************
* Select a random value from a comma separated list                        *
***************************************************************************/
function randomListVal(list) {
	arrayVals = list.split(',');
	pos=  Math.round(Math.random() * (arrayVals.length - 1));
	debug('Returning ' + arrayVals[pos] + ' as random image');
	return arrayVals[pos];
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('122741,122737,122735');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 'images/' + photos[j].src;
			img.width = photos[j].width;
			img.height = photos[j].height;
			}
			else {
				newImage = new Image(photos[j].width,photos[j].height);
				newImage.src = 'images/' + photos[j].src;
				document.images[img.name] = newImage;
				debug(newImage.src);
			}
			break;
		}
	}
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline() {
	
	imageID = randomListVal('122741,122737,122735');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
			document.write('<img src="images/' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if (photos[j].galleries_id != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !(0)) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
						document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="images/' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
			temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
			if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
			if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.visibility = 'hidden';
		}
		else {
			document.getElementById('imageDetails').style.visibility = 'visible';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {

	
	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j  -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.
        *
* Gallery_id = id of gallery to choose                                     *
* 
 img = reference to html image                                       *
* in which to show image                                                   *
***************************************************************************/
function showGalleryImage(gallery_id, img) {
	debug('Image = ' + gallery_id);
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = 'images/' + photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
	}

/***************************************************************************
* If we have dynamic HTML                                                  *
*  replace the galleries link with a list that                             *
* doesn't include the current gallery                                      *
***************************************************************************/
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(365976,'11393','','gallery','oyster catcher C0069.jpg',541,400,'Oyster Catcher<i>Haematopus ostralegus <i/>','oyster catcher C0069_thumb.jpg',130, 96,0, 0,'','18/07/06','© Dave Foker','Moi Rana Norway');
photos[1] = new photo(283860,'11393','','gallery','grey heron 0053-03.jpg',400,670,'Grey Heron<br>\n<i>Ardea cinera<i/>','grey heron 0053-03_thumb.jpg',130, 218,0, 0,'','01/06/06','© Dave Foker ','Ludlow Shropshire');
photos[2] = new photo(271145,'11393','','gallery','sedge warbler 0027-03.jpg',367,400,'Sedge Warbler<br>\n<i> Acrocephalus schoenobaenus<i/>','sedge warbler 0027-03_thumb.jpg',130, 142,0, 0,'','11/05/06','© Dave Foker','River Wey Triggs Lock Surrey');
photos[3] = new photo(268592,'11393','','gallery','female blackbird0023-02.jpg',400,299,'Female blackbird<br>\n<i> Turdus merula<i/>','female blackbird0023-02_thumb.jpg',130, 97,0, 0,'','09/05/06','© Dave Foker ','River Wey Send');
photos[4] = new photo(272545,'11393','','gallery','DUNOCK0020-04.jpg',400,361,'Dunnock<br>\n<i>Prunella modularis<i/>','DUNOCK0020-04_thumb.jpg',130, 117,0, 0,'','06/05/06','© Dave Foker','Knaphill Surrey');
photos[5] = new photo(271093,'11393','','gallery','PARAKEET.JPG',306,400,'Ring-necked parakeet<br>\n<i>Psittacula krameri<i/>','PARAKEET_thumb.JPG',130, 170,0, 0,'','21/04/06','© Dave Foker','River Thames Laleham ');
photos[6] = new photo(272363,'11393','','gallery','egyptian geese.jpg',400,228,'Egyptian Geese<br>\n<i>Alopochen aegytiacus<i/>','egyptian geese_thumb.jpg',130, 74,0, 0,'Egyptian Geese with goslings','21/04/06','© Dave Foker','River Thames Laleham');
photos[7] = new photo(272549,'11393','','gallery','heron 0001-01.jpg',307,400,'Grey Heron<br>\n<i>Ardea cinerea<i/>','heron 0001-01_thumb.jpg',130, 169,0, 0,'','18/04/06','© Dave Foker','River Wey Pyrford Surrey');
photos[8] = new photo(222204,'11397','','gallery','_DSC0034-01 copy.jpg',400,282,'Cowslips<br>\n<i>Primula veris<i/>','_DSC0034-01 copy_thumb.jpg',130, 92,0, 0,'','14/04/06','© Dave Foker','Brookwood Hospital Grounds Brookwood Surrey');
photos[9] = new photo(193312,'11393','','gallery','tufted duck jpg.jpg',400,527,'Tufted duck<br>\n<i>Aythya  fuligu</i>','tufted duck jpg_thumb.jpg',130, 171,0, 0,'','06/03/06','© Dave Foker','river Wey Stoke Lock Guilford');
photos[10] = new photo(163735,'11393','','gallery','robin 0071.jpg',400,565,'Robin<br>\n<i>Erithacus rubecula</i>','robin 0071_thumb.jpg',130, 184,0, 0,'Robin singing','17/02/06','© Dave Foker','River Wey Stoke Lock Guildford');
photos[11] = new photo(163737,'11393','','gallery','treecreeper 0027.jpg',400,554,'Treecreeper<br>\n<i> Certhia familiaris</i>','treecreeper 0027_thumb.jpg',130, 180,0, 0,'','17/02/06','© Dave Foker','River Wey Stoke Lock Guildford');
photos[12] = new photo(161594,'11393','','gallery','redshank_0024.jpg',400,644,'Redshank<br>\n<i>Tringa totanus</I>','redshank_0024_thumb.jpg',130, 209,0, 0,'','14/02/06','© Dave Foker','Pagham Harbour Church Norton');
photos[13] = new photo(181014,'11394','','gallery','roe deer_0004.jpg',400,275,'Roe Deer<br>\n<i>Capreolus capreolus</i>','roe deer_0004_thumb.jpg',130, 89,0, 0,'','10/02/06','© Dave Foker','Pirbright Surrey');
photos[14] = new photo(122754,'11393','','gallery','dabchick_0175.jpg',400,566,'Little Grebe<br>\n<i>Tachybaptus ruficollis</i>','dabchick_0175_thumb.jpg',130, 184,0, 0,'','29/12/05','© Dave Foker','Brookwood Surrey');
photos[15] = new photo(126484,'11393','','gallery','mallard splashing.jpg',400,266,'Mallard splashing<br>\n<i>Anas platyrhynchos</i>','mallard splashing_thumb.jpg',130, 86,0, 0,'','28/12/05','© Dave Foker','Brookwood Surrey');
photos[16] = new photo(126503,'11393','','gallery','Pheasant_0132.jpg',400,266,'Pheasant<br>\n<i> Phasianus colchicus</i>','Pheasant_0132_thumb.jpg',130, 86,0, 0,'','20/12/05','© Dave Foker','West Dean Sussex');
photos[17] = new photo(122836,'11393','','gallery','starling0617.JPG',400,266,'Starling<br>\n<i>Sternus vulgaris</i>','starling0617_thumb.JPG',130, 86,0, 0,'','23/09/05','© Dave Foker','Knaphill Surrey');
photos[18] = new photo(122744,'11399','','gallery','anax imperator_0120.jpg',400,241,'Emperor dragonfly<br>\nAnax imperator','anax imperator_0120_thumb.jpg',130, 78,0, 0,'','05/09/05','© Dave Foker','Pirbright Surrey');
photos[19] = new photo(122773,'11393','','gallery','greylag geese_0397.JPG',400,266,'Greylag geese<br>\n<i>Anser anser</i>','greylag geese_0397_thumb.JPG',130, 86,0, 0,'','31/07/05','© Dave Foker','Isle of Mull Scotland');
photos[20] = new photo(122806,'11393','','gallery','oyster catchers_0351.jpg',400,282,'Oystercatcher<br>\n<i>Haematopus ostralegus</i>','oyster catchers_0351_thumb.jpg',130, 92,0, 0,'','31/07/05','© Dave Foker','Isle of Mull Scotland');
photos[21] = new photo(122807,'11393','','gallery','oyster catchers_0393.JPG',400,266,'Oystercatchers<br>\n<i>Haematopus ostralegus</i>','oyster catchers_0393_thumb.JPG',130, 86,0, 0,'','31/07/05','© Dave Foker','Isle of Mull Scotland');
photos[22] = new photo(122839,'11393','','gallery','swallows_0491.jpg',400,266,'Young Swallow<br>\n<i>Hirundo rustica</i>','swallows_0491_thumb.jpg',130, 86,0, 0,'','31/07/05','© Dave Foker','Isle of Mull Scotland');
photos[23] = new photo(127629,'11393','','gallery','eider_0347.jpg',400,331,'Eider<br>\n<i>Somateria mollissima</i.','eider_0347_thumb.jpg',130, 108,0, 0,'Female eider taking a drink','28/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[24] = new photo(129639,'11399','','gallery','large emerald_0025.jpg',400,289,'Large Emerald Moth<br>\n<i>Geometra papilionaria</i>','large emerald_0025_thumb.jpg',130, 94,0, 0,'The large emerald flies from July to August.Locally common in England,Wales and Ireland  and scarce in Scotland. Unusually this was photographed outside the famous RSPB hide at Loch Garten in the Highlands.','28/07/05','© Dave Foker','Loch Garten Scotland');
photos[25] = new photo(136470,'11394','','gallery','pine marten_0081.jpg',400,278,'Pine Marten<br>\n<i> Martes martes</i>','pine marten_0081_thumb.jpg',130, 90,0, 0,'Pine marten feeding on peanuts in the rain.','28/07/05','© Dave Foker','Rothiemurcus Estate Aviemore');
photos[26] = new photo(149692,'11393','','gallery','sandwich terns _0167.jpg',400,273,'Sandwich Terns<br>\n<i>Sterna sandvichensis</i>','sandwich terns _0167_thumb.jpg',130, 89,0, 0,'courtship display ','28/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[27] = new photo(122826,'11394','','gallery','red squirrel_0252.jpg',400,266,'Red Squirrel<br>\nSciurus vulgaris','red squirrel_0252_thumb.jpg',130, 86,0, 0,'','27/07/05','© Dave Foker','Carrbridge Scotland');
photos[28] = new photo(122780,'11393','','gallery','Kittiwakes_0083.JPG',400,266,'Kittiwakes<br>\n<i>Rissa tridactyla</I>','Kittiwakes_0083_thumb.JPG',130, 86,0, 0,'Kittiwake with young. This picture was taken from one of the many boats that visit the Farne Islands during the breeding season. Hand held Nikon D70 Nikon 400 mm VR lens','26/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[29] = new photo(122799,'11393','','gallery','Jacdaw_0013.JPG',400,266,'Jackdaw<br>\n<i>Corvus mondedula</I>','Jacdaw_0013_thumb.JPG',130, 86,0, 0,'','26/07/05','© Dave Foker','Esh Winning County Durham');
photos[30] = new photo(122822,'11393','','gallery','puffins_0232_1.jpg',400,266,'Puffin<br>\n<i>Fratercula artica</i>','puffins_0232_1_thumb.jpg',130, 86,0, 0,'','26/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[31] = new photo(122831,'11393','','gallery','sandwich terns.jpg',400,266,'Sandwich terns<br>\n<i>Sterna sandvichensis</i>','sandwich terns_thumb.jpg',130, 86,0, 0,'','26/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[32] = new photo(122833,'11394','','gallery','seals_0120.jpg',400,602,'Grey Seal<br>\nHalichoerus grypus','seals_0120_thumb.jpg',130, 196,0, 0,'','26/07/05','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[33] = new photo(122776,'11393','','gallery','greywagtail_0165.jpg',400,255,'Grey wagtail<br>\n<i>Motacilla cinerea</i>','greywagtail_0165_thumb.jpg',130, 83,0, 0,'','21/07/05','© Dave Foker','Basingstoke canal Brookwood Surrey');
photos[34] = new photo(126482,'11393','','gallery','collared dove on nest.jpg',400,602,'Collared Dove on nest<br>\n<i>Streptopelia decaocto</i>','collared dove on nest_thumb.jpg',130, 196,0, 0,'This unusual nest site is by the market square in Ludlow. <br>\nFirst recorded in the 1950\'s the collared dove is widespread and a familiar visitor to most gardens in Britain','25/06/05','© Dave Foker','Ludlow Shropshire');
photos[35] = new photo(122870,'11393','','gallery','young tawny owl_2940.jpg',400,304,'Young Tawny Owl<br>\n<i>Strix aluco</i>','young tawny owl_2940_thumb.jpg',130, 99,0, 0,'This young tawny owl was photographed in the Hanger, the favourite  woodland of the naturalist Gilbert White','03/06/05','© Dave Foker','Selborne Hampshire');
photos[36] = new photo(122824,'11393','','gallery','red kite_2846.jpg',400,266,'Red Kite<br>\n<i>Milvus milvus</i>','red kite_2846_thumb.jpg',130, 86,0, 0,'','27/05/05','© Dave Foker','Turville Oxon');
photos[37] = new photo(122874,'11393','','gallery','DSC_2857.JPG',400,266,'Geese ','DSC_2857_thumb.JPG',130, 86,0, 0,'','27/05/05','© Dave Foker','Pangbourne Berkshire');
photos[38] = new photo(133223,'11399','','gallery','green tiger beetle 2702.jpg',400,536,'Green Tiger Beetle<br>\n<i> Cicindela campestris</i>','green tiger beetle 2702_thumb.jpg',130, 174,0, 0,'A fast running,voracious hunter found on heathland and coastal dunes','14/05/05','© Dave Foker','Piebright Surrey');
photos[39] = new photo(271132,'11393','','gallery','long tailed tit_2613-01.jpg',400,254,'Long tailed tit<br>\n<i>Aegithalos caudatus<i/>','long tailed tit_2613-01_thumb.jpg',130, 83,0, 0,'','05/05/05','© Dave Foker','lightwater Country Park Surrey');
photos[40] = new photo(272551,'11393','','gallery','dartford_2624-01.jpg',325,400,'Dartford Warbler<br>\n<i> Sylvia undata<i/>','dartford_2624-01_thumb.jpg',130, 160,0, 0,'Male Dartford Warbler','05/05/05','© Dave Foker','Lightwater Country Park');
photos[41] = new photo(271032,'11393','','gallery','dartford _2596-01.jpg',419,468,'Dartford Warbler<br>\n<i>Sylvia undata<i/>','dartford _2596-01_thumb.jpg',130, 145,0, 0,'Male Dartford Warbler','02/05/05','© Dave Foker','Pirbright Surrey');
photos[42] = new photo(271149,'11393','','gallery','ringed plover_2468-01 copy.jpg',400,279,'Ringed Plover<br>\n<i>Charadrius hiaticula<i/>','ringed plover_2468-01 copy_thumb.jpg',130, 91,0, 0,'','28/04/05','© Dave Foker','Pagham Harbour Church Norton');
photos[43] = new photo(272354,'11393','','gallery','Linnet_2462-01 copy.jpg',330,400,'Linnet<br>\n<i>Carduelis cannabina<i/>','Linnet_2462-01 copy_thumb.jpg',130, 158,0, 0,'Male Linnet','28/04/05','© Dave Foker','Pagham Harbour Church Norton');
photos[44] = new photo(122757,'11393','','gallery','dartford _2383.jpg',400,259,'Dartford Warbler<br>\n<i>Sylvia undata </i>','dartford _2383_thumb.jpg',130, 84,0, 0,'','20/04/05','© Dave Foker','Pirbright Surrey');
photos[45] = new photo(181159,'11393','','gallery','gt spotted woodpecker_2313.jpg',400,525,'Great Spotted Woodpecker<br>\n<i> Dendrocopus major</i>','gt spotted woodpecker_2313_thumb.jpg',130, 171,0, 0,'','27/03/05','© Dave Foker','Pirbright Surrey');
photos[46] = new photo(122769,'11396','','gallery','frogs and spawn2280.jpg',400,266,'Frogs and spawn<br>\n<i>Rana temporaria</i>','frogs and spawn2280_thumb.jpg',130, 86,0, 0,'','23/03/05','© Dave Foker','Knaphill Surrey');
photos[47] = new photo(122977,'11393','','gallery','redwing_2124.jpg',400,519,'Redwing<br>\nTurdus iliacus','redwing_2124_thumb.jpg',130, 169,0, 0,'','16/03/05','© Dave Foker','Knaphill Surrey');
photos[48] = new photo(122849,'11393','','gallery','waxwings_1551.jpg',400,266,'Waxwings<br>\n<i>Bombycilla garrulus </i>','waxwings_1551_thumb.jpg',130, 86,0, 0,'','15/02/05','© Dave Foker','Woking town centre Surrey');
photos[49] = new photo(122853,'11393','','gallery','waxwings_1556.jpg',400,634,'Waxwings<br>\n<i>Bombycilla garrulus</i>','waxwings_1556_thumb.jpg',130, 206,0, 0,'','15/02/05','© Dave Foker','Woking town centre Surrey');
photos[50] = new photo(124066,'11393','','gallery','bee-eater0062.jpg',400,510,'Bee-eater<br>\n<i>Merops apiaster</i>','bee-eater0062_thumb.jpg',130, 166,0, 0,'','24/07/04','© Dave Foker','Rhodes ');
photos[51] = new photo(122820,'11397','','gallery','poppies_0034.jpg',400,602,'Poppies<br>\nPapaver rhoeas','poppies_0034_thumb.jpg',130, 196,0, 0,'','08/06/04','© Dave Foker','Old Woking Surrey');
photos[52] = new photo(181163,'11393','','gallery','whitethroat_0056.jpg',400,308,'Whitethroat<br>\n<i>Sylvia communis</i>','whitethroat_0056_thumb.jpg',130, 100,0, 0,'','07/06/04','© Dave Foker','River Wey Triggs Lock Surrey');
photos[53] = new photo(122856,'11394','','gallery','weasel Triggs Lock.jpg',400,298,'Weasel<br>\nmustela nivalis','weasel Triggs Lock_thumb.jpg',130, 97,0, 0,'','16/05/04','© Dave Foker','River Wey Triggs Lock Surrey');
photos[54] = new photo(122735,'11396','','gallery','adder pirbright.jpg',400,230,'Adder <br>\n<i>Vipera berus</i>','adder pirbright_thumb.jpg',130, 75,1, 0,'This basking male adder is one of many that I visit  during the summer. The photograph was hand held using a Nikon D70 VR70-400 mm','08/05/04','© Dave Foker','Pirbright Surrey');
photos[55] = new photo(161593,'11393','','gallery','magpies6.jpg',400,532,'Magpies<br>\n<i>Pica pica</i>','magpies6_thumb.jpg',130, 173,0, 0,'','07/05/04','© Dave Foker','Knaphill Surrey');
photos[56] = new photo(122737,'11394','','gallery','leaping Roe deer.jpg',400,321,'Roe deer','leaping Roe deer_thumb.jpg',130, 104,1, 0,'Roe Deer <br>\nCapreolus capreolus','','© Dave Foker','Kemishford Surrey');
photos[57] = new photo(122741,'11394','','gallery','fox 03.jpg',400,283,'','fox 03_thumb.jpg',130, 92,1, 0,'','','© Dave Foker','Knaphill Surrey');
photos[58] = new photo(122745,'11399','','gallery','banded damesel.jpg',400,273,'Banded demoiselle<br>\nCalopteryx splendens','banded damesel_thumb.jpg',130, 89,0, 0,'','','© Dave Foker','River Wey Triggs Lock Surrey');
photos[59] = new photo(122748,'11393','','gallery','brambling.jpg',400,294,'Brambling<br>\n<i>Fringilla montifringilla</i>','brambling_thumb.jpg',130, 96,0, 0,'','','© Dave Foker','Knaphill Surrey');
photos[60] = new photo(122750,'11393','','gallery','chaffinch.jpg',400,264,'Chaffinch<br>\n<i>Fringilla Coelebs</i>','chaffinch_thumb.jpg',130, 86,0, 0,'Male Chaffinch in breeding plumage','','© Dave Foker','Knaphill Surrey');
photos[61] = new photo(122752,'11399','','gallery','comma.jpg',400,261,'Comma <br>\nPolygonia c-album','comma_thumb.jpg',130, 85,0, 0,'','','© Dave Foker','Brookwood Surrey');
photos[62] = new photo(122753,'11397','','gallery','cuckoo pint 1.jpg',400,533,'Cuckoo Pint<br>\nArum maculatum','cuckoo pint 1_thumb.jpg',130, 173,0, 0,'','','© Dave Foker','Rattery Devon');
photos[63] = new photo(122796,'11393','','gallery','Heron0093.jpg',400,266,'Grey Heron<br>\n<i>Ardea cinerea</i>','Heron0093_thumb.jpg',130, 86,0, 0,'','','© Dave Foker','River Wey Stoke Lock Guilford');
photos[64] = new photo(122797,'11393','','gallery','hooded crow.jpg',400,555,'Hooded Crow<br>\n<i>Corvus corone cornix</i>','hooded crow_thumb.jpg',130, 180,0, 0,'','','© Dave Foker','Isle of Mull Scotland');
photos[65] = new photo(122800,'11393','','gallery','JAY.jpg',400,283,'Jay<br>\n<i>Garrulus glandarius</i>','JAY_thumb.jpg',130, 92,0, 0,'','','© Dave Foker','Knaphill Surrey');
photos[66] = new photo(122801,'11393','','gallery','Kingfisher.jpg',400,264,'Kingfisher<br>\nAlcedo athis','Kingfisher_thumb.jpg',130, 86,0, 0,'','','© Dave Foker','Kemishford Surrey');
photos[67] = new photo(122802,'11393','','gallery','kingfisher front cover.jpg',400,591,'Kingfisher<br>\n<i>Alcedo athis<i/>','kingfisher front cover_thumb.jpg',130, 192,0, 0,'Male Kingfisher','','© Dave Foker','kemishford Surrey');
photos[68] = new photo(122805,'11393','','gallery','osprey.jpg',400,287,'Osprey<br>\nPandion haliaetus','osprey_thumb.jpg',130, 93,0, 0,'','','© Dave Foker','Fort Myers Florida');
photos[69] = new photo(122841,'11393','','gallery','swan at Newark Priory.jpg',400,597,'Mute Swan<br>\n<i>Cygnus olor</i>','swan at Newark Priory_thumb.jpg',130, 194,0, 0,'','','© Dave Foker','Newark Priory Ripley Surrey');
photos[70] = new photo(122864,'11393','','gallery','willow warbler.jpg',400,264,'Willow Warbler<br>\nPhylloscopus trochilus','willow warbler_thumb.jpg',130, 86,0, 0,'','','© Dave Foker','Esh Winning County Durham');
photos[71] = new photo(122866,'11393','','gallery','woodpecker0362.jpg',400,619,'Great Spotted Woodpecker<br>\n<i>Dendrocopus major</i>','woodpecker0362_thumb.jpg',130, 201,0, 0,'','','© Dave Foker','Knaphill Surrey');
photos[72] = new photo(122984,'11393','','gallery','Mallards in flight.jpg',400,296,'Mallards in flight<br>\nAnas platyrhynchos','Mallards in flight_thumb.jpg',130, 96,0, 0,'','','© Dave Foker','River Wey Triggs Lock Surrey');
photos[73] = new photo(123329,'11399','','gallery','red admiral canal.jpg',400,295,'Red Admiral<br>\nVanessa atalanta','red admiral canal_thumb.jpg',130, 96,0, 0,'','','© Dave Foker','Basingstoke canal Brookwood Surrey');
photos[74] = new photo(124508,'11394','','gallery','Charlie.jpg',400,266,'Charlie','Charlie_thumb.jpg',130, 86,0, 0,'This is Charlie who accompanies me on most of my trips.<br>\nHe is a half retreiver on his mother\'s side and very patient.','','© Dave Foker','Brookwood Surrey');
photos[75] = new photo(125238,'11393','','gallery','pelican.jpg',400,601,'Brown Pelican<br>\n<i>Pelecanus occidentalis</i>','pelican_thumb.jpg',130, 195,0, 0,'','','© Dave Foker','Fort Myers Florida');
photos[76] = new photo(126465,'11393','','gallery','pochard.jpg',400,264,'Pochard<br>\n<i>Aythya ferina</i>','pochard_thumb.jpg',130, 86,0, 0,'','','© Dave Foker','Lightwater Country Park');
photos[77] = new photo(126505,'11393','','gallery','night0703.jpg',400,270,'Nightjar<br>\n<i>Caprimulgus europaeus </i>','night0703_thumb.jpg',130, 88,0, 0,'','','© Dave Foker','Pirbright Surrey');
photos[78] = new photo(127617,'11399','','gallery','silver studded blue.jpg',400,252,'Silver- studded Blue<br>\n<i>Plebejus argus</i>','silver studded blue_thumb.jpg',130, 82,0, 0,'Confined mainly to heaths in the South of England on the wing June to July','','© Dave Foker','Pirbright Surrey');
photos[79] = new photo(127623,'11393','','gallery','crestet tit.jpg',400,301,'Crested Tit<br>\n<i> Parus cristatus</i>','crestet tit_thumb.jpg',130, 98,0, 0,'Restricted to native pine and coniferous woodland of the Scottish Highlands. Can be attracted by imitating its trill like call','','© Dave Foker','Loch Garten Scotland');
photos[80] = new photo(127634,'11393','','gallery','redshank_0020.jpg',400,580,'Redshank<br>\n<i> Tringa totanus</i>','redshank_0020_thumb.jpg',130, 189,0, 0,'','','© Dave Foker','Farne Islands Seahouses Northumberland');
photos[81] = new photo(127635,'11397','','gallery','poppies.jpg',400,600,'Poppies<br>\n<i> Papaver rhoeas</i>','poppies_thumb.jpg',130, 195,0, 0,'','','© Dave Foker','Christmas Pie Wanborough Surrey');
photos[82] = new photo(127638,'11397','','gallery','harebell.jpg',396,616,'Harebell<br>\n<i> Campanula rotundifolia</i>','harebell_thumb.jpg',130, 202,0, 0,'Seen July to October','','© Dave Foker','Klosterle Austrian Alps');
photos[83] = new photo(128192,'11393','','gallery','swan bay green.jpg',400,609,'Mute Swan Cygnet<br>\n<i> Cygnus olor</i>','swan bay green_thumb.jpg',130, 198,0, 0,'Cygnet on the Basingstoke Canal ','','© Dave Foker','St John\'s Woking Surrey');
photos[84] = new photo(128194,'11801','','gallery','tree.jpg',383,244,'Beech Tree<br>\n<i> Fagus sylvatica</i>','tree_thumb.jpg',130, 83,0, 0,'','','© Dave Foker','North Wales');
photos[85] = new photo(130697,'11393','','gallery','dartford 72.jpg',400,264,'Dartford Warbler<br>\n<i>Sylvia undata</i>','dartford 72_thumb.jpg',130, 86,0, 0,'','','© Dave Foker','Pirbright Surrey');
photos[86] = new photo(133226,'11399','','gallery','greenveined white flowering.jpg',400,266,'Green-veined white<br>\n<i> Artogeia napi</i>','greenveined white flowering_thumb.jpg',130, 86,0, 0,'Green-veined white on flowering rush','','© Dave Foker','Brookwood Surrey');
photos[87] = new photo(136455,'11393','','gallery','NUTHATCH.jpg',400,604,'Nuthatch<br>\n<i> Sitta europaea</i>','NUTHATCH_thumb.jpg',130, 196,0, 0,'','','© Dave Foker','Knaphill Surrey');
photos[88] = new photo(136478,'11394','','gallery','grey squirrel heather.jpg',400,224,'Grey Squirrel<br>\n<i> Sciurus carolinensis</i>','grey squirrel heather_thumb.jpg',130, 73,0, 0,'In his book the  History of Quadrepeds, Thomas Bewick the  naturalist and engraver wrote in 1792  of the grey squirrel <i> It is very numerous in North -America, and does incredible damage to the plantations. Great flocks descend from the mountains and lay waste the fields of maize,by eating the young ears.-A reward of three pence per head was given for every one that was killed; and such numbers were destroyed in one year that Pennsylvania alone paid in rewards the sum of £8000 of its currency.</i><br>\n84 years before its introduction to Britain','','© Dave Foker','Knaphill Surrey');
photos[89] = new photo(140936,'11393','','gallery','great blacked back gull.jpg',400,256,'Great blacked-gulll<br>\n<i>Larus marinus</i>','great blacked back gull_thumb.jpg',130, 83,0, 0,'Great backed gull drinking','','© Dave Foker','farne Islands Seahouses Northumberland');
photos[90] = new photo(181013,'11396','','gallery','common lizard.jpg',400,276,'Common lizard <br>\n<i>Lacerta Vivipara </i>','common lizard_thumb.jpg',130, 90,0, 0,'','','© Dave Foker','Lightwater Country Park');
photos[91] = new photo(181164,'11393','','gallery','willowwarbler caddisfly.jpg',400,276,'Willow warbler <br>\n<i>Phyllocopus trochilus</i>','willowwarbler caddisfly_thumb.jpg',130, 90,0, 0,'Willow warbler  with caddis fly','','© Dave Foker','Esh Winning County Durham');
photos[92] = new photo(272562,'11395','','gallery','selborne0767-01.jpg',400,265,'Selborne','selborne0767-01_thumb.jpg',130, 86,0, 0,'Selborne Village view from the Hanger','13/02/06','© Dave Foker','Selborne Hampshire');
photos[93] = new photo(122834,'11395','','gallery','send church 111205_jpg.jpg',400,187,'Send Curch','send church 111205_jpg_thumb.jpg',130, 61,0, 0,'','11/12/05','© Dave Foker','Send Church Send Surrey');
photos[94] = new photo(122846,'11395','','gallery','triggs lock 2005.72 dpi.jpg',400,266,'Triggs Lock','triggs lock 2005_thumb.72 dpi.jpg',130, 86,0, 0,'','19/11/05','© Dave Foker','River Wey Triggs Lock Surrey');
photos[95] = new photo(126807,'11395','','gallery','sunset triggs lock.jpg',400,266,'Sunset Triggs Lock','sunset triggs lock_thumb.jpg',130, 86,0, 0,'','19/11/05','© Dave Foker','River Wey Triggs Lock Surrey');
photos[96] = new photo(122859,'11395','','gallery','wicken fen_0085.jpg',400,266,'Wicken Fen Windmill','wicken fen_0085_thumb.jpg',130, 86,0, 0,'','23/10/05','© Dave Foker','Wicken Fen Cambridgeshire');
photos[97] = new photo(138234,'11395','','gallery','Duart castle0506.jpg',400,262,'Duart Castle','Duart castle0506_thumb.jpg',130, 85,0, 0,'','28/07/05','© Dave Foker','Isle of Mull Scotland');
photos[98] = new photo(138416,'11395','','gallery','Torosay Castle_0440.jpg',400,602,'Torosay Castle','Torosay Castle_0440_thumb.jpg',130, 196,0, 0,'','28/07/05','© Dave Foker','Isle of Mull Scotland');
photos[99] = new photo(138796,'11395','','gallery','sunset0281.jpg',400,266,'Sunset ','sunset0281_thumb.jpg',130, 86,0, 0,'','28/07/05','© Dave Foker','Isle of Mull Scotland');
photos[100] = new photo(123135,'11395','','gallery','send church_3057.jpg',400,266,'Send Church ','send church_3057_thumb.jpg',130, 86,0, 0,'Summer','17/06/05','© Dave Foker','Send Church Send Surrey');
photos[101] = new photo(122915,'11395','','gallery','The Wakes.jpg',400,266,'The Wakes Selborne','The Wakes_thumb.jpg',130, 86,0, 0,'The home of the naturalist Gibert White','19/12/04','© Dave Foker','Selborne Hampshire');
photos[102] = new photo(126802,'11395','','gallery','triggs lock_0781.jpg',400,266,' Triggs Lock','triggs lock_0781_thumb.jpg',130, 86,0, 0,'The lock keeper\'s cottage at Triggs Lock on the River Wey<br>\nSend  Surrey','17/12/04','© Dave Foker','Send Woking Surrey');
photos[103] = new photo(124261,'11395','','gallery','oldwoking church.jpg',400,266,'St Peter\'s Church Old Woking','oldwoking church_thumb.jpg',130, 86,0, 0,'','04/08/04','© Dave Foker',' Old Woking');
photos[104] = new photo(137281,'11395','','gallery','Pirbright heath from the air_0053.jpg',400,266,'','Pirbright heath from the air_0053_thumb.jpg',130, 86,0, 0,'Pirbright and Brookwood Heath from the air','03/06/04','© Dave Foker','Pirbright Surrey');
photos[105] = new photo(122762,'11395','','gallery','Eilean Donen_1.jpg',400,263,'Eilean Donen Castle','Eilean Donen_1_thumb.jpg',130, 85,0, 0,'','','© Dave Foker','Kyle of Lochalsh, Scotland');
photos[106] = new photo(122803,'11395','','gallery','lightning in Knaphill.jpg',400,269,'Lightning Knaphill','lightning in Knaphill_thumb.jpg',130, 87,0, 0,'','','© Dave Foker','Knaphill Surrey');
photos[107] = new photo(122804,'11395','','gallery','newark priorydarker.jpg',400,244,'Newark Priory and Canada Geese','newark priorydarker_thumb.jpg',130, 79,0, 0,'','','© Dave Foker','Newark Priory Ripley Surrey');
photos[108] = new photo(126255,'11395','','gallery','oxo3.jpg',400,309,'Oxo Tower','oxo3_thumb.jpg',130, 100,0, 0,'The back of the Oxo Tower circa 1989 the buildings in the foreground are no longer there.','','© Dave Foker','Coin Street London');
photos[109] = new photo(138244,'11395','','gallery','send chuirch_0069.jpg',400,602,'Send Church','send chuirch_0069_thumb.jpg',130, 196,0, 0,'','','© Dave Foker','Send Church Send Surrey');
photos[110] = new photo(161586,'11395','','gallery','woking fc.jpg',400,262,'Woking Football Club','woking fc_thumb.jpg',130, 85,0, 0,'Woking Football Club <i>\"The Cards\"</i>','','© Dave Foker','Woking');
photos[111] = new photo(181147,'11395','','gallery','St ives view.jpg',400,267,'St Ives Cornwall','St ives view_thumb.jpg',130, 87,0, 0,'','','© Dave Foker','St Ives Cornwall');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(11396,'181013,122769,122735','Amphibians and Reptiles','gallery');
galleries[1] = new gallery(11393,'365976,283860,272551,272549,272545,272363,272354,271149,271145,271132','Birds','gallery');
galleries[2] = new gallery(11399,'133226,133223,129639,127617,123329,122752,122745,122744','Insects','gallery');
galleries[3] = new gallery(11394,'181014,136478,136470,124508,122856,122833,122826,122741,122737','Mammals','gallery');
galleries[4] = new gallery(11397,'222204,127638,127635,122820,122753','Plants','gallery');
galleries[5] = new gallery(11801,'128194','Trees','gallery');
galleries[6] = new gallery(11395,'272562,181147,161586,138796,138416,138244,138234,137281,126807,126802','Landscapes','gallery');

