/***************************************************************************
* 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('249090,249089,249062,218682,191798,191793,191776,189233');
	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('249090,249089,249062,218682,191798,191793,191776,189233');
	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) || (0))) {
		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 + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'RWA Photography: ' + 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(3481427,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_8955_6_1.JPG',400,600,'London Eye','http://www3.clikpic.com/rwaphotography/images/IMG_8955_6_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[1] = new photo(3481461,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_8993_7_1.JPG',600,400,'Golden Jubilee Bridge','http://www3.clikpic.com/rwaphotography/images/IMG_8993_7_1_thumb.JPG',130, 87,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[2] = new photo(3481465,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9042_6_1.JPG',400,600,'DALI 1 @ London Eye','http://www3.clikpic.com/rwaphotography/images/IMG_9042_6_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[3] = new photo(3481492,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9088_5_1.JPG',400,600,'DALI 2 @ London Eye','http://www3.clikpic.com/rwaphotography/images/IMG_9088_5_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[4] = new photo(3481518,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9078_7_1.JPG',600,400,'Houses of Parliament - Silhouette 1','http://www3.clikpic.com/rwaphotography/images/IMG_9078_7_1_thumb.JPG',130, 87,0, 0,'','13/02/08','R W Armitage','','','');
photos[5] = new photo(3481520,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9081_5_1.JPG',400,600,'Houses of Parliament - Silhouette 2','http://www3.clikpic.com/rwaphotography/images/IMG_9081_5_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[6] = new photo(3481578,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9248-crop_6_1.jpg',600,400,'Houses of Parliament','http://www3.clikpic.com/rwaphotography/images/IMG_9248-crop_6_1_thumb.jpg',130, 87,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[7] = new photo(3481581,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9328_5_1.JPG',400,600,'Millenium Bridge','http://www3.clikpic.com/rwaphotography/images/IMG_9328_5_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[8] = new photo(3481582,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9338-crop_5_1.jpg',600,428,'Millenium Bridge & St. Pauls','http://www3.clikpic.com/rwaphotography/images/IMG_9338-crop_5_1_thumb.jpg',130, 93,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[9] = new photo(3481658,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9343_4_1.JPG',400,600,'Millenium Bridge to St. Pauls','http://www3.clikpic.com/rwaphotography/images/IMG_9343_4_1_thumb.JPG',130, 195,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[10] = new photo(3481660,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9349-crop_5_1.jpg',600,428,'St. Pauls','http://www3.clikpic.com/rwaphotography/images/IMG_9349-crop_5_1_thumb.jpg',130, 93,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[11] = new photo(3481694,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9370_5_1.JPG',600,400,'London City from Waterloo Bridge','http://www3.clikpic.com/rwaphotography/images/IMG_9370_5_1_thumb.JPG',130, 87,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[12] = new photo(3481725,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9368_5_11.JPG',600,400,'The Misty City from Waterloo Bridge','http://www3.clikpic.com/rwaphotography/images/IMG_9368_5_11_thumb.JPG',130, 87,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[13] = new photo(3481728,'212890','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_9371_5_1.JPG',600,400,'The London Eye from Waterloo Bridge','http://www3.clikpic.com/rwaphotography/images/IMG_9371_5_1_thumb.JPG',130, 87,0, 0,'','13/02/08','Roland W Armitage','','','');
photos[14] = new photo(1108193,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2916.jpg',600,400,'Outside Church Doorway','http://www3.clikpic.com/rwaphotography/images/IMG_2916_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[15] = new photo(1108197,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3026.jpg',600,400,'Groom Laughing','http://www3.clikpic.com/rwaphotography/images/IMG_3026_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[16] = new photo(1108200,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3054.jpg',600,400,'Bride & Groom','http://www3.clikpic.com/rwaphotography/images/IMG_3054_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[17] = new photo(1108207,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3098.jpg',600,400,'Bride & Groom','http://www3.clikpic.com/rwaphotography/images/IMG_3098_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[18] = new photo(1108215,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3135.jpg',600,400,'Bride & Groom Outside','http://www3.clikpic.com/rwaphotography/images/IMG_3135_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[19] = new photo(1108248,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2940bwJPG.jpg',400,600,'Outside Church Doorway (Mono)','http://www3.clikpic.com/rwaphotography/images/IMG_2940bwJPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[20] = new photo(1108252,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2948JPG.jpg',400,600,'Walking on the Lawn','http://www3.clikpic.com/rwaphotography/images/IMG_2948JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[21] = new photo(1108253,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2997JPG.jpg',400,600,'Bride on the Lawn','http://www3.clikpic.com/rwaphotography/images/IMG_2997JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[22] = new photo(1108260,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3042JPG.jpg',400,600,'Bride','http://www3.clikpic.com/rwaphotography/images/IMG_3042JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[23] = new photo(1108270,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3205JPG.jpg',400,600,'Walking in the Grounds','http://www3.clikpic.com/rwaphotography/images/IMG_3205JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[24] = new photo(1108274,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3223JPG.jpg',400,600,'Inside Church Doorway','http://www3.clikpic.com/rwaphotography/images/IMG_3223JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[25] = new photo(1108276,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3269JPG.jpg',400,600,'Walking up the Aisle','http://www3.clikpic.com/rwaphotography/images/IMG_3269JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[26] = new photo(1108277,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3389JPG.jpg',400,600,'Bride @ Window','http://www3.clikpic.com/rwaphotography/images/IMG_3389JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[27] = new photo(1108284,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3447bwJPG.jpg',400,600,'Groom @ Window','http://www3.clikpic.com/rwaphotography/images/IMG_3447bwJPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[28] = new photo(1108286,'81337','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3522JPG.jpg',400,600,'Adjusting Tie','http://www3.clikpic.com/rwaphotography/images/IMG_3522JPG_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[29] = new photo(432443,'34418','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4513Aug06.jpg',600,400,'Tiara Two','http://www3.clikpic.com/rwaphotography/images/IMG_4513Aug06_thumb.jpg',130, 87,0, 0,'Tiara Two','11/08/06','','','','');
photos[30] = new photo(432458,'34418','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4621Aug06.jpg',600,400,'Tiara Five','http://www3.clikpic.com/rwaphotography/images/IMG_4621Aug06_thumb.jpg',130, 87,0, 0,'Tiara Five','11/08/06','','','','');
photos[31] = new photo(432462,'34418','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4679Aug06.jpg',600,400,'Tiara Seven','http://www3.clikpic.com/rwaphotography/images/IMG_4679Aug06_thumb.jpg',130, 87,0, 0,'Tiara Seven','11/08/06','','','','');
photos[32] = new photo(432771,'17309','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3846Aug06.jpg',400,600,'','http://www3.clikpic.com/rwaphotography/images/IMG_3846Aug06_thumb.jpg',130, 195,0, 0,'','09/07/06','','','','');
photos[33] = new photo(249062,'17309','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_89481.jpg',400,600,'Water Fountain - Stratford-Upon-Avon','http://www3.clikpic.com/rwaphotography/images/IMG_89481_thumb.jpg',130, 195,1, 0,'','04/03/06','','','','');
photos[34] = new photo(249079,'17309','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_7992.jpg',400,600,'Chimney Sweeps Brush - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_7992_thumb.jpg',130, 195,0, 0,'','20/12/05','','','','');
photos[35] = new photo(249089,'17309','','gallery','http://www3.clikpic.com/rwaphotography/images/CC270305.jpg',400,600,'Chinese Garden Fountain','http://www3.clikpic.com/rwaphotography/images/CC270305_thumb.jpg',130, 195,1, 0,'','27/03/05','','','','');
photos[36] = new photo(432756,'17310','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3655Aug061.jpg',600,400,'Ragdoll','http://www3.clikpic.com/rwaphotography/images/IMG_3655Aug061_thumb.jpg',130, 87,0, 0,'Ragatage Ragdolls<br>\r\nwww.ragatage.moonfruit.com','08/07/06','','','','');
photos[37] = new photo(193071,'17310','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_1039r.jpg',600,400,'Tabby Cat','http://www3.clikpic.com/rwaphotography/images/IMG_1039r_thumb.jpg',130, 87,0, 0,'','10/04/05','','','','');
photos[38] = new photo(432750,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3598Aug06.jpg',600,400,'','http://www3.clikpic.com/rwaphotography/images/IMG_3598Aug06_thumb.jpg',130, 87,0, 0,'Elvedon Forrest','06/07/06','','','','');
photos[39] = new photo(432641,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_1743-cropAug06.jpg',400,600,'Heath Fritillary Butterfly - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_1743-cropAug06_thumb.jpg',130, 195,0, 0,'Heath Fritillary Butterfly - Essex','17/06/06','','','','');
photos[40] = new photo(193044,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_8443w.jpg',600,400,'Snowy Farm Gate','http://www3.clikpic.com/rwaphotography/images/IMG_8443w_thumb.jpg',130, 87,0, 0,'','28/12/05','','','','');
photos[41] = new photo(193034,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_7706w.jpg',600,400,'Frosty Oak Leaves','http://www3.clikpic.com/rwaphotography/images/IMG_7706w_thumb.jpg',130, 87,0, 0,'','20/11/05','','','','');
photos[42] = new photo(191798,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6883w.jpg',400,600,'','http://www3.clikpic.com/rwaphotography/images/IMG_6883w_thumb.jpg',130, 195,1, 0,'','20/10/05','','','','');
photos[43] = new photo(191799,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6928w.jpg',600,400,'','http://www3.clikpic.com/rwaphotography/images/IMG_6928w_thumb.jpg',130, 87,0, 0,'','20/10/05','','','','');
photos[44] = new photo(191796,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_5369w.jpg',400,600,'Summer Thistle - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_5369w_thumb.jpg',130, 195,0, 0,'','09/07/05','','','','');
photos[45] = new photo(191794,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_5266w.jpg',600,400,'Heath Fritillary Butterfly - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_5266w_thumb.jpg',130, 87,0, 0,'','26/06/05','','','','');
photos[46] = new photo(191793,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_5104w.jpg',400,600,'Five-Spot Burnet Moth - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_5104w_thumb.jpg',130, 195,1, 0,'','21/06/05','','','','');
photos[47] = new photo(191792,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4956w.jpg',400,600,'White Foxglove (Digitalis purpurea) - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_4956w_thumb.jpg',130, 195,0, 0,'','11/06/05','','','','');
photos[48] = new photo(191790,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4561w.jpg',600,400,'Bluebells - Essex','http://www3.clikpic.com/rwaphotography/images/IMG_4561w_thumb.jpg',130, 87,0, 0,'','02/05/05','','','','');
photos[49] = new photo(250028,'17311','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4444w.jpg',600,400,'Bluebell (Hyacinthoides non-scripta)','http://www3.clikpic.com/rwaphotography/images/IMG_4444w_thumb.jpg',130, 87,0, 0,'','01/05/05','','','','');
photos[50] = new photo(3489600,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4789_1.JPG',400,600,'La Mola Window 1 - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_4789_1_thumb.JPG',130, 195,0, 0,'','07/09/08','Roland W Armitage','','','');
photos[51] = new photo(3489618,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4791_1.JPG',400,600,'La Mola - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_4791_1_thumb.JPG',130, 195,0, 0,'','07/09/08','Roland W Armitage','','','');
photos[52] = new photo(3489621,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4827_1.JPG',600,400,'La Mola Window 2 - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_4827_1_thumb.JPG',130, 87,0, 0,'','07/09/08','Roland W Armitage','','','');
photos[53] = new photo(3489628,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_5018_1.JPG',400,600,'La Mola Window 3 - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_5018_1_thumb.JPG',130, 195,0, 0,'','07/09/08','Roland W Armitage','','','');
photos[54] = new photo(3489596,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4637_1.JPG',600,400,'Cales Fonts - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_4637_1_thumb.JPG',130, 87,0, 0,'','05/09/08','Roland W Armitage','','','');
photos[55] = new photo(3489586,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4425_1.JPG',400,600,'Horse Statue @ San Martorellet - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_4425_1_thumb.JPG',130, 195,0, 0,'','03/09/08','Roland W Armitage','','','');
photos[56] = new photo(3489526,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3828_1.JPG',600,400,'Fornells - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_3828_1_thumb.JPG',130, 87,0, 0,'','31/08/08','Roland W Armitage','','','');
photos[57] = new photo(3489536,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3834_1.JPG',400,600,'Fornells Fishing Boat - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_3834_1_thumb.JPG',130, 195,0, 0,'','31/08/08','Roland W Armitage','','','');
photos[58] = new photo(3489552,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3869_1.JPG',600,400,'Cales Fonts @ Dusk - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_3869_1_thumb.JPG',130, 87,0, 0,'','31/08/08','Roland W Armitage','','','');
photos[59] = new photo(3489559,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3891_1.JPG',600,400,'Cales Fonts @ Night - Menorca','http://www3.clikpic.com/rwaphotography/images/IMG_3891_1_thumb.JPG',130, 87,0, 0,'','31/08/08','Roland W Armitage','','','');
photos[60] = new photo(191781,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6626m.jpg',400,600,'Ciutadella - Menorca 2005','http://www3.clikpic.com/rwaphotography/images/IMG_6626m_thumb.jpg',130, 195,0, 0,'','14/09/05','','','','');
photos[61] = new photo(191778,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6492m.jpg',600,400,'El Sereno - Menorca 2005','http://www3.clikpic.com/rwaphotography/images/IMG_6492m_thumb.jpg',130, 87,0, 0,'','12/09/05','','','','');
photos[62] = new photo(191776,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6410m.jpg',400,600,'Sant Lluis - Menorca 2005','http://www3.clikpic.com/rwaphotography/images/IMG_6410m_thumb.jpg',130, 195,1, 0,'','11/09/05','','','','');
photos[63] = new photo(189233,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6370m.jpg',400,600,'Cales Fonts - Menorca 2005','http://www3.clikpic.com/rwaphotography/images/IMG_6370m_thumb.jpg',130, 195,1, 0,'','10/09/05','','','','');
photos[64] = new photo(191775,'17313','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6396m.jpg',600,400,'Cales Fonts @ Night- Menorca 2005','http://www3.clikpic.com/rwaphotography/images/IMG_6396m_thumb.jpg',130, 87,0, 0,'','10/09/05','','','','');
photos[65] = new photo(432781,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4311Aug06.jpg',400,600,'','http://www3.clikpic.com/rwaphotography/images/IMG_4311Aug06_thumb.jpg',130, 195,0, 0,'','29/07/06','','','','');
photos[66] = new photo(432657,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2219Aug06.jpg',600,400,'Snow Leopard','http://www3.clikpic.com/rwaphotography/images/IMG_2219Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[67] = new photo(432658,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2272Aug06.jpg',600,400,'Snow Leopard','http://www3.clikpic.com/rwaphotography/images/IMG_2272Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[68] = new photo(432659,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2380Aug06.jpg',600,400,'Tiger','http://www3.clikpic.com/rwaphotography/images/IMG_2380Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[69] = new photo(432663,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2441Aug06.jpg',600,400,'Tiger','http://www3.clikpic.com/rwaphotography/images/IMG_2441Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[70] = new photo(432665,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2578Aug06.jpg',600,400,'','http://www3.clikpic.com/rwaphotography/images/IMG_2578Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[71] = new photo(432668,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2608Aug06.jpg',600,400,'','http://www3.clikpic.com/rwaphotography/images/IMG_2608Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[72] = new photo(432739,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2707Aug06.jpg',600,400,'','http://www3.clikpic.com/rwaphotography/images/IMG_2707Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[73] = new photo(432742,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_2747Aug06.jpg',600,400,'Cheetah','http://www3.clikpic.com/rwaphotography/images/IMG_2747Aug06_thumb.jpg',130, 87,0, 0,'','25/06/06','','','','');
photos[74] = new photo(249090,'34419','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6138r.jpg',400,600,'Fishing Cat - Kent','http://www3.clikpic.com/rwaphotography/images/IMG_6138r_thumb.jpg',130, 195,1, 0,'','26/08/05','','','','');
photos[75] = new photo(432775,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_4070Aug06.jpg',400,600,'Kestrel','http://www3.clikpic.com/rwaphotography/images/IMG_4070Aug06_thumb.jpg',130, 195,0, 0,'','29/07/06','','','','');
photos[76] = new photo(432747,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_3539Aug06.jpg',400,600,'Mallard Duckling','http://www3.clikpic.com/rwaphotography/images/IMG_3539Aug06_thumb.jpg',130, 195,0, 0,'','06/07/06','','','','');
photos[77] = new photo(218662,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_0110b.jpg',600,400,'Mallard Duck in Flight','http://www3.clikpic.com/rwaphotography/images/IMG_0110b_thumb.jpg',130, 87,0, 0,'','25/03/06','','','','');
photos[78] = new photo(193109,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_7571b.jpg',600,400,'Mallard - In Flight','http://www3.clikpic.com/rwaphotography/images/IMG_7571b_thumb.jpg',130, 87,0, 0,'','07/11/05','','','','');
photos[79] = new photo(193104,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_7114b.jpg',600,400,'Canada Goose','http://www3.clikpic.com/rwaphotography/images/IMG_7114b_thumb.jpg',130, 87,0, 0,'','20/10/05','','','','');
photos[80] = new photo(193107,'17307','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_7135b.jpg',600,400,'Rosy-Billed Pochard (Netta peposaca)','http://www3.clikpic.com/rwaphotography/images/IMG_7135b_thumb.jpg',130, 87,0, 0,'','20/10/05','','','','');
photos[81] = new photo(218682,'19859','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_0319m.jpg',400,600,'Post & Rope','http://www3.clikpic.com/rwaphotography/images/IMG_0319m_thumb.jpg',130, 195,1, 0,'','14/04/06','','','','');
photos[82] = new photo(218679,'19859','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_0134m.jpg',400,600,'Woodland Gate Post','http://www3.clikpic.com/rwaphotography/images/IMG_0134m_thumb.jpg',130, 195,0, 0,'','09/04/06','','','','');
photos[83] = new photo(218680,'19859','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_0321m.jpg',400,600,'Silver Birch','http://www3.clikpic.com/rwaphotography/images/IMG_0321m_thumb.jpg',130, 195,0, 0,'','14/02/06','','','','');
photos[84] = new photo(3489650,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6295_1.JPG',600,400,'Aldeburgh Beach - Suffolk','http://www3.clikpic.com/rwaphotography/images/IMG_6295_1_thumb.JPG',130, 87,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[85] = new photo(3489655,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6341_1.JPG',600,400,'Fishing Boat @ Aldeburgh Beach - Suffolk','http://www3.clikpic.com/rwaphotography/images/IMG_6341_1_thumb.JPG',130, 87,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[86] = new photo(3489658,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6346_1.JPG',400,600,'Aldeburgh Chimney - Suffolk','http://www3.clikpic.com/rwaphotography/images/IMG_6346_1_thumb.JPG',130, 195,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[87] = new photo(3489671,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6355_1.JPG',400,600,'Aldeburgh Beach - Scallop Sculpture - Suffolk','http://www3.clikpic.com/rwaphotography/images/IMG_6355_1_thumb.JPG',130, 195,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[88] = new photo(3489677,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6363_1.JPG',400,600,'Maggi Hambling\'s Scallop Sculpture - Aldeburgh Beach','http://www3.clikpic.com/rwaphotography/images/IMG_6363_1_thumb.JPG',130, 195,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[89] = new photo(3489685,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6379_1.JPG',400,600,'\'A Conversation with the Sea\' - Scallop Sculpture - Aldeburgh Beach','http://www3.clikpic.com/rwaphotography/images/IMG_6379_1_thumb.JPG',130, 195,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[90] = new photo(3489687,'213400','','gallery','http://www3.clikpic.com/rwaphotography/images/IMG_6457_1.JPG',600,400,'Sculpture @ Snape Maltings','http://www3.clikpic.com/rwaphotography/images/IMG_6457_1_thumb.JPG',130, 87,0, 0,'','15/11/08','Roland W Armitage','','','');
photos[91] = new photo(3513613,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3270_1.JPG',400,600,'Southend Pier - New Entrance Structure','http://admin.clikpic.com/rwaphotography/images/IMG_3270_1_thumb.JPG',130, 195,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[92] = new photo(3513616,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3347_1.JPG',400,600,'Southend Pier - View from New Entrance','http://admin.clikpic.com/rwaphotography/images/IMG_3347_1_thumb.JPG',130, 195,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[93] = new photo(3513622,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3351_1.JPG',400,600,'Southend Pier Head - Seat Detail','http://admin.clikpic.com/rwaphotography/images/IMG_3351_1_thumb.JPG',130, 195,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[94] = new photo(3513627,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3389_1.JPG',600,400,'Southend Pier Head - Seat','http://admin.clikpic.com/rwaphotography/images/IMG_3389_1_thumb.JPG',130, 87,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[95] = new photo(3513632,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3422_1.JPG',600,400,'Southend Pier - \"The Boards\"','http://admin.clikpic.com/rwaphotography/images/IMG_3422_1_thumb.JPG',130, 87,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[96] = new photo(3513639,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3441_1.JPG',400,600,'Leigh-on-Sea - view from Southend Pier','http://admin.clikpic.com/rwaphotography/images/IMG_3441_1_thumb.JPG',130, 195,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[97] = new photo(3513645,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3460_1.JPG',600,400,'Southend Pier - New Entrance 1','http://admin.clikpic.com/rwaphotography/images/IMG_3460_1_thumb.JPG',130, 87,0, 0,'','16/08/08','Roland W Armitage','','','');
photos[98] = new photo(3513648,'214904','','gallery','http://admin.clikpic.com/rwaphotography/images/IMG_3461_1.JPG',400,600,'Southend Pier - New Entrance 2','http://admin.clikpic.com/rwaphotography/images/IMG_3461_1_thumb.JPG',130, 195,0, 0,'','16/08/08','Roland W Armitage','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(212890,'3481728,3481725,3481694,3481660,3481658,3481582,3481581,3481578,3481520,3481518','London','gallery');
galleries[1] = new gallery(82897,'1108286,1108284,1108277,1108276,1108274,1108270,1108260,1108253,1108252,1108248','Wedding Photography','gallery');
galleries[2] = new gallery(81337,'1108286,1108284,1108277,1108276,1108274,1108270,1108260,1108253,1108252,1108248','Essex Wedding - 19/06/07','gallery');
galleries[3] = new gallery(34418,'432462,432458,432443','Recent Commissions','gallery');
galleries[4] = new gallery(17309,'432771,249089,249079,249062','Buildings & Abstract','gallery');
galleries[5] = new gallery(17310,'432756,193071','Cats','gallery');
galleries[6] = new gallery(17311,'432750,432641,250028,193044,193034,191799,191798,191796,191794,191793','Woodland & Countryside','gallery');
galleries[7] = new gallery(17313,'3489628,3489621,3489618,3489600,3489596,3489586,3489559,3489552,3489536,3489526','Menorca','gallery');
galleries[8] = new gallery(34419,'432781,432742,432739,432668,432665,432663,432659,432658,432657,249090','Big Cats & SafariPark\'s','gallery');
galleries[9] = new gallery(17307,'432775,432747,218662,193109,193107,193104','Birds','gallery');
galleries[10] = new gallery(19859,'218682,218680,218679','Mono','gallery');
galleries[11] = new gallery(213400,'3489687,3489685,3489677,3489671,3489658,3489655,3489650','Norfolk & Suffolk','gallery');
galleries[12] = new gallery(214904,'3513648,3513645,3513639,3513632,3513627,3513622,3513616,3513613','Southend-on-Sea','gallery');

