/***************************************************************************
* 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('2681375');
	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('2681375');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !((1) || (0))) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'Tony Watson 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(2682510,'','','','http://www2.clikpic.com/fungilad/images/me.jpg',200,238,'','http://www2.clikpic.com/fungilad/images/me_thumb.jpg',109, 130,0, 0,'','','','','','');
photos[1] = new photo(2675385,'169114','040603 Sunset tree','gallery','http://www2.clikpic.com/fungilad/images/040603_tree.jpg',600,478,'','http://www2.clikpic.com/fungilad/images/040603_tree_thumb.jpg',130, 104,0, 1,'Sunset and dead oak tree silhouette','','','','','');
photos[2] = new photo(2671295,'169114','080740 Lavender','gallery','http://www2.clikpic.com/fungilad/images/080740_lavender3.jpg',600,571,'','http://www2.clikpic.com/fungilad/images/080740_lavender3_thumb.jpg',130, 124,0, 0,'Lavender field Shoreham, Kent.','','','','','');
photos[3] = new photo(2681375,'169114','050203 Snow track','gallery','http://www2.clikpic.com/fungilad/images/050203_snowy lane.jpg',600,482,'','http://www2.clikpic.com/fungilad/images/050203_snowy lane_thumb.jpg',130, 104,1, 0,'Winter track in woodlands, Kent','','','','','');
photos[4] = new photo(2741086,'169114','050610 poppies in flax','gallery','http://www2.clikpic.com/fungilad/images/050610_poppies_in_flax.jpg',500,409,'','http://www2.clikpic.com/fungilad/images/050610_poppies_in_flax_thumb.jpg',130, 106,0, 0,'Three poppies in flax field','','','','','');
photos[5] = new photo(2739477,'169114','080259 Cuckmere river','gallery','http://www2.clikpic.com/fungilad/images/080259_cuckmere_river.jpg',500,358,'','http://www2.clikpic.com/fungilad/images/080259_cuckmere_river_thumb.jpg',130, 93,0, 0,'Meandering river Cuckmere, East Sussex','','','','','');
photos[6] = new photo(2681215,'169114','040901 Canary Wharf','gallery','http://www2.clikpic.com/fungilad/images/040901_Canary_Wharf.jpg',600,472,'','http://www2.clikpic.com/fungilad/images/040901_Canary_Wharf_thumb.jpg',130, 102,0, 0,'Time lapse image of Canary Wharf, London','','','','','');
photos[7] = new photo(2675110,'169114','050618 Pink Poppy','gallery','http://www2.clikpic.com/fungilad/images/050618_pink_poppy .jpg',600,541,'','http://www2.clikpic.com/fungilad/images/050618_pink_poppy _thumb.jpg',130, 117,0, 0,'Single pink poppy in a sea of red.','','','','','');
photos[8] = new photo(2680147,'169114','031002 Quay','gallery','http://www2.clikpic.com/fungilad/images/031002_cobbled_jetty.jpg',500,600,'','http://www2.clikpic.com/fungilad/images/031002_cobbled_jetty_thumb.jpg',108, 130,0, 0,'Old cobblestone jetty at Hastings','','','','','');
photos[9] = new photo(2680241,'169114','041102 Dymchurch','gallery','http://www2.clikpic.com/fungilad/images/041102_dymchurch.jpg',600,522,'','http://www2.clikpic.com/fungilad/images/041102_dymchurch_thumb.jpg',130, 113,0, 0,'Seafront at Dymchurch in sepia','','','','','');
photos[10] = new photo(2987912,'169114','050202b snowy lane','gallery','http://www2.clikpic.com/fungilad/images/050202b snowy lane.jpg',600,542,'','http://www2.clikpic.com/fungilad/images/050202b snowy lane_thumb.jpg',130, 117,0, 0,'snowy lane','','','','','');
photos[11] = new photo(2675037,'169114','050606 Poppy','gallery','http://www2.clikpic.com/fungilad/images/050606_poppy_flax.jpg',600,586,'','http://www2.clikpic.com/fungilad/images/050606_poppy_flax_thumb.jpg',130, 127,0, 0,'Single red poppy in a field of blue flax','','','','','');
photos[12] = new photo(2674786,'169114','071253 Winter dawn','gallery','http://www2.clikpic.com/fungilad/images/071255_cudham_sunrise.jpg',600,479,'','http://www2.clikpic.com/fungilad/images/071255_cudham_sunrise_thumb.jpg',130, 104,0, 0,'Before sunrise over a frosty landscape in Kent','','','','','');
photos[13] = new photo(2681484,'169114','051105 Walkway','gallery','http://www2.clikpic.com/fungilad/images/051105_wooden_path.jpg',600,520,'','http://www2.clikpic.com/fungilad/images/051105_wooden_path_thumb.jpg',130, 113,0, 0,'Wooden walkway on Dungeness beach, Kent','','','','','');
photos[14] = new photo(2680505,'169114','080629 Footbridge','gallery','http://www2.clikpic.com/fungilad/images/080611_teddington_footbridge.JPG',600,491,'','http://www2.clikpic.com/fungilad/images/080611_teddington_footbridge_thumb.JPG',130, 106,0, 0,'The suspension footbridge at Teddington lock','','','','','');
photos[15] = new photo(2680587,'169114','080145 Driftwood','gallery','http://www2.clikpic.com/fungilad/images/080145_worthing_driftwood.jpg',600,480,'','http://www2.clikpic.com/fungilad/images/080145_worthing_driftwood_thumb.jpg',130, 104,0, 0,'Driftwood washed up on Worthing beach','','','','','');
photos[16] = new photo(2680634,'169114','080507 Bluebells','gallery','http://www2.clikpic.com/fungilad/images/080507_bluebells.jpg',600,409,'','http://www2.clikpic.com/fungilad/images/080507_bluebells_thumb.jpg',130, 89,0, 0,'Bluebells at Staffhurst Wood, Surrey.','','','','','');
photos[17] = new photo(2987152,'169114','070799e devon crow point','gallery','http://www2.clikpic.com/fungilad/images/070799e devon crow point.jpg',600,500,'','http://www2.clikpic.com/fungilad/images/070799e devon crow point_thumb.jpg',130, 108,0, 0,'crow point, Barnstable','','','','','');
photos[18] = new photo(2987808,'169114','050206b tree in snow','gallery','http://www2.clikpic.com/fungilad/images/050206b tree in snow.jpg',600,600,'','http://www2.clikpic.com/fungilad/images/050206b tree in snow_thumb.jpg',130, 130,0, 0,'tree in snow','','','','','');
photos[19] = new photo(2987933,'169114','050601 camber sands ','gallery','http://www2.clikpic.com/fungilad/images/050601 camber sands.jpg',600,487,'','http://www2.clikpic.com/fungilad/images/050601 camber sands_thumb.jpg',130, 106,0, 0,'Camber sands','','','','','');
photos[20] = new photo(2988008,'169114','030304 tatsfield tree','gallery','http://www2.clikpic.com/fungilad/images/030304 tatsfield tree.jpg',445,600,'','http://www2.clikpic.com/fungilad/images/030304 tatsfield tree_thumb.jpg',96, 130,0, 0,'tree silhouette','','','','','');
photos[21] = new photo(2989272,'169114','041023 sunset rays','gallery','http://www2.clikpic.com/fungilad/images/041023 sunset rays.jpg',600,462,'','http://www2.clikpic.com/fungilad/images/041023 sunset rays_thumb.jpg',130, 100,0, 0,'sunset rays','','','','','');
photos[22] = new photo(2989280,'169114','050925 Pevensey flats','gallery','http://www2.clikpic.com/fungilad/images/050925 hasting flats.jpg',600,501,'','http://www2.clikpic.com/fungilad/images/050925 hasting flats_thumb.jpg',130, 109,0, 0,'Sunset over Pevensey Flats','','','','','');
photos[23] = new photo(2675310,'169114','040401b Door','gallery','http://www2.clikpic.com/fungilad/images/040401b_door.jpg',600,490,'','http://www2.clikpic.com/fungilad/images/040401b_door_thumb.jpg',130, 106,0, 1,'Surreal image of a door as found, Dungeness beach','','','','','');
photos[24] = new photo(2675149,'169114','050811b Turbines','gallery','http://www2.clikpic.com/fungilad/images/050811b_wind_turbines.jpg',600,556,'','http://www2.clikpic.com/fungilad/images/050811b_wind_turbines_thumb.jpg',130, 120,0, 0,'Wind turbines and cow, Cornwall','','','','','');
photos[25] = new photo(2983126,'168983','081006 dragonfly','gallery','http://www2.clikpic.com/fungilad/images/081006 dragonfly.jpg',500,424,'','http://www2.clikpic.com/fungilad/images/081006 dragonfly_thumb.jpg',130, 110,0, 1,'Southern hawker Dragonfly, Aeshna cyanea.','','','','','');
photos[26] = new photo(2671316,'168983','080817 Cardoon','gallery','http://www2.clikpic.com/fungilad/images/080817_cardoon_Cynara_cardunculus.jpg',477,600,'','http://www2.clikpic.com/fungilad/images/080817_cardoon_Cynara_cardunculus_thumb.jpg',103, 130,0, 0,'Cardoon, Cynara cardunculus','','','','','');
photos[27] = new photo(2985731,'168983','061008 witches butter fungi, Tremella mesenterica','gallery','http://www2.clikpic.com/fungilad/images/061008 witches butter fungi.jpg',346,500,'','http://www2.clikpic.com/fungilad/images/061008 witches butter fungi_thumb.jpg',90, 130,0, 0,'witches butter fungi','','','','','');
photos[28] = new photo(2983375,'168983','081009 fly agaric','gallery','http://www2.clikpic.com/fungilad/images/081009 fly agaric.jpg',436,500,'','http://www2.clikpic.com/fungilad/images/081009 fly agaric_thumb.jpg',113, 130,0, 0,'Fly Agaric fungi','','','','','');
photos[29] = new photo(2983370,'168983','081011 fungi','gallery','http://www2.clikpic.com/fungilad/images/081011 fungi.jpg',406,500,'','http://www2.clikpic.com/fungilad/images/081011 fungi_thumb.jpg',106, 130,0, 0,'Fly Agaric fungi','','','','','');
photos[30] = new photo(2985690,'168983','080920 spider and ladybird','gallery','http://www2.clikpic.com/fungilad/images/080920 spider and ladybird.jpg',375,500,'','http://www2.clikpic.com/fungilad/images/080920 spider and ladybird_thumb.jpg',98, 130,0, 0,'Common garden spider, Araneus diadematus. Dragging off a live Harlequin ladybird, Harmonia axyridis with a squirt of sticky web.','','','','','');
photos[31] = new photo(2741010,'168983','071122  fungi','gallery','http://www2.clikpic.com/fungilad/images/071122_russula_fungi.jpg',500,423,'','http://www2.clikpic.com/fungilad/images/071122_russula_fungi_thumb.jpg',130, 110,0, 0,'Woolly Milk Cap, Lactarius torminosus fungi','','','','','');
photos[32] = new photo(2983367,'168983','081001 dragonfly','gallery','http://www2.clikpic.com/fungilad/images/081001 dragonfly.jpg',369,500,'','http://www2.clikpic.com/fungilad/images/081001 dragonfly_thumb.jpg',96, 130,0, 0,'Southern hawker Dragonfly, Aeshna cyanea.','','','','','');
photos[33] = new photo(2741113,'168983','050935 rocks ','gallery','http://www2.clikpic.com/fungilad/images/050935_rocks.jpg',500,409,'','http://www2.clikpic.com/fungilad/images/050935_rocks_thumb.jpg',130, 106,0, 0,'Abstract rocks','','','','','');
photos[34] = new photo(2741067,'168983','050509 Juncus rushes','gallery','http://www2.clikpic.com/fungilad/images/050509_grass.jpg',500,351,'','http://www2.clikpic.com/fungilad/images/050509_grass_thumb.jpg',130, 91,0, 0,'Juncus rushes at Frensham Surrey','','','','','');
photos[35] = new photo(2715799,'168983','070936 Badger','gallery','http://www2.clikpic.com/fungilad/images/070936 badger meles meles.jpg',600,521,'','http://www2.clikpic.com/fungilad/images/070936 badger meles meles_thumb.jpg',130, 113,0, 0,'British Badger Meles Meles','','','','','');
photos[36] = new photo(2681537,'168983','060905 Oak Fungi','gallery','http://www2.clikpic.com/fungilad/images/060905_inonotus_dryadeus_fungi.jpg',600,410,'','http://www2.clikpic.com/fungilad/images/060905_inonotus_dryadeus_fungi_thumb.jpg',130, 89,0, 0,'Inonotus dryadeus bracket fungi growing on an Oak tree','','','','','');
photos[37] = new photo(2715659,'168983','080824 Frog','gallery','http://www2.clikpic.com/fungilad/images/080824 Common Frog, Rana temporaria 1.jpg',600,573,'','http://www2.clikpic.com/fungilad/images/080824 Common Frog, Rana temporaria 1_thumb.jpg',130, 124,0, 0,'Common Frog, Rana temporaria','','','','','');
photos[38] = new photo(2681527,'168983','060802 New growth','gallery','http://www2.clikpic.com/fungilad/images/060802_thursley_fire.jpg',520,600,'','http://www2.clikpic.com/fungilad/images/060802_thursley_fire_thumb.jpg',113, 130,0, 0,'New growth appears after a forest fire at Thursley, Surrey','','','','','');
photos[39] = new photo(2740050,'168983','Green shieldbug','gallery','http://www2.clikpic.com/fungilad/images/041206_shield_bug.jpg',500,347,'','http://www2.clikpic.com/fungilad/images/041206_shield_bug_thumb.jpg',130, 90,0, 0,'Palomena prasina, Green shieldbug','','','','','');
photos[40] = new photo(2677554,'168983','031008 Rainbow','gallery','http://www2.clikpic.com/fungilad/images/031008_rainbow.jpg',600,400,'','http://www2.clikpic.com/fungilad/images/031008_rainbow_thumb.jpg',130, 87,0, 0,'Couple admiring a double rainbow over Kent','','','','','');
photos[41] = new photo(2680175,'168976','080421 Temple','gallery','http://www2.clikpic.com/fungilad/images/080421_temple.jpg',600,594,'','http://www2.clikpic.com/fungilad/images/080421_temple_thumb.jpg',130, 129,0, 1,'Temple of Giunone, Valley of the Temples, Agrigento, Sicily.','','','','','');
photos[42] = new photo(2680187,'168976','080496 Fish stall','gallery','http://www2.clikpic.com/fungilad/images/080496_fish_market.jpg',600,561,'','http://www2.clikpic.com/fungilad/images/080496_fish_market_thumb.jpg',130, 122,0, 0,'The old fish market in at Ortygia, Sicily.','','','','','');
photos[43] = new photo(2680198,'168976','080440 Erice street','gallery','http://www2.clikpic.com/fungilad/images/080440_cobbled_street_erice.jpg',600,483,'','http://www2.clikpic.com/fungilad/images/080440_cobbled_street_erice_thumb.jpg',130, 105,0, 0,'Ancient cobblestone street in Erice, Sicily.','','','','','');
photos[44] = new photo(2680207,'168976','040805 Dune','gallery','http://www2.clikpic.com/fungilad/images/040805_dunes.jpg',600,519,'','http://www2.clikpic.com/fungilad/images/040805_dunes_thumb.jpg',130, 112,0, 0,'Sand dune in Fuerteventura','','','','','');
photos[45] = new photo(2681061,'168976','021101b Motorway','gallery','http://www2.clikpic.com/fungilad/images/021101b_a7spain.jpg',600,418,'','http://www2.clikpic.com/fungilad/images/021101b_a7spain_thumb.jpg',130, 91,0, 0,'The S shaped A7 motorway Spain','','','','','');
photos[46] = new photo(2681121,'168976','021107 Windmill','gallery','http://www2.clikpic.com/fungilad/images/021107_javea_windmill.jpg',459,600,'','http://www2.clikpic.com/fungilad/images/021107_javea_windmill_thumb.jpg',99, 130,0, 0,'Ancient windmill remains Javea Spain','','','','','');
photos[47] = new photo(2681198,'168976','040401c Old Boat','gallery','http://www2.clikpic.com/fungilad/images/040401c_boat.jpg',600,483,'','http://www2.clikpic.com/fungilad/images/040401c_boat_thumb.jpg',130, 105,0, 0,'Old fishing boat on Dungeness beach','','','','','');
photos[48] = new photo(2715866,'168976','080475 Shutter','gallery','http://www2.clikpic.com/fungilad/images/080475 window mozia Sicily.jpg',600,485,'','http://www2.clikpic.com/fungilad/images/080475 window mozia Sicily_thumb.jpg',130, 105,0, 0,'Rustic Sicilian window shutter','','','','','');
photos[49] = new photo(2715989,'168976','080458 Fisherman','gallery','http://www2.clikpic.com/fungilad/images/080458 cefalu fisherman.jpg',600,532,'','http://www2.clikpic.com/fungilad/images/080458 cefalu fisherman_thumb.jpg',130, 115,0, 0,'A Sicilian fisherman repairing his nets','','','','','');
photos[50] = new photo(2739522,'168976','080401 Sicilian grocer','gallery','http://www2.clikpic.com/fungilad/images/080401_sicilian_grocer.jpg',500,425,'','http://www2.clikpic.com/fungilad/images/080401_sicilian_grocer_thumb.jpg',130, 111,0, 0,'Sicilian Man selling his home produce','','','','','');
photos[51] = new photo(2739547,'168976','080421 Erice street','gallery','http://www2.clikpic.com/fungilad/images/080421_erice_cobbled_street.jpg',500,400,'','http://www2.clikpic.com/fungilad/images/080421_erice_cobbled_street_thumb.jpg',130, 104,0, 0,'Ancient cobbled street Erice, Sicily','','','','','');
photos[52] = new photo(2739636,'168976','040821 fuerteventura road','gallery','http://www2.clikpic.com/fungilad/images/040821_fuerteventura.jpg',500,425,'','http://www2.clikpic.com/fungilad/images/040821_fuerteventura_thumb.jpg',130, 111,0, 0,'Road winding through the Betancuria mountains Fuerteventura','','','','','');
photos[53] = new photo(2992220,'168976','080429a agrigento columns','gallery','http://www2.clikpic.com/fungilad/images/080429a agrigento columns.jpg',488,600,'','http://www2.clikpic.com/fungilad/images/080429a agrigento columns_thumb.jpg',106, 130,0, 0,'agrigento columns','','','','','');
photos[54] = new photo(2992221,'168976','080454 Temple of Concord','gallery','http://www2.clikpic.com/fungilad/images/080454 Temple of Concord.jpg',600,456,'','http://www2.clikpic.com/fungilad/images/080454 Temple of Concord_thumb.jpg',130, 99,0, 0,'Temple of Concord, Agrigento, Sicily.','','','','','');
photos[55] = new photo(2674984,'168975','050507 Droplet','gallery','http://www2.clikpic.com/fungilad/images/050507_droplet.jpg',413,600,'','http://www2.clikpic.com/fungilad/images/050507_droplet_thumb.jpg',89, 130,0, 1,'Highly magnified droplet of water slipping off a blade of grass.','','','','','');
photos[56] = new photo(2675407,'168975','040902 Dahlia droplet','gallery','http://www2.clikpic.com/fungilad/images/040902_droplet_red.jpg',600,480,'','http://www2.clikpic.com/fungilad/images/040902_droplet_red_thumb.jpg',130, 104,0, 0,'Highly magnified droplet of water projecting an image of a red Dahlia flower.','','','','','');
photos[57] = new photo(2676475,'168975','041014 Droplets','gallery','http://www2.clikpic.com/fungilad/images/041014_pola_drops.jpg',600,396,'','http://www2.clikpic.com/fungilad/images/041014_pola_drops_thumb.jpg',130, 86,0, 0,'Water droplets coloured by cross polarized light','','','','','');
photos[58] = new photo(2680541,'168975','050701 Rosea Ice plant','gallery','http://www2.clikpic.com/fungilad/images/050701_Drosanthemum_Hispidum.jpg',435,600,'','http://www2.clikpic.com/fungilad/images/050701_Drosanthemum_Hispidum_thumb.jpg',94, 130,0, 0,'Highly magnified Rosea Ice plant, Drosanthemum Hispidum','','','','','');
photos[59] = new photo(2680574,'168975','050640 Seedling','gallery','http://www2.clikpic.com/fungilad/images/050640_Goats_beard .jpg',600,395,'','http://www2.clikpic.com/fungilad/images/050640_Goats_beard _thumb.jpg',130, 86,0, 0,'Goats beard seedling, Tragopogon pratensis','','','','','');
photos[60] = new photo(2681545,'168975','061002 Fly Agaric','gallery','http://www2.clikpic.com/fungilad/images/061002_fly_agaric.jpg',600,410,'','http://www2.clikpic.com/fungilad/images/061002_fly_agaric_thumb.jpg',130, 89,0, 0,'The Fly Agaric toadstool, Amanita muscaria','','','','','');
photos[61] = new photo(2681569,'168975','070501 Allium','gallery','http://www2.clikpic.com/fungilad/images/070501_allium_flower.jpg',600,423,'','http://www2.clikpic.com/fungilad/images/070501_allium_flower_thumb.jpg',130, 92,0, 0,'Close up of an Allium Flower','','','','','');
photos[62] = new photo(2739839,'168975','040502 Chilean Potato Tree','gallery','http://www2.clikpic.com/fungilad/images/040502_mexican_potato_plant.jpg',500,453,'','http://www2.clikpic.com/fungilad/images/040502_mexican_potato_plant_thumb.jpg',130, 118,0, 0,'Highly magnified Chilean Potato Tree flower, Solanum crispum Glasnevin','','','','','');
photos[63] = new photo(2739976,'168975','040512 Alpine Saxifraga','gallery','http://www2.clikpic.com/fungilad/images/040512_Alpine_Saxifraga.jpg',500,331,'','http://www2.clikpic.com/fungilad/images/040512_Alpine_Saxifraga_thumb.jpg',130, 86,0, 0,'Highly magnified Pink Alpine Saxifraga flower','','','','','');
photos[64] = new photo(2740775,'168975','071017 fungi ','gallery','http://www2.clikpic.com/fungilad/images/071017_coprinus_lagopus_fungi .jpg',372,500,'','http://www2.clikpic.com/fungilad/images/071017_coprinus_lagopus_fungi _thumb.jpg',97, 130,0, 0,'fungi coprinus lagopus','','','','','');
photos[65] = new photo(2989262,'168975','051009 passion flower','gallery','http://www2.clikpic.com/fungilad/images/051009 passion flower .jpg',600,437,'','http://www2.clikpic.com/fungilad/images/051009 passion flower _thumb.jpg',130, 95,0, 0,'passion flower','','','','','');
photos[66] = new photo(2674599,'168975','071018 Sycamore seed','gallery','http://www2.clikpic.com/fungilad/images/071018_sycamore_seed.jpg',600,448,'','http://www2.clikpic.com/fungilad/images/071018_sycamore_seed_thumb.jpg',130, 97,0, 0,'Sycamore seed on wet grass','','','','','');
photos[67] = new photo(2670740,'168923','080208 Ultra modern architecture','gallery','http://www2.clikpic.com/fungilad/images/080208_croydon_architecture.jpg',600,411,'','http://www2.clikpic.com/fungilad/images/080208_croydon_architecture_thumb.jpg',130, 89,0, 1,'Abstract looking ultra modern architecture, Croydon','','','','','');
photos[68] = new photo(2670935,'168923','080807 concrete architecture ','gallery','http://www2.clikpic.com/fungilad/images/080807_southbank.jpg',600,487,'','http://www2.clikpic.com/fungilad/images/080807_southbank_thumb.jpg',130, 106,0, 0,'Part of the symmetrical concrete architecture of the National Theatre, London.','','','','','');
photos[69] = new photo(2671010,'168923','080731b QE2 Bridge','gallery','http://www2.clikpic.com/fungilad/images/080731b_qe2_bridge1.jpg',600,390,'','http://www2.clikpic.com/fungilad/images/080731b_qe2_bridge1_thumb.jpg',130, 85,0, 0,'Queen Elizabeth Bridge crossing the river Thames at dawn.','','','','','');
photos[70] = new photo(2680495,'168923','080632 Spiral architecture','gallery','http://www2.clikpic.com/fungilad/images/080632_oracle_car_park.jpg',433,600,'','http://www2.clikpic.com/fungilad/images/080632_oracle_car_park_thumb.jpg',94, 130,0, 0,'The spiral of a car park ramp','','','','','');
photos[71] = new photo(2680298,'168923','080121 Art Deco pier','gallery','http://www2.clikpic.com/fungilad/images/080121_worthing_pier.jpg',600,487,'','http://www2.clikpic.com/fungilad/images/080121_worthing_pier_thumb.jpg',130, 106,0, 0,'Art Deco style structure on Worthing Pier.','','','','','');
photos[72] = new photo(2739302,'168923','080209 Ultra modern architecture','gallery','http://www2.clikpic.com/fungilad/images/080209_croydon_architecture.jpg',500,400,'','http://www2.clikpic.com/fungilad/images/080209_croydon_architecture_thumb.jpg',130, 104,0, 0,'Ultra modern architecture In Croydon','','','','','');
photos[73] = new photo(2739357,'168923','080829 Roof structure','gallery','http://www2.clikpic.com/fungilad/images/080829_stansted_airport.jpg',431,500,'','http://www2.clikpic.com/fungilad/images/080829_stansted_airport_thumb.jpg',112, 130,0, 0,'Stansted airport roof structure','','','','','');
photos[74] = new photo(2740273,'168923','070722 Cardinal House ','gallery','http://www2.clikpic.com/fungilad/images/070722_Cardinal_House.jpg',385,500,'','http://www2.clikpic.com/fungilad/images/070722_Cardinal_House_thumb.jpg',100, 130,0, 0,'Cardinal House Architecture, London','','','','','');
photos[75] = new photo(2740626,'168923','070776 Hammersmith bridge','gallery','http://www2.clikpic.com/fungilad/images/070776_hammersmith_bridge.jpg',500,495,'','http://www2.clikpic.com/fungilad/images/070776_hammersmith_bridge_thumb.jpg',130, 129,0, 0,'Hammersmith bridge','','','','','');
photos[76] = new photo(2739376,'168923','080830 stansted airport abstract','gallery','http://www2.clikpic.com/fungilad/images/080830_stansted_airport_abstract.jpg',500,472,'','http://www2.clikpic.com/fungilad/images/080830_stansted_airport_abstract_thumb.jpg',130, 123,0, 0,'Stansted airport roof abstract','','','','','');
photos[77] = new photo(2739406,'168923','080122 Worthing pier','gallery','http://www2.clikpic.com/fungilad/images/080122_worthing_pier.jpg',500,440,'','http://www2.clikpic.com/fungilad/images/080122_worthing_pier_thumb.jpg',130, 114,0, 0,'Art Deco style Pier worthing','','','','','');
photos[78] = new photo(2740744,'168923','071209 Orange building','gallery','http://www2.clikpic.com/fungilad/images/071209_orange_building.jpg',500,360,'','http://www2.clikpic.com/fungilad/images/071209_orange_building_thumb.jpg',130, 94,0, 0,'Modern housing in Newington, London','','','','','');
photos[79] = new photo(2680246,'168922','030501 Black face','gallery','http://www2.clikpic.com/fungilad/images/030501_black_face.jpg',450,600,'','http://www2.clikpic.com/fungilad/images/030501_black_face_thumb.jpg',98, 130,0, 1,'Young boy with a blacked up face','','','','','');
photos[80] = new photo(2671171,'168922','071275 Sparkler','gallery','http://www2.clikpic.com/fungilad/images/071275_sparklers.jpg',504,600,'','http://www2.clikpic.com/fungilad/images/071275_sparklers_thumb.jpg',109, 130,0, 0,'Boy having fun with a sparkler','','','','','');
photos[81] = new photo(2681155,'168922','00970803 Cool boy','gallery','http://www2.clikpic.com/fungilad/images/00970803_fisheye.jpg',577,600,'','http://www2.clikpic.com/fungilad/images/00970803_fisheye_thumb.jpg',125, 130,0, 0,'Cool looking dude in matching sunglasses and top','','','','','');
photos[82] = new photo(2674940,'168922','050409 Angry boy','gallery','http://www2.clikpic.com/fungilad/images/050409_Muddy_sam.jpg',577,600,'','http://www2.clikpic.com/fungilad/images/050409_Muddy_sam_thumb.jpg',125, 130,0, 0,'Muddy boy with angry face','','','','','');
photos[83] = new photo(2681165,'168922','00980801b Jouster','gallery','http://www2.clikpic.com/fungilad/images/00980801b_jouster.jpg',416,600,'','http://www2.clikpic.com/fungilad/images/00980801b_jouster_thumb.jpg',90, 130,0, 0,'Jouster on horseback leaving Hever castle','','','','','');
photos[84] = new photo(2680250,'168922','071009 Jolly man','gallery','http://www2.clikpic.com/fungilad/images/071009_michael.jpg',600,596,'','http://www2.clikpic.com/fungilad/images/071009_michael_thumb.jpg',130, 129,0, 0,'Jolly man outside Croydon Town Hall.','','','','','');
photos[85] = new photo(2681142,'168922','00930601 Beer baby','gallery','http://www2.clikpic.com/fungilad/images/00930601_baby_beer.jpg',463,600,'','http://www2.clikpic.com/fungilad/images/00930601_baby_beer_thumb.jpg',100, 130,0, 0,'Baby trying to drink from an empty beer bottle','','','','','');
photos[86] = new photo(2680261,'168922','071206 Gravedigger','gallery','http://www2.clikpic.com/fungilad/images/071206_gravedigger.jpg',563,600,'','http://www2.clikpic.com/fungilad/images/071206_gravedigger_thumb.jpg',122, 130,0, 0,'Gravedigger at work','','','','','');
photos[87] = new photo(2680264,'168922','080117 Three women','gallery','http://www2.clikpic.com/fungilad/images/080117_worthing_ladies.jpg',600,548,'','http://www2.clikpic.com/fungilad/images/080117_worthing_ladies_thumb.jpg',130, 119,0, 0,'Three elderly women take the air on Worthing Pier.','','','','','');
photos[88] = new photo(2740705,'168922','071005 croydon man','gallery','http://www2.clikpic.com/fungilad/images/071005_croydon_man.jpg',500,407,'','http://www2.clikpic.com/fungilad/images/071005_croydon_man_thumb.jpg',130, 106,0, 0,'Portrait of a Street man','','','','','');
photos[89] = new photo(2740690,'168922','070935b pilot','gallery','http://www2.clikpic.com/fungilad/images/070935b_spitfire_pilot.jpg',500,346,'','http://www2.clikpic.com/fungilad/images/070935b_spitfire_pilot_thumb.jpg',130, 90,0, 0,'Spitfire pilot','','','','','');
photos[90] = new photo(2740464,'168922','070745b skim board','gallery','http://www2.clikpic.com/fungilad/images/070745b_skim_board.jpg',500,408,'','http://www2.clikpic.com/fungilad/images/070745b_skim_board_thumb.jpg',130, 106,0, 0,'Boy on a skim Board','','','','','');
photos[91] = new photo(2741212,'169105','061106 Fireworks','gallery','http://www2.clikpic.com/fungilad/images/061106_fireworks.jpg',500,452,'','http://www2.clikpic.com/fungilad/images/061106_fireworks_thumb.jpg',130, 118,0, 0,'Fireworks abstract','','','','','');
photos[92] = new photo(2677685,'169105','00790000 Fireworks','gallery','http://www2.clikpic.com/fungilad/images/00790000_firework1.jpg',394,600,'','http://www2.clikpic.com/fungilad/images/00790000_firework1_thumb.jpg',85, 130,0, 0,'Burst of red Fireworks','','','','','');
photos[93] = new photo(2680490,'169105','080730 Lavender harvest','gallery','http://www2.clikpic.com/fungilad/images/080730_lavender_harvest.jpg',584,600,'','http://www2.clikpic.com/fungilad/images/080730_lavender_harvest_thumb.jpg',127, 130,0, 0,'Lavender being harvested, Shoreham, Kent','','','','','');
photos[94] = new photo(2681415,'169105','050613 Abstract shack','gallery','http://www2.clikpic.com/fungilad/images/050613_broken_shed .jpg',600,483,'','http://www2.clikpic.com/fungilad/images/050613_broken_shed _thumb.jpg',130, 105,0, 0,'Abstract image of a collapsed shack','','','','','');
photos[95] = new photo(2680503,'169105','080625 Salt bin','gallery','http://www2.clikpic.com/fungilad/images/080625_yellow_bin.jpg',453,600,'','http://www2.clikpic.com/fungilad/images/080625_yellow_bin_thumb.jpg',98, 130,0, 0,'Yellow salt bin','','','','','');
photos[96] = new photo(2680498,'169105','080629 Figure','gallery','http://www2.clikpic.com/fungilad/images/080629_walkway.jpg',556,600,'','http://www2.clikpic.com/fungilad/images/080629_walkway_thumb.jpg',120, 130,0, 0,'Human figure painted on a walkway','','','','','');
photos[97] = new photo(2681499,'169105','051107 The leas seafront','gallery','http://www2.clikpic.com/fungilad/images/051107_the_leas.jpg',600,503,'','http://www2.clikpic.com/fungilad/images/051107_the_leas_thumb.jpg',130, 109,0, 0,'Couple walking along the seafront in winter, The leas, Folkstone','','','','','');
photos[98] = new photo(2681560,'169105','070311 Tomato','gallery','http://www2.clikpic.com/fungilad/images/070311_tom.jpg',600,413,'','http://www2.clikpic.com/fungilad/images/070311_tom_thumb.jpg',130, 89,0, 0,'Tomato','','','','','');
photos[99] = new photo(2739499,'169105','080302 traffic cone','gallery','http://www2.clikpic.com/fungilad/images/080302_traffic_cone.jpg',500,444,'','http://www2.clikpic.com/fungilad/images/080302_traffic_cone_thumb.jpg',130, 115,0, 0,'Orange traffic cone','','','','','');
photos[100] = new photo(2985702,'169105','00980902b dragsters','gallery','http://www2.clikpic.com/fungilad/images/00980902b dragsters.jpg',500,305,'','http://www2.clikpic.com/fungilad/images/00980902b dragsters_thumb.jpg',130, 79,0, 0,'Top fuel dragsters','','','','','');
photos[101] = new photo(2992213,'169105','070815 Hastings fishing boat','gallery','http://www2.clikpic.com/fungilad/images/070815 hastings fishing boat .jpg',600,522,'','http://www2.clikpic.com/fungilad/images/070815 hastings fishing boat _thumb.jpg',130, 113,0, 0,'hastings fishing boat','','','','','');
photos[102] = new photo(2992215,'169105','070917 tilford cricket','gallery','http://www2.clikpic.com/fungilad/images/070917 tilford cricket.jpg',600,453,'','http://www2.clikpic.com/fungilad/images/070917 tilford cricket_thumb.jpg',130, 98,0, 0,'Village cricket at Tilford Surrey.','','','','','');
photos[103] = new photo(2992216,'169105','071027 croydon sliproad','gallery','http://www2.clikpic.com/fungilad/images/071027 croydon sliproad.jpg',600,580,'','http://www2.clikpic.com/fungilad/images/071027 croydon sliproad_thumb.jpg',130, 126,0, 0,'Sliproad','','','','','');
photos[104] = new photo(2992217,'169105','071128 fireworks','gallery','http://www2.clikpic.com/fungilad/images/071128 fireworks.jpg',519,600,'','http://www2.clikpic.com/fungilad/images/071128 fireworks_thumb.jpg',112, 130,0, 0,'Fireworks over lake','','','','','');
photos[105] = new photo(2992218,'169105','080222 gate','gallery','http://www2.clikpic.com/fungilad/images/080222 thames gate.jpg',600,512,'','http://www2.clikpic.com/fungilad/images/080222 thames gate_thumb.jpg',130, 111,0, 0,'galvanized gate','','','','','');
photos[106] = new photo(2992236,'169105','080499n cefalu steps','gallery','http://www2.clikpic.com/fungilad/images/080499n cefalu steps.jpg',600,497,'','http://www2.clikpic.com/fungilad/images/080499n cefalu steps_thumb.jpg',130, 108,0, 0,'Dark Sicilian staircase','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(169114,'2675385,2675310','Landscapes','gallery');
galleries[1] = new gallery(168983,'2983126','Natural History & Nature','gallery');
galleries[2] = new gallery(168976,'2680175','Travel','gallery');
galleries[3] = new gallery(168975,'2674984','Hidden worlds','gallery');
galleries[4] = new gallery(168923,'2670740','Architecture','gallery');
galleries[5] = new gallery(168922,'2680246','People','gallery');
galleries[6] = new gallery(169105,'2992236,2992218,2992217,2992216,2992215,2992213,2985702,2741212,2739499,2681560','Miscellaneous','gallery');

