/***************************************************************************
* 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('571844,444682,444681,444680,403239,403191,403185,403181,175200,135492,135486,89250,87729,87727,87725,43929,43926,26441,26307,26304,26201,26200,26199,26197,26106,26104,26102,26101,26100,26099,26098,26096,26094,26089,26087,26084,26081,26078,26076,26073');
	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('571844,444682,444681,444680,403239,403191,403185,403181,175200,135492,135486,89250,87729,87727,87725,43929,43926,26441,26307,26304,26201,26200,26199,26197,26106,26104,26102,26101,26100,26099,26098,26096,26094,26089,26087,26084,26081,26078,26076,26073');
	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)) {
		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 + '" border="0">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = 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(26197,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Harajuku Girl small.jpg',400,602,'Harajuku Girl','http://www1.clikpic.com/idmurphy/images/Harajuku Girl small_thumb.jpg',130, 196,1, 1,'Harajuku is Tokyo\'s teenager town, a shopping and entertainment district for the young and trendy. Many small stores, boutiques, restaurants and cafes can be found in the area. It is located in Shibuya-ku, north of the Shibuya shopping district and just next to the entrance of the Meiji Shrine and Yoyogi Park. On Sundays teenagers come here to pose and be seen.','','','Harajuku, Tokyo, Japan','','');
photos[1] = new photo(26084,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Imperial Palace East 3001.jpg',266,400,'Moats and walls around the Imperial Palace, Tokyo','http://www1.clikpic.com/idmurphy/images/Imperial Palace East 3001_thumb.jpg',130, 195,1, 1,'The current Imperial Palace (Kokyo) is located on the former site of Edo Castle, a large park area surrounded by moats and massive stone walls in the center of Tokyo, a short walk from Tokyo station. It is the residence of Japan\'s Imperial Family. ','','','Tokyo, Japan','','');
photos[2] = new photo(179178,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Imperial Palace East B&W small.jpg',400,602,'Moats and walls around the Imperial Palace, Tokyo','http://www1.clikpic.com/idmurphy/images/Imperial Palace East B&W small_thumb.jpg',130, 196,0, 1,'The current Imperial Palace (Kokyo) is located on the former site of Edo Castle, a large park area surrounded by moats and massive stone walls in the center of Tokyo, a short walk from Tokyo station. It is the residence of Japan\'s Imperial Family. ','','','Tokyo, Japan','','');
photos[3] = new photo(26099,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Miyajima Torii portrait001.jpg',320,400,'Torii of the Itsukushima Shrine, Miyajima','http://www1.clikpic.com/idmurphy/images/Miyajima Torii portrait001_thumb.jpg',130, 163,1, 1,'Miyajima (literally \"shrine island\") has been celebrated as a sacred island and one of Japan\'s three most scenic views. It is most famous for Itsukushima Shrine, which, together with its large wooden torii (gate), stands in the ocean during high tide.','','','Miyajima, Japan','','');
photos[4] = new photo(26073,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Great Buddha001.jpg',266,400,'Great Buddha of Kamakura','http://www1.clikpic.com/idmurphy/images/Great Buddha001_thumb.jpg',130, 195,1, 1,'The Great Buddha of Kamakura is a bronze statue of Amida Buddha that is located on the grounds of the Kotokuin Temple. With a height of 13.35 meters, it is the second largest Buddha statue in Japan (the largest is located in the Todaiji Temple in Nara). <br>\nThe statue was cast in 1252 and originally located inside a large temple hall. However, the temple buildings were washed away by a tsunami tidal wave in the end of the 15th century, and since then the Buddha stands in the open air. <br>\n','','','Kamakura, Japan','','');
photos[5] = new photo(26100,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Himeji castle portrait 2001.jpg',266,400,'Himeji Castle, Japan','http://www1.clikpic.com/idmurphy/images/Himeji castle portrait 2001_thumb.jpg',130, 195,1, 1,'Himeji Castle is widely considered Japan\'s most spectacular castle. Unlike many other Japanese castles, Himeji Castle was never destroyed in wars, earthquakes or fires and survives in its original form. It is both, a national treasure and a UNESCO world heritage site. <br><br>\nIn the 14th century, a fort was first built on the current castle site. Over the centuries, the various clans, who ruled over the region, gradually enlarged it. The castle complex, as it survives today, was completed in 1609. <br>\n','','','Himeji, Japan','','');
photos[6] = new photo(26441,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Himeji castle section small1.jpg',400,602,'Himeji Castle section','http://www1.clikpic.com/idmurphy/images/Himeji castle section small1_thumb.jpg',130, 196,1, 1,'Himeji Castle is widely considered Japan\'s most spectacular castle. Unlike many other Japanese castles, Himeji Castle was never destroyed in wars, earthquakes or fires and survives in its original form. It is both, a national treasure and a UNESCO world heritage site. <br><br>\nIn the 14th century, a fort was first built on the current castle site. Over the centuries, the various clans, who ruled over the region, gradually enlarged it. The castle complex, as it survives today, was completed in 1609.','','','Himeji, Japan','','');
photos[7] = new photo(26104,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Nijo-bashi bridge imperial palace portrait001.jpg',266,400,'Imperial Palace, Tokyo','http://www1.clikpic.com/idmurphy/images/Nijo-bashi bridge imperial palace portrait001_thumb.jpg',130, 195,1, 1,'From Koyo Gaien, the large plaza in front of the Imperial Palace, visitors can view the Nijubashi, two bridges that form an entrance to the inner palace grounds. The stone bridge in front is called Meganebashi (Eyeglass Bridge) for its looks. The bridge in the back was formerly a wooden bridge with two levels, from which the name Nijubashi (Double Bridge) is derived. ','','','Tokyo, Japan','','');
photos[8] = new photo(26098,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Golden Pavilion Kyoto, Portrait001.jpg',320,400,'Kinkakuji (Golden Pavilion) in Kyoto. <br>\n','http://www1.clikpic.com/idmurphy/images/Golden Pavilion Kyoto, Portrait001_thumb.jpg',130, 163,1, 1,'Kinkakuji (Golden Pavilion) is a Zen temple formally known as Rokuonji. <br><br>\nIn 1397 construction started on the Golden Pavilion as part of a new residence for the retired shogun Ashikaga Yoshimitsu. Kinkakuji was converted into a Zen temple after Yoshimitsu\'s death in 1408. <br><br>\nThe Golden Pavilion functions as shariden, housing sacred relics of the Buddha and is covered in gold leaf. The present building dates from 1955 as the pavilion was burnt by a fanatic monk in 1950. ','','','Kyoto','','');
photos[9] = new photo(26081,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Maikos in Kyoto001.jpg',343,400,'Two maikos on the Path of Philosophy in Kyoto','http://www1.clikpic.com/idmurphy/images/Maikos in Kyoto001_thumb.jpg',130, 152,1, 1,'Geisha are professional female entertainers who perform traditional Japanese arts at banquets. <br>\nGirls who wish to become a geisha, have to go through a rigorous apprenticeship during which they learn various traditional arts such as playing musical instruments, singing, dancing, but also conversation and other social skills. In Kyoto, geisha apprentices are called \"maiko\". <br><br>\nGeisha dress in traditional kimonos, and their faces are made up very pale. <br>\n','','','','','');
photos[10] = new photo(26106,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Rickshaw driver at rest001.jpg',249,400,'Rickshaw puller, Miyajima','http://www1.clikpic.com/idmurphy/images/Rickshaw driver at rest001_thumb.jpg',130, 209,1, 1,'','','','Miyajima, Japan','','');
photos[11] = new photo(26101,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Imperial palace east 2001.jpg',266,400,'Imperial Palace, Tokyo, Japan','http://www1.clikpic.com/idmurphy/images/Imperial palace east 2001_thumb.jpg',130, 195,1, 1,'The current Imperial Palace (Kokyo) is located on the former site of Edo Castle, a large park area surrounded by moats and massive stone walls in the center of Tokyo, a short walk from Tokyo station. It is the residence of Japan\'s Imperial Family. ','','','Tokyo, Japan','','');
photos[12] = new photo(26096,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Japanese wedding party 2001.jpg',279,400,'Japanese wedding party','http://www1.clikpic.com/idmurphy/images/Japanese wedding party 2001_thumb.jpg',130, 186,1, 1,'Taken at the Meiji shrine in Tokyo this picture features a bride and groom and wedding party in traditional costume.','','','Meiji Shrine, Tokyo','','');
photos[13] = new photo(26304,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Stair hand rails Miyajima small.jpg',400,266,'Prayer wheel handrail, Daisho-in temple, Miyajima','http://www1.clikpic.com/idmurphy/images/Stair hand rails Miyajima small_thumb.jpg',130, 86,1, 1,'Miyajima (literally \"shrine island\") has been celebrated as a sacred island and one of Japan\'s three most scenic views. It is most famous for Itsukushima Shrine, which, together with its large wooden torii (gate), stands in the ocean during high tide. Daisho-in is a beautifully situated temple at the foot of the wooded hill \"Misen\", whose summit can be reached by a hiking trail that commences at the temple. ','','','Miyajima, Japan','','');
photos[14] = new photo(26078,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Himeji castle landscapejpg.jpg',400,266,'Himeji Castle, Japan','http://www1.clikpic.com/idmurphy/images/Himeji castle landscapejpg_thumb.jpg',130, 86,1, 1,'Himeji Castle is widely considered Japan\'s most spectacular castle. Unlike many other Japanese castles, Himeji Castle was never destroyed in wars, earthquakes or fires and survives in its original form. It is both, a national treasure and a UNESCO world heritage site. <br><br>\nIn the 14th century, a fort was first built on the current castle site. Over the centuries, the various clans, who ruled over the region, gradually enlarged it. The castle complex, as it survives today, was completed in 1609. <br><br>\n','','','Himeji, Japan','','');
photos[15] = new photo(26105,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Three Monkeys at Nikkojpg.jpg',400,173,'Carving showing the original three monkeys at Toshogu Shrine, Nikko','http://www1.clikpic.com/idmurphy/images/Three Monkeys at Nikkojpg_thumb.jpg',130, 56,0, 0,'The Toshogu is the mausoleum of Tokugawa Ieyasu, founder of the Tokugawa shogunate, which ruled Japan for over 250 years until 1868. The shrine is dedicated to the spirits of Ieyasu and two other of Japan\'s most influential historical personalities, Toyotomi Hideyoshi and Minamoto Yoritomo. Carvings include the original \"See No Evil, Hear No Evil, Speak No Evil\" monkeys','','','Nikko, Japan','','');
photos[16] = new photo(26076,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Hiroshima Portjpg.jpg',400,266,'Boat returning to port in Hiroshima at sunset','http://www1.clikpic.com/idmurphy/images/Hiroshima Portjpg_thumb.jpg',130, 86,1, 1,'Taken from near to the Hiroshima Prince Hotel at Motoujina Park this image looks out toward the picturesque islands that dot the Seto Inland Sea.','','','Hiroshima, Japan','','');
photos[17] = new photo(26094,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Hiroshima A-Bomb Domejpg.jpg',400,266,'Hiroshima A-Bomb Dome','http://www1.clikpic.com/idmurphy/images/Hiroshima A-Bomb Domejpg_thumb.jpg',130, 86,1, 1,'On August 6, 1945, the city of Hiroshima was the target of the first atomic bomb used against civil population in history. Three days later, the United States dropped a second atomic bomb over the city of Nagasaki. In total, about one quarter of a million people were killed by the two bombs. <br><br>\nToday, Hiroshima, Nagasaki, and the country of Japan are strongly engaged in banning nuclear weapons and their testing worldwide. <br>\n','','','Hiroshima, Japan','','');
photos[18] = new photo(26102,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Golden Pavilion Landscapejpg.jpg',400,266,'Kinkakuji (Golden Pavilion), Kyoto','http://www1.clikpic.com/idmurphy/images/Golden Pavilion Landscapejpg_thumb.jpg',130, 86,1, 1,'Kinkakuji (Golden Pavilion) is a Zen temple formally known as Rokuonji. <br><br>\nIn 1397 construction started on the Golden Pavilion as part of a new residence for the retired shogun Ashikaga Yoshimitsu. Kinkakuji was converted into a Zen temple after Yoshimitsu\'s death in 1408. <br><br>\nThe Golden Pavilion functions as shariden, housing sacred relics of the Buddha and is covered in gold leaf. The present building dates from 1955 as the pavilion was burnt by a fanatic monk in 1950. ','','','Kyoto, Japan','','');
photos[19] = new photo(26307,'2992','','gallery','http://www1.clikpic.com/idmurphy/images/Niju-bashi bridge landscape small.jpg',400,266,'Nijubashi bridge, Imperial Palace, Tokyo','http://www1.clikpic.com/idmurphy/images/Niju-bashi bridge landscape small_thumb.jpg',130, 86,1, 1,'From Koyo Gaien, the large plaza in front of the Imperial Palace, visitors can view the Nijubashi, two bridges that form an entrance to the inner palace grounds. The stone bridge in front is called Meganebashi (Eyeglass Bridge) for its looks. The bridge in the back was formerly a wooden bridge with two levels, from which the name Nijubashi (Double Bridge) is derived. ','','','','','');
photos[20] = new photo(175200,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Reflections Kirkwall small.jpg',400,266,'Reflections, Kirkwall Harbour','http://www1.clikpic.com/idmurphy/images/Reflections Kirkwall small_thumb.jpg',130, 86,1, 1,'This impressionistic image captures the reflections of some fishing boats in Kirkwall Harbour, Orkney.<br>\nThis image is available as a limited-edition mounted and framed A2 print. The prints are made using the Lambda Print technology, which combines the best of digital and traditional imaging. Basically, the high-resolution digital files are written onto photographic paper using coloured lasers. The result is a print with excellent, continuous tone, sharpness and detail that surpasses most traditional (wet darkroom) prints.<br>\nThere are only five of these available, at a price of £165 each.','','','Kirkwall, Orkney','','');
photos[21] = new photo(444682,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Westray Beaches013.jpg',400,284,'Grobust Beach in the Evening Sun','http://www1.clikpic.com/idmurphy/images/Westray Beaches013_thumb.jpg',130, 92,1, 1,'This shot is taken from Grobust beach in the attractive light of the evening sun.','','','Westray, Orkney','','');
photos[22] = new photo(444680,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/ Summer rose at Dawn.jpg',400,292,'\"Summer Rose\" at Dawn','http://www1.clikpic.com/idmurphy/images/ Summer rose at Dawn_thumb.jpg',130, 95,1, 1,'The small vessel \"Summer Rose\" sits just on the land at Pierowall Bay, and is used as a small shelter and studio by visiting artists. This shot was taken just as the sun rose above the horizon at dawn.','','','Westray, Orkney','','');
photos[23] = new photo(43926,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Pierowall Sunset 1001.jpg',400,266,'Sunset over Pierowall, Westray','http://www1.clikpic.com/idmurphy/images/Pierowall Sunset 1001_thumb.jpg',130, 86,1, 1,'Pierowall is the main village on Westray. This sunset was captured in July 2005. No filters or manipulation were applied.','','Ian Murphy','Westray, Orkney','','');
photos[24] = new photo(89250,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Pierowall Sunset panorama small.jpg',400,173,'Sunset over Pierowall Bay panoramic','http://www1.clikpic.com/idmurphy/images/Pierowall Sunset panorama small_thumb.jpg',130, 56,1, 1,'This spectacular sunset was captured in Westray in Summer 2005. This picture has not been manipulated, the colours really were this spectacular.','','','Westray, Orkney','','');
photos[25] = new photo(445657,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Portree Reflections edited.jpg',400,256,'Portree Reflections','http://www1.clikpic.com/idmurphy/images/Portree Reflections edited_thumb.jpg',130, 83,0, 0,'Portree is the main town on the Isle of Skye and this shot shows some boats and houses at the shore reflected in the water.','','','Portree, Skye','','');
photos[26] = new photo(26087,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/DSC_3277jpg.jpg',400,266,'Rainbow over Loch Dunvegan, Skye','http://www1.clikpic.com/idmurphy/images/DSC_3277jpg_thumb.jpg',130, 86,1, 1,'A small hamlet on the western shore of Loch Dunvegan, on the beautiful island of Skye, off the West coast of Scotland. Skinidin lies 2 miles (3 km) west of Dunvegan, and is also worth visiting for the nearby \"Three Chimneys\" restaurant, one of the nicest in Scotland.','','','Skinidin, Skye','','');
photos[27] = new photo(26199,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Skye Heron reflected small.jpg',400,264,'A heron on Dunvegan Loch, Skye','http://www1.clikpic.com/idmurphy/images/Skye Heron reflected small_thumb.jpg',130, 86,1, 1,'Looking at Dunvegan today it is difficult to imagine it as a significant port. But in the 1890s it was a stopping off point for many of the steamers to the Western Isles, and it also had a daily service to Oban. The steamers departed in the 1950s, leaving a sheltered harbour frequented by yachtsmen. ','','','Dunvegan, Skye','','');
photos[28] = new photo(43959,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/DSC_5481001.jpg',400,266,'Flowers, Trenabie Mill conservatory, Pierowall, Westray','http://www1.clikpic.com/idmurphy/images/DSC_5481001_thumb.jpg',130, 86,0, 0,'','','','Westray, Orkney','','');
photos[29] = new photo(43955,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/DSC_5487001.jpg',400,266,'Flowers, Trenabie Mill conservatory, Westray','http://www1.clikpic.com/idmurphy/images/DSC_5487001_thumb.jpg',130, 86,0, 0,'','','','Pierowall, Westray, Orkney','','');
photos[30] = new photo(403191,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Noup Head sunset2.jpg',600,399,'Sunset at Noup Head','http://www1.clikpic.com/idmurphy/images/Noup Head sunset2_thumb.jpg',130, 86,1, 1,'Sunset at Noup Head Lighthouse, Westray, Orkney','','','','','');
photos[31] = new photo(43938,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Trenabie Mill001.jpg',400,266,'Trenabie Mill, Pierowall, Westray','http://www1.clikpic.com/idmurphy/images/Trenabie Mill001_thumb.jpg',130, 86,0, 0,'This attractive mill in beautiful landscaped grounds has been lovingly restored, and is now available to rent as self-catering holiday accommodation. See the Links page for details.','','','Pierowall, Westray. Orkney','','');
photos[32] = new photo(47391,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Moon over Scapa Flow small.jpg',400,262,'Moon over Scapa Flow at Dusk','http://www1.clikpic.com/idmurphy/images/Moon over Scapa Flow small_thumb.jpg',130, 85,0, 1,'This shot shows the moon reflecting the light of the sun at nightfall, in Orkney, looking out over Scapa Flow. Taken in low light this photograph has an almost \"impressionist\" feel to it. This was shot on film and the scanned image here does not do the picture full justice!','','','Braehead, Stromness, Orkney','','');
photos[33] = new photo(135486,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Cove Harbour B&W small.jpg',400,266,'Cove Harbour','http://www1.clikpic.com/idmurphy/images/Cove Harbour B&W small_thumb.jpg',130, 86,1, 1,'The natural harbour at Cove has been used by local fishermen since the early 1600s. <br>\nThe harbour one sees today was built in 1831. This involved the construction of a breakwater on the eastern side of the bay. The seaward side of the main harbour wall reveals the extent to which both it and the lower parts of the old cottages on it were sculpted from the natural rock as much as built upon it. The outer side of the harbour wall gives a strong sense of the power of the sea against which the harbour provides protection. The lower levels of the rock have been carved into remarkable patterns by the action of the waves. ','','','Cove Village, East Lothian, Scotland','','');
photos[34] = new photo(26089,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Bush House Mackerel Skyjpg.jpg',400,266,'Bush House in Midlothian','http://www1.clikpic.com/idmurphy/images/Bush House Mackerel Skyjpg_thumb.jpg',130, 86,1, 1,'Built in three stages starting in 1746 Bush House is an attractive country house within the Bush Estate, Midlothian, near to Edinburgh','','','Midlothian, ','','');
photos[35] = new photo(26200,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Balmoral Hotel from Gardens small.jpg',400,270,'The Balmoral Hotel, Edinburgh','http://www1.clikpic.com/idmurphy/images/Balmoral Hotel from Gardens small_thumb.jpg',130, 88,1, 1,'Located at the most prestigious address in Edinburgh, The Balmoral is recognised as one of the city’s leading hotels.','','','Edinburgh','','');
photos[36] = new photo(135492,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Skye Rainbow small.jpg',400,518,'Rainbow over Loch Dunvegan 2','http://www1.clikpic.com/idmurphy/images/Skye Rainbow small_thumb.jpg',130, 168,1, 1,'A small hamlet on the western shore of Loch Dunvegan, on the beautiful island of Skye, off the West coast of Scotland. Skinidin lies 2 miles (3 km) west of Dunvegan, and is also worth visiting for the nearby \"Three Chimneys\" restaurant, one of the nicest in Scotland.','','','Skinidin, Skye','','');
photos[37] = new photo(444681,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Noup Head from Grobust small.jpg',417,600,'Noup Head Lighthouse from Grobust Beach','http://www1.clikpic.com/idmurphy/images/Noup Head from Grobust small_thumb.jpg',130, 187,1, 1,'This shot shows the view from Grobust Beach looking around the coast to the Noup Head Lighthouse and RSPB Bird reserve. ','','','Westray, Orkney','','');
photos[38] = new photo(43948,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Kilnman\'s Cottage001.jpg',400,602,'Kilnman\'s Cottage, Pierowall, Westray','http://www1.clikpic.com/idmurphy/images/Kilnman\'s Cottage001_thumb.jpg',130, 196,0, 1,'This cottage adjacent to Trenabie Mill in Pierowall is now converted into an attractive self-catering holiday cottage.','','','Westray, Orkney','','');
photos[39] = new photo(403185,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Loch Morlich Dawn 3.jpg',600,399,'Loch Morlich at Dawn','http://www1.clikpic.com/idmurphy/images/Loch Morlich Dawn 3_thumb.jpg',130, 86,1, 1,'This shot was taken shortly after dawn at Loch Morlich, near Glenmore, with the Cairngorm Mountains in the background.','','','Near Aviemore, Scotland','','');
photos[40] = new photo(403186,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Loch Morlich Dawn 2.jpg',600,396,'Loch Morlich at Dawn 2','http://www1.clikpic.com/idmurphy/images/Loch Morlich Dawn 2_thumb.jpg',130, 86,0, 0,'This shot was taken shortly after dawn while mist still hung over the loch. A few minutes later the mist had blown off and the reflections disappeared.','','','','','');
photos[41] = new photo(403239,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Janet\'s Lochside Picture.jpg',600,413,'Loch Morlich at Dawn 3','http://www1.clikpic.com/idmurphy/images/Janet\'s Lochside Picture_thumb.jpg',130, 89,1, 1,'Taken shortly after dawn this view across the loch to the Cairngorms was beautiful and peaceful. The boats of the watersports centre can be seen on the loch surface.','','','','','');
photos[42] = new photo(43929,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Panoramic Noup Head Light at Twilight.jpg',600,238,'Noup Head Lighthouse, Orkney','http://www1.clikpic.com/idmurphy/images/Panoramic Noup Head Light at Twilight_thumb.jpg',130, 52,1, 1,'A Panorama of the sunset at Noup Head Westray, just as the light comes on','','','Westray, Orkney','','');
photos[43] = new photo(714856,'2994','','gallery','http://www1.clikpic.com/idmurphy/images/Loch Morlich Sunset 016.jpg',600,458,'Sunset at Loch Morlich','http://www1.clikpic.com/idmurphy/images/Loch Morlich Sunset 016_thumb.jpg',130, 99,0, 1,'This attractive sunset was captured at Loch Morlich, near the Cairngorms on my Bronica. The original file is about 100 Meg and can generate a very high quality print.','','Ian Murphy','Loch Morlich, Glenmore','','');
photos[44] = new photo(87725,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Louvre section small.jpg',400,576,'The Louvre, Paris','http://www1.clikpic.com/idmurphy/images/Louvre section small_thumb.jpg',130, 187,1, 1,'The Louvre Museum (Musée du Louvre) in Paris, France, is one of the largest and most famous museums in the world. The building, a former royal palace, lies in the centre of Paris, between the Seine river and the Rue de Rivoli. Its central courtyard, now occupied by the Louvre glass pyramid, lies in the axis of the Champs-Élysées, and thus forms the nucleus from which the Axe historique springs. Part of the royal Palace of the Louvre was first opened to the public as a museum on November 8, 1793, during the French Revolution. This small section of the famous gallery was taken from the bank of the Seine.','','','Paris','','');
photos[45] = new photo(87727,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Ile de la cite sepia small.jpg',400,203,'Ile de la Cité, Paris','http://www1.clikpic.com/idmurphy/images/Ile de la cite sepia small_thumb.jpg',130, 66,1, 1,'A picture of the Cité island surrounded by<br>\nwater. You can see the Pont-Neuf bridge<br>\n(New bridge) dating back to 1600, which despite its name is in fact the oldest in Paris.<br>\nThis shot was taken from the same viewpoint as the famous photograph by Henri Cartier-Bresson. The skyline remains remarkably similar, but one modern building has been digitally removed.','','','Ile de la Cité, Paris','','');
photos[46] = new photo(87729,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/L\'epicurien small.jpg',400,596,'A small bistro in the Montmartre area of Paris.','http://www1.clikpic.com/idmurphy/images/L\'epicurien small_thumb.jpg',130, 194,1, 1,'This is a typical Parisian bistro, in Montmarte.','','','Montmartre, Paris','','');
photos[47] = new photo(571766,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Charles-Bridge-Morning-shot.jpg',600,399,'Charles Bridge in the Early Morning','http://www1.clikpic.com/idmurphy/images/Charles-Bridge-Morning-shot_thumb.jpg',130, 86,0, 1,'','','Ian Murphy','Prague','','');
photos[48] = new photo(571838,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Prague Castle by Night.jpg',600,388,'Prague Castle by Night','http://www1.clikpic.com/idmurphy/images/Prague Castle by Night_thumb.jpg',130, 84,0, 1,'','','Ian Murphy','Prague','','');
photos[49] = new photo(571844,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Misty Morning Charles Bridge.jpg',600,399,'Misty Morning Charles Bridge','http://www1.clikpic.com/idmurphy/images/Misty Morning Charles Bridge_thumb.jpg',130, 86,1, 1,'This image was captured very early in the morning, just as the sun rose to clear the mist from the river.','','Ian Murphy','Prague','','');
photos[50] = new photo(571849,'8296','','gallery','http://www1.clikpic.com/idmurphy/images/Charles Bridge in the Morning.jpg',600,399,'Early morning Charles Bridge','http://www1.clikpic.com/idmurphy/images/Charles Bridge in the Morning_thumb.jpg',130, 86,0, 1,'','','','Prague','','');
photos[51] = new photo(71329,'6920','','gallery','http://www1.clikpic.com/idmurphy/images/Garlic small1.jpg',400,266,'Still Life with Garlic','http://www1.clikpic.com/idmurphy/images/Garlic small1_thumb.jpg',130, 86,0, 1,'This picture of garlic is intended for display in restaurants or kitchens.','','','','','');
photos[52] = new photo(99892,'6920','','gallery','http://www1.clikpic.com/idmurphy/images/Mushroom close-up.jpg',400,266,'Close-up of a mushroom','http://www1.clikpic.com/idmurphy/images/Mushroom close-up_thumb.jpg',130, 86,0, 1,'This close-up image of a mushroom is suitable for display in kitchens or restaurants.','','','','','');
photos[53] = new photo(99893,'6920','','gallery','http://www1.clikpic.com/idmurphy/images/Lime close up.jpg',400,266,'A juicy lime','http://www1.clikpic.com/idmurphy/images/Lime close up_thumb.jpg',130, 86,0, 1,'This close-up of a lime makes a vibrant contemporary image for display in kitchens or restaurants.','','','','','');
photos[54] = new photo(99894,'6920','','gallery','http://www1.clikpic.com/idmurphy/images/Orange close up.jpg',400,266,'A juicy orange','http://www1.clikpic.com/idmurphy/images/Orange close up_thumb.jpg',130, 86,0, 1,'This close-up picture of an orange makes a vibrant and contemporary image for display in kitchens or restaurants.','','','','','');
photos[55] = new photo(205965,'6920','','gallery','http://www1.clikpic.com/idmurphy/images/King\'s Ransom thumbnail1.jpg',400,266,'The King\'s Ransom','http://www1.clikpic.com/idmurphy/images/King\'s Ransom thumbnail1_thumb.jpg',130, 86,0, 1,'This image shows sterling pound coins and Scottish Banknotes.','','','','','');
photos[56] = new photo(26201,'3024','','gallery','http://www1.clikpic.com/idmurphy/images/Waterskier small.jpg',400,266,'Waterskier at the Scottish National Watersports Centre on Townhill Loch','http://www1.clikpic.com/idmurphy/images/Waterskier small_thumb.jpg',130, 86,1, 1,'Opened in 1992 by HRH Prince Edward, and supported by sportscotland, this purpose built Centre is located in the tranquil surroundings of Townhill Country Park near Dunfermline in Scotland. <br><br>\n','','','Dunfermline, Fife','','');
photos[57] = new photo(26433,'3024','','gallery','http://www1.clikpic.com/idmurphy/images/Waterskier 2 small.jpg',400,213,'Waterskier at the Scottish National Watersports Centre on Townhill Loch ','http://www1.clikpic.com/idmurphy/images/Waterskier 2 small_thumb.jpg',130, 69,0, 0,'Opened in 1992 by HRH Prince Edward, and supported by sportscotland, this purpose built Centre is located in the tranquil surroundings of Townhill Country Park near Dunfermline in Scotland. <br>\n','','','Dunfermline, Fife','','');
photos[58] = new photo(403181,'32424','','gallery','http://www1.clikpic.com/idmurphy/images/Puffin Headshot.jpg',600,399,'A puffin taken at Castle o\' Burrian, Westray, Orkney','http://www1.clikpic.com/idmurphy/images/Puffin Headshot_thumb.jpg',130, 86,1, 1,'','','','','','');
photos[59] = new photo(403187,'32424','','gallery','http://www1.clikpic.com/idmurphy/images/Rabbit backlit.jpg',495,600,'Rabbit on Westray','http://www1.clikpic.com/idmurphy/images/Rabbit backlit_thumb.jpg',130, 158,0, 1,'This rabbit was spotted in a hedgerow in Westray, Orkney, during a dawn photo expedition.','','','','','');
photos[60] = new photo(43932,'32424','','gallery','http://www1.clikpic.com/idmurphy/images/Puffin solo landscape001.jpg',400,266,'Puffin on Westray','http://www1.clikpic.com/idmurphy/images/Puffin solo landscape001_thumb.jpg',130, 86,0, 1,'Many puffins can be seen at Castle o\'Burrian on Westray\'s East coast.','','','Westray, Orkney','','');
photos[61] = new photo(482348,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Alistair\'s Puffin headshot small.jpg',600,428,'A puffin at Castle o\' Burrian Westray','http://www1.clikpic.com/idmurphy/images/Alistair\'s Puffin headshot small_thumb.jpg',130, 93,0, 1,'','','Alistair Murphy','','','');
photos[62] = new photo(482426,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Alistair\'s German Sunset1.jpg',400,266,'Sunset at Loch Morlich','http://www1.clikpic.com/idmurphy/images/Alistair\'s German Sunset1_thumb.jpg',130, 86,0, 1,'','','Alistair Murphy','','','');
photos[63] = new photo(482352,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Early Morning Loch Morlich with Ducks.jpg',400,266,'Loch Morlich Early Morning','http://www1.clikpic.com/idmurphy/images/Early Morning Loch Morlich with Ducks_thumb.jpg',130, 86,0, 1,'','','Alistair Murphy','','','');
photos[64] = new photo(482356,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Loch Morlich One Boat.jpg',400,242,'Early morning at Loch Morlich 2','http://www1.clikpic.com/idmurphy/images/Loch Morlich One Boat_thumb.jpg',130, 79,0, 1,'','','','','','');
photos[65] = new photo(714846,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Little Loch Morlich for web.jpg',600,539,'Loch Morlich Early Morning 2','http://www1.clikpic.com/idmurphy/images/Little Loch Morlich for web_thumb.jpg',130, 117,0, 1,'','','Alistair Murphy','','','');
photos[66] = new photo(727692,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Ship B&W & Orange.jpg',600,333,'Kommandor Jack','http://www1.clikpic.com/idmurphy/images/Ship B&W & Orange_thumb.jpg',130, 72,0, 1,'This ship sits in the harbour at Leith Docks','','Alistair Murphy','Leith, Scotland','','');
photos[67] = new photo(727697,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Leith view.jpg',600,439,'View of Leith across the Water','http://www1.clikpic.com/idmurphy/images/Leith view_thumb.jpg',130, 95,0, 1,'','','Alistair Murphy','','','');
photos[68] = new photo(727704,'37797','','gallery','http://www1.clikpic.com/idmurphy/images/Three cranes in a row.jpg',600,399,'Three cranes in a row','http://www1.clikpic.com/idmurphy/images/Three cranes in a row_thumb.jpg',130, 86,0, 1,'These three derelict cranes are a feature of the Leith skyline.','','Alistair Murphy','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(2992,'179178,26441,26307,26304,26197,26106,26104,26102,26101,26100,26099,26098,26096,26094,26084,26081,26078,26076,26073','Travel - Japan ','gallery');
galleries[1] = new gallery(2994,'714856,444682,444681,444680,403239,403191,403185,175200,135492,135486,89250,47391,43948,43929,43926,26200,26199,26089,26087','Travel - Scotland','gallery');
galleries[2] = new gallery(8296,'571849,571844,571838,571766,87729,87727,87725','Travel - Europe','gallery');
galleries[3] = new gallery(6920,'205965,99894,99893,99892,71329','Still Life','gallery');
galleries[4] = new gallery(3024,'26201','Action','gallery');
galleries[5] = new gallery(32424,'403187,403181,43932','Wildlife','gallery');
galleries[6] = new gallery(37797,'727704,727697,727692,714846,482426,482356,482352,482348','Alistair\'s Gallery','gallery');

