/***************************************************************************
* 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('1743143,1743128,1726674,1726671,1726654,1726648,1726643,1726637,719277,717141,557703,472886,467588,466244,466231,466228,453807,453746,453642,453615,451979');
	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('1743143,1743128,1726674,1726671,1726654,1726648,1726643,1726637,719277,717141,557703,472886,467588,466244,466231,466228,453807,453746,453642,453615,451979');
	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 && !(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 + '" 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(717141,'39588','D3J0020BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0020BW.jpg',600,450,'Paris by night','http://www1.clikpic.com/ryanfarthing/images/D3J0020BW_thumb.jpg',130, 98,1, 1,'Paris on a cold February evening.','23/05/05','Ryan Farthing','Paris - France','','');
photos[1] = new photo(1726666,'39588','D8R0089BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0089BW.jpg',450,600,'Sand Storm in Dublin','http://www1.clikpic.com/ryanfarthing/images/D8R0089BW_thumb.jpg',98, 130,0, 0,'','','Ryan Farthing','Dollymount Beach - County Dublin','','');
photos[2] = new photo(1726674,'39588','D8R00105BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00105BW.jpg',600,450,'Frosty Grass','http://www1.clikpic.com/ryanfarthing/images/D8R00105BW_thumb.jpg',130, 98,1, 1,'View this image at Digital Photographer http://www.dphotographer.co.uk/show_image.php?imageID=9104&page=2','','Ryan Farthing','','','');
photos[3] = new photo(1743117,'39588','D8R00108BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00108BW.jpg',450,600,'','http://www1.clikpic.com/ryanfarthing/images/D8R00108BW_thumb.jpg',98, 130,0, 1,'','','Ryan Farthing','','','');
photos[4] = new photo(1743124,'39588','D8R00119BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00119BW.jpg',450,600,'1,2,3 Blow','http://www1.clikpic.com/ryanfarthing/images/D8R00119BW_thumb.jpg',98, 130,0, 1,'','','Ryan Farthing','','','');
photos[5] = new photo(717172,'39588','D8J0021BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0021BW.jpg',450,600,'Forever','http://www1.clikpic.com/ryanfarthing/images/D8J0021BW_thumb.jpg',98, 130,0, 1,'The graceful elegance of swans captures our hearts.','23/08/06','Ryan Farthing','Malahide - County Dublin - Ireland','','');
photos[6] = new photo(557928,'39588','NS0011','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0011.jpg',450,600,'Star patterns No.2','http://www1.clikpic.com/ryanfarthing/images/NS0011_thumb.jpg',98, 130,0, 0,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[7] = new photo(717078,'39588','D3J0017BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0017BW.jpg',450,600,'Alone or lonely?','http://www1.clikpic.com/ryanfarthing/images/D3J0017BW_thumb.jpg',98, 130,0, 1,'There is some amazing rugged and exposed coastline in Northern Island.   I think this shot captures this,','20/06/05','Ryan Farthing','Northern Ireland','','');
photos[8] = new photo(717064,'39588','D3J0015BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0015BW.jpg',450,600,'Steps to no where','http://www1.clikpic.com/ryanfarthing/images/D3J0015BW_thumb.jpg',98, 130,0, 1,'This shot was taken in Havar a little Island just off Split Croatia.','21/06/04','Ryan Farthing','Havar Island - Croatia','','');
photos[9] = new photo(719277,'39588','D8R0028BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0028BW.jpg',450,600,'Grab a branch','http://www1.clikpic.com/ryanfarthing/images/D8R0028BW_thumb.jpg',98, 130,1, 1,'Newbridge house in Donabate has fantastic unspoilt landscapes including some great trees like this one.','31/07/06','Ryan Farthing','Donabate - County Dublin - Ireland','','');
photos[10] = new photo(557646,'34355','D8R0036','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0036.jpg',600,450,'Ripples No.4','http://www1.clikpic.com/ryanfarthing/images/D8R0036_thumb.jpg',130, 98,0, 0,'This photograph was taken on Donabate Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.','09/10/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[11] = new photo(472886,'34355','D3J0007','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0007.jpg',600,450,'Tranquillity','http://www1.clikpic.com/ryanfarthing/images/D3J0007_thumb.jpg',130, 98,1, 1,'The Plitvice Lakes National Park, Croatia\'s most popular tourist attraction, was granted UNESCO World Heritage status in 1979. Located roughly halfway between capital city Zagreb and Zadar on the coast, the lakes are definitely a must-see.<br />\r\n<br />\r\nThe beauty of the National Park lies in its sixteen lakes, inter-connected by a series of waterfalls, and set in deep woodland populated by deer, bears, wolves, boars and rare bird species.','18/06/04','Ryan Farthing','Plitvice Lakes - Croatia National Park','','');
photos[12] = new photo(1726643,'34355','D8J0036','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0036.jpg',600,450,'Sunset over Dublin Port','http://www1.clikpic.com/ryanfarthing/images/D8J0036_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','Dublin Port - Clontaff','','');
photos[13] = new photo(1726648,'34355','D8R0044','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0044.jpg',600,450,'Reflection','http://www1.clikpic.com/ryanfarthing/images/D8R0044_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','Donabate Beach - County Dublin','','');
photos[14] = new photo(1726659,'34355','D8R0069','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0069.jpg',450,600,'Waterfall 1','http://www1.clikpic.com/ryanfarthing/images/D8R0069_thumb.jpg',98, 130,0, 0,'','','Ryan Farthing','Powerscourt - County Wicklow','','');
photos[15] = new photo(1726660,'34355','D8R0072','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0072.jpg',450,600,'Waterfall 2','http://www1.clikpic.com/ryanfarthing/images/D8R0072_thumb.jpg',98, 130,0, 0,'','','Ryan Farthing','Powerscourt - County Wicklow','','');
photos[16] = new photo(1726663,'34355','D8R0073','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0073.jpg',450,600,'Waterfall 3','http://www1.clikpic.com/ryanfarthing/images/D8R0073_thumb.jpg',98, 130,0, 1,'','','Ryan Farthing','Powerscourt - County Wicklow','','');
photos[17] = new photo(1726671,'34355','D8R0096','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0094.jpg',600,450,'Catch the wave','http://www1.clikpic.com/ryanfarthing/images/D8R0094_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','The Strand - Sligo - Ireland','','');
photos[18] = new photo(1726672,'34355','D8R00100','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00100.jpg',450,600,'Waterfall 4','http://www1.clikpic.com/ryanfarthing/images/D8R00100_thumb.jpg',98, 130,0, 1,'','','','Powerscourt - County Wicklow','','');
photos[19] = new photo(1743128,'34355','IMG_3085','gallery','http://www1.clikpic.com/ryanfarthing/images/IMG_3085.jpg',600,450,'','http://www1.clikpic.com/ryanfarthing/images/IMG_3085_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','Mauritius','','');
photos[20] = new photo(453746,'34355','D3J0001','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0001.jpg',600,450,'Wooden bridge','http://www1.clikpic.com/ryanfarthing/images/D3J0001_thumb.jpg',130, 98,1, 1,'The Plitvice Lakes National Park, Croatia\'s most popular tourist attraction, was granted UNESCO World Heritage status in 1979. Located roughly halfway between capital city Zagreb and Zadar on the coast, the lakes are definitely a must-see.<br />\r\n<br />\r\nThe beauty of the National Park lies in its sixteen lakes, inter-connected by a series of waterfalls, and set in deep woodland populated by deer, bears, wolves, boars and rare bird species.','18/06/04','Ryan Farthing','Plitvice Lakes - Croatia National Park','','');
photos[21] = new photo(451979,'34355','D8J0325','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0325.jpg',600,450,'Bull Island bridge','http://www1.clikpic.com/ryanfarthing/images/D8J0325_thumb.jpg',130, 98,1, 1,'This photograph was taken on Dollymount Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.  The view is of Bull Island and Dublin Port.','21/11/05','Ryan Farthing','Bull Island - Dublin','','Bull Island with view of Dublin Port');
photos[22] = new photo(466236,'34355','D8J0010','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0010.jpg',600,450,'Silhouette No.1','http://www1.clikpic.com/ryanfarthing/images/D8J0010_thumb.jpg',130, 98,0, 1,'This photograph was taken from Bull Island County Dublin Ireland, with the sun setting creating wonderful colour casts and silhouettes.','21/11/05','Ryan Farthing','Dublin Port - Ireland','','');
photos[23] = new photo(466228,'34355','D8J0007','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0007.jpg',600,450,'Bull Island','http://www1.clikpic.com/ryanfarthing/images/D8J0007_thumb.jpg',130, 98,1, 1,'This photograph was taken on Dollymount Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.  The view is of Bull Island and Dublin Port.','21/11/05','Ryan Farthing','Bull Island - Dublin - Ireland','','');
photos[24] = new photo(466231,'34355','D8J0008','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0008.jpg',600,450,'Dublin Bay','http://www1.clikpic.com/ryanfarthing/images/D8J0008_thumb.jpg',130, 98,1, 1,'This photograph was taken on Dollymount Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.  The view is of Bull Island and Dublin Port.','21/11/05','Ryan Farthing','Dublin Port - Ireland','','');
photos[25] = new photo(520617,'34355','D8R0019','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0019.jpg',450,600,'Ripples No.2','http://www1.clikpic.com/ryanfarthing/images/D8R0019_thumb.jpg',98, 130,0, 0,'This photograph was taken on Donbate Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.','10/10/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[26] = new photo(521282,'34355','D8R0020','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0020.jpg',450,600,'Evening stroll','http://www1.clikpic.com/ryanfarthing/images/D8R0020_thumb.jpg',98, 130,0, 1,'This photograph was taken on Donbate Beach County Dublin Ireland, with the sea coming in and the sun setting creating wonderful colour casts and silhouettes.','10/10/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[27] = new photo(557787,'34355','D3J0012','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J0012.jpg',450,600,'Waterfall No.9','http://www1.clikpic.com/ryanfarthing/images/D3J0012_thumb.jpg',98, 130,0, 0,'The Plitvice Lakes National Park, Croatia\'s most popular tourist attraction, was granted UNESCO World Heritage status in 1979. Located roughly halfway between capital city Zagreb and Zadar on the coast, the lakes are definitely a must-see.<br />\r\n<br />\r\nThe beauty of the National Park lies in its sixteen lakes, inter-connected by a series of waterfalls, and set in deep woodland populated by deer, bears, wolves, boars and rare bird species.','18/06/04','Ryan Farthing','Plitvice Lakes - Croatia National Park','','');
photos[28] = new photo(472890,'34355','D3J0002','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J00022.jpg',450,600,'Waterfall No.5','http://www1.clikpic.com/ryanfarthing/images/D3J00022_thumb.jpg',98, 130,0, 1,'The Plitvice Lakes National Park, Croatia\'s most popular tourist attraction, was granted UNESCO World Heritage status in 1979. Located roughly halfway between capital city Zagreb and Zadar on the coast, the lakes are definitely a must-see.<br />\r\n<br />\r\nThe beauty of the National Park lies in its sixteen lakes, inter-connected by a series of waterfalls, and set in deep woodland populated by deer, bears, wolves, boars and rare bird species.','18/06/04','Ryan Farthing','Plitvice Lakes - Croatia National Park','','');
photos[29] = new photo(472666,'34355','D3J0009','gallery','http://www1.clikpic.com/ryanfarthing/images/D3J00091.jpg',450,600,'Waterfall No.6','http://www1.clikpic.com/ryanfarthing/images/D3J00091_thumb.jpg',98, 130,0, 0,'The Plitvice Lakes National Park, Croatia\'s most popular tourist attraction, was granted UNESCO World Heritage status in 1979. Located roughly halfway between capital city Zagreb and Zadar on the coast, the lakes are definitely a must-see.<br />\r\n<br />\r\nThe beauty of the National Park lies in its sixteen lakes, inter-connected by a series of waterfalls, and set in deep woodland populated by deer, bears, wolves, boars and rare bird species.','18/06/04','Ryan Farthing','Plitvice Lakes - Croatia National Park','','');
photos[30] = new photo(1726654,'34353','D8R0067','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0067.jpg',600,450,'Enchanting','http://www1.clikpic.com/ryanfarthing/images/D8R0067_thumb.jpg',130, 98,1, 0,'','','Ryan Farthing','Powerscourt - County Wicklow','','');
photos[31] = new photo(1743138,'34353','D8R00120','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00120.jpg',600,450,'Reflections','http://www1.clikpic.com/ryanfarthing/images/D8R00120_thumb.jpg',130, 98,0, 1,'','','Ryan Farthing','Glendalough - County Wicklow','','');
photos[32] = new photo(1743143,'34353','D8R00138BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R00138BW.jpg',600,450,'Cycling along Dubai Creek','http://www1.clikpic.com/ryanfarthing/images/D8R00138BW_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','Dubai Creek','','');
photos[33] = new photo(557756,'34353','D8R0032','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0032.jpg',450,600,'Another world No.3','http://www1.clikpic.com/ryanfarthing/images/D8R0032_thumb.jpg',98, 130,0, 0,'This photograph was taken on Donbate Beach County Dublin Ireland, with the sun setting creating wonderful colour casts and silhouettes.','09/10/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[34] = new photo(473242,'34353','D8R0015','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0015.jpg',450,600,'Hay bales No. 2','http://www1.clikpic.com/ryanfarthing/images/D8R0015_thumb.jpg',98, 130,0, 0,'Hay bail\'s No. 2','02/09/06','Ryan Farthing','Donabate - Dublin Ireland','','');
photos[35] = new photo(473243,'34353','D8R0016','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0016.jpg',450,600,'Close shave!','http://www1.clikpic.com/ryanfarthing/images/D8R0016_thumb.jpg',98, 130,0, 0,'Cut field in Donabate - County Dublin','02/09/06','Ryan Farthing','Donabate - Dublin Ireland','','');
photos[36] = new photo(557703,'34353','D8R0034','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0034.jpg',600,450,'Another world No.1','http://www1.clikpic.com/ryanfarthing/images/D8R0034_thumb.jpg',130, 98,1, 0,'This photograph was taken on Donbate Beach County Dublin Ireland, with the sun setting creating wonderful colour casts and silhouettes.','09/10/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[37] = new photo(467588,'34353','D8R0010','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0010.jpg',600,450,'Morning sun','http://www1.clikpic.com/ryanfarthing/images/D8R0010_thumb.jpg',130, 98,1, 1,'Morning Sun in a field in Kilkenny - Ireland','24/07/06','Ryan Farthing','Kilkenny - Ireland','','');
photos[38] = new photo(719273,'35676','D8R0029','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0029.jpg',450,600,'Wild thing','http://www1.clikpic.com/ryanfarthing/images/D8R0029_thumb.jpg',98, 130,0, 1,'Lovely sunny day in Ireland.','07/08/06','Ryan Farthing','Donabate - County Dublin - Ireland','','');
photos[39] = new photo(1726637,'35676','D8J0017','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0017.jpg',600,450,'Majestic','http://www1.clikpic.com/ryanfarthing/images/D8J0017_thumb.jpg',130, 98,1, 1,'','','Ryan Farthing','','','');
photos[40] = new photo(1743149,'35676','D8J0045','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0045.jpg',600,450,'Hide and Seek','http://www1.clikpic.com/ryanfarthing/images/D8J0045_thumb.jpg',130, 98,0, 1,'','','Ryan Farthing','Malahide - County Dublin - Ireland','','');
photos[41] = new photo(472894,'35676','D8R0012','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0012.jpg',450,600,'Eye contact','http://www1.clikpic.com/ryanfarthing/images/D8R0012_thumb.jpg',98, 130,0, 0,'O\'Sullivan\'s farm in County Cork - Ireland','11/07/05','Ryan Farthing','County Cork - Ireland','','');
photos[42] = new photo(453807,'35676','D8R0006','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0006.jpg',450,600,'Untitled','http://www1.clikpic.com/ryanfarthing/images/D8R0006_thumb.jpg',98, 130,1, 0,'I just love this image!','12/08/06','Ryan Farthing','Donabate beach - County Dublin','','');
photos[43] = new photo(453615,'35676','D8R0002','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J00023.jpg',450,600,'Flowers in bloom','http://www1.clikpic.com/ryanfarthing/images/D8J00023_thumb.jpg',98, 130,1, 0,'Flowers in bloom','12/07/05','Ryan Farthing','County Cork - Ireland','','');
photos[44] = new photo(453642,'35676','D8R0003','gallery','http://www1.clikpic.com/ryanfarthing/images/DR80003.jpg',600,450,'It\'s a tough life!','http://www1.clikpic.com/ryanfarthing/images/DR80003_thumb.jpg',130, 98,1, 1,'Ladybird on a head of wheat','31/07/06','Ryan Farthing','Donabate - Dublin Ireland','','');
photos[45] = new photo(466244,'35676','D8R0009','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0009.jpg',600,450,'Keeping watch','http://www1.clikpic.com/ryanfarthing/images/D8R0009_thumb.jpg',130, 98,1, 1,'Keeping watch','07/08/06','Ryan Farthing','Donabate - Dublin Ireland','','');
photos[46] = new photo(1743110,'55185','D8R0080','gallery','http://www1.clikpic.com/ryanfarthing/images/D8R0080.jpg',450,600,'Carve your name','http://www1.clikpic.com/ryanfarthing/images/D8R0080_thumb.jpg',98, 130,0, 0,'','','Ryan Farthing','Powerscourt - County Wicklow','','');
photos[47] = new photo(466248,'55185','NS0003','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0003.jpg',450,600,'Watermark','http://www1.clikpic.com/ryanfarthing/images/NS0003_thumb.jpg',98, 130,0, 0,'Sunset over the River Thames - London','01/07/94','Ryan Farthing','River Thames - London','','');
photos[48] = new photo(510775,'55185','D8J0005BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0005BW.jpg',450,600,'Sand patterns No. 1','http://www1.clikpic.com/ryanfarthing/images/D8J0005BW_thumb.jpg',98, 130,0, 0,'Sand patterns','','Ryan Farthing','County Galway - Ireland','','');
photos[49] = new photo(717336,'55185','D8J0031BW','gallery','http://www1.clikpic.com/ryanfarthing/images/D8J0031BW.jpg',600,450,'Mud patterns','http://www1.clikpic.com/ryanfarthing/images/D8J0031BW_thumb.jpg',130, 98,0, 1,'','23/08/06','Ryan Farthing','Malahide - County Dublin - Ireland','','');
photos[50] = new photo(557814,'36018','NS0010','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0010.jpg',450,600,'Star patterns No.1','http://www1.clikpic.com/ryanfarthing/images/NS0010_thumb.jpg',98, 130,0, 0,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[51] = new photo(557935,'36018','NS0012','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0012.jpg',450,600,'Cranes meet glass!','http://www1.clikpic.com/ryanfarthing/images/NS0012_thumb.jpg',98, 130,0, 0,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[52] = new photo(557945,'36018','NS0013','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0013.jpg',450,600,'Change','http://www1.clikpic.com/ryanfarthing/images/NS0013_thumb.jpg',98, 130,0, 1,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[53] = new photo(557953,'36018','NS0014','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0014.jpg',450,600,'Not forgotten!','http://www1.clikpic.com/ryanfarthing/images/NS0014_thumb.jpg',98, 130,0, 0,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[54] = new photo(1743154,'36018','IMG_3486','gallery','http://www1.clikpic.com/ryanfarthing/images/IMG_3486.jpg',450,600,'Hot shadows','http://www1.clikpic.com/ryanfarthing/images/IMG_3486_thumb.jpg',98, 130,0, 1,'','','Ryan Farthing','Dubai','','');
photos[55] = new photo(466246,'36018','NS00001','gallery','http://www1.clikpic.com/ryanfarthing/images/NS00001.jpg',450,600,'Canary Wharf','http://www1.clikpic.com/ryanfarthing/images/NS00001_thumb.jpg',98, 130,0, 1,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','Canary Wharf - London','','');
photos[56] = new photo(466247,'36018','NS0002','gallery','http://www1.clikpic.com/ryanfarthing/images/NS00002.jpg',450,600,'Development','http://www1.clikpic.com/ryanfarthing/images/NS00002_thumb.jpg',98, 130,0, 1,'This photograph was taken at London Docklands - Canary Wharf in the early 1990\'s.  This is a stark contrast compared to Carnary Wharf today.','01/07/94','Ryan Farthing','London Docklands - London','','');
photos[57] = new photo(558011,'55571','NS0007','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0007.jpg',600,210,'Ray Island','http://www1.clikpic.com/ryanfarthing/images/NS0007_thumb.jpg',130, 46,0, 1,'This photograph was taken with a Fuji field camera producing a negative 6cm x 17cm. Evening sun setting over Ray Island in the Black water estuary Essex.','01/10/95','Ryan Farthing','Ray Island - West Mersea - Essex','','');
photos[58] = new photo(473254,'55571','NS0004','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0004.jpg',600,210,'Rowing boat','http://www1.clikpic.com/ryanfarthing/images/NS0004_thumb.jpg',130, 46,0, 1,'This photograph was taken with a Fuji field camera producing a negative 6cm x 17cm. Rowing boat anchored at West Mersea harbour - Essex.','01/10/95','Ryan Farthing','West Mersea Harbour - Essex - England','','');
photos[59] = new photo(557974,'55571','NS0006','gallery','http://www1.clikpic.com/ryanfarthing/images/NS0006.jpg',600,210,'Woods','http://www1.clikpic.com/ryanfarthing/images/NS0006_thumb.jpg',130, 46,0, 1,'This photograph was taken with a Fuji field camera producing a negative 6cm x 17cm.  The morning sun cutting through the tree\'s casting amazing shadows and highlights across the leaves drawing your eye deep into the woods.','01/10/95','Ryan Farthing','Friday wood\'s - Colchester Essex','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(39588,'1743124,1743117,1726674,719277,717172,717141,717078,717064','black & white','gallery');
galleries[1] = new gallery(34355,'1743128,1726672,1726671,1726663,1726648,1726643,521282,472890,472886,466236,466231,466228,453746,451979','waterscapes','gallery');
galleries[2] = new gallery(34353,'1743143,1743138,467588','landscapes','gallery');
galleries[3] = new gallery(35676,'1743149,1726637,719273,466244,453642','nature','gallery');
galleries[4] = new gallery(55185,'717336','abstract','gallery');
galleries[5] = new gallery(36018,'1743154,557945,466247,466246','urban scapes','gallery');
galleries[6] = new gallery(55571,'558011,557974,473254','panoramic','gallery');

