/***************************************************************************
* 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('1803378,1803164');
	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('1803378,1803164');
	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(1826753,'121207','','gallery','http://www1.clikpic.com/mattylough/images/BlueCarPan.jpg',600,418,'Blue car Havana','http://www1.clikpic.com/mattylough/images/BlueCarPan_thumb.jpg',130, 91,0, 1,'','','','','','');
photos[1] = new photo(1803297,'121207','','gallery','http://www1.clikpic.com/mattylough/images/Churchsunse0203.jpg',600,393,'The Cathedral, Trinidad, Cuba','http://www1.clikpic.com/mattylough/images/Churchsunse0203_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[2] = new photo(1826756,'121207','','gallery','http://www1.clikpic.com/mattylough/images/Derelict.jpg',550,388,'Derelict Building, Trinidad','http://www1.clikpic.com/mattylough/images/Derelict_thumb.jpg',130, 92,0, 0,'','','','','','');
photos[3] = new photo(1826771,'121207','','gallery','http://www1.clikpic.com/mattylough/images/HEN313.jpg',500,424,'Hen 313, Havana','http://www1.clikpic.com/mattylough/images/HEN313_thumb.jpg',130, 110,0, 0,'','','','','','');
photos[4] = new photo(1826784,'121207','','gallery','http://www1.clikpic.com/mattylough/images/TheMalachon.jpg',550,399,'The Malachon, Havana','http://www1.clikpic.com/mattylough/images/TheMalachon_thumb.jpg',130, 94,0, 0,'','','','','','');
photos[5] = new photo(1826807,'121207','','gallery','http://www1.clikpic.com/mattylough/images/YellowDoors.jpg',500,425,'Yellow doors, Cienfuegos','http://www1.clikpic.com/mattylough/images/YellowDoors_thumb.jpg',130, 111,0, 0,'','','','','','');
photos[6] = new photo(1826777,'121207','','gallery','http://www1.clikpic.com/mattylough/images/OldFarmer.jpg',429,450,'Retired tobacco farmer, Venales valley, Cuba','http://www1.clikpic.com/mattylough/images/OldFarmer_thumb.jpg',130, 136,0, 0,'','','','','','');
photos[7] = new photo(1826800,'121207','','gallery','http://www1.clikpic.com/mattylough/images/VinalesValley.jpg',600,297,'Venales Valley, Cuba','http://www1.clikpic.com/mattylough/images/VinalesValley_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[8] = new photo(1826781,'121207','','gallery','http://www1.clikpic.com/mattylough/images/OldHavana.jpg',396,550,'Table and chairs, Old townhouse, Havana','http://www1.clikpic.com/mattylough/images/OldHavana_thumb.jpg',130, 181,0, 0,'','','','','','');
photos[9] = new photo(1826768,'121207','','gallery','http://www1.clikpic.com/mattylough/images/Exit.jpg',398,550,'Cinema exit, Cienfuegas','http://www1.clikpic.com/mattylough/images/Exit_thumb.jpg',130, 180,0, 0,'','','','','','');
photos[10] = new photo(1828758,'121209','','gallery','http://www1.clikpic.com/mattylough/images/Castlemorn2.jpg',600,229,'Prague castle at sunrise','http://www1.clikpic.com/mattylough/images/Castlemorn2_thumb.jpg',130, 50,0, 0,'','','','','','');
photos[11] = new photo(1828762,'121209','','gallery','http://www1.clikpic.com/mattylough/images/Castlesunset1b.jpg',600,279,'Prague castle, sunset','http://www1.clikpic.com/mattylough/images/Castlesunset1b_thumb.jpg',130, 60,0, 0,'','','','','','');
photos[12] = new photo(1828767,'121209','','gallery','http://www1.clikpic.com/mattylough/images/Oldtownsq05040501.jpg',600,255,'Old town square, sunrise','http://www1.clikpic.com/mattylough/images/Oldtownsq05040501_thumb.jpg',130, 55,0, 0,'','','','','','');
photos[13] = new photo(1803363,'121209','','gallery','http://www1.clikpic.com/mattylough/images/CharlesBridge.jpg',600,444,'Charles Bridge at sunrise','http://www1.clikpic.com/mattylough/images/CharlesBridge_thumb.jpg',130, 96,0, 0,'','','','','','');
photos[14] = new photo(1828797,'121209','','gallery','http://www1.clikpic.com/mattylough/images/StNicholas.jpg',530,417,'St Nicholas Cathedral, Old Town Square','http://www1.clikpic.com/mattylough/images/StNicholas_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[15] = new photo(1828774,'121209','','gallery','http://www1.clikpic.com/mattylough/images/Rooftops.jpg',550,403,'Little Quarter, Prague at sunrise','http://www1.clikpic.com/mattylough/images/Rooftops_thumb.jpg',130, 95,0, 0,'','','','','','');
photos[16] = new photo(1828781,'121209','','gallery','http://www1.clikpic.com/mattylough/images/PragueOldSq2005.jpg',381,500,'Old town square, winter','http://www1.clikpic.com/mattylough/images/PragueOldSq2005_thumb.jpg',130, 171,0, 1,'','','','','','');
photos[17] = new photo(1828788,'121209','','gallery','http://www1.clikpic.com/mattylough/images/LadyofTyn2005.jpg',326,600,'Our Lady of Tyn church, Old town','http://www1.clikpic.com/mattylough/images/LadyofTyn2005_thumb.jpg',130, 239,0, 0,'','','','','','');
photos[18] = new photo(1828791,'121209','','gallery','http://www1.clikpic.com/mattylough/images/MunicipalHse2005.jpg',600,378,'Municipal House','http://www1.clikpic.com/mattylough/images/MunicipalHse2005_thumb.jpg',130, 82,0, 0,'','','','','','');
photos[19] = new photo(1803373,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany2007_05_20.jpg',600,400,'Val d\'Orcia, church at sunset','http://www1.clikpic.com/mattylough/images/Tuscany2007_05_20_thumb.jpg',130, 87,0, 1,'','','','','','');
photos[20] = new photo(1827252,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany070512.jpg',550,367,'Tuscan skyline','http://www1.clikpic.com/mattylough/images/Tuscany070512_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[21] = new photo(1827205,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Florence0705200.jpg',600,400,'The Duomo, Florence','http://www1.clikpic.com/mattylough/images/Florence0705200_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[22] = new photo(1827212,'121208','','gallery','http://www1.clikpic.com/mattylough/images/kitchen.jpg',500,393,'Abandoned Tuscan farmhouse','http://www1.clikpic.com/mattylough/images/kitchen_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[23] = new photo(1827200,'121208','','gallery','http://www1.clikpic.com/mattylough/images/07050301Belvedere.jpg',600,296,'Belvedere, Val d\'Orcia','http://www1.clikpic.com/mattylough/images/07050301Belvedere_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[24] = new photo(1827289,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany07050602.jpg',600,315,'Cyprus grove, rural Tuscany','http://www1.clikpic.com/mattylough/images/Tuscany07050602_thumb.jpg',130, 68,0, 0,'','','','','','');
photos[25] = new photo(1827278,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany070563.jpg',600,365,'The Monastery at Sant Antimo','http://www1.clikpic.com/mattylough/images/Tuscany070563_thumb.jpg',130, 79,0, 0,'','','','','','');
photos[26] = new photo(1827271,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany070553.jpg',600,284,'Sunrise, Val d\'Orcia','http://www1.clikpic.com/mattylough/images/Tuscany070553_thumb.jpg',130, 62,0, 0,'','','','','','');
photos[27] = new photo(1827283,'121208','','gallery','http://www1.clikpic.com/mattylough/images/Tuscany0705103.jpg',333,500,'Farmhouse','http://www1.clikpic.com/mattylough/images/Tuscany0705103_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[28] = new photo(1803164,'120823','','gallery','http://www1.clikpic.com/mattylough/images/Ailsa Craig Combo2004.jpg',600,319,'Ailsa Craig, Ayrshire','http://www1.clikpic.com/mattylough/images/Ailsa Craig Combo2004_thumb.jpg',130, 69,1, 1,'','','','','','');
photos[29] = new photo(1811358,'120823','','gallery','http://www1.clikpic.com/mattylough/images/Blackrockcottage.jpg',600,296,'Blackrock Cottage, Glencoe','http://www1.clikpic.com/mattylough/images/Blackrockcottage_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[30] = new photo(1811361,'120823','','gallery','http://www1.clikpic.com/mattylough/images/Corsewelllighthouse.jpg',600,473,'Corsewall Lighthouse, Galloway','http://www1.clikpic.com/mattylough/images/Corsewelllighthouse_thumb.jpg',130, 102,0, 0,'','','','','','');
photos[31] = new photo(1811364,'120823','','gallery','http://www1.clikpic.com/mattylough/images/CuillinsLochnanEileann.jpg',600,317,'The Cuillins from Loch nan Eilean, Skye','http://www1.clikpic.com/mattylough/images/CuillinsLochnanEileann_thumb.jpg',130, 69,0, 0,'','','','','','');
photos[32] = new photo(1811365,'120823','','gallery','http://www1.clikpic.com/mattylough/images/CuillinsView.jpg',600,297,'Cuillins view, Skye','http://www1.clikpic.com/mattylough/images/CuillinsView_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[33] = new photo(1811345,'120823','','gallery','http://www1.clikpic.com/mattylough/images/AilsaCraig.jpg',600,421,'Ailsa Craig, Ayrshire','http://www1.clikpic.com/mattylough/images/AilsaCraig_thumb.jpg',130, 91,0, 0,'','','','','','');
photos[34] = new photo(1811372,'120823','','gallery','http://www1.clikpic.com/mattylough/images/GoatFell2005.jpg',600,463,'Goat Fell, Arran','http://www1.clikpic.com/mattylough/images/GoatFell2005_thumb.jpg',130, 100,0, 0,'','','','','','');
photos[35] = new photo(1811375,'120823','','gallery','http://www1.clikpic.com/mattylough/images/WoodlandRannoch.jpg',600,324,'Woodland scene, Rannoch','http://www1.clikpic.com/mattylough/images/WoodlandRannoch_thumb.jpg',130, 70,0, 0,'','','','','','');
photos[36] = new photo(1811367,'120823','','gallery','http://www1.clikpic.com/mattylough/images/GlenEtiveFalls.jpg',320,450,'Glen Etive Falls','http://www1.clikpic.com/mattylough/images/GlenEtiveFalls_thumb.jpg',130, 183,0, 0,'','','','','','');
photos[37] = new photo(1811343,'120823','','gallery','http://www1.clikpic.com/mattylough/images/AchnambeitnachCottage.jpg',221,450,'Misty day, Glencoe','http://www1.clikpic.com/mattylough/images/AchnambeitnachCottage_thumb.jpg',130, 265,0, 0,'','','','','','');
photos[38] = new photo(1811350,'120823','','gallery','http://www1.clikpic.com/mattylough/images/AuldKirkAlloway.jpg',350,450,'The Auld Kirk, Alloway','http://www1.clikpic.com/mattylough/images/AuldKirkAlloway_thumb.jpg',130, 167,0, 0,'','','','','','');
photos[39] = new photo(1935396,'120823','','gallery','http://admin.clikpic.com/mattylough/images/Greenancastlecrop.jpg',600,346,'Greenan Castle at sunset, Ayr','http://admin.clikpic.com/mattylough/images/Greenancastlecrop_thumb.jpg',130, 75,0, 0,'','','','','','');
photos[40] = new photo(1818131,'121211','','gallery','http://www1.clikpic.com/mattylough/images/HighlandScene.jpg',600,400,'Highland scene, Iceland','http://www1.clikpic.com/mattylough/images/HighlandScene_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[41] = new photo(1818127,'121211','','gallery','http://www1.clikpic.com/mattylough/images/HighlandMonochrome.jpg',600,396,'Highland monochrome, Iceland','http://www1.clikpic.com/mattylough/images/HighlandMonochrome_thumb.jpg',130, 86,0, 0,'','','','','','');
photos[42] = new photo(1818141,'121211','','gallery','http://www1.clikpic.com/mattylough/images/IcebergsSunriseJokulsarlon.jpg',600,411,'Icebergs at sunrise, Iceland','http://www1.clikpic.com/mattylough/images/IcebergsSunriseJokulsarlon_thumb.jpg',130, 89,0, 1,'','','','','','');
photos[43] = new photo(1818163,'121211','','gallery','http://www1.clikpic.com/mattylough/images/TheUnicorn.jpg',600,400,'The Unicorn, South Iceland','http://www1.clikpic.com/mattylough/images/TheUnicorn_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[44] = new photo(1818135,'121211','','gallery','http://www1.clikpic.com/mattylough/images/Highlandsunset.jpg',600,244,'Highland sunset, Iceland','http://www1.clikpic.com/mattylough/images/Highlandsunset_thumb.jpg',130, 53,0, 0,'','','','','','');
photos[45] = new photo(1818166,'121211','','gallery','http://www1.clikpic.com/mattylough/images/TurfChurchHof.jpg',600,429,'Turf Church at Hof, South Iceland','http://www1.clikpic.com/mattylough/images/TurfChurchHof_thumb.jpg',130, 93,0, 0,'','','','','','');
photos[46] = new photo(1818144,'121211','','gallery','http://www1.clikpic.com/mattylough/images/MountainFlowers.jpg',600,475,'Mountain Flowers, Iceland interior','http://www1.clikpic.com/mattylough/images/MountainFlowers_thumb.jpg',130, 103,0, 0,'','','','','','');
photos[47] = new photo(1818145,'121211','','gallery','http://www1.clikpic.com/mattylough/images/SkogarFalls.jpg',600,478,'The Falls near Skogar','http://www1.clikpic.com/mattylough/images/SkogarFalls_thumb.jpg',130, 104,0, 0,'','','','','','');
photos[48] = new photo(1818168,'121211','','gallery','http://www1.clikpic.com/mattylough/images/VolcanicLake.jpg',600,400,'Volcanic lakes, Iceland','http://www1.clikpic.com/mattylough/images/VolcanicLake_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[49] = new photo(1803341,'121211','','gallery','http://www1.clikpic.com/mattylough/images/Iceland.jpg',313,450,'Pinks and Blues, Jokulsarlon Lagoon, Iceland','http://www1.clikpic.com/mattylough/images/Iceland_thumb.jpg',130, 187,0, 0,'','','','','','');
photos[50] = new photo(1818139,'121211','','gallery','http://www1.clikpic.com/mattylough/images/IcebergsJokulsarlonLagoon.jpg',333,500,'Icebergs, Jokulsarlon Lagoon','http://www1.clikpic.com/mattylough/images/IcebergsJokulsarlonLagoon_thumb.jpg',130, 195,0, 0,'','','','','','');
photos[51] = new photo(1818143,'121211','','gallery','http://www1.clikpic.com/mattylough/images/LighthouseIngolfshofdi.jpg',500,445,'The Lighthouse at Ingolfshofdi Nature Reserve','http://www1.clikpic.com/mattylough/images/LighthouseIngolfshofdi_thumb.jpg',130, 116,0, 0,'','','','','','');
photos[52] = new photo(1818125,'121211','','gallery','http://www1.clikpic.com/mattylough/images/ChurchatReynir.jpg',401,450,'The Church at Reynir, South Iceland','http://www1.clikpic.com/mattylough/images/ChurchatReynir_thumb.jpg',130, 146,0, 0,'','','','','','');
photos[53] = new photo(1803347,'121203','','gallery','http://www1.clikpic.com/mattylough/images/Derryclare2003.jpg',600,426,'Lough Derryclare, Connemara','http://www1.clikpic.com/mattylough/images/Derryclare2003_thumb.jpg',130, 92,0, 1,'','','','','','');
photos[54] = new photo(1805794,'121203','','gallery','http://www1.clikpic.com/mattylough/images/LongWalk.jpg',600,392,'Long Walk, Galway city, Ireland','http://www1.clikpic.com/mattylough/images/LongWalk_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[55] = new photo(1805811,'121203','','gallery','http://www1.clikpic.com/mattylough/images/SmallKillary36.jpg',600,452,'Small Killary, Connemara','http://www1.clikpic.com/mattylough/images/SmallKillary36_thumb.jpg',130, 98,0, 0,'','','','','','');
photos[56] = new photo(1805809,'121203','','gallery','http://www1.clikpic.com/mattylough/images/NearGlinsk2003.jpg',600,346,'Near Glinsk, Connemara','http://www1.clikpic.com/mattylough/images/NearGlinsk2003_thumb.jpg',130, 75,0, 0,'','','','','','');
photos[57] = new photo(1805804,'121203','','gallery','http://www1.clikpic.com/mattylough/images/LoughFee1.jpg',600,214,'Lough Fee, Connemara','http://www1.clikpic.com/mattylough/images/LoughFee1_thumb.jpg',130, 46,0, 0,'','','','','','');
photos[58] = new photo(1805814,'121203','','gallery','http://www1.clikpic.com/mattylough/images/CloonileQuay1.jpg',600,249,'Cloonile Quay, Connemara','http://www1.clikpic.com/mattylough/images/CloonileQuay1_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[59] = new photo(1805815,'121203','','gallery','http://www1.clikpic.com/mattylough/images/CrumpIsland2.jpg',600,232,'Crump Island, Connemara','http://www1.clikpic.com/mattylough/images/CrumpIsland2_thumb.jpg',130, 50,0, 0,'','','','','','');
photos[60] = new photo(1805819,'121203','','gallery','http://www1.clikpic.com/mattylough/images/Roundstone1.jpg',600,205,'Roundstone, Connemara','http://www1.clikpic.com/mattylough/images/Roundstone1_thumb.jpg',130, 44,0, 0,'','','','','','');
photos[61] = new photo(1803359,'121213','','gallery','http://www1.clikpic.com/mattylough/images/LoughFee.jpg',600,214,'Lough Fee, Connemara, Ireland','http://www1.clikpic.com/mattylough/images/LoughFee_thumb.jpg',130, 46,0, 0,'','','','','','');
photos[62] = new photo(1805788,'121213','','gallery','http://www1.clikpic.com/mattylough/images/CloonileQuay.jpg',600,249,'Cloonile Quay, Connemara, Ireland','http://www1.clikpic.com/mattylough/images/CloonileQuay_thumb.jpg',130, 54,0, 0,'','','','','','');
photos[63] = new photo(1805803,'121213','','gallery','http://www1.clikpic.com/mattylough/images/CrumpIsland1.jpg',600,232,'Crump Island, Connemara','http://www1.clikpic.com/mattylough/images/CrumpIsland1_thumb.jpg',130, 50,0, 0,'','','','','','');
photos[64] = new photo(1805810,'121213','','gallery','http://www1.clikpic.com/mattylough/images/Roundstone.jpg',600,205,'Roundstone, Connemara','http://www1.clikpic.com/mattylough/images/Roundstone_thumb.jpg',130, 44,0, 0,'','','','','','');
photos[65] = new photo(1805813,'121213','','gallery','http://www1.clikpic.com/mattylough/images/Ait Benhaddou1.jpg',600,294,'Ait Benhaddou, Morocco','http://www1.clikpic.com/mattylough/images/Ait Benhaddou1_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[66] = new photo(1805817,'121213','','gallery','http://www1.clikpic.com/mattylough/images/GondolasMist20051.jpg',600,289,'Gondolas in mist, Venice','http://www1.clikpic.com/mattylough/images/GondolasMist20051_thumb.jpg',130, 63,0, 0,'','','','','','');
photos[67] = new photo(1803378,'121210','','gallery','http://www1.clikpic.com/mattylough/images/GondolasMist2005.jpg',600,289,'Gondolas in the mist','http://www1.clikpic.com/mattylough/images/GondolasMist2005_thumb.jpg',130, 63,1, 0,'','','','','','');
photos[68] = new photo(1827133,'121210','','gallery','http://www1.clikpic.com/mattylough/images/SGiorgioSunrise.jpg',600,223,'S. Giorgio sunrise','http://www1.clikpic.com/mattylough/images/SGiorgioSunrise_thumb.jpg',130, 48,0, 0,'','','','','','');
photos[69] = new photo(1827146,'121210','','gallery','http://www1.clikpic.com/mattylough/images/GrandCanal.jpg',600,294,'Grand canal, sunset','http://www1.clikpic.com/mattylough/images/GrandCanal_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[70] = new photo(1827135,'121210','','gallery','http://www1.clikpic.com/mattylough/images/SGiorgioMoonlight.jpg',600,229,'S. Giorgio, mist and moon','http://www1.clikpic.com/mattylough/images/SGiorgioMoonlight_thumb.jpg',130, 50,0, 0,'','','','','','');
photos[71] = new photo(1827142,'121210','','gallery','http://www1.clikpic.com/mattylough/images/GrandCanalEvening.jpg',600,228,'Grand canal, midday','http://www1.clikpic.com/mattylough/images/GrandCanalEvening_thumb.jpg',130, 49,0, 0,'','','','','','');
photos[72] = new photo(1827138,'121210','','gallery','http://www1.clikpic.com/mattylough/images/GrandCanalSunrise05050601.jpg',458,370,'Grand Canal, sunrise','http://www1.clikpic.com/mattylough/images/GrandCanalSunrise05050601_thumb.jpg',130, 105,0, 1,'','','','','','');
photos[73] = new photo(1827129,'121210','','gallery','http://www1.clikpic.com/mattylough/images/StMarks.jpg',384,500,'St Marks Square','http://www1.clikpic.com/mattylough/images/StMarks_thumb.jpg',130, 169,0, 0,'','','','','','');
photos[74] = new photo(1827150,'121210','','gallery','http://www1.clikpic.com/mattylough/images/CanalBoat.jpg',245,650,'Canal and boat','http://www1.clikpic.com/mattylough/images/CanalBoat_thumb.jpg',130, 345,0, 0,'','','','','','');
photos[75] = new photo(1803352,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Ait Benhaddou.jpg',600,294,'Ait Benhaddou','http://www1.clikpic.com/mattylough/images/Ait Benhaddou_thumb.jpg',130, 64,0, 0,'','','','','','');
photos[76] = new photo(1817828,'121206','','gallery','http://www1.clikpic.com/mattylough/images/2bluewindows.jpg',600,309,'Desert Blues','http://www1.clikpic.com/mattylough/images/2bluewindows_thumb.jpg',130, 67,0, 0,'','','','','','');
photos[77] = new photo(1817830,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Blueyell.jpg',600,364,'Silks in the Souk, Marrakech','http://www1.clikpic.com/mattylough/images/Blueyell_thumb.jpg',130, 79,0, 0,'','','','','','');
photos[78] = new photo(1817833,'121206','','gallery','http://www1.clikpic.com/mattylough/images/DunesErgChebbi.jpg',600,222,'Dunes, Erg |Chebbi, Sahara desert, Morocco','http://www1.clikpic.com/mattylough/images/DunesErgChebbi_thumb.jpg',130, 48,0, 0,'','','','','','');
photos[79] = new photo(1817836,'121206','','gallery','http://www1.clikpic.com/mattylough/images/MajorellePavillion.jpg',600,300,'The Pavillion, Marjorelle gardens, Marrakech','http://www1.clikpic.com/mattylough/images/MajorellePavillion_thumb.jpg',130, 65,0, 1,'','','','','','');
photos[80] = new photo(1817837,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Nkobsunset.jpg',600,274,'Nkob at sunset, Morocco','http://www1.clikpic.com/mattylough/images/Nkobsunset_thumb.jpg',130, 59,0, 0,'','','','','','');
photos[81] = new photo(1817839,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Spiceseller.jpg',264,700,'Spice seller, Marrakech','http://www1.clikpic.com/mattylough/images/Spiceseller_thumb.jpg',130, 345,0, 0,'','','','','','');
photos[82] = new photo(1817846,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Tenerhir.jpg',280,700,'Tinerhir, Morocco','http://www1.clikpic.com/mattylough/images/Tenerhir_thumb.jpg',130, 325,0, 0,'','','','','','');
photos[83] = new photo(1817848,'121206','','gallery','http://www1.clikpic.com/mattylough/images/Waterseller.jpg',389,570,'Waterseller. Marrakech','http://www1.clikpic.com/mattylough/images/Waterseller_thumb.jpg',130, 190,0, 0,'','','','','','');
photos[84] = new photo(1803357,'121214','','gallery','http://www1.clikpic.com/mattylough/images/StLuc2003.jpg',600,226,'Rosa Valley, St Lucia, West Indies','http://www1.clikpic.com/mattylough/images/StLuc2003_thumb.jpg',130, 49,0, 0,'','','','','','');
photos[85] = new photo(1805707,'121214','','gallery','http://www1.clikpic.com/mattylough/images/DalesFields1.jpg',600,323,'The Yorkshire Dales','http://www1.clikpic.com/mattylough/images/DalesFields1_thumb.jpg',130, 70,0, 0,'','','Matty Lough','Yorkshire, England','','');
photos[86] = new photo(1805779,'121214','','gallery','http://www1.clikpic.com/mattylough/images/Madeira1.jpg',400,499,'Nun\'s Valley, Madeira','http://www1.clikpic.com/mattylough/images/Madeira1_thumb.jpg',130, 162,0, 0,'Mountain scene, Madeira','','','Madeira','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(121207,'1826753','CUBA','gallery');
galleries[1] = new gallery(121209,'1828781','PRAGUE','gallery');
galleries[2] = new gallery(121208,'1803373','TUSCANY','gallery');
galleries[3] = new gallery(120823,'1803164','SCOTLAND','gallery');
galleries[4] = new gallery(121211,'1818141','ICELAND','gallery');
galleries[5] = new gallery(121203,'1803347','IRELAND','gallery');
galleries[6] = new gallery(121213,'1805817,1805813,1805810,1805803,1805788,1803359','PANORAMAS','gallery');
galleries[7] = new gallery(121210,'1827138','VENICE','gallery');
galleries[8] = new gallery(121206,'1817836','MOROCCO','gallery');
galleries[9] = new gallery(121214,'1805779,1805707,1803357','OTHER PLACES','gallery');
galleries[10] = new gallery(121212,'','ARTWORK','gallery');


