/***************************************************************************
* 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('2062231,2062230,2062229,2062228,2062227,2062226,2062225,2062222,2062221,2062219,2062218,2062215,2062214,2062213,2062205,2062204,2062202,2062200,2062199,2062198,2062197,2062195,2062191,2062189,2062187,2062186,2062184,2062183,2062181,2062177,2062176,1587836,1587831,1587829,1587826,1587824,1587823,1587822,1587821,1587820,1089902,1089900,1089709,1078766,1078762,1078746,1011467,1011466,1011464,1011460,1002864,1002862,1002857,1002855,999095,999094,999088,999086,999083,999080,974720,974719,974717,974714,974709,974069,973779,973770,973767,971724,971723,971722,971222,971219,971218,971214,971213,971205,968500');
	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('2062231,2062230,2062229,2062228,2062227,2062226,2062225,2062222,2062221,2062219,2062218,2062215,2062214,2062213,2062205,2062204,2062202,2062200,2062199,2062198,2062197,2062195,2062191,2062189,2062187,2062186,2062184,2062183,2062181,2062177,2062176,1587836,1587831,1587829,1587826,1587824,1587823,1587822,1587821,1587820,1089902,1089900,1089709,1078766,1078762,1078746,1011467,1011466,1011464,1011460,1002864,1002862,1002857,1002855,999095,999094,999088,999086,999083,999080,974720,974719,974717,974714,974709,974069,973779,973770,973767,971724,971723,971722,971222,971219,971218,971214,971213,971205,968500');
	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 = 'Schweppe and Ball Photographic: ' + 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(1587821,'80346','oct07001','gallery','http://www1.clikpic.com/melball/images/oct07001 web.jpg',600,351,'oct07001 Bee on cosmos with yellow background','http://www1.clikpic.com/melball/images/oct07001 web_thumb.jpg',130, 76,1, 0,'Bee perched on Cosmos flower with yellow background','01/09/07','Melanie Ball','Whitegate, East Cork','','');
photos[1] = new photo(1587822,'80345','','gallery','http://www1.clikpic.com/melball/images/oct07002 web.jpg',592,367,'oct07002 Gulls at Ballybrannigan Beach','http://www1.clikpic.com/melball/images/oct07002 web_thumb.jpg',130, 81,1, 0,'Gulls at Ballybrannigan beach, East Cork, Ireland.','01/09/07','Melanie Ball','Ballybrannigan, East Cork, Ireland','','');
photos[2] = new photo(1089709,'80346','','gallery','http://www1.clikpic.com/melball/images/FN07006 web.jpg',600,387,'FN07006 White Spider on Zantedeschia Lily','http://www1.clikpic.com/melball/images/FN07006 web_thumb.jpg',130, 84,1, 0,'Small white spider on Zantedeschia lily.','03/06/07','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[3] = new photo(1089900,'80346','','gallery','http://www1.clikpic.com/melball/images/FN07004 web.jpg',600,411,'FN07004 White spider on Zantedeschia 2','http://www1.clikpic.com/melball/images/FN07004 web_thumb.jpg',130, 89,1, 0,'White Spider on Zantedeschia lily','03/06/07','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[4] = new photo(1089902,'80346','','gallery','http://www1.clikpic.com/melball/images/FN07010 web.jpg',600,406,'FN07010 White Spider on Zantedeschia 3','http://www1.clikpic.com/melball/images/FN07010 web_thumb.jpg',130, 88,1, 0,'White spider on Zantedeschia lily','03/06/07','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[5] = new photo(971723,'80345','','gallery','http://www1.clikpic.com/melball/images/BI00021_preening_robin.jpg',600,436,'BI00021 Preening Robin','http://www1.clikpic.com/melball/images/BI00021_preening_robin_thumb.jpg',130, 94,1, 0,'preening robin','','Melanie Ball','','','');
photos[6] = new photo(971724,'80345','','gallery','http://www1.clikpic.com/melball/images/BI00024_blue_tit_in_eucalyptus.jpg',600,446,'BI00024 Blue Tit in eucalyptus tree','http://www1.clikpic.com/melball/images/BI00024_blue_tit_in_eucalyptus_thumb.jpg',130, 97,1, 0,'Blue tit in eucalyptus tree with grub in its mouth','','Melanie Ball','','','');
photos[7] = new photo(973770,'80340','','gallery','http://www1.clikpic.com/melball/images/FL02012_yellow_iris.jpg',600,451,'FL02012 Yellow Iris','http://www1.clikpic.com/melball/images/FL02012_yellow_iris_thumb.jpg',130, 98,1, 0,'Yellow iris at the waterside.','','Melanie Ball','Cork','','');
photos[8] = new photo(974069,'80346','','gallery','http://www1.clikpic.com/melball/images/FL01003_butterfly_on_buddleia_2.jpg',597,600,'FL01003 Butterfly on Buddleia 2','http://www1.clikpic.com/melball/images/FL01003_butterfly_on_buddleia_2_thumb.jpg',130, 131,1, 0,'butterfly on Buddleia','','Melanie Ball','','','');
photos[9] = new photo(974709,'80340','','gallery','http://www1.clikpic.com/melball/images/FL01008_crocosmia.jpg',600,388,'FL01008 Crocosmia','http://www1.clikpic.com/melball/images/FL01008_crocosmia_thumb.jpg',130, 84,1, 0,'Orange Crocosmia flowers with greenery behind.','','Melanie Ball','East Cork','','');
photos[10] = new photo(974714,'80341','','gallery','http://www1.clikpic.com/melball/images/FL04003_meconopsis.jpg',411,600,'FL04003 Meconopsis','http://www1.clikpic.com/melball/images/FL04003_meconopsis_thumb.jpg',130, 190,1, 0,'Meconopsis, Himalayan blue poppy','','Melanie Ball','','','');
photos[11] = new photo(974717,'80340','','gallery','http://www1.clikpic.com/melball/images/FL04012_glowing_red.jpg',458,600,'FL04012 Glowing Red flower','http://www1.clikpic.com/melball/images/FL04012_glowing_red_thumb.jpg',130, 170,1, 0,'Orange and Red glowing flower head with dark background.','','Melanie Ball','','','');
photos[12] = new photo(974719,'80343','','gallery','http://www1.clikpic.com/melball/images/FL99009_cream_rose.jpg',600,464,'FL99009 Yellow Cream Rose','http://www1.clikpic.com/melball/images/FL99009_cream_rose_thumb.jpg',130, 101,1, 0,'Yellow Cream rose flower head with small rosebuds.','','Melanie Ball','Suffolk, England','','');
photos[13] = new photo(974720,'80340','','gallery','http://www1.clikpic.com/melball/images/FL99010_calendula_in_foreground.jpg',600,458,'FL99010 Calendula with daisies in background','http://www1.clikpic.com/melball/images/FL99010_calendula_in_foreground_thumb.jpg',130, 99,1, 0,'Orange Calendula flower with small daisies behind it','','Melanie Ball','Cornwall, England','','');
photos[14] = new photo(999086,'74958','','gallery','http://www1.clikpic.com/melball/images/SC05004_Scottish_loch_at_dusk.jpg',600,386,'SC05004 Scottish Loch at dusk','http://www1.clikpic.com/melball/images/SC05004_Scottish_loch_at_dusk_thumb.jpg',130, 84,1, 0,'Reflections on a Scottish Loch at dusk.','','Melanie Ball','','','');
photos[15] = new photo(1002864,'80341','','gallery','http://www1.clikpic.com/melball/images/FL06083_sempervivum.jpg',600,396,'FL06083 Sempervivum green','http://www1.clikpic.com/melball/images/FL06083_sempervivum_thumb.jpg',130, 86,1, 0,'Sempervivum in green','','Melanie Ball','Cornwall, England','','');
photos[16] = new photo(1587820,'80343','FL00065','gallery','http://www1.clikpic.com/melball/images/FL00065 blossom.jpg',600,396,'FL00065 Blossom explosion','http://www1.clikpic.com/melball/images/FL00065 blossom_thumb.jpg',130, 86,1, 0,'An explosion of cream coloured blossom.','','Melanie Ball','Suffolk','','');
photos[17] = new photo(2062176,'80340','','gallery','http://www1.clikpic.com/melball/images/FL08012_curly_chrysanth.jpg',600,409,'FL08012 Curly chrysanthemum','http://www1.clikpic.com/melball/images/FL08012_curly_chrysanth_thumb.jpg',130, 89,1, 0,'Yellow petals of curly chrysanthemum.','','Melanie Ball','Whitegate, Cork, Ilrenad','','');
photos[18] = new photo(2062177,'80340','','gallery','http://www1.clikpic.com/melball/images/FL08013_curly_chrysanth.jpg',415,600,'FL08013 Curly Chrysanthemum','http://www1.clikpic.com/melball/images/FL08013_curly_chrysanth_thumb.jpg',130, 188,1, 0,'Curly petals of yellow chrysanthemum','','Melanie Ball','Whitegate, Cork, Ireland','','');
photos[19] = new photo(2062181,'80340','','gallery','http://www1.clikpic.com/melball/images/FL08029_tulip.jpg',425,600,'FL08029 Tulip','http://www1.clikpic.com/melball/images/FL08029_tulip_thumb.jpg',130, 184,1, 0,'Red Tulip petals','','Melanie Ball','Whitegate, Cork, Ireland','','');
photos[20] = new photo(2062183,'80340','','gallery','http://www1.clikpic.com/melball/images/FL08030_tulip.jpg',410,600,'FL08030 Tulip','http://www1.clikpic.com/melball/images/FL08030_tulip_thumb.jpg',130, 190,1, 0,'Red Tulip','','Melanie Ball','Whitegate, Cork, Ireland','','');
photos[21] = new photo(2062184,'80340','','gallery','http://www1.clikpic.com/melball/images/FL08031_tulip.jpg',600,396,'FL08031 Tulip','http://www1.clikpic.com/melball/images/FL08031_tulip_thumb.jpg',130, 86,1, 0,'Tulip and leaves','','Melanie Ball','Whitegate, Cork, Ireland','','');
photos[22] = new photo(2062186,'181925','','gallery','http://www1.clikpic.com/melball/images/fotadelta3200feb08001_bark_eye.jpg',600,404,'FD3200 Feb 08001 Bark Eye','http://www1.clikpic.com/melball/images/fotadelta3200feb08001_bark_eye_thumb.jpg',130, 88,1, 0,'Eye in bark of tree trunk','','Melanie Ball','Cork, Ireland','','');
photos[23] = new photo(2062189,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08086_hydrangea.jpg',600,398,'FR3 Feb 08086 Hydrangea','http://www1.clikpic.com/melball/images/fotarolleir3feb08086_hydrangea_thumb.jpg',130, 86,1, 0,'Old hydrangea heads in the sun.','','Melanie Ball','','','');
photos[24] = new photo(2062191,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08084_magnolia_stellata.jpg',600,442,'FR3 Feb 08084 Magnolia stellata','http://www1.clikpic.com/melball/images/fotarolleir3feb08084_magnolia_stellata_thumb.jpg',130, 96,1, 0,'magnolia stellata bud opening','','Melanie Ball','Cork, Ireland','','');
photos[25] = new photo(2062202,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08059_magnolia_bud.jpg',427,600,'FR3 Feb 08059 magnolia bud','http://www1.clikpic.com/melball/images/fotarolleir3feb08059_magnolia_bud_thumb.jpg',130, 183,1, 0,'magnolia bud in black and white','','Melanie Ball','Cork, Ireland','','');
photos[26] = new photo(2062205,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08056_mossandivy.jpg',402,600,'FR3 Feb 08056 Moss and Ivy','http://www1.clikpic.com/melball/images/fotarolleir3feb08056_mossandivy_thumb.jpg',130, 194,1, 0,'Ivy and moss on tree trunk','','Melanie Ball','Cork, Ireland','','');
photos[27] = new photo(2062214,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08038_leaves.jpg',600,407,'FR3 Feb 08038 leaves','http://www1.clikpic.com/melball/images/fotarolleir3feb08038_leaves_thumb.jpg',130, 88,1, 0,'','','','','','');
photos[28] = new photo(2062215,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08031crop_seedheads.jpg',600,544,'FR3 Feb 08031 seedheads','http://www1.clikpic.com/melball/images/fotarolleir3feb08031crop_seedheads_thumb.jpg',130, 118,1, 0,'','','','','','');
photos[29] = new photo(2062218,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08025_bottle_brush.jpg',434,600,'FR3 Feb 08025 Bottle brush seeds','http://www1.clikpic.com/melball/images/fotarolleir3feb08025_bottle_brush_thumb.jpg',130, 180,1, 0,'','','','','','');
photos[30] = new photo(2062219,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08021_bottle_brush.jpg',600,453,'FR3 Feb 08021 Bottle Brush seeds','http://www1.clikpic.com/melball/images/fotarolleir3feb08021_bottle_brush_thumb.jpg',130, 98,1, 0,'','','','','','');
photos[31] = new photo(2062221,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08019_bottle_brush.jpg',600,566,'FR3 Feb 08019 Bottle brush seeds','http://www1.clikpic.com/melball/images/fotarolleir3feb08019_bottle_brush_thumb.jpg',130, 123,1, 0,'','','','','','');
photos[32] = new photo(2062222,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08015_white_flowers.jpg',448,600,'FR3 Feb 08015 white flowers','http://www1.clikpic.com/melball/images/fotarolleir3feb08015_white_flowers_thumb.jpg',130, 174,1, 0,'','','','','','');
photos[33] = new photo(2062225,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08012_bud.jpg',600,431,'FR3 Feb 08012 Bud','http://www1.clikpic.com/melball/images/fotarolleir3feb08012_bud_thumb.jpg',130, 93,1, 0,'','','','','','');
photos[34] = new photo(2062226,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08007_bottle_brush.jpg',600,404,'FR3 Feb 08007 Bottle brush','http://www1.clikpic.com/melball/images/fotarolleir3feb08007_bottle_brush_thumb.jpg',130, 88,1, 0,'','','','','','');
photos[35] = new photo(2062227,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08006_bottle_brush.jpg',600,404,'FR3 Feb 08006 Bottle brush','http://www1.clikpic.com/melball/images/fotarolleir3feb08006_bottle_brush_thumb.jpg',130, 88,1, 0,'','','','','','');
photos[36] = new photo(2062228,'80344','','gallery','http://www1.clikpic.com/melball/images/fotadelta3200feb08023mod_3_zebras.jpg',600,385,'FD3200 Feb 08023 Zebras','http://www1.clikpic.com/melball/images/fotadelta3200feb08023mod_3_zebras_thumb.jpg',130, 83,1, 0,'','','','','','');
photos[37] = new photo(2062229,'80344','','gallery','http://www1.clikpic.com/melball/images/fotadelta3200feb08023crop_3_zebras.jpg',600,360,'FD3200 Feb 08023 zebras cropped','http://www1.clikpic.com/melball/images/fotadelta3200feb08023crop_3_zebras_thumb.jpg',130, 78,1, 0,'','','','','','');
photos[38] = new photo(2062230,'181925','','gallery','http://www1.clikpic.com/melball/images/fotadelta3200feb08017grad_magnolia_buds.jpg',396,600,'FD3200 Feb 08017 magnolia buds','http://www1.clikpic.com/melball/images/fotadelta3200feb08017grad_magnolia_buds_thumb.jpg',130, 197,1, 0,'','','','','','');
photos[39] = new photo(2062231,'181925','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08005.jpg',600,423,'FR3 Feb 08005 bottle brush','http://www1.clikpic.com/melball/images/fotarolleir3feb08005_thumb.jpg',130, 92,1, 0,'','','','','','');
photos[40] = new photo(971205,'80341','','gallery','http://www1.clikpic.com/melball/images/FL00002_hyacinth.jpg',388,600,'FL00002 Hyacinth Bud in morning sun','http://www1.clikpic.com/melball/images/FL00002_hyacinth_thumb.jpg',130, 201,1, 0,'hyacinth bud emerging in morning sun','','Melanie Ball','Suffolk, England','','');
photos[41] = new photo(968500,'80341','','gallery','http://www1.clikpic.com/melball/images/FL00003_lily_leaf.jpg',600,388,'FL00003 Lily Leaf','http://www1.clikpic.com/melball/images/FL00003_lily_leaf_thumb.jpg',130, 84,1, 0,'Sunlight through lily leaf','','Melanie Ball','','','');
photos[42] = new photo(971207,'80341','','gallery','http://www1.clikpic.com/melball/images/FL00005_banana_palm_leaf.jpg',416,600,'FL00005 Banana Palm leaf illuminated by sun','http://www1.clikpic.com/melball/images/FL00005_banana_palm_leaf_thumb.jpg',130, 188,0, 0,'banana palm illuminated by sunlight','','Melanie Ball','','','');
photos[43] = new photo(1002857,'66249','','gallery','http://www1.clikpic.com/melball/images/FL06083_sempervivum_gray.jpg',600,396,'FL06083 Sempervivum in black and white','http://www1.clikpic.com/melball/images/FL06083_sempervivum_gray_thumb.jpg',130, 86,1, 0,'Sempervivum in black and white.','','Melanie Ball','','','');
photos[44] = new photo(1011467,'66249','','gallery','http://www1.clikpic.com/melball/images/FL07081_clematis_montana_1_web_grey.jpg',600,542,'FL07081 Clematis montana 1 in black and white','http://www1.clikpic.com/melball/images/FL07081_clematis_montana_1_web_grey_thumb.jpg',130, 117,1, 0,'Clematis montana black and white macro shot.','','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[45] = new photo(971219,'67613','','gallery','http://www1.clikpic.com/melball/images/CO05024_fishing_boats.jpg',600,370,'CO05024 Cornish fishing boats','http://www1.clikpic.com/melball/images/CO05024_fishing_boats_thumb.jpg',130, 80,1, 0,'Cornish fishing boats','','Melanie Ball','Cornwall','','');
photos[46] = new photo(1078746,'67614','','gallery','http://www1.clikpic.com/melball/images/bw june 07066 cashel.jpg',591,382,'bw june 07066 cashel Rock of Cashel','http://www1.clikpic.com/melball/images/bw june 07066 cashel_thumb.jpg',130, 84,1, 0,'Rock of Cashel, County Tipperary, Ireland. Part of Ireland\'s heritage. Sepia tone. Cross viewed through doorway.','02/06/07','Melanie Ball','Cashel, Tipperary, Ireland','','');
photos[47] = new photo(1078762,'67614','','gallery','http://www1.clikpic.com/melball/images/bw june 07055 hore abbey.jpg',600,511,'bw june 07055 hore abbey','http://www1.clikpic.com/melball/images/bw june 07055 hore abbey_thumb.jpg',130, 111,1, 0,'Hore Abbey, Cashel, Tipperary, Ireland. Wall of Abbey ruins with doorway opening out to lighter area.','02/06/07','Melanie Ball','Hore Abbey, Cashel, Tipperary, Ireland','','');
photos[48] = new photo(1078766,'67614','','gallery','http://www1.clikpic.com/melball/images/bw june 07058 hore.jpg',600,392,'bw june 07058 hore','http://www1.clikpic.com/melball/images/bw june 07058 hore_thumb.jpg',130, 85,1, 0,'Wall detail at the ruins of Hore Abbey, Cashel, Tipperary, Ireland.','02/06/07','Melanie Ball','Hore Abbey, Cashel, Tipperary, Ireland','','');
photos[49] = new photo(999083,'67614','','gallery','http://www1.clikpic.com/melball/images/MU03005_Industrial_Cork_harbour_at_dusk.jpg',600,395,'MU03005 Cork\'s Industrial harbour at dusk','http://www1.clikpic.com/melball/images/MU03005_Industrial_Cork_harbour_at_dusk_thumb.jpg',130, 86,1, 0,'Cork\'s Industrial Harbour at dusk, taken from Corkbeg, Whitegate, East Cork, Ireland.','','Melanie Ball','','','');
photos[50] = new photo(1587824,'67614','','gallery','http://www1.clikpic.com/melball/images/oct07006 web.jpg',408,600,'0ct07004 Old Mellifont Abbey, County Louth, Ireland','http://www1.clikpic.com/melball/images/oct07006 web_thumb.jpg',130, 191,1, 0,'Ruins at Old Mellifont Abbey, County Louth, Ireland','','Melanie Ball','Old Mellifont Abbey, Co. Louth, Ireland','','');
photos[51] = new photo(1587826,'67614','','gallery','http://www1.clikpic.com/melball/images/oct07007 web.jpg',600,496,'Old Mellifont Abbey 2','http://www1.clikpic.com/melball/images/oct07007 web_thumb.jpg',130, 107,1, 0,'','','Melanie Ball','','','');
photos[52] = new photo(1587829,'67614','','gallery','http://www1.clikpic.com/melball/images/oct07008 web.jpg',600,391,'Old Mellifont Abbey 3','http://www1.clikpic.com/melball/images/oct07008 web_thumb.jpg',130, 85,1, 0,'','','Melanie Ball','','','');
photos[53] = new photo(1587836,'67614','','gallery','http://www1.clikpic.com/melball/images/oct07015 web.jpg',600,377,'View across Ballybrannigan at harvest time, East Cork, Ireland','http://www1.clikpic.com/melball/images/oct07015 web_thumb.jpg',130, 82,1, 0,'','','Melanie Ball','','','');
photos[54] = new photo(971222,'67614','','gallery','http://www1.clikpic.com/melball/images/CN05061_poulnabrone_dolman_portal_tomb.jpg',600,358,'CN05061 Poulnabrone Dolmen Portal Tomb','http://www1.clikpic.com/melball/images/CN05061_poulnabrone_dolman_portal_tomb_thumb.jpg',130, 78,1, 0,'Poulnabrone Portal Tomb Dolman, Burren Co. Clare Ireland','','Melanie Ball','Burren, Co. Clare','','');
photos[55] = new photo(971218,'67619','','gallery','http://www1.clikpic.com/melball/images/JP06034_himeji_castle.jpg',600,371,'JP06034 Himeji Castle','http://www1.clikpic.com/melball/images/JP06034_himeji_castle_thumb.jpg',130, 80,1, 0,'Himeji Castle','','Melanie Ball','Himeji, Japan, Melanie Ball','','');
photos[56] = new photo(973767,'67610','','gallery','http://www1.clikpic.com/melball/images/FL00060a_purple_iris_1.jpg',435,600,'FL00060a Purple Iris 1','http://www1.clikpic.com/melball/images/FL00060a_purple_iris_1_thumb.jpg',130, 179,1, 0,'Purple iris macro shot','','Melanie Ball','','','');
photos[57] = new photo(973779,'67610','','gallery','http://www1.clikpic.com/melball/images/FL04018_armeria_maritima_thrift.jpg',600,405,'FL04018 Armeria maritima \"thrift\"','http://www1.clikpic.com/melball/images/FL04018_armeria_maritima_thrift_thumb.jpg',130, 88,1, 0,'Armeria maritima, seaside pink thrift','','Melanie Ball','','','');
photos[58] = new photo(1011464,'67610','','gallery','http://www1.clikpic.com/melball/images/FL07080_fly_on_clematis_montana_web.jpg',600,311,'FL07080 fly on clematis montana','http://www1.clikpic.com/melball/images/FL07080_fly_on_clematis_montana_web_thumb.jpg',130, 67,1, 0,'Fly on clematis montana. Pink flowers, one in focus with others slightly out of focus.','','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[59] = new photo(1011466,'67610','','gallery','http://www1.clikpic.com/melball/images/FL07081_clematis_montana_1_web.jpg',600,542,'FL07081 Clematis montana 1','http://www1.clikpic.com/melball/images/FL07081_clematis_montana_1_web_thumb.jpg',130, 117,1, 0,'Macro shot of Clematis montana. Pink flower with yellow stamens.','','Melanie Ball','Whitegate, East Cork, Ireland','','');
photos[60] = new photo(1587823,'67612','','gallery','http://www1.clikpic.com/melball/images/oct07003 web.jpg',600,379,'oct07003 Car and Flora sculpture at Hampton Court Palace Flower Show 2007 (artists name to follow)','http://www1.clikpic.com/melball/images/oct07003 web_thumb.jpg',130, 82,1, 0,'Car and Flora sculpture at Hampton Court Palace Flower Show 2007.','','Melanie Ball','Hampton Court Palace Flower Show 2007','','');
photos[61] = new photo(2062198,'67612','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08072_ripples.jpg',399,600,'FR3 Feb 08072 Ripples in sand','http://www1.clikpic.com/melball/images/fotarolleir3feb08072_ripples_thumb.jpg',130, 195,1, 0,'Ripple sin the sand, White Strand Bay, Cork, Ireland','','Melanie Ball','White Strand Bay, Cork, Ireland','','');
photos[62] = new photo(2062213,'67612','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08046_ripples.jpg',391,600,'FR3 Feb 08046 Ripples','http://www1.clikpic.com/melball/images/fotarolleir3feb08046_ripples_thumb.jpg',130, 199,1, 0,'','','','','','');
photos[63] = new photo(1002858,'67615','','gallery','http://www1.clikpic.com/melball/images/ST00001_rusty_wire_on_wood.jpg',377,600,'ST00001 Rusty wire on old wood','http://www1.clikpic.com/melball/images/ST00001_rusty_wire_on_wood_thumb.jpg',82, 130,0, 0,'Rusty wire on old wood.','','Melanie Ball','','','');
photos[64] = new photo(1002860,'67615','','gallery','http://www1.clikpic.com/melball/images/ST00003_wood_wire_stone_2.jpg',385,600,'ST00003 Wood, wire and stone 2','http://www1.clikpic.com/melball/images/ST00003_wood_wire_stone_2_thumb.jpg',83, 130,0, 0,'','','Melanie Ball','','','');
photos[65] = new photo(1002862,'67615','','gallery','http://www1.clikpic.com/melball/images/ST00009_millstone_1.jpg',600,391,'ST00009 Millstone 1','http://www1.clikpic.com/melball/images/ST00009_millstone_1_thumb.jpg',130, 85,1, 0,'Millstone 1','','Melanie Ball','Suffolk, England','','');
photos[66] = new photo(2062187,'67615','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08102_between_rocks.jpg',600,396,'FR3 Feb 08102 Between the rocks','http://www1.clikpic.com/melball/images/fotarolleir3feb08102_between_rocks_thumb.jpg',130, 86,1, 0,'Patterns in the sand between two rocks, White Bay Strand, Cork Harbour, Cork, Ireland','','Melanie Ball','','','');
photos[67] = new photo(2062195,'67615','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08079_sawn_wood.jpg',600,397,'FR3 Feb 08079 sawn wood','http://www1.clikpic.com/melball/images/fotarolleir3feb08079_sawn_wood_thumb.jpg',130, 86,1, 0,'Patterns on the sawn face of a log.','','Melanie Ball','','','');
photos[68] = new photo(2062197,'67615','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08075_door.jpg',364,600,'FR3 Feb 08075 Door','http://www1.clikpic.com/melball/images/fotarolleir3feb08075_door_thumb.jpg',130, 214,1, 0,'Old door with broken window','','Melanie Ball','','','');
photos[69] = new photo(2062199,'67615','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08071_gull_prints.jpg',397,600,'FR3 Feb 08071 gull prints','http://www1.clikpic.com/melball/images/fotarolleir3feb08071_gull_prints_thumb.jpg',130, 196,1, 0,'Gull prints on White Strand Bay, Cork, Ireland','','Melanie Ball','White Strand Bay, Cork, Ireland','','');
photos[70] = new photo(2062200,'67615','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08065_sawn_wood.jpg',600,401,'FR3 Feb 08065 sawn wood','http://www1.clikpic.com/melball/images/fotarolleir3feb08065_sawn_wood_thumb.jpg',130, 87,1, 0,'Thw sawn wood face of a storm damaged tree trunk.','','Melanie Ball','Cork, Ireland','','');
photos[71] = new photo(1587831,'67617','','gallery','http://www1.clikpic.com/melball/images/oct07014web.jpg',600,342,'Carol Klein and Chris Beardshaw share a joke at Hampton Court Palace Flower Show 2007','http://www1.clikpic.com/melball/images/oct07014web_thumb.jpg',130, 74,1, 0,'','','Melanie Ball','','','');
photos[72] = new photo(2062204,'67617','','gallery','http://www1.clikpic.com/melball/images/fotarolleir3feb08057_looking_for_fish.jpg',600,387,'FR3 Feb 08057 Looking for fish','http://www1.clikpic.com/melball/images/fotarolleir3feb08057_looking_for_fish_thumb.jpg',130, 84,1, 0,'Adrian looking over a bridge for fish.','','Melanie Ball','Cork, Ireland','','');
photos[73] = new photo(999080,'67616','','gallery','http://www1.clikpic.com/melball/images/DG07001_Cuba_in_the_water.jpg',600,344,'DG07001 Cuba in the water','http://www1.clikpic.com/melball/images/DG07001_Cuba_in_the_water_thumb.jpg',130, 75,1, 0,'Cuba swimming and fetching a tennis ball from a rock pool, Ballybrannigan beach, East Cork, Ireland.','','Melanie Ball','Ballybrannigan Strand Beach, East Cork, Ireland','','');
photos[74] = new photo(1002855,'67616','','gallery','http://www1.clikpic.com/melball/images/DG04bw001_Bertie_in_the_crops.jpg',600,469,'DG04bw001 Bertie in the Crops','http://www1.clikpic.com/melball/images/DG04bw001_Bertie_in_the_crops_thumb.jpg',130, 102,1, 0,'Bertie, a Lakeland terrier, standing in the crops.','','Melanie Ball','Suffolk, England','','');
photos[75] = new photo(1011460,'67616','','gallery','http://www1.clikpic.com/melball/images/DG07067_Cuba_shaking_in_water_web.jpg',600,359,'DG07067 Cuba shaking in the water','http://www1.clikpic.com/melball/images/DG07067_Cuba_shaking_in_water_web_thumb.jpg',130, 78,1, 0,'Cuba shaking in the water','','Melanie Ball','','','');
photos[76] = new photo(971722,'68356','','gallery','http://www1.clikpic.com/melball/images/AU01007_classic_bmw.jpg',436,600,'AU01007 Classic BMW','http://www1.clikpic.com/melball/images/AU01007_classic_bmw_thumb.jpg',130, 179,1, 0,'Front detail of classic BMW car','','Melanie Ball','','','');
photos[77] = new photo(999088,'68356','','gallery','http://www1.clikpic.com/melball/images/bmw_detail_grayscale.jpg',440,600,'AU01007bw BMW detail in Black and White','http://www1.clikpic.com/melball/images/bmw_detail_grayscale_thumb.jpg',130, 177,1, 0,'Classic BMW detail in Black and White','','Melanie Ball','','','');
photos[78] = new photo(999094,'68356','','gallery','http://www1.clikpic.com/melball/images/race_start_grayscale1.jpg',500,247,'A Vintage Race Start, Goodwood, England.','http://www1.clikpic.com/melball/images/race_start_grayscale1_thumb.jpg',130, 64,1, 0,'Start of a race at the Goodwood Revival Meeting, Goodwood, England. Goodwood is the home of Classic and Vintage motor racing.','','Melanie Ball','','','');
photos[79] = new photo(999095,'68356','','gallery','http://www1.clikpic.com/melball/images/jaguar_front.jpg',416,600,'Classic Jaguar Grille','http://www1.clikpic.com/melball/images/jaguar_front_thumb.jpg',130, 188,1, 0,'Classic Jaguar Grille','','Melanie Ball','','','');
photos[80] = new photo(971213,'68356','','gallery','http://www1.clikpic.com/melball/images/AU01005_mercedes.jpg',366,600,'AU01005 Aerial Mercedes','http://www1.clikpic.com/melball/images/AU01005_mercedes_thumb.jpg',130, 213,1, 0,'Silver classic Mercedes on a pedestal sculpture','','Melanie Ball','','','');
photos[81] = new photo(971214,'68356','','gallery','http://www1.clikpic.com/melball/images/GO04019_bentley.jpg',417,600,'GO04019 Bentley detail','http://www1.clikpic.com/melball/images/GO04019_bentley_thumb.jpg',130, 187,1, 0,'Bentley detail of wheel arch in sunlight','','Melanie Ball','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(80344,'2062229,2062228','Fauna - Animals ','gallery');
galleries[1] = new gallery(80345,'1587822,971724,971723','Fauna - Birds','gallery');
galleries[2] = new gallery(80346,'1587821,1089902,1089900,1089709,974069','Fauna - Spiders and Insects','gallery');
galleries[3] = new gallery(181925,'2062231,2062230,2062227,2062226,2062225,2062222,2062221,2062219,2062218,2062215','Flora - Black and White','gallery');
galleries[4] = new gallery(80341,'1002864,974714,971207,971205,968500','Flora - Blues and Greens','gallery');
galleries[5] = new gallery(80343,'1587820,974719','Flora - Creams and Whites','gallery');
galleries[6] = new gallery(80340,'2062184,2062183,2062181,2062177,2062176,974720,974717,974709,973770','Flora - Yellows, Oranges and Reds','gallery');
galleries[7] = new gallery(74958,'999086','Other Places','gallery');
galleries[8] = new gallery(94807,'','NEW','gallery');
galleries[9] = new gallery(66249,'1011467,1002857','Favourites','gallery');
galleries[10] = new gallery(67620,'1587836,1587829,1587826,1587824,1078766,1078762,1078746,999086,999083,971222','Travel ','gallery');
galleries[11] = new gallery(67613,'971219','Cornwall','gallery');
galleries[12] = new gallery(67614,'1587836,1587829,1587826,1587824,1078766,1078762,1078746,999083,971222','Ireland','gallery');
galleries[13] = new gallery(67619,'971218','Japan','gallery');
galleries[14] = new gallery(67621,'2062231,2062230,2062229,2062228,2062227,2062226,2062225,2062222,2062221,2062219','Flora & Fauna','gallery');
galleries[15] = new gallery(67610,'1011466,1011464,973779,973767','Flora - Pinks and Purples','gallery');
galleries[16] = new gallery(67622,'2062213,2062200,2062199,2062198,2062197,2062195,2062187,1587823,1002862,1002860','Abstract & Structure','gallery');
galleries[17] = new gallery(67612,'2062213,2062198,1587823','Abstract','gallery');
galleries[18] = new gallery(67615,'2062200,2062199,2062197,2062195,2062187,1002862,1002860,1002858','Structural','gallery');
galleries[19] = new gallery(67623,'2062204,1587831,1011460,1002855,999080','People & Pets','gallery');
galleries[20] = new gallery(67617,'2062204,1587831','People','gallery');
galleries[21] = new gallery(67616,'1011460,1002855,999080','Pets & Animals','gallery');
galleries[22] = new gallery(68355,'999095,999094,999088,971722,971214,971213','Transport','gallery');
galleries[23] = new gallery(68356,'999095,999094,999088,971722,971214,971213','Cars','gallery');
galleries[24] = new gallery(68357,'','Motorbikes','gallery');
galleries[25] = new gallery(68358,'','Other Transport','gallery');

