/***************************************************************************
* 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('250876');
	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('250876');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !((0) || (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 = 'john reed\'s digital images: ' + 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(8444,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/artichoke.jpg',400,601,'artichoke','http://www3.clikpic.com/deernhoj/images/artichoke_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[1] = new photo(8445,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/allan1.jpg',400,560,'allan','http://www3.clikpic.com/deernhoj/images/allan1_thumb.jpg',130, 182,0, 0,'','','','','','');
photos[2] = new photo(8446,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/amaryllis1.jpg',400,601,'amaryllis','http://www3.clikpic.com/deernhoj/images/amaryllis1_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[3] = new photo(8448,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/berries.jpg',400,598,'berries','http://www3.clikpic.com/deernhoj/images/berries_thumb.jpg',130, 194,0, 0,'','','','','','');
photos[4] = new photo(8449,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/boy.jpg',400,533,'boy','http://www3.clikpic.com/deernhoj/images/boy_thumb.jpg',130, 173,0, 0,'','','','','','');
photos[5] = new photo(8450,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/buds.jpg',400,600,'buds','http://www3.clikpic.com/deernhoj/images/buds_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[6] = new photo(8452,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/concorde1.jpg',400,266,'concorde','http://www3.clikpic.com/deernhoj/images/concorde1_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[7] = new photo(8453,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/dahlia.jpg',400,400,'dahlia','http://www3.clikpic.com/deernhoj/images/dahlia_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[8] = new photo(8456,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/girl.jpg',400,400,'girl','http://www3.clikpic.com/deernhoj/images/girl_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[9] = new photo(8457,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/glass gherkin.jpg',400,279,'glass gherkin','http://www3.clikpic.com/deernhoj/images/glass gherkin_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[10] = new photo(8459,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/hoodat.jpg',400,601,'hoodat','http://www3.clikpic.com/deernhoj/images/hoodat_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[11] = new photo(8461,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/in the swim copy.jpg',400,283,'intheswim','http://www3.clikpic.com/deernhoj/images/in the swim copy_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[12] = new photo(8462,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/knysnadawn.jpg',400,103,'knysnadawn','http://www3.clikpic.com/deernhoj/images/knysnadawn_thumb.jpg',130, 33,0, 0,'','','','','','');
photos[13] = new photo(8463,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/la vie en rose copy.jpg',400,266,'la vie en rose','http://www3.clikpic.com/deernhoj/images/la vie en rose copy_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[14] = new photo(8466,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/lighthouse.jpg',400,266,'lighthouse','http://www3.clikpic.com/deernhoj/images/lighthouse_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[15] = new photo(8467,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/lily.jpg',400,602,'lily','http://www3.clikpic.com/deernhoj/images/lily_thumb.jpg',130, 196,0, 0,'','','','','','');
photos[16] = new photo(8471,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/pond.jpg',400,274,'tree','http://www3.clikpic.com/deernhoj/images/pond_thumb.jpg',130, 89,0, 0,'','','','','','');
photos[17] = new photo(8474,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/redrose.jpg',400,307,'red rose','http://www3.clikpic.com/deernhoj/images/redrose_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[18] = new photo(8475,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/stainglass.jpg',400,601,'stainedglass','http://www3.clikpic.com/deernhoj/images/stainglass_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[19] = new photo(8476,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/streetmime.jpg',400,487,'streetmime','http://www3.clikpic.com/deernhoj/images/streetmime_thumb.jpg',130, 158,0, 0,'','','','','','');
photos[20] = new photo(8478,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/surfs up.jpg',400,400,'surfs up','http://www3.clikpic.com/deernhoj/images/surfs up_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[21] = new photo(8480,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/which way.jpg',400,337,'which way','http://www3.clikpic.com/deernhoj/images/which way_thumb.jpg',130, 110,0, 0,'','','','','','');
photos[22] = new photo(8788,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/angel.jpg',400,243,'angel','http://www3.clikpic.com/deernhoj/images/angel_thumb.jpg',130, 79,0, 0,'','','','','','');
photos[23] = new photo(9432,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/BEACHANGEL.jpg',400,300,'the angel of the beach','http://www3.clikpic.com/deernhoj/images/BEACHANGEL_thumb.jpg',130, 98,0, 0,'I have a confession - the picture of the beach was scanned from a magazine and hence I take no credit for it. However the image of the Angel is all my own work.','','','','','');
photos[24] = new photo(9647,'1286','','gallery','http://www3.clikpic.com/deernhoj/images/african zebras.jpg',400,325,'african zebras','http://www3.clikpic.com/deernhoj/images/african zebras_thumb.jpg',130, 106,0, 0,'howay the lads','','','','','');
photos[25] = new photo(32973,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/poppiesinfield1 copy.jpg',400,245,'poppies','http://www3.clikpic.com/deernhoj/images/poppiesinfield1 copy_thumb.jpg',130, 80,0, 0,'','','','','','');
photos[26] = new photo(46034,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_0124.JPG',400,573,'','http://www3.clikpic.com/deernhoj/images/DSC_0124_thumb.JPG',130, 186,0, 0,'','','','','','');
photos[27] = new photo(46035,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_0136.JPG',400,298,'','http://www3.clikpic.com/deernhoj/images/DSC_0136_thumb.JPG',130, 97,0, 0,'','','','','','');
photos[28] = new photo(46036,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_01521.JPG',400,494,'','http://www3.clikpic.com/deernhoj/images/DSC_01521_thumb.JPG',130, 161,0, 0,'','','','','','');
photos[29] = new photo(46037,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_01031.JPG',400,396,'','http://www3.clikpic.com/deernhoj/images/DSC_01031_thumb.JPG',130, 129,0, 0,'','','','','','');
photos[30] = new photo(46038,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_0181.JPG',400,434,'','http://www3.clikpic.com/deernhoj/images/DSC_0181_thumb.JPG',130, 141,0, 0,'','','','','','');
photos[31] = new photo(46039,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_01921.JPG',400,266,'','http://www3.clikpic.com/deernhoj/images/DSC_01921_thumb.JPG',130, 86,0, 0,'','','','','','');
photos[32] = new photo(46040,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_0170.JPG',400,313,'','http://www3.clikpic.com/deernhoj/images/DSC_0170_thumb.JPG',130, 102,0, 0,'','','','','','');
photos[33] = new photo(46041,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_0150.JPG',400,526,'','http://www3.clikpic.com/deernhoj/images/DSC_0150_thumb.JPG',130, 171,0, 0,'','','','','','');
photos[34] = new photo(46042,'4727','','gallery','http://www3.clikpic.com/deernhoj/images/DSC_01491.JPG',400,557,'','http://www3.clikpic.com/deernhoj/images/DSC_01491_thumb.JPG',130, 181,0, 0,'','','','','','');
photos[35] = new photo(118474,'1285','','gallery','http://www3.clikpic.com/deernhoj/images/amaryllis2.jpg',400,399,'amaryllis2','http://www3.clikpic.com/deernhoj/images/amaryllis2_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[36] = new photo(250876,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/loseley.jpg',600,399,'Guildford Balloon Festival 2006','http://www3.clikpic.com/deernhoj/images/loseley_thumb.jpg',130, 86,1, 1,'','','','','','');
photos[37] = new photo(250923,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/Souter Point.jpg',600,762,'Souter Point','http://www3.clikpic.com/deernhoj/images/Souter Point_thumb.jpg',130, 165,0, 0,'','','','','','');
photos[38] = new photo(251052,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/bamburgh castle.jpg',600,268,'Bamburgh Castle','http://www3.clikpic.com/deernhoj/images/bamburgh castle_thumb.jpg',130, 58,0, 0,'','','','','','');
photos[39] = new photo(251074,'1287','','gallery','http://www3.clikpic.com/deernhoj/images/east gill force2.jpg',500,332,'East Gill Force','http://www3.clikpic.com/deernhoj/images/east gill force2_thumb.jpg',130, 86,0, 1,'','','','','','');
photos[40] = new photo(3291859,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0801.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0801_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[41] = new photo(3291861,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0802.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0802_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[42] = new photo(3291864,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0803.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0803_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[43] = new photo(3291871,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0804.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0804_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(3291873,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0805.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0805_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[45] = new photo(3291875,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0806.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0806_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[46] = new photo(3291879,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0807.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0807_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[47] = new photo(3291881,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0808.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0808_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[48] = new photo(3291882,'200697','','gallery','http://admin.clikpic.com/deernhoj/images/0809.jpg',600,400,'','http://admin.clikpic.com/deernhoj/images/0809_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[49] = new photo(8455,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/fish.jpg',400,331,'fish','http://www3.clikpic.com/deernhoj/images/fish_thumb.jpg',130, 108,0, 0,'','','','','','');
photos[50] = new photo(8458,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/hairylips.jpg',400,400,'hairylips','http://www3.clikpic.com/deernhoj/images/hairylips_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[51] = new photo(8464,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/le frog.jpg',400,266,'frog','http://www3.clikpic.com/deernhoj/images/le frog_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[52] = new photo(8468,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/lion.jpg',400,400,'lion','http://www3.clikpic.com/deernhoj/images/lion_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[53] = new photo(8470,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/ostrich.jpg',400,356,'ostrich','http://www3.clikpic.com/deernhoj/images/ostrich_thumb.jpg',130, 116,0, 0,'','','','','','');
photos[54] = new photo(8481,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/whooaa.jpg',400,448,'whooaa','http://www3.clikpic.com/deernhoj/images/whooaa_thumb.jpg',130, 146,0, 0,'','','','','','');
photos[55] = new photo(8482,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/whyayeman.jpg',400,400,'why aye man','http://www3.clikpic.com/deernhoj/images/whyayeman_thumb.jpg',130, 130,0, 0,'','','','','','');
photos[56] = new photo(8483,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/zebrasunset.jpg',400,283,'zebra sunset','http://www3.clikpic.com/deernhoj/images/zebrasunset_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[57] = new photo(32937,'1258','','gallery','http://www3.clikpic.com/deernhoj/images/Picture 030a.jpg',400,319,'butterfly','http://www3.clikpic.com/deernhoj/images/Picture 030a_thumb.jpg',130, 104,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(200697,'3291882,3291881,3291879,3291875,3291873,3291871,3291864,3291861,3291859','CARNEVALE!','gallery');
galleries[1] = new gallery(4727,'46042,46041,46040,46039,46038,46037,46036,46035,46034','fireworks','gallery');
galleries[2] = new gallery(1286,'9647,8480,8478,8476,8461,8459,8456,8449,8445','people','gallery');
galleries[3] = new gallery(1285,'118474,32973,8474,8471,8467,8463,8453,8450,8448,8446','plants','gallery');
galleries[4] = new gallery(1287,'251074,250876','things','gallery');
galleries[5] = new gallery(1258,'32937,8483,8482,8481,8470,8468,8464,8458,8455','animals','gallery');

