/***************************************************************************
* 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('3196639,988479,988472,988443,988429,988411,988392,988389,988387,988385,988384,988355,988343,988310,988302,988297,988295,988292,988291,988290,988289,988288,988287,988282');
	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('3196639,988479,988472,988443,988429,988411,988392,988389,988387,988385,988384,988355,988343,988310,988302,988297,988295,988292,988291,988290,988289,988288,988287,988282');
	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 = 'Ken Hugill Art + Photography: ' + photos[nextImg].caption;
										/* apply 'blank' classname to element where */			if ( photos[nextImg].caption == '') {
				document.getElementById('imageTitle').style.className = 'blank';
			}
			else {
				document.getElementById('imageTitle').style.className = 'normal';
			}
						temp = '';
			if (photos[nextImg].description != '') {
				temp = temp +  '<p id="imageDescription">' + photos[nextImg].description + '</p>';
			}
						if (photos[nextImg].photo_ref != '') {
				temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + photos[nextImg].photo_ref + '</p>';
			}
						if (photos[nextImg].takendate != '') {
				debug('Resetting taken date');
				temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + photos[nextImg].takendate + '</p>';
			}
			
			if (photos[nextImg].location != '') {
				debug('Resetting location');
				temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  photos[nextImg].location + '</p>';
			}
			
			if (photos[nextImg].photographer != '') {
				debug('Resetting photographer');
				temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.display = 'none';
		}
		else {
			document.getElementById('imageDetails').style.display = 'block';
		}
		document.getElementById('imageDetails').innerHTML =temp;	
		
	}
	else {
		debug('Redirecting to id ' + photos[nextImg].id);
		window.location = 'photo_' + photos[nextImg].id + '.html';
	}
}

/***************************************************************************
* Show the previous image for a gallery. field = hidden field containing   *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function previous(field,img) {


	imageID = field.value;
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k = j -1;
	while (nextImg < 0) {
		for (; k >= 0; k--) {
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				break;
			}
		}
		if (nextImg == -1) {
			k = photos.length -1;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);	
	}
}

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.
        *
* Gallery_id = id of gallery to choose                                     *
* 
 img = reference to html image                                       *
* in which to show image                                                   *
***************************************************************************/
function showGalleryImage(gallery_id, img) {
	debug('Gallery = ' + gallery_id);
	for (i = 0; i < galleries.length; i++) {
		if (galleries[i].id == gallery_id) {
			imageID = randomListVal(galleries[i].featured_images);
				for (j = 0; j < photos.length; j++) {
					if (photos[j].id == imageID) {
						
						img.src = photos[j].thumbnail;
						img.width = photos[j].thumbnail_width;
						img.height = photos[j].thumbnail_height;
						
						break;
					}
				}
			break;
		}
	} 
	}

/***************************************************************************
* If we have dynamic HTML                                                  *
*  replace the galleries link with a list that                             *
* doesn't include the current gallery                                      *
***************************************************************************/
function showGalleries(gallery_id) {
	debug('Showing links for gallery ' + gallery_id);
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
			debug('Testing gallery ' + galleries[i].id);
			
			if (galleries[i].id != gallery_id) {
				debug('Adding link');
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="gallery_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}
/***************************************************************************
* Create the array of Photo objects                                        *
***************************************************************************/
photos = new Array();
photos[0] = new photo(988282,'1763','','gallery','http://www1.clikpic.com/khugill/images/190706 copy.jpg',450,450,'Poppy 1','http://www1.clikpic.com/khugill/images/190706 copy_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[1] = new photo(988284,'1763','','gallery','http://www1.clikpic.com/khugill/images/13.jpg',450,338,'Old trailer','http://www1.clikpic.com/khugill/images/13_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[2] = new photo(988287,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 02 040527004(2) copyjpg.jpg',307,450,'Bilbao 1','http://www1.clikpic.com/khugill/images/bilbao 02 040527004(2) copyjpg_thumb.jpg',130, 191,1, 1,'','','','','','');
photos[3] = new photo(988288,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 03 040526008(2) copyjpg.jpg',299,450,'Bilbao 2','http://www1.clikpic.com/khugill/images/bilbao 03 040526008(2) copyjpg_thumb.jpg',130, 196,1, 1,'','','','','','');
photos[4] = new photo(988289,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 04 040526003 (2) copyjpg.jpg',300,450,'Bilbao 3','http://www1.clikpic.com/khugill/images/bilbao 04 040526003 (2) copyjpg_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[5] = new photo(988290,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 05 040527011 (2) copyjpg.jpg',300,450,'Bilbao 4','http://www1.clikpic.com/khugill/images/bilbao 05 040527011 (2) copyjpg_thumb.jpg',130, 195,1, 1,'','','','','','');
photos[6] = new photo(988291,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 06 040528003(2) copyjpg.jpg',318,450,'Bilbao 5','http://www1.clikpic.com/khugill/images/bilbao 06 040528003(2) copyjpg_thumb.jpg',130, 184,1, 1,'','','','','','');
photos[7] = new photo(988292,'1763','','gallery','http://www1.clikpic.com/khugill/images/bilbao 07 IMG_0592 (2) copyjpg.jpg',299,450,'Bilbao 6','http://www1.clikpic.com/khugill/images/bilbao 07 IMG_0592 (2) copyjpg_thumb.jpg',130, 196,1, 1,'','','','','','');
photos[8] = new photo(988295,'1763','','gallery','http://www1.clikpic.com/khugill/images/CRW_4182copy 2.jpg',450,450,'Pieris 1','http://www1.clikpic.com/khugill/images/CRW_4182copy 2_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[9] = new photo(988296,'1763','','gallery','http://www1.clikpic.com/khugill/images/DS040528092332 copyJPGjpg.jpg',309,450,'Light','http://www1.clikpic.com/khugill/images/DS040528092332 copyJPGjpg_thumb.jpg',130, 189,0, 0,'','','','','','');
photos[10] = new photo(988297,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_0832copy2 copy.jpg',450,450,'Lily 1','http://www1.clikpic.com/khugill/images/IMG_0832copy2 copy_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[11] = new photo(988299,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_1421 copyjpg.jpg',450,432,'Headlights 1','http://www1.clikpic.com/khugill/images/IMG_1421 copyjpg_thumb.jpg',130, 125,0, 0,'','','','','','');
photos[12] = new photo(988300,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_1424 copyjpg.jpg',450,251,'Headlights 2','http://www1.clikpic.com/khugill/images/IMG_1424 copyjpg_thumb.jpg',130, 73,0, 0,'','','','','','');
photos[13] = new photo(988301,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_1428 copyjpg.jpg',420,450,'Headlights 3','http://www1.clikpic.com/khugill/images/IMG_1428 copyjpg_thumb.jpg',130, 139,0, 0,'','','','','','');
photos[14] = new photo(988302,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_2076copY2 copy.jpg',450,450,'Dappled light','http://www1.clikpic.com/khugill/images/IMG_2076copY2 copy_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[15] = new photo(988306,'1763','','gallery','http://www1.clikpic.com/khugill/images/IMG_4059copy.jpg',450,450,'Chinese lantern','http://www1.clikpic.com/khugill/images/IMG_4059copy_thumb.jpg',130, 130,0, 1,'','','','','','');
photos[16] = new photo(988307,'1763','','gallery','http://www1.clikpic.com/khugill/images/KH3REV1 copy.jpg',160,600,'Earth','http://www1.clikpic.com/khugill/images/KH3REV1 copy_thumb.jpg',130, 488,0, 0,'','','','','','');
photos[17] = new photo(988308,'1763','','gallery','http://www1.clikpic.com/khugill/images/life copyjpg.jpg',360,450,'Radishes','http://www1.clikpic.com/khugill/images/life copyjpg_thumb.jpg',130, 163,0, 0,'','','','','','');
photos[18] = new photo(988310,'1763','','gallery','http://www1.clikpic.com/khugill/images/No 8 copy.jpg',337,450,'No 8','http://www1.clikpic.com/khugill/images/No 8 copy_thumb.jpg',130, 174,1, 1,'','','','','','');
photos[19] = new photo(988311,'1763','','gallery','http://www1.clikpic.com/khugill/images/ny skyline copyjpg.jpg',550,142,'New York skyline','http://www1.clikpic.com/khugill/images/ny skyline copyjpg_thumb.jpg',130, 34,0, 0,'','','','','','');
photos[20] = new photo(988312,'1763','','gallery','http://www1.clikpic.com/khugill/images/relections 01jpg.jpg',450,377,'Reflections','http://www1.clikpic.com/khugill/images/relections 01jpg_thumb.jpg',130, 109,0, 0,'','','','','','');
photos[21] = new photo(988314,'1763','','gallery','http://www1.clikpic.com/khugill/images/toronto night copyjpg.jpg',450,258,'Headlights 4','http://www1.clikpic.com/khugill/images/toronto night copyjpg_thumb.jpg',130, 75,0, 0,'','','','','','');
photos[22] = new photo(988315,'1763','','gallery','http://www1.clikpic.com/khugill/images/trump interior NY1 copy 2jpg.jpg',450,338,'Water','http://www1.clikpic.com/khugill/images/trump interior NY1 copy 2jpg_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[23] = new photo(3196639,'1763','','gallery','http://www1.clikpic.com/khugill/images/1 Alium.jpg',500,500,'Alium','http://www1.clikpic.com/khugill/images/1 Alium_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[24] = new photo(3196643,'1763','','gallery','http://www1.clikpic.com/khugill/images/2 Nigella.jpg',500,500,'Nigella','http://www1.clikpic.com/khugill/images/2 Nigella_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[25] = new photo(3196650,'1763','','gallery','http://www1.clikpic.com/khugill/images/3 Campanula.jpg',600,600,'campanula','http://www1.clikpic.com/khugill/images/3 Campanula_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[26] = new photo(3196664,'1763','','gallery','http://www1.clikpic.com/khugill/images/11 National Assembly, Edinburgh.jpg',500,500,'National Assembly, Edinburgh','http://www1.clikpic.com/khugill/images/11 National Assembly, Edinburgh_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[27] = new photo(988359,'1762','','gallery','http://www1.clikpic.com/khugill/images/011_8 copy.jpg',550,222,'New York skyline','http://www1.clikpic.com/khugill/images/011_8 copy_thumb.jpg',130, 52,0, 0,'','','','','','');
photos[28] = new photo(988362,'1762','','gallery','http://www1.clikpic.com/khugill/images/040526008bw.jpg',307,450,'Bilbao mono 1','http://www1.clikpic.com/khugill/images/040526008bw_thumb.jpg',130, 191,0, 1,'','','','','','');
photos[29] = new photo(988363,'1762','','gallery','http://www1.clikpic.com/khugill/images/040528013 copy.jpg',500,226,'Rowers','http://www1.clikpic.com/khugill/images/040528013 copy_thumb.jpg',130, 59,0, 0,'','','','','','');
photos[30] = new photo(988380,'1762','','gallery','http://www1.clikpic.com/khugill/images/bikesutrecht2.jpg',450,450,'Bikes in Utrecht, Netherlands','http://www1.clikpic.com/khugill/images/bikesutrecht2_thumb.jpg',130, 130,0, 1,'','','','','','');
photos[31] = new photo(988382,'1762','','gallery','http://www1.clikpic.com/khugill/images/doorparis copy 2.jpg',296,450,'Door Paris - mono version','http://www1.clikpic.com/khugill/images/doorparis copy 2_thumb.jpg',130, 198,0, 1,'','','','','','');
photos[32] = new photo(988384,'1762','','gallery','http://www1.clikpic.com/khugill/images/DS040527095257copy.jpg',450,485,'Guggenheim Museum, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/DS040527095257copy_thumb.jpg',130, 140,1, 1,'','','','','','');
photos[33] = new photo(988385,'1762','','gallery','http://www1.clikpic.com/khugill/images/DS041122201655 copy.jpg',450,399,'Office block','http://www1.clikpic.com/khugill/images/DS041122201655 copy_thumb.jpg',130, 115,1, 1,'','','','','','');
photos[34] = new photo(988387,'1762','','gallery','http://www1.clikpic.com/khugill/images/fire escapes NY.jpg',272,450,'Fire escapes, New York, USA','http://www1.clikpic.com/khugill/images/fire escapes NY_thumb.jpg',130, 215,1, 1,'','','','','','');
photos[35] = new photo(988389,'1762','','gallery','http://www1.clikpic.com/khugill/images/IMG_0289 copy2.jpg',361,450,'Beach stones','http://www1.clikpic.com/khugill/images/IMG_0289 copy2_thumb.jpg',130, 162,1, 1,'','','','','','');
photos[36] = new photo(988392,'1762','','gallery','http://www1.clikpic.com/khugill/images/leafgroup12.jpg',335,450,'Leaves 2','http://www1.clikpic.com/khugill/images/leafgroup12_thumb.jpg',130, 175,1, 1,'','','','','','');
photos[37] = new photo(988316,'74147','','gallery','http://www1.clikpic.com/khugill/images/34.jpg',339,450,'Timber wharf','http://www1.clikpic.com/khugill/images/34_thumb.jpg',130, 173,0, 1,'','','','','','');
photos[38] = new photo(988317,'74147','','gallery','http://www1.clikpic.com/khugill/images/05020410 copyjpg.jpg',450,350,'Rally car','http://www1.clikpic.com/khugill/images/05020410 copyjpg_thumb.jpg',130, 101,0, 1,'','','','','','');
photos[39] = new photo(988318,'74147','','gallery','http://www1.clikpic.com/khugill/images/040528005 copyjpg.jpg',296,450,'Building, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/040528005 copyjpg_thumb.jpg',130, 198,0, 0,'','','','','','');
photos[40] = new photo(988320,'74147','','gallery','http://www1.clikpic.com/khugill/images/040528010 copyjpg.jpg',318,450,'Reflections in River Nervon, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/040528010 copyjpg_thumb.jpg',130, 184,0, 1,'','','','','','');
photos[41] = new photo(988321,'74147','','gallery','http://www1.clikpic.com/khugill/images/CNV00027 copyjpg.jpg',301,450,'Bigsweir bridge, on the River Wye near Chepstow, Monmouthshire, Wales, UK','http://www1.clikpic.com/khugill/images/CNV00027 copyjpg_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[42] = new photo(988322,'74147','','gallery','http://www1.clikpic.com/khugill/images/doorparis charcoal copyjpg.jpg',296,450,'Door - Paris, France (blue version 1)','http://www1.clikpic.com/khugill/images/doorparis charcoal copyjpg_thumb.jpg',130, 198,0, 1,'','','','','','');
photos[43] = new photo(988324,'74147','','gallery','http://www1.clikpic.com/khugill/images/DS041129151902 copyjpg.jpg',450,397,'Window, L\'Oratoire de St Joseph, Montreal, Canada','http://www1.clikpic.com/khugill/images/DS041129151902 copyjpg_thumb.jpg',130, 115,0, 0,'','','','','','');
photos[44] = new photo(988325,'74147','','gallery','http://www1.clikpic.com/khugill/images/horses3 copyjpg.jpg',500,209,'Horse race','http://www1.clikpic.com/khugill/images/horses3 copyjpg_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[45] = new photo(988327,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_0277 copyJPGjpg.jpg',450,420,'Farm machinery','http://www1.clikpic.com/khugill/images/IMG_0277 copyJPGjpg_thumb.jpg',130, 121,0, 0,'','','','','','');
photos[46] = new photo(988328,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_0646 copyjpg.jpg',338,450,'Drinking water tap, old town, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/IMG_0646 copyjpg_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[47] = new photo(988341,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_0651 copyjpg.jpg',338,450,'Wall shrine old town, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/IMG_0651 copyjpg_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[48] = new photo(988343,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_0664 copyjpg.jpg',338,450,'Advertising hoarding','http://www1.clikpic.com/khugill/images/IMG_0664 copyjpg_thumb.jpg',130, 173,1, 1,'Runner up in Urban Living Photography Competition 2007','','','','','');
photos[49] = new photo(988347,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_1085 copyjpg.jpg',450,338,'Street car Berlin, Germany','http://www1.clikpic.com/khugill/images/IMG_1085 copyjpg_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[50] = new photo(988351,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_2762 copy.jpg',258,450,'Sailing boat, Lydney canal/harbour, Gloucestershire, UK','http://www1.clikpic.com/khugill/images/IMG_2762 copy_thumb.jpg',130, 227,0, 1,'','','','','','');
photos[51] = new photo(988352,'74147','','gallery','http://www1.clikpic.com/khugill/images/IMG_2999 copy.jpg',450,300,'Floating debris','http://www1.clikpic.com/khugill/images/IMG_2999 copy_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[52] = new photo(988355,'74147','','gallery','http://www1.clikpic.com/khugill/images/seed pods copyjpg.jpg',450,450,'Poppy seed heads - blue version','http://www1.clikpic.com/khugill/images/seed pods copyjpg_thumb.jpg',130, 130,1, 1,'','','','','','');
photos[53] = new photo(988420,'1837','','gallery','http://www1.clikpic.com/khugill/images/05020401 copyjpg.jpg',305,450,'River Severn and the old Severn bridge','http://www1.clikpic.com/khugill/images/05020401 copyjpg_thumb.jpg',130, 192,0, 1,'','','','','','');
photos[54] = new photo(988424,'1837','','gallery','http://www1.clikpic.com/khugill/images/040526008 copyjpg.jpg',286,450,'Guggenheim museuem, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/040526008 copyjpg_thumb.jpg',130, 205,0, 1,'','','','','','');
photos[55] = new photo(988429,'1837','','gallery','http://www1.clikpic.com/khugill/images/040528002 copyjpg.jpg',450,281,'Guggenheim museum at sunset, Bilbao, North Spain','http://www1.clikpic.com/khugill/images/040528002 copyjpg_thumb.jpg',130, 81,1, 1,'','','','','','');
photos[56] = new photo(988433,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041017101049 copyjpg.jpg',450,186,'Brandenberg Gates, Berlin, Germany','http://www1.clikpic.com/khugill/images/DS041017101049 copyjpg_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[57] = new photo(988435,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041018165514 copyjpg.jpg',450,295,'Berlin Dom (cathedral), Berlin, Germany','http://www1.clikpic.com/khugill/images/DS041018165514 copyjpg_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[58] = new photo(988437,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041019151656 copyjpg.jpg',450,282,'Berlin Dom reflected in the old East German HQ building','http://www1.clikpic.com/khugill/images/DS041019151656 copyjpg_thumb.jpg',130, 81,0, 0,'','','','','','');
photos[59] = new photo(988443,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041122194958 copyjpg.jpg',307,450,'Reflections in office facades, Toronto, Canada','http://www1.clikpic.com/khugill/images/DS041122194958 copyjpg_thumb.jpg',130, 191,1, 1,'','','','','','');
photos[60] = new photo(988446,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041123100853copyrev.jpg',450,318,'Toronto skyline at night','http://www1.clikpic.com/khugill/images/DS041123100853copyrev_thumb.jpg',130, 92,0, 1,'','','','','','');
photos[61] = new photo(988461,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041128153026 copyjpg.jpg',450,318,'Niagara Falls','http://www1.clikpic.com/khugill/images/DS041128153026 copyjpg_thumb.jpg',130, 92,0, 1,'','','','','','');
photos[62] = new photo(988464,'1837','','gallery','http://www1.clikpic.com/khugill/images/DS041128193733 copyjpg.jpg',357,450,'Old town, Montreal, Canada','http://www1.clikpic.com/khugill/images/DS041128193733 copyjpg_thumb.jpg',130, 164,0, 0,'','','','','','');
photos[63] = new photo(988468,'1837','','gallery','http://www1.clikpic.com/khugill/images/guggenheim1 copyjpg.jpg',500,193,'Guggenheim skyline','http://www1.clikpic.com/khugill/images/guggenheim1 copyjpg_thumb.jpg',130, 50,0, 1,'','','','','','');
photos[64] = new photo(988469,'1837','','gallery','http://www1.clikpic.com/khugill/images/image 7 severn1tif copyjpg.jpg',450,359,'Old Severn bridge, UK','http://www1.clikpic.com/khugill/images/image 7 severn1tif copyjpg_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[65] = new photo(988472,'1837','','gallery','http://www1.clikpic.com/khugill/images/IMG_1096 copyjpg.jpg',338,450,'Atrium, Sony Centre, Potsdamer Platz, Berlin, Germany','http://www1.clikpic.com/khugill/images/IMG_1096 copyjpg_thumb.jpg',130, 173,1, 1,'','','','','','');
photos[66] = new photo(988475,'1837','','gallery','http://www1.clikpic.com/khugill/images/ny2 copyjpg.jpg',450,458,'Reflections in office facades, New York, USA','http://www1.clikpic.com/khugill/images/ny2 copyjpg_thumb.jpg',130, 132,0, 0,'','','','','','');
photos[67] = new photo(988479,'1837','','gallery','http://www1.clikpic.com/khugill/images/ny3.jpg',335,450,'Office building New York, USA','http://www1.clikpic.com/khugill/images/ny3_thumb.jpg',130, 175,1, 1,'','','','','','');
photos[68] = new photo(3196672,'1837','','gallery','http://www1.clikpic.com/khugill/images/12 Manhattan.jpg',500,500,'Manhattan','http://www1.clikpic.com/khugill/images/12 Manhattan_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[69] = new photo(3196677,'1837','','gallery','http://www1.clikpic.com/khugill/images/14 Ocean Drive, Miami.jpg',550,317,'Ocean Drive, Miami','http://www1.clikpic.com/khugill/images/14 Ocean Drive, Miami_thumb.jpg',130, 75,0, 0,'','','','','','');
photos[70] = new photo(988394,'1765','','gallery','http://www1.clikpic.com/khugill/images/bluebell wood copyjpg.jpg',338,450,'Bluebell wood','http://www1.clikpic.com/khugill/images/bluebell wood copyjpg_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[71] = new photo(988398,'1765','','gallery','http://www1.clikpic.com/khugill/images/CNV00001 copyjpg.jpg',450,302,'Hydrangea','http://www1.clikpic.com/khugill/images/CNV00001 copyjpg_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[72] = new photo(988400,'1765','','gallery','http://www1.clikpic.com/khugill/images/CNV00021 copyjpg.jpg',301,450,'Iris','http://www1.clikpic.com/khugill/images/CNV00021 copyjpg_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[73] = new photo(988404,'1765','','gallery','http://www1.clikpic.com/khugill/images/DS041018121837 copyjpg.jpg',302,450,'Pond in the Tiergarten, Berlin, Germany','http://www1.clikpic.com/khugill/images/DS041018121837 copyjpg_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[74] = new photo(988405,'1765','','gallery','http://www1.clikpic.com/khugill/images/DS041121145654 copyjpg.jpg',350,450,'Urban street, Toronto, Canada','http://www1.clikpic.com/khugill/images/DS041121145654 copyjpg_thumb.jpg',130, 167,0, 1,'','','','','','');
photos[75] = new photo(988406,'1765','','gallery','http://www1.clikpic.com/khugill/images/DS041128194547 copyjpg.jpg',450,318,'Sunset over the St Lawrence, Montreal, Canada','http://www1.clikpic.com/khugill/images/DS041128194547 copyjpg_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[76] = new photo(988408,'1765','','gallery','http://www1.clikpic.com/khugill/images/DS041129160618 copyjpg.jpg',450,313,'River St Lawrence, Montreal, Canada','http://www1.clikpic.com/khugill/images/DS041129160618 copyjpg_thumb.jpg',130, 90,0, 0,'','','','','','');
photos[77] = new photo(988409,'1765','','gallery','http://www1.clikpic.com/khugill/images/IMG_3234rev1.jpg',450,450,'Alium head','http://www1.clikpic.com/khugill/images/IMG_3234rev1_thumb.jpg',130, 130,0, 1,'','','','','','');
photos[78] = new photo(988411,'1765','','gallery','http://www1.clikpic.com/khugill/images/IMG_3690copyrev.jpg',329,450,'Pieris buds','http://www1.clikpic.com/khugill/images/IMG_3690copyrev_thumb.jpg',130, 178,1, 1,'','','','','','');
photos[79] = new photo(988413,'1765','','gallery','http://www1.clikpic.com/khugill/images/IMG_4072copy copy.jpg',450,450,'Wood stump','http://www1.clikpic.com/khugill/images/IMG_4072copy copy_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[80] = new photo(988414,'1765','','gallery','http://www1.clikpic.com/khugill/images/IMG_4074.jpg',450,341,'Camelia buds in the frost','http://www1.clikpic.com/khugill/images/IMG_4074_thumb.jpg',130, 99,0, 1,'','','','','','');
photos[81] = new photo(988415,'1765','','gallery','http://www1.clikpic.com/khugill/images/pansies copyjpg.jpg',450,425,'Pansies','http://www1.clikpic.com/khugill/images/pansies copyjpg_thumb.jpg',130, 123,0, 1,'','','','','','');
photos[82] = new photo(988416,'1765','','gallery','http://www1.clikpic.com/khugill/images/sev copyjpg.jpg',450,450,'River Wye in autumn','http://www1.clikpic.com/khugill/images/sev copyjpg_thumb.jpg',130, 130,0, 1,'','','','','','');
photos[83] = new photo(988417,'1765','','gallery','http://www1.clikpic.com/khugill/images/wye valley copyjpg.jpg',299,450,'The river Wye between Monmouth and Chepstow, UK','http://www1.clikpic.com/khugill/images/wye valley copyjpg_thumb.jpg',130, 196,0, 0,'','','','','','');
photos[84] = new photo(988567,'1764','','gallery','http://www1.clikpic.com/khugill/images/32.jpg',411,450,'River Wye','http://www1.clikpic.com/khugill/images/32_thumb.jpg',130, 142,0, 1,'Acrylic on canvas','','','','','');
photos[85] = new photo(988613,'1764','','gallery','http://www1.clikpic.com/khugill/images/35.jpg',221,450,'Trees','http://www1.clikpic.com/khugill/images/35_thumb.jpg',130, 265,0, 0,'Collagraph','','','','','');
photos[86] = new photo(988692,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_1879jpg.jpg',164,550,'Bilbao #1','http://www1.clikpic.com/khugill/images/IMG_1879jpg_thumb.jpg',130, 436,0, 1,'Photo etching','','','','','');
photos[87] = new photo(988724,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_1880 copyjpg.jpg',310,450,'Forest rockface','http://www1.clikpic.com/khugill/images/IMG_1880 copyjpg_thumb.jpg',130, 189,0, 1,'Pastel on paper','','','','','');
photos[88] = new photo(988776,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_1883 copyjpg.jpg',341,450,'Bluebell wood','http://www1.clikpic.com/khugill/images/IMG_1883 copyjpg_thumb.jpg',130, 172,0, 1,'Oil on board','','','','','');
photos[89] = new photo(988833,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2918jpg.jpg',225,550,'Oak','http://www1.clikpic.com/khugill/images/IMG_2918jpg_thumb.jpg',130, 318,0, 0,'Etching with chine colle','','','','','');
photos[90] = new photo(988899,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2922jpg.jpg',450,449,'Circular abstract','http://www1.clikpic.com/khugill/images/IMG_2922jpg_thumb.jpg',130, 130,0, 1,'Collagraph','','','','','');
photos[91] = new photo(988936,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2929jpg.jpg',315,450,'Deep in the wood','http://www1.clikpic.com/khugill/images/IMG_2929jpg_thumb.jpg',130, 186,0, 0,'Oil on canvas','','','','','');
photos[92] = new photo(988938,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2933jpg.jpg',322,450,'New York reflections','http://www1.clikpic.com/khugill/images/IMG_2933jpg_thumb.jpg',130, 182,0, 0,'Photo etching','','','','','');
photos[93] = new photo(988940,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2935jpg.jpg',315,450,'Bilbao #2','http://www1.clikpic.com/khugill/images/IMG_2935jpg_thumb.jpg',130, 186,0, 0,'Photo etching','','','','','');
photos[94] = new photo(989112,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2938jpg.jpg',315,450,'Plant','http://www1.clikpic.com/khugill/images/IMG_2938jpg_thumb.jpg',130, 186,0, 0,'Linocut','','','','','');
photos[95] = new photo(989114,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2946.jpg',340,450,'Ploughed field','http://www1.clikpic.com/khugill/images/IMG_2946_thumb.jpg',130, 172,0, 0,'Monoprint','','','','','');
photos[96] = new photo(989115,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_2958.jpg',450,448,'Landscape','http://www1.clikpic.com/khugill/images/IMG_2958_thumb.jpg',130, 129,0, 0,'Monoprint','','','','','');
photos[97] = new photo(989116,'1764','','gallery','http://www1.clikpic.com/khugill/images/IMG_3473.jpg',450,320,'Earth 1','http://www1.clikpic.com/khugill/images/IMG_3473_thumb.jpg',130, 92,0, 1,'Collage','','','','','');
photos[98] = new photo(989117,'1764','','gallery','http://www1.clikpic.com/khugill/images/seascape 1.jpg',323,450,'Seascape 1','http://www1.clikpic.com/khugill/images/seascape 1_thumb.jpg',130, 181,0, 1,'Monoprint','','','','','');
photos[99] = new photo(989118,'1764','','gallery','http://www1.clikpic.com/khugill/images/seascape 2.jpg',427,450,'Seascape 2','http://www1.clikpic.com/khugill/images/seascape 2_thumb.jpg',130, 137,0, 1,'Monoprint','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(1763,'3196639,988310,988306,988302,988297,988295,988292,988291,988290,988289,988288,988287,988282','Abstract','gallery');
galleries[1] = new gallery(1762,'988392,988389,988387,988385,988384,988382,988380,988362','Black & White','gallery');
galleries[2] = new gallery(74147,'988355,988351,988343,988322,988320,988317,988316','Details and Objects','gallery');
galleries[3] = new gallery(1837,'988479,988472,988468,988461,988446,988443,988429,988424,988420','Places','gallery');
galleries[4] = new gallery(1765,'988416,988415,988414,988411,988409,988405','Nature','gallery');
galleries[5] = new gallery(1764,'989118,989117,989116,988899,988776,988724,988692,988567','Mixed Media','gallery');

