/***************************************************************************
* 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, item_price, purchase_instruction) {
	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;
	this.item_price = item_price;
	this.purchase_instruction = purchase_instruction;
}
/***************************************************************************
* 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('1792767,1714662,1713816,1713814,1713808,1694019,1693704,1693701,1693635,1693633,1693629,1672135,1670437,1670432,1658802,1658787');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 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 = 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('1792767,1714662,1713816,1713814,1713808,1694019,1693704,1693701,1693635,1693633,1693629,1672135,1670437,1670432,1658802,1658787');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				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 && !(1)) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + 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;
			document.title = photos[nextImg].caption;
			/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						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.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		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('Gallery = ' + 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 = 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(1639713,'110430','LS 001','gallery','http://www1.clikpic.com/teedub/images/Meresands212.jpg',500,333,'Misty Morning in Meresands Wood lancashire.','http://www1.clikpic.com/teedub/images/Meresands212_thumb.jpg',130, 87,0, 1,'Meresands Wood is a nature reserve in Lancashire near Rufford. Well worth a visit.','','','','','');
photos[1] = new photo(1658659,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-1jpg.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-1jpg_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[2] = new photo(1658660,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-3jpg.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-3jpg_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[3] = new photo(1658661,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-4jpg.jpg',400,569,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-4jpg_thumb.jpg',130, 185,0, 1,'','','','','','');
photos[4] = new photo(1658662,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-5jpg.jpg',400,307,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-5jpg_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[5] = new photo(1658663,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-6jpg.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-6jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[6] = new photo(1658664,'111958','','gallery','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-7jpg.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Arabic Song & Dance-7jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[7] = new photo(1658784,'111961','LL05','gallery','http://www1.clikpic.com/teedub/images/Balloon fest-1jpg3.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Balloon fest-1jpg3_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[8] = new photo(1658785,'111961','LL04','gallery','http://www1.clikpic.com/teedub/images/Balloon fest-2jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Balloon fest-2jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[9] = new photo(1658786,'111961','LL03','gallery','http://www1.clikpic.com/teedub/images/Balloon fest-3jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Balloon fest-3jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[10] = new photo(1658787,'111961','LL02','gallery','http://www1.clikpic.com/teedub/images/Balloon fest-4jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Balloon fest-4jpg2_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[11] = new photo(1658788,'111961','LL01','gallery','http://www1.clikpic.com/teedub/images/Balloon fest-5jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Balloon fest-5jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[12] = new photo(1658799,'111959','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-1jpg.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Elterwater-1jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[13] = new photo(1658802,'111959','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-5jpg.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Elterwater-5jpg_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[14] = new photo(1658803,'111959','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-6jpg.jpg',400,267,'','http://www1.clikpic.com/teedub/images/Elterwater-6jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[15] = new photo(1666120,'110430','','gallery','http://www1.clikpic.com/teedub/images/-1jpg2.jpg',500,333,'','http://www1.clikpic.com/teedub/images/-1jpg2_thumb.jpg',130, 87,0, 0,'South Stack Lighthouse looking impressive against a grey sea and sky.','','','','','');
photos[16] = new photo(1666121,'110430','','gallery','http://www1.clikpic.com/teedub/images/-2jpg2.jpg',500,333,'','http://www1.clikpic.com/teedub/images/-2jpg2_thumb.jpg',130, 87,0, 0,'RSPB observation tower, South Stack Anglesey.','','','','','');
photos[17] = new photo(1666123,'110430','','gallery','http://www1.clikpic.com/teedub/images/-3jpg1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/-3jpg1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(1666124,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-1jpg2.jpg',500,333,'Misty Dawn at Elterwater, Lake District','http://www1.clikpic.com/teedub/images/Elterwater-1jpg2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[19] = new photo(1666125,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-2jpg2.jpg',500,333,'Misty Lake','http://www1.clikpic.com/teedub/images/Elterwater-2jpg2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[20] = new photo(1666126,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-3jpg2.jpg',500,333,'Elterwater','http://www1.clikpic.com/teedub/images/Elterwater-3jpg2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[21] = new photo(1666129,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-6jpg2.jpg',500,333,'Frosty Morning Elterwater, Lake District','http://www1.clikpic.com/teedub/images/Elterwater-6jpg2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[22] = new photo(1666130,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-7jpg2.jpg',500,333,'','http://www1.clikpic.com/teedub/images/Elterwater-7jpg2_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[23] = new photo(1666131,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-8jpg1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/Elterwater-8jpg1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[24] = new photo(1666132,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-9jpg1.jpg',500,333,'Rough with the Smooth','http://www1.clikpic.com/teedub/images/Elterwater-9jpg1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[25] = new photo(1666133,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-10jpg1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/Elterwater-10jpg1_thumb.jpg',130, 87,0, 0,'Makeshift fence reflected in the still waters of Elterwater lake in the Lake District Cumbria.','','','','','');
photos[26] = new photo(1666134,'110430','','gallery','http://www1.clikpic.com/teedub/images/Lunestuary2jpg1.jpg',500,333,'Sandstone and Pebbles','http://www1.clikpic.com/teedub/images/Lunestuary2jpg1_thumb.jpg',130, 87,0, 0,'Sandstone and pebbles create an abstract image. Taken at the mouth of the River Lune Lancashire','','','','','');
photos[27] = new photo(1670436,'112715','','gallery','http://www1.clikpic.com/teedub/images/FL002jpg.jpg',500,333,'','http://www1.clikpic.com/teedub/images/FL002jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[28] = new photo(1670437,'112715','FL04','gallery','http://www1.clikpic.com/teedub/images/FL004jpg.jpg',500,333,'','http://www1.clikpic.com/teedub/images/FL004jpg_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[29] = new photo(1670439,'112715','FL03','gallery','http://www1.clikpic.com/teedub/images/FL005jpg.jpg',500,333,'','http://www1.clikpic.com/teedub/images/FL005jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[30] = new photo(1670442,'112715','FL02','gallery','http://www1.clikpic.com/teedub/images/FLOO3jpg.jpg',500,333,'','http://www1.clikpic.com/teedub/images/FLOO3jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[31] = new photo(1671483,'110430','','gallery','http://www1.clikpic.com/teedub/images/South Stack-1jpg.jpg',500,333,'Last rays of the sun South tack Lighthouse.','http://www1.clikpic.com/teedub/images/South Stack-1jpg_thumb.jpg',130, 87,0, 1,'South Stack Lighthouse, Anglsey.','','','','','');
photos[32] = new photo(1673046,'112715','FL01','gallery','http://www1.clikpic.com/teedub/images/bee on raspberry flower-1jpg.jpg',500,333,'Bee on Raspberry flower','http://www1.clikpic.com/teedub/images/bee on raspberry flower-1jpg_thumb.jpg',130, 87,0, 0,'','','Tony Williams','','','');
photos[33] = new photo(1673052,'112715','','gallery','http://www1.clikpic.com/teedub/images/lavender-4jpg.jpg',500,309,'','http://www1.clikpic.com/teedub/images/lavender-4jpg_thumb.jpg',130, 80,0, 0,'','','Tony Williams','','','');
photos[34] = new photo(1673053,'112715','','gallery','http://www1.clikpic.com/teedub/images/lavender-1jpg.jpg',450,675,'','http://www1.clikpic.com/teedub/images/lavender-1jpg_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[35] = new photo(1673055,'112715','','gallery','http://www1.clikpic.com/teedub/images/lavender-2jpg.jpg',450,678,'','http://www1.clikpic.com/teedub/images/lavender-2jpg_thumb.jpg',130, 196,0, 0,'','','Tony Williams','','','');
photos[36] = new photo(1673056,'112715','','gallery','http://www1.clikpic.com/teedub/images/lavender-3jpg.jpg',450,675,'','http://www1.clikpic.com/teedub/images/lavender-3jpg_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[37] = new photo(1693633,'112714','BIR02','gallery','http://www1.clikpic.com/teedub/images/elterwater0711_014-2-2jpg.jpg',450,675,'Robin 1','http://www1.clikpic.com/teedub/images/elterwater0711_014-2-2jpg_thumb.jpg',130, 195,1, 0,'','','','','','');
photos[38] = new photo(1693967,'','TRB02','','http://www1.clikpic.com/teedub/images/IMG_0811jpg.jpg',500,333,'Marina Barcelona','http://www1.clikpic.com/teedub/images/IMG_0811jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[39] = new photo(1693969,'','TRB01','','http://www1.clikpic.com/teedub/images/IMG_0880jpg.jpg',500,337,'Sillhouete from the Roof of Barcelona Cathedral','http://www1.clikpic.com/teedub/images/IMG_0880jpg_thumb.jpg',130, 88,0, 1,'','','','','','');
photos[40] = new photo(1694019,'110430','','gallery','http://www1.clikpic.com/teedub/images/1207_lightroomed_003jpg.jpg',500,306,'Goodwick Harbour, Fishguard','http://www1.clikpic.com/teedub/images/1207_lightroomed_003jpg_thumb.jpg',130, 80,1, 1,'Sunrise from Goodwick Harbour in Fishguard, Pembrokeshire. The low sun picks out a dramatic cloud formation.','','Tony Williams','','','');
photos[41] = new photo(1694020,'110430','','gallery','http://www1.clikpic.com/teedub/images/1207_lightroomed_004jpg.jpg',500,321,'','http://www1.clikpic.com/teedub/images/1207_lightroomed_004jpg_thumb.jpg',130, 83,0, 0,'','','','','','');
photos[42] = new photo(1710811,'112714','BIR01','gallery','http://www1.clikpic.com/teedub/images/_MG_6570jpg.jpg',500,333,'Sparrowhawk','http://www1.clikpic.com/teedub/images/_MG_6570jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(1714587,'112714','','gallery','http://www1.clikpic.com/teedub/images/001001.jpg',500,304,'','http://www1.clikpic.com/teedub/images/001001_thumb.jpg',130, 79,0, 0,'','','','','','');
photos[44] = new photo(1714591,'110430','','gallery','http://www1.clikpic.com/teedub/images/109JPG1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/109JPG1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[45] = new photo(1717043,'111985','','gallery','http://www1.clikpic.com/teedub/images/001JPG1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/001JPG1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[46] = new photo(1717046,'111985','','gallery','http://www1.clikpic.com/teedub/images/003JPG.jpg',500,333,'','http://www1.clikpic.com/teedub/images/003JPG_thumb.jpg',130, 87,0, 1,'','','','','','');
photos[47] = new photo(1717048,'111985','','gallery','http://www1.clikpic.com/teedub/images/005JPG.jpg',500,333,'','http://www1.clikpic.com/teedub/images/005JPG_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[48] = new photo(1717051,'111985','','gallery','http://www1.clikpic.com/teedub/images/006JPG.jpg',500,333,'','http://www1.clikpic.com/teedub/images/006JPG_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[49] = new photo(1717054,'111985','','gallery','http://www1.clikpic.com/teedub/images/009JPG.jpg',500,333,'','http://www1.clikpic.com/teedub/images/009JPG_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[50] = new photo(1717058,'111985','','gallery','http://www1.clikpic.com/teedub/images/0020021.jpg',500,333,'','http://www1.clikpic.com/teedub/images/0020021_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[51] = new photo(1717061,'111985','','gallery','http://www1.clikpic.com/teedub/images/003003.jpg',500,333,'','http://www1.clikpic.com/teedub/images/003003_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[52] = new photo(1717064,'111985','','gallery','http://www1.clikpic.com/teedub/images/004004.jpg',450,675,'','http://www1.clikpic.com/teedub/images/004004_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[53] = new photo(1717066,'111985','','gallery','http://www1.clikpic.com/teedub/images/005005.jpg',500,333,'','http://www1.clikpic.com/teedub/images/005005_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[54] = new photo(1722931,'111985','','gallery','http://www1.clikpic.com/teedub/images/001JPG2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/001JPG2_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[55] = new photo(1722932,'111985','','gallery','http://www1.clikpic.com/teedub/images/002JPG1.jpg',400,600,'','http://www1.clikpic.com/teedub/images/002JPG1_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[56] = new photo(1722934,'111985','','gallery','http://www1.clikpic.com/teedub/images/003JPG1.jpg',400,600,'','http://www1.clikpic.com/teedub/images/003JPG1_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[57] = new photo(1722935,'111985','','gallery','http://www1.clikpic.com/teedub/images/004JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/004JPG_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[58] = new photo(1722936,'111985','','gallery','http://www1.clikpic.com/teedub/images/005JPG1.jpg',400,600,'','http://www1.clikpic.com/teedub/images/005JPG1_thumb.jpg',130, 195,0, 0,'','','Tony Williams','','','');
photos[59] = new photo(1722937,'111985','','gallery','http://www1.clikpic.com/teedub/images/0010011.jpg',500,333,'','http://www1.clikpic.com/teedub/images/0010011_thumb.jpg',130, 87,0, 0,'','','Tony Williams','','','');
photos[60] = new photo(1722938,'111985','','gallery','http://www1.clikpic.com/teedub/images/0020022.jpg',500,333,'','http://www1.clikpic.com/teedub/images/0020022_thumb.jpg',130, 87,0, 0,'','','Tony Williams','','','');
photos[61] = new photo(1792687,'110430','','gallery','http://www1.clikpic.com/teedub/images/108JPG1.jpg',500,333,'Wild water flowing over moss covered rock','http://www1.clikpic.com/teedub/images/108JPG1_thumb.jpg',130, 87,0, 0,'','','Tony Williams','Ogwyn Valley, North Wales','','');
photos[62] = new photo(1813441,'112715','','gallery','http://www1.clikpic.com/teedub/images/0030031.jpg',500,333,'','http://www1.clikpic.com/teedub/images/0030031_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[63] = new photo(1693629,'112714','BIR04','gallery','http://www1.clikpic.com/teedub/images/sparrowhawk_6538jpg.jpg',500,326,'Sparrowhawk and prey','http://www1.clikpic.com/teedub/images/sparrowhawk_6538jpg_thumb.jpg',130, 85,1, 1,'This Sparrowhawk killed the Pigeon earlier in the day and kept returning. I was struck by the intense look which appears to be warning the viewer off the meal.','','','','','');
photos[64] = new photo(1658800,'111959','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-2jpg.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Elterwater-2jpg_thumb.jpg',130, 195,0, 1,'','','','','','');
photos[65] = new photo(1666148,'110430','','gallery','http://www1.clikpic.com/teedub/images/-2-2jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/-2-2jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[66] = new photo(1670432,'112715','FL08','gallery','http://www1.clikpic.com/teedub/images/FL001jpg.jpg',400,600,'','http://www1.clikpic.com/teedub/images/FL001jpg_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[67] = new photo(1693642,'112714','BIR05','gallery','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-11jpg.jpg',500,333,'Moorhen Chick','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-11jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[68] = new photo(1658801,'111959','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-3jpg.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Elterwater-3jpg_thumb.jpg',130, 195,0, 1,'','','','','','');
photos[69] = new photo(1666150,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-4jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Elterwater-4jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[70] = new photo(1693637,'112714','','gallery','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-23jpg.jpg',500,308,'','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-23jpg_thumb.jpg',130, 80,0, 0,'Grebe on Meresands Wood Lake, Lancashire.','','','','','');
photos[71] = new photo(1666153,'110430','','gallery','http://www1.clikpic.com/teedub/images/Elterwater-5jpg2.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Elterwater-5jpg2_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[72] = new photo(1693635,'112714','','gallery','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-10jpg.jpg',500,333,'Canada Geese and Goslings','http://www1.clikpic.com/teedub/images/Meresands wood-lancs-10jpg_thumb.jpg',130, 87,1, 0,'','','','','','');
photos[73] = new photo(1666156,'110430','','gallery','http://www1.clikpic.com/teedub/images/Lunestuary1cleanjpg1.jpg',400,600,'','http://www1.clikpic.com/teedub/images/Lunestuary1cleanjpg1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[74] = new photo(1693631,'112714','','gallery','http://www1.clikpic.com/teedub/images/elterwater0711_011-2-1jpg.jpg',500,347,'Robin 2','http://www1.clikpic.com/teedub/images/elterwater0711_011-2-1jpg_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[75] = new photo(1672135,'112823','','gallery','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_024jpg.jpg',500,333,'Peaceful Power','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_024jpg_thumb.jpg',130, 87,1, 0,'This idyllic scene demonstrates the potential beauty industrial landscapes.','','','','','');
photos[76] = new photo(1672136,'112823','','gallery','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_015jpg.jpg',500,292,'Solar Power','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_015jpg_thumb.jpg',130, 76,0, 0,'Early morning sun rising alongside the silhouetted cooling towers of the power station create a fantastically powerful image.','','','','','');
photos[77] = new photo(1672137,'112823','','gallery','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_008jpg.jpg',500,333,'Pink Power!!','http://www1.clikpic.com/teedub/images/Runcorn bridge sunrise0707_008jpg_thumb.jpg',130, 87,0, 1,'Wonderful colours over Fiddlers Ferry power station The birds are on the Manchester ship canal with the Mersey beyond the wall. I have slightly enhanced the pink in the sky to accentuate the peaceful mood.','','','','','');
photos[78] = new photo(1672139,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_027jpg1.jpg',500,333,'Moreton','http://www1.clikpic.com/teedub/images/Moreton0706_027jpg1_thumb.jpg',130, 87,0, 0,'The historic lighthouse on the coast at Moreton on the Wirral Peninsula.','','','','','');
photos[79] = new photo(1672153,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_018jpg.jpg',500,333,'Windpower','http://www1.clikpic.com/teedub/images/Moreton0706_018jpg_thumb.jpg',130, 87,0, 0,'An impressive sight of a wind farm off the coast in the Mersey Estuary.','','','','','');
photos[80] = new photo(1672168,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_030jpg.jpg',500,333,'Poppies in Moreton','http://www1.clikpic.com/teedub/images/Moreton0706_030jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[81] = new photo(1693701,'112823','','gallery','http://www1.clikpic.com/teedub/images/bridge-mersey0705_006jpg.jpg',500,333,'Runcorn/Widnes bridge.','http://www1.clikpic.com/teedub/images/bridge-mersey0705_006jpg_thumb.jpg',130, 87,1, 1,'','','','','','');
photos[82] = new photo(1693702,'112823','','gallery','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_001-1jpg.jpg',500,333,'Liverpool Skyline','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_001-1jpg_thumb.jpg',130, 87,0, 0,'Taken just before sunrise.','','','','','');
photos[83] = new photo(1693704,'112823','','gallery','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_031-1jpg.jpg',500,333,'Liverpool sunrise','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_031-1jpg_thumb.jpg',130, 87,1, 0,'Sunrise over Liverpool waterfront from New Brighton Beach. The colours have not been altered from the original image.','','','','','');
photos[84] = new photo(1693705,'112823','','gallery','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_053-1jpg.jpg',500,333,'Perch Rock Fort, New Brighton Wirral.','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_053-1jpg_thumb.jpg',130, 87,0, 0,'I waited until the rising sun was picking out the peaks on the sand ripples to form leading lines to the fort which was glowing with the warm red sun.','','','','','');
photos[85] = new photo(1693706,'112823','','gallery','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_061-1jpg.jpg',500,333,'Lighthouse at new Brighton','http://www1.clikpic.com/teedub/images/Liverpool sunrise from New Brighton0712_061-1jpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[86] = new photo(1672154,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_017jpg.jpg',450,675,'Wind Power','http://www1.clikpic.com/teedub/images/Moreton0706_017jpg_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[87] = new photo(1672150,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_036jpg1.jpg',450,675,'Moreton lighthouse','http://www1.clikpic.com/teedub/images/Moreton0706_036jpg1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[88] = new photo(1672141,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_029jpg.jpg',450,675,'Moreton Lighthouse','http://www1.clikpic.com/teedub/images/Moreton0706_029jpg_thumb.jpg',130, 195,0, 0,'Dramatic clouds and striking red poppies.','','','','','');
photos[89] = new photo(1672138,'112823','','gallery','http://www1.clikpic.com/teedub/images/Moreton0706_005jpg.jpg',450,675,'Mersey estuary','http://www1.clikpic.com/teedub/images/Moreton0706_005jpg_thumb.jpg',130, 195,0, 0,'A lone Gull over the Mersey Estuary with Crosby, a suburb of Liverpool in the background','','','','','');
photos[90] = new photo(1714592,'115404','','gallery','http://www1.clikpic.com/teedub/images/106JPG1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/106JPG1_thumb.jpg',130, 87,0, 0,'shell + sand','','Tony Williams','','','');
photos[91] = new photo(1714594,'115404','','gallery','http://www1.clikpic.com/teedub/images/105JPG1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/105JPG1_thumb.jpg',130, 87,0, 0,'','','Tony Williams','','','');
photos[92] = new photo(1713801,'110426','','gallery','http://www1.clikpic.com/teedub/images/104JPG.jpg',400,267,'','http://www1.clikpic.com/teedub/images/104JPG_thumb.jpg',130, 87,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','','','','');
photos[93] = new photo(1713809,'110426','','gallery','http://www1.clikpic.com/teedub/images/113JPG.jpg',400,466,'','http://www1.clikpic.com/teedub/images/113JPG_thumb.jpg',130, 151,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[94] = new photo(1713816,'110426','','gallery','http://www1.clikpic.com/teedub/images/002002.jpg',500,333,'','http://www1.clikpic.com/teedub/images/002002_thumb.jpg',130, 87,1, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[95] = new photo(1713817,'110426','','gallery','http://www1.clikpic.com/teedub/images/011011.jpg',500,333,'','http://www1.clikpic.com/teedub/images/011011_thumb.jpg',130, 87,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[96] = new photo(1713818,'110426','','gallery','http://www1.clikpic.com/teedub/images/013013.jpg',500,333,'','http://www1.clikpic.com/teedub/images/013013_thumb.jpg',130, 87,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[97] = new photo(1713819,'110426','','gallery','http://www1.clikpic.com/teedub/images/015015.jpg',500,333,'','http://www1.clikpic.com/teedub/images/015015_thumb.jpg',130, 87,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[98] = new photo(1714589,'110426','','gallery','http://www1.clikpic.com/teedub/images/107JPG1.jpg',500,333,'','http://www1.clikpic.com/teedub/images/107JPG1_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[99] = new photo(1792767,'110426','','gallery','http://www1.clikpic.com/teedub/images/0010012.jpg',500,333,'','http://www1.clikpic.com/teedub/images/0010012_thumb.jpg',130, 87,1, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[100] = new photo(1792841,'110426','','gallery','http://www1.clikpic.com/teedub/images/0020023.jpg',400,600,'','http://www1.clikpic.com/teedub/images/0020023_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[101] = new photo(1713815,'110426','','gallery','http://www1.clikpic.com/teedub/images/121JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/121JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[102] = new photo(1713814,'110426','','gallery','http://www1.clikpic.com/teedub/images/120JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/120JPG_thumb.jpg',130, 195,1, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[103] = new photo(1713813,'110426','','gallery','http://www1.clikpic.com/teedub/images/119JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/119JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[104] = new photo(1713812,'110426','','gallery','http://www1.clikpic.com/teedub/images/117JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/117JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[105] = new photo(1713811,'110426','','gallery','http://www1.clikpic.com/teedub/images/116JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/116JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[106] = new photo(1713810,'110426','','gallery','http://www1.clikpic.com/teedub/images/114JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/114JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[107] = new photo(1713808,'110426','','gallery','http://www1.clikpic.com/teedub/images/112JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/112JPG_thumb.jpg',130, 195,1, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[108] = new photo(1713807,'110426','','gallery','http://www1.clikpic.com/teedub/images/111JPG.jpg',400,570,'','http://www1.clikpic.com/teedub/images/111JPG_thumb.jpg',130, 185,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','Tony Williams','','','');
photos[109] = new photo(1713805,'110426','','gallery','http://www1.clikpic.com/teedub/images/108JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/108JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','','','','');
photos[110] = new photo(1713804,'110426','','gallery','http://www1.clikpic.com/teedub/images/107JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/107JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','','','','');
photos[111] = new photo(1713803,'110426','','gallery','http://www1.clikpic.com/teedub/images/106JPG.jpg',400,600,'','http://www1.clikpic.com/teedub/images/106JPG_thumb.jpg',130, 195,0, 0,'PLEASE NOTE: This picture is deliberately saved as a very low quality file and heavily watermarked to prevent unauthorised use.<br />\r\n<br />\r\nConsequently, the image shown does not reflect the quality of the final picture produced from a portrait session which will be far superior.','','','','','');
photos[112] = new photo(1714661,'115402','','gallery','http://www1.clikpic.com/teedub/images/001JPG.jpg',500,333,'Eddi Reader','http://www1.clikpic.com/teedub/images/001JPG_thumb.jpg',130, 87,0, 0,'Eddi Reader and Boo Hewerdine in concert at Brampton Folk Festival.','','Tony Williams','','','');
photos[113] = new photo(1714662,'115402','','gallery','http://www1.clikpic.com/teedub/images/002JPG.jpg',500,750,'Eddi Reader','http://www1.clikpic.com/teedub/images/002JPG_thumb.jpg',130, 195,1, 0,'Eddi Reader in Concert','','Tony Williams','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(111958,'1658661','Arabic Festival of Song & dance ','gallery');
galleries[1] = new gallery(112714,'1693629','Birds','gallery');
galleries[2] = new gallery(111959,'1658801,1658800','Croxteth Park Country Fair','gallery');
galleries[3] = new gallery(112715,'1670432','Flowers','gallery');
galleries[4] = new gallery(111985,'1717046','Italy','gallery');
galleries[5] = new gallery(110430,'1694019,1671483,1639713','Landscapes','gallery');
galleries[6] = new gallery(111961,'1658787','Llangollen balloon Festival','gallery');
galleries[7] = new gallery(112823,'1693701,1672137','Images of  Merseyside','gallery');
galleries[8] = new gallery(111479,'1717046','Travel ','gallery');
galleries[9] = new gallery(115404,'1714594,1714592','Odds \'n Sods','gallery');
galleries[10] = new gallery(110426,'1792841,1792767,1714589,1713819,1713818,1713817,1713816,1713815,1713814,1713813','Portraits','gallery');
galleries[11] = new gallery(115402,'1714662,1714661','Misc. other','gallery');
galleries[12] = new gallery(111957,'1658801,1658800,1658787,1658661','EVENTS','gallery');
galleries[13] = new gallery(111984,'1693629,1670432','Nature','gallery');

