/***************************************************************************
* 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('3047866,2952475,2931121,2931097,2924318,2924132,2884605,2884477,2882783,2882782,2749432,2338685,2338679,2338590,2338547,2338508,2336365,2336322,2332359,2322138,2322105,2322072,2322047,2322039,2310382,2310083,2310063,2310036,2310031,2309419,2309408,2309401,2309398,2309386,2309385,2309328,2309318,2309088,2308939,2308920,2308910,2258697,2258692,2258691,2258688,2258687,2258527,2258245,2258223,2258138,2258105,2078554,2078463,2078457,2078445,2078422,2077914');
	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('3047866,2952475,2931121,2931097,2924318,2924132,2884605,2884477,2882783,2882782,2749432,2338685,2338679,2338590,2338547,2338508,2336365,2336322,2332359,2322138,2322105,2322072,2322047,2322039,2310382,2310083,2310063,2310036,2310031,2309419,2309408,2309401,2309398,2309386,2309385,2309328,2309318,2309088,2308939,2308920,2308910,2258697,2258692,2258691,2258688,2258687,2258527,2258245,2258223,2258138,2258105,2078554,2078463,2078457,2078445,2078422,2077914');
	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) || (1))) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'John Cave 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>John Cave </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(2258105,'138813','','gallery','http://admin2.clikpic.com/johncave/images/the Finger webcopy.jpg',600,798,'View from Sulphur Mountain, Banff','http://admin2.clikpic.com/johncave/images/the Finger webcopy_thumb.jpg',98, 130,1, 0,'','','','Alberta, Canada','','');
photos[1] = new photo(2258108,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4308.JPG',500,750,'Sulphur Mountain, Banff','http://admin2.clikpic.com/johncave/images/IMG_4308_thumb.JPG',130, 195,0, 0,'Sulphur Mountain, Banff','','','Sulphur Mountain, Banff','','');
photos[2] = new photo(2258198,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Tranquilitywebres.jpg',600,400,'Tranquility','http://admin2.clikpic.com/johncave/images/Tranquilitywebres_thumb.jpg',130, 87,0, 1,'Pyramid Lake, Jasper','','','Pyramid Lake, Jasper, Alberta, Canada','','');
photos[3] = new photo(2258223,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4477.JPG',500,333,'Fenland Trail, Banff','http://admin2.clikpic.com/johncave/images/IMG_4477_thumb.JPG',130, 87,1, 0,'Fenland Trail, Banff','','','Fenland Trail, Banff, Alberta, Canada','','');
photos[4] = new photo(2258528,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Downtown Vancouver British Columbia Canada webcopy.jpg',600,430,'City Life','http://admin2.clikpic.com/johncave/images/Downtown Vancouver British Columbia Canada webcopy_thumb.jpg',130, 93,0, 0,'Downtown Vancouver at night','','','Vancouver, British Columbia, Canada','','');
photos[5] = new photo(2258684,'148509','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2683.jpg',600,400,'Jungle Stream','http://admin2.clikpic.com/johncave/images/_MG_2683_thumb.jpg',130, 87,0, 0,'A Jungle Stream','','','Tamil Nadu, India','','');
photos[6] = new photo(2258687,'138813','','gallery','http://admin2.clikpic.com/johncave/images/_MG_52282.jpg',600,279,'Reflections','http://admin2.clikpic.com/johncave/images/_MG_52282_thumb.jpg',130, 60,1, 0,'This shot was taken on a quiet lake near Jasper, Alberta. The still water provides a perfect reflection of the dramatic mountain range above.','','','Pyramid Lake, Jasper, Alberta, Canada','','');
photos[7] = new photo(2258692,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Prince Edward Island, Canada.jpg',600,440,'Fishing Village','http://admin2.clikpic.com/johncave/images/Prince Edward Island, Canada_thumb.jpg',130, 95,1, 0,'A fishing village on Prince Edward Island','','','Prince Edward Island, Canada','','');
photos[8] = new photo(2258697,'138813','','gallery','http://admin2.clikpic.com/johncave/images/1c2bd998-bcfb-4e59-95e8-84e7dd9816bd.JPG',400,267,'Peggy\'s Cove','http://admin2.clikpic.com/johncave/images/1c2bd998-bcfb-4e59-95e8-84e7dd9816bd_thumb.JPG',130, 87,1, 0,'The fishing village of Peggy\'s Cove, Nova Scotia','','','Peggy\'s Cove, Nova Scotia, Canada','','');
photos[9] = new photo(2309386,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4154.JPG',600,900,'There\'s a storm coming...','http://admin2.clikpic.com/johncave/images/IMG_4154_thumb.JPG',87, 130,1, 0,'Rundle Mountain under a moody sky','','','Banff, Alberta, Canada','','');
photos[10] = new photo(2309401,'148509','','gallery','http://admin2.clikpic.com/johncave/images/496d6722-a8ee-4d58-ba72-0096a878cb73.JPG',600,400,'If a tree fell...','http://admin2.clikpic.com/johncave/images/496d6722-a8ee-4d58-ba72-0096a878cb73_thumb.JPG',130, 87,1, 0,'Lush forest undergrowth','','','Prince Edward Island, Canada','','');
photos[11] = new photo(2309408,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Cavendish Beach webcopy.jpg',600,426,'Red sands','http://admin2.clikpic.com/johncave/images/Cavendish Beach webcopy_thumb.jpg',130, 92,1, 0,'The red sands of Cavendish beach on Prince Edward Islands - otherwise known as \"Anne of Green Gables Country.\"','','','Cavendish, Prince Edward Island, Canada','','');
photos[12] = new photo(2322472,'148509','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2177.jpg',600,900,'Fire','http://admin2.clikpic.com/johncave/images/_MG_2177_thumb.jpg',87, 130,0, 0,'A bonfire','','','','','');
photos[13] = new photo(2332359,'148509','','gallery','http://admin2.clikpic.com/johncave/images/IMG_6021-12.JPG',600,868,'Lily','http://admin2.clikpic.com/johncave/images/IMG_6021-12_thumb.JPG',90, 130,1, 0,'An Arum Lily, or for those gardening geeks out there, a Zantedeschia Aethiopica...','','','The back garden...','','');
photos[14] = new photo(2338547,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5411.JPG',400,267,'Orange sunset','http://admin2.clikpic.com/johncave/images/IMG_5411_thumb.JPG',130, 87,1, 0,'A dramatic long exposure (30 secs) shot of the Canadian coastline on Prince Edward Island','','','Cavendish, Prince Edward Island, Canada','','');
photos[15] = new photo(2749455,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5585.JPG',400,189,'Vancouver at night','http://admin2.clikpic.com/johncave/images/IMG_5585_thumb.JPG',130, 61,0, 0,'The city of Vancouver at night looking towards the BC Place Stadium','','','Vancouver, British Columbia, Canada','','');
photos[16] = new photo(2884477,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4290 copy.jpg',600,428,'Dramatic Mountain Range','http://admin2.clikpic.com/johncave/images/IMG_4290 copy_thumb.jpg',130, 93,1, 0,'View from the top of Sulphur Mountain, Banff','','','Banff, Alberta, Canada','','');
photos[17] = new photo(2884605,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Lunenberg webcopy.jpg',600,406,'Colourful Houses','http://admin2.clikpic.com/johncave/images/Lunenberg webcopy_thumb.jpg',130, 88,1, 0,'Some of the colourful houses in Lunenberg, Nova Scotia','','','Lunenberg, Nova Scotia, Canada','','');
photos[18] = new photo(2884724,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Mahone Bay.jpg',600,280,'Mahone Bay','http://admin2.clikpic.com/johncave/images/Mahone Bay_thumb.jpg',130, 61,0, 0,'The famous colourful houses of Mahone Bay, Nova Scotia.','','','Mahone Bay, Nova Scotia, Canada','','');
photos[19] = new photo(2924318,'148509','','gallery','http://admin2.clikpic.com/johncave/images/_MG_7755.jpg',600,400,'Orchid','http://admin2.clikpic.com/johncave/images/_MG_7755_thumb.jpg',130, 87,1, 0,'A Phalaenopsis, otherwise known as an Orchid','','','Solihull, UK','','');
photos[20] = new photo(2931097,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Athabasca Glacierwebcopy.jpg',600,431,'Athabasca Glacier','http://admin2.clikpic.com/johncave/images/Athabasca Glacierwebcopy_thumb.jpg',130, 93,1, 0,'The majestic sight of the Athabasca Glacier. To appreciate the scale of this, the black dot in to the left of the centre is a 15ft tall \'Snowcoach\'!','','','Icefields Parkway, Alberta, Canada','','');
photos[21] = new photo(2931121,'138813','','gallery','http://admin2.clikpic.com/johncave/images/Johnson canyon alberta webcopy.jpg',600,798,'Scenic Waterfall','http://admin2.clikpic.com/johncave/images/Johnson canyon alberta webcopy_thumb.jpg',98, 130,1, 0,'The lower falls at Johnson Canyon, Alberta.','','','Johnson Canyon, Alberta, Canada','','');
photos[22] = new photo(3047866,'148509','','gallery','http://admin2.clikpic.com/johncave/images/IMG_7974.JPG',600,574,'Autumn Colours','http://admin2.clikpic.com/johncave/images/IMG_7974_thumb.JPG',130, 124,1, 0,'A vivid red leaf in Autumn (Fall for those over the Atlantic...!)','','','Solihull, UK','','');
photos[23] = new photo(2258681,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5732.JPG',600,900,'The Green City','http://admin2.clikpic.com/johncave/images/IMG_5732_thumb.JPG',87, 130,0, 0,'Downtown Vancouver','','','Downtown Vancouver, British Columbia, Canada','','');
photos[24] = new photo(2258683,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5737.JPG',600,764,'Downtown Vancouver','http://admin2.clikpic.com/johncave/images/IMG_5737_thumb.JPG',102, 130,0, 0,'Downtown Vancouver','','','Downtown Vancouver, British Columbia, Canada','','');
photos[25] = new photo(2258688,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4933.JPG',400,100,'Castle Mountain, Alberta','http://admin2.clikpic.com/johncave/images/IMG_4933_thumb.JPG',130, 33,1, 0,'Castle Mountain, Canadian Rockies','','','Alberta, Canada','','');
photos[26] = new photo(2258527,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5234.JPG',600,308,'Pyramid Lake, Jasper','http://admin2.clikpic.com/johncave/images/IMG_5234_thumb.JPG',130, 67,1, 0,'This shot was taken on a quiet lake near Jasper, Alberta. The still water provides a perfect reflection of the dramatic mountain range above.','','','Pyramid Lake, Jasper, Alberta, Canada','','');
photos[27] = new photo(2258245,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4913.JPG',500,188,'Highway 93','http://admin2.clikpic.com/johncave/images/IMG_4913_thumb.JPG',130, 49,1, 0,'View from Highway 93 on the way to Radium Hot Springs','','','Highway 93, Alberta, Canada','','');
photos[28] = new photo(2258186,'138813','','gallery','http://admin2.clikpic.com/johncave/images/_MG_5098.jpg',500,158,'Icefields Parkway','http://admin2.clikpic.com/johncave/images/_MG_5098_thumb.jpg',130, 41,0, 0,'Icefields Parkway','','','Icefields Parkway, Alberta, Canada','','');
photos[29] = new photo(2258138,'138813','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4358.JPG',500,263,'Dramatic Mountains','http://admin2.clikpic.com/johncave/images/IMG_4358_thumb.JPG',130, 68,1, 0,'Kananaskis Country','','','Kananaskis Country, Alberta, Canada','','');
photos[30] = new photo(2078457,'138740','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2403.jpg',500,244,'Ruined Temple in the Jungle','http://admin2.clikpic.com/johncave/images/_MG_2403_thumb.jpg',130, 63,1, 0,'Ruined Temple in the Jungle','14/11/07','','Karnataka, India','','');
photos[31] = new photo(2078554,'138740','','gallery','http://admin2.clikpic.com/johncave/images/The Tajwebcopy.jpg',600,439,'The Taj Mahal','http://admin2.clikpic.com/johncave/images/The Tajwebcopy_thumb.jpg',130, 95,1, 0,'The Taj Mahal','05/11/07','','Agra, India','','');
photos[32] = new photo(2078566,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1197.JPG',500,141,'Chaos on the Road','http://admin2.clikpic.com/johncave/images/IMG_1197_thumb.JPG',130, 37,0, 0,'A typical Chaotic scene on the roads in India','04/11/07','','Punjab, India','','');
photos[33] = new photo(2077914,'138740','','gallery','http://admin2.clikpic.com/johncave/images/Golden Temple Amritsar Indiaweb.jpg',600,270,'The Golden Temple, Amritsar','http://admin2.clikpic.com/johncave/images/Golden Temple Amritsar Indiaweb_thumb.jpg',130, 59,1, 1,'An atmospheric early morning shot of the Golden Temple, Amritsar, India.','03/11/07','John Cave','Amritsar, India','','');
photos[34] = new photo(2077963,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1100.JPG',427,640,'Sikh Guards at the Golden Temple','http://admin2.clikpic.com/johncave/images/IMG_1100_thumb.JPG',130, 195,0, 0,'Sikh Guards at the Golden Temple, Amritsar, India.','03/11/07','John Cave','Amritsar, India','','');
photos[35] = new photo(2078422,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1127.JPG',427,640,'The Golden Temple, Amritsar','http://admin2.clikpic.com/johncave/images/IMG_1127_thumb.JPG',130, 195,1, 0,'The Golden Temple, Amritsar, India','03/11/07','','Amritsar, India','','');
photos[36] = new photo(2078445,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1116.JPG',500,334,'The Golden Temple, Amritsar','http://admin2.clikpic.com/johncave/images/IMG_1116_thumb.JPG',130, 87,1, 0,'The Golden Temple, Amritsar, India','03/11/07','','Amritsar, India','','');
photos[37] = new photo(2078455,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1137.JPG',500,334,'Street Scene','http://admin2.clikpic.com/johncave/images/IMG_1137_thumb.JPG',130, 87,0, 0,'A street scene in Amritsar, India','03/11/07','','Amritsar, India','','');
photos[38] = new photo(2077909,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0765.JPG',500,218,'Hard work...','http://admin2.clikpic.com/johncave/images/IMG_0765_thumb.JPG',130, 57,0, 0,'','02/11/07','John Cave','Punjab, India','','');
photos[39] = new photo(2077912,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1060.JPG',500,334,'Indian truck','http://admin2.clikpic.com/johncave/images/IMG_1060_thumb.JPG',130, 87,0, 0,'A colourfully decorated Indian truck','02/11/07','John Cave','Amritsar, India','','');
photos[40] = new photo(2078441,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0772.JPG',500,190,'Travelling to work','http://admin2.clikpic.com/johncave/images/IMG_0772_thumb.JPG',130, 49,0, 0,'A typical Indian scene of commuters making the most of every inch!','02/11/07','','Punjab, India','','');
photos[41] = new photo(2080410,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0836.JPG',500,220,'The Two Indias','http://admin2.clikpic.com/johncave/images/IMG_0836_thumb.JPG',130, 57,0, 0,'The contrast between the modern and the traditional India.','02/11/07','','Punjab, India','','');
photos[42] = new photo(2308939,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1944.jpg',400,478,'Rural Transport...','http://admin2.clikpic.com/johncave/images/IMG_1944_thumb.jpg',130, 155,1, 0,'A man riding an ox and cart','','','Karnataka, India','','');
photos[43] = new photo(2952475,'138740','','gallery','http://admin2.clikpic.com/johncave/images/The foothills of the Western Ghats webcopy.jpg',600,315,'Foothills of The Western Ghats','http://admin2.clikpic.com/johncave/images/The foothills of the Western Ghats webcopy_thumb.jpg',130, 68,1, 0,'Foothills of The Western Ghats in Karnataka, India','','','Karnataka, India','','');
photos[44] = new photo(2078559,'138740','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1835.JPG',427,640,'Mumbai at night','http://admin2.clikpic.com/johncave/images/IMG_1835_thumb.JPG',130, 195,0, 0,'Downtown Mumbai at night','10/11/07','','Mumbai, India','','');
photos[45] = new photo(2078463,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1188.jpg',500,360,'Shrike','http://admin2.clikpic.com/johncave/images/IMG_1188_thumb.jpg',130, 94,1, 0,'Some type of Indian Shrike','14/11/07','','Karnataka, India','','');
photos[46] = new photo(2308910,'151009','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2886.jpg',400,267,'Wild Peacock','http://admin2.clikpic.com/johncave/images/_MG_2886_thumb.jpg',130, 87,1, 0,'A wild peacock running through the Indian jungle','','','Western Ghats, India','','');
photos[47] = new photo(2308915,'151009','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2888.jpg',546,800,'Wild Peacocks','http://admin2.clikpic.com/johncave/images/_MG_2888_thumb.jpg',89, 130,0, 0,'Wild peacocks in the Indian jungle','','','Western Ghats, India','','');
photos[48] = new photo(2308920,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1108.jpg',400,527,'White Tailed Deer','http://admin2.clikpic.com/johncave/images/IMG_1108_thumb.jpg',130, 171,1, 1,'Wild Indian White Tailed Deer','','','Western Ghats, India','','');
photos[49] = new photo(2308930,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1746.JPG',400,154,'Squirrels','http://admin2.clikpic.com/johncave/images/IMG_1746_thumb.JPG',130, 50,0, 0,'Some squirrels nibbling....','','','Agra, India','','');
photos[50] = new photo(2309318,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4674.JPG',400,537,'Red Squirrel','http://admin2.clikpic.com/johncave/images/IMG_4674_thumb.JPG',130, 175,1, 0,'A curious red squirrel','','','Alberta, Canada','','');
photos[51] = new photo(2309328,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_4507.JPG',400,589,'Columbia Ground Squirrel','http://admin2.clikpic.com/johncave/images/IMG_4507_thumb.JPG',130, 191,1, 0,'Columbia Ground Squirrel','','','Alberta, Canada','','');
photos[52] = new photo(2309398,'151009','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2872.jpg',400,267,'I\'m watching you...','http://admin2.clikpic.com/johncave/images/_MG_2872_thumb.jpg',130, 87,1, 0,'A Macaque watching intently','','','Western Ghats, India','','');
photos[53] = new photo(2309419,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1258.jpg',400,299,'Guar','http://admin2.clikpic.com/johncave/images/IMG_1258_thumb.jpg',130, 97,1, 0,'A wild bull Guar (largest cattle in India)','','','Tamil Nadu, India','','');
photos[54] = new photo(2310031,'151009','','gallery','http://admin2.clikpic.com/johncave/images/_MG_2267.JPG',400,261,'The Herd','http://admin2.clikpic.com/johncave/images/_MG_2267_thumb.JPG',130, 85,1, 0,'A herd of White Tailed Deer','','','Karnataka, India','','');
photos[55] = new photo(2310382,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_3214.JPG',400,267,'Pig at peace','http://admin2.clikpic.com/johncave/images/IMG_3214_thumb.JPG',130, 87,1, 0,'A snoozing swine...','','','On a farm','','');
photos[56] = new photo(2322039,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1047.jpg',400,601,'Peacock','http://admin2.clikpic.com/johncave/images/IMG_1047_thumb.jpg',130, 195,1, 0,'Wild Peacock','','','Tamil Nadu, India','','');
photos[57] = new photo(2322072,'151009','','gallery','http://admin2.clikpic.com/johncave/images/281_8187.JPG',500,467,'Cheeky Monkey!','http://admin2.clikpic.com/johncave/images/281_8187_thumb.JPG',130, 121,1, 0,'Monkeys nowadays.... no respect.','','','Staffordshire, UK','','');
photos[58] = new photo(2322105,'151009','','gallery','http://admin2.clikpic.com/johncave/images/_MG_6147.jpg',400,266,'Elephants in the wild','http://admin2.clikpic.com/johncave/images/_MG_6147_thumb.jpg',130, 86,1, 0,'A herd of Wild Elephants in the Indian jungle','','','Karnataka, India','','');
photos[59] = new photo(2338508,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_3206.JPG',400,267,'Cute monkey','http://admin2.clikpic.com/johncave/images/IMG_3206_thumb.JPG',130, 87,1, 0,'A marmoset looking for the way out.....','','','Blair Drummond Safari Park, near Stirling, Scotland','','');
photos[60] = new photo(2338679,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_9518.JPG',400,267,'Duck','http://admin2.clikpic.com/johncave/images/IMG_9518_thumb.JPG',130, 87,1, 0,'A Duck...','','','','','');
photos[61] = new photo(2338685,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_9610.JPG',400,267,'Who are you looking at?','http://admin2.clikpic.com/johncave/images/IMG_9610_thumb.JPG',130, 87,1, 0,'A curious meerkat','','','','','');
photos[62] = new photo(2749432,'151009','','gallery','http://admin2.clikpic.com/johncave/images/IMG_5858.JPG',400,267,'Jellyfish','http://admin2.clikpic.com/johncave/images/IMG_5858_thumb.JPG',130, 87,1, 0,'Some translucent jellyfish','','','','','');
photos[63] = new photo(2258691,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0242.JPG',400,600,'The Lowry','http://admin2.clikpic.com/johncave/images/IMG_0242_thumb.JPG',130, 195,1, 0,'The striking architecture of the Lowry Theatre, Manchester','','','The Lowry Theatre, Manchester, UK','','');
photos[64] = new photo(2309088,'138849','','gallery','http://admin2.clikpic.com/johncave/images/London at Night1webcopy.jpg',600,530,'London at Night','http://admin2.clikpic.com/johncave/images/London at Night1webcopy_thumb.jpg',130, 115,1, 0,'Big Ben, the London Eye and a new London Bus','','','London','','');
photos[65] = new photo(2309385,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_3545.JPG',400,600,'The Bullring','http://admin2.clikpic.com/johncave/images/IMG_3545_thumb.JPG',130, 195,1, 0,'The Bullring, Birmingham','','','Birmingham, UK','','');
photos[66] = new photo(2310036,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1017.JPG',400,238,'Cloisters','http://admin2.clikpic.com/johncave/images/IMG_1017_thumb.JPG',130, 77,1, 0,'Atmospheric cloisters in Worcester Cathedral','','','Worcester Cathedral, UK','','');
photos[67] = new photo(2310063,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1386.JPG',400,600,'Beach House','http://admin2.clikpic.com/johncave/images/IMG_1386_thumb.JPG',130, 195,1, 0,'A run-down beach house in Devon','','','Devon, UK','','');
photos[68] = new photo(2310083,'138849','','gallery','http://admin2.clikpic.com/johncave/images/piperdam web.jpg',600,399,'Scottish Sunset','http://admin2.clikpic.com/johncave/images/piperdam web_thumb.jpg',130, 86,1, 0,'Sunset near Dundee, Scotland','','','Dundee, UK','','');
photos[69] = new photo(2322047,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0802.JPG',500,333,'Big Ben','http://admin2.clikpic.com/johncave/images/IMG_0802_thumb.JPG',130, 87,1, 0,'Big Ben, London','','','London, UK','','');
photos[70] = new photo(2322138,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_0654.JPG',400,232,'Modern Offices','http://admin2.clikpic.com/johncave/images/IMG_0654_thumb.JPG',130, 75,1, 0,'A Modern Office building','','','Coventry, UK','','');
photos[71] = new photo(2336322,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_9571.JPG',500,750,'Golden Sunset','http://admin2.clikpic.com/johncave/images/IMG_9571_thumb.JPG',130, 195,1, 0,'A golden sunset','','','Milnthorpe, Cumbria','','');
photos[72] = new photo(2336365,'138849','','gallery','http://admin2.clikpic.com/johncave/images/282_8256.JPG',500,379,'Busy station','http://admin2.clikpic.com/johncave/images/282_8256_thumb.JPG',130, 99,1, 0,'A \'high key\' image of a busy railway station','','','London, UK','','');
photos[73] = new photo(2338494,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_1815.JPG',400,267,'Traditional English Pub','http://admin2.clikpic.com/johncave/images/IMG_1815_thumb.JPG',130, 87,0, 0,'Traditional English Pub in Wiltshire.','','','Wiltshire, UK','','');
photos[74] = new photo(2338590,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_8217.jpg',400,267,'Old and New','http://admin2.clikpic.com/johncave/images/IMG_8217_thumb.jpg',130, 87,1, 0,'Norman Foster\'s 30 St Mary\'s Axe or \"The Gherkin\" and St Andrew Undershaft Church.','','','London, UK','','');
photos[75] = new photo(2882782,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_7600-1.JPG',399,600,'Two children exploring in the woods.','http://admin2.clikpic.com/johncave/images/IMG_7600-1_thumb.JPG',130, 195,1, 0,'Exploring in the woods!','','','Worcestershire, UK','','');
photos[76] = new photo(2882783,'138849','','gallery','http://admin2.clikpic.com/johncave/images/IMG_7554.JPG',399,600,'A typical rural scene in Worcestershire, UK.','http://admin2.clikpic.com/johncave/images/IMG_7554_thumb.JPG',130, 195,1, 0,'English Countryside','','','Worcestershire, UK','','');
photos[77] = new photo(2924132,'138849','Field in Summer','gallery','http://admin2.clikpic.com/johncave/images/IMG_7559 copy copy.jpg',400,259,'Field in Summer','http://admin2.clikpic.com/johncave/images/IMG_7559 copy copy_thumb.jpg',130, 84,1, 0,'A field in Worcestershire, UK in the summer.','','','Worcestershire, UK','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(148509,'3047866,2924318,2332359,2322472,2309401,2258684','Nature','gallery');
galleries[1] = new gallery(138813,'2258198','Oh Canada!','gallery');
galleries[2] = new gallery(138740,'2077914','Incredible India','gallery');
galleries[3] = new gallery(151009,'2308920','Creatures','gallery');
galleries[4] = new gallery(138849,'2924132,2882783,2882782,2338590,2338494,2336365,2336322,2322138,2322047,2310083','Around the UK','gallery');

