/***************************************************************************
* 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('2995857,2995850,2992018,2992015,2992014,2088283,1929245,1929214,1929197,1917466,1784771,1784751,1784740,1784691,1784644,1784605,1784533,1707846,1687868,1586499,1586480,1586463,1586452,1586444,1586246,1586232,1586208,1586198,1586104,1586086,1565949,1514255,1514253,1514250,1514231,1512879,1511570,1511560,1498073,1492624,1486237,1486232,1473489,1473481,1473478,1473472,1473470,1457101,1457091,1457086');
	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('2995857,2995850,2992018,2992015,2992014,2088283,1929245,1929214,1929197,1917466,1784771,1784751,1784740,1784691,1784644,1784605,1784533,1707846,1687868,1586499,1586480,1586463,1586452,1586444,1586246,1586232,1586208,1586198,1586104,1586086,1565949,1514255,1514253,1514250,1514231,1512879,1511570,1511560,1498073,1492624,1486237,1486232,1473489,1473481,1473478,1473472,1473470,1457101,1457091,1457086');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if ('gallery' != '') {
						if (photos[j].galleries_id != '') {
						document.write('<a href="' + photos[j].section_code + '_' + photos[j].galleries_id + '.html">');
						}
						else {
						document.write('<a href="gallery.html">');
						}
			}
			document.write('<img src="' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			if ('gallery' != '') {
				document.write('</a>');
			}
			break;
		}
	}
	
}

/***************************************************************************
* Show the next image in a gallery.  field = hidden field containing       *
* image_id                                                                 *
*  img = reference to image object in which to show image                  *
***************************************************************************/
function next(field,img) {

	debug('IN next');
	imageID = field.value;
	
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			break;
		}
	}
	debug('image is ' + j);
	nextImg = -1;
	k= j + 1;
	while (nextImg < 0) {
		for (; k < photos.length; k++) {
			debug('testing image ' + k + ': gallery = ' + photos[k].galleries_id + '(existing: ' + photos[j].galleries_id + ')');
			if (photos[k].galleries_id == photos[j].galleries_id) {
				nextImg = k;
				debug('setting  nextImg = ' + k);
				break;
			}
		}
		if (nextImg == -1) {
			k = 0;
		}
	}
	if (nextImg != -1) {
		updateImage(nextImg, field,img);
	}


}


/***************************************************************************
* Set a new image on the gallery detail page given its array position      *
***************************************************************************/
function updateImage (nextImg, field,img) {
	debug('Updating image');
	if (!basic && !((0) || (0))) {
		debug('In updateImage');
		debug('setting  img src = ' + photos[nextImg].src);
		
					
			document.getElementById('imagePhoto').innerHTML = '<img class="mainphoto" src="' + photos[nextImg].src + ' " id="mainPic" name="mainPic" width="' + photos[nextImg].width + '" height="' + photos[nextImg].height + '" alt="' + photos[nextImg].caption + '">';
						field.value = photos[nextImg].id;
			document.getElementById('imageTitle').innerHTML = photos[nextImg].caption;
									document.title = 'Geoff Banks 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(2992014,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Market.jpg',400,268,'International Market - Aberdeen','http://www4.clikpic.com/riverdon/images/Market_thumb.jpg',130, 87,0, 0,'','28/09/08','Geoff Banks','Aberdeen','','');
photos[1] = new photo(2992015,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Market2.jpg',268,400,'Little Holland','http://www4.clikpic.com/riverdon/images/Market2_thumb.jpg',130, 194,0, 0,'International Market - Aberdeen','28/09/08','Geoff Banks','Aberdeen','','');
photos[2] = new photo(2992018,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Market 3.jpg',268,400,'Making French Nougat','http://www4.clikpic.com/riverdon/images/Market 3_thumb.jpg',130, 194,0, 0,'International Market - Aberdeen','28/09/08','Geoff Banks','Aberdeen','','');
photos[3] = new photo(2995850,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Demonstration2.jpg',268,400,'Demonstration','http://www4.clikpic.com/riverdon/images/Demonstration2_thumb.jpg',130, 194,0, 0,'Aberdeen Council Demonstration','05/04/08','Geoff Banks','Aberdeen','','');
photos[4] = new photo(2995857,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Demostration.jpg',400,268,'Nicol Stephen & Malcolm Bruce','http://www4.clikpic.com/riverdon/images/Demostration_thumb.jpg',130, 87,0, 0,'Aberdeen City Council Demonstration','05/04/08','Geoff Banks','Aberdeen','','');
photos[5] = new photo(1929197,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Claire.jpg',400,266,'Danse McCabre - Claire','http://www4.clikpic.com/riverdon/images/Claire_thumb.jpg',130, 86,0, 0,'','08/03/08','Geoff Banks','Eliphinstone Hall, Aberdeen','','');
photos[6] = new photo(1929214,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Danse-McCabre.jpg',400,268,'Danse McCabre','http://www4.clikpic.com/riverdon/images/Danse-McCabre_thumb.jpg',130, 87,0, 0,'','08/03/08','Geoff Banks','','','');
photos[7] = new photo(1929245,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Danse-McCabre-2.jpg',400,266,'Danse McCabre 2','http://www4.clikpic.com/riverdon/images/Danse-McCabre-2_thumb.jpg',130, 86,0, 0,'','08/03/08','Geoff Banks','','','');
photos[8] = new photo(1511560,'141867','','gallery','http://www4.clikpic.com/riverdon/images/June.jpg',268,400,'Bodega - June Naylor','http://www4.clikpic.com/riverdon/images/June_thumb.jpg',130, 194,0, 0,'','21/10/07','Geoff Banks','Aberdeen','','');
photos[9] = new photo(1511570,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Norrie.jpg',268,400,'Bodega - Norrie MacIver','http://www4.clikpic.com/riverdon/images/Norrie_thumb.jpg',130, 194,0, 0,'','21/10/07','Geoff Banks','Aberdeen','','');
photos[10] = new photo(1512879,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Nic.jpg',400,268,'Percussion Dancer - Nic Gareiss','http://www4.clikpic.com/riverdon/images/Nic_thumb.jpg',130, 87,0, 0,'','21/10/07','Geoff Banks','Aberdeen','','');
photos[11] = new photo(1456994,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Beech-Roots.jpg',400,260,'Beech Roots','http://www4.clikpic.com/riverdon/images/Beech-Roots_thumb.jpg',130, 85,0, 0,'','','Geoff Banks','Seaton Park, Aberdeen','','');
photos[12] = new photo(1457003,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Rowan-Leaves.jpg',400,258,'Rowan Leaves','http://www4.clikpic.com/riverdon/images/Rowan-Leaves_thumb.jpg',130, 84,0, 0,'','','','','','');
photos[13] = new photo(1457030,'100635','','gallery','http://www4.clikpic.com/riverdon/images/Skyline.jpg',288,400,'Skyline','http://www4.clikpic.com/riverdon/images/Skyline_thumb.jpg',130, 181,0, 0,'','','','','','');
photos[14] = new photo(1457035,'100635','','gallery','http://www4.clikpic.com/riverdon/images/Papermill.jpg',256,400,'Paper Mill','http://www4.clikpic.com/riverdon/images/Papermill_thumb.jpg',130, 203,0, 0,'','','Geoff Banks','Tillydrone, Aberdeen','','');
photos[15] = new photo(1457086,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Leaf.jpg',400,266,'Leaf Gall','http://www4.clikpic.com/riverdon/images/Leaf_thumb.jpg',130, 86,0, 0,'','','Geoff Banks','','','');
photos[16] = new photo(1457101,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Wave-wood.jpg',400,267,'Wavy Wood','http://www4.clikpic.com/riverdon/images/Wave-wood_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','','','');
photos[17] = new photo(1473470,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Birch-Bark.jpg',400,266,'Birch Bark','http://www4.clikpic.com/riverdon/images/Birch-Bark_thumb.jpg',130, 86,0, 0,'','','Geoff Banks ','Cruickshank Gardens, Old Aberdeen','','');
photos[18] = new photo(1473481,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Kings-College.jpg',400,268,'Kings College','http://www4.clikpic.com/riverdon/images/Kings-College_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Old Aberdeen','','');
photos[19] = new photo(1473489,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Sycamore.jpg',400,268,'Sycamore','http://www4.clikpic.com/riverdon/images/Sycamore_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Seaton Park, Old Aberdeen','','');
photos[20] = new photo(1486232,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Evening-Light.jpg',400,268,'Evening Light','http://www4.clikpic.com/riverdon/images/Evening-Light_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Seaton Park, Aberdeen','','');
photos[21] = new photo(1486237,'100635','','gallery','http://www4.clikpic.com/riverdon/images/Powis-Gate.jpg',268,400,'Powis Gate','http://www4.clikpic.com/riverdon/images/Powis-Gate_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','Old Aberdeen','','');
photos[22] = new photo(1514255,'100635','','gallery','http://www4.clikpic.com/riverdon/images/Sky.jpg',266,400,'Sky','http://www4.clikpic.com/riverdon/images/Sky_thumb.jpg',130, 195,0, 0,'','','Geoff Banks','Schoolhill, Aberdeen','','');
photos[23] = new photo(1586086,'100635','','gallery','http://www4.clikpic.com/riverdon/images/St.Machar-Cathedral.jpg',500,228,'St. Machar Cathedral','http://www4.clikpic.com/riverdon/images/St_thumb.Machar-Cathedral.jpg',130, 59,0, 0,'','','Geoff Banks','Old Aberdeen','','');
photos[24] = new photo(1586104,'120009','','gallery','http://www4.clikpic.com/riverdon/images/Summer-Beech-Leaves.jpg',268,400,'Summer Beech Leaves','http://www4.clikpic.com/riverdon/images/Summer-Beech-Leaves_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','','','');
photos[25] = new photo(1586198,'100635','','gallery','http://www4.clikpic.com/riverdon/images/St.-Marks-High-Dome.jpg',267,400,'St. Marks High Dome','http://www4.clikpic.com/riverdon/images/St_thumb.-Marks-High-Dome.jpg',130, 195,0, 0,'','','Geoff Banks','','','');
photos[26] = new photo(1586246,'100635','','gallery','http://www4.clikpic.com/riverdon/images/Richards.jpg',400,271,'Richards','http://www4.clikpic.com/riverdon/images/Richards_thumb.jpg',130, 88,0, 0,'','','','','','');
photos[27] = new photo(1586444,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Bodega.jpg',400,268,'Bodega','http://www4.clikpic.com/riverdon/images/Bodega_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','The Tunnels, Aberdeen','','');
photos[28] = new photo(1586452,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Gillian.jpg',268,400,'Bodega - Gillian Chalmers','http://www4.clikpic.com/riverdon/images/Gillian_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','The Tunnels, Aberdeen','','');
photos[29] = new photo(1586463,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Ross Couper.jpg',268,400,'Bodega - Ross Couper','http://www4.clikpic.com/riverdon/images/Ross Couper_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','The Tunnels, Aberdeen','','');
photos[30] = new photo(1586480,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Rappers.jpg',400,268,'Rappers','http://www4.clikpic.com/riverdon/images/Rappers_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Blue Lamp, Aberdeen','','');
photos[31] = new photo(1586499,'141867','','gallery','http://www4.clikpic.com/riverdon/images/Bodega .jpg',268,400,'Bodega -','http://www4.clikpic.com/riverdon/images/Bodega _thumb.jpg',130, 194,0, 0,'','','Geoff Banks','Blue Lamp, Aberdeen','','');
photos[32] = new photo(1687868,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Frosted-Leaves.jpg',400,268,'Frosted Leaves','http://www4.clikpic.com/riverdon/images/Frosted-Leaves_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Old Aberdeen','','');
photos[33] = new photo(1707846,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Beech-Tree.jpg',400,279,'Beech Tree - River Don','http://www4.clikpic.com/riverdon/images/Beech-Tree_thumb.jpg',130, 91,0, 0,'(For my brother - Mick Banks)','','Geoff Banks','Persley, Aberdeen','','');
photos[34] = new photo(1784533,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Sycamore in Winter.jpg',400,257,'Sycamore in Winter','http://www4.clikpic.com/riverdon/images/Sycamore in Winter_thumb.jpg',130, 84,0, 0,'','','Geoff Banks','Seaton Park','','');
photos[35] = new photo(1784605,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Gean.jpg',400,270,'Gean Leaves','http://www4.clikpic.com/riverdon/images/Gean_thumb.jpg',130, 88,0, 0,'','','Geoff Banks','Old Aberdeen','','');
photos[36] = new photo(1784644,'120009','','gallery','http://www4.clikpic.com/riverdon/images/Elm-Seed_1.jpg',294,400,'Wych Elm Seed','http://www4.clikpic.com/riverdon/images/Elm-Seed_1_thumb.jpg',130, 177,0, 0,'','','Geoff Banks','Seaton Park','','');
photos[37] = new photo(1784691,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Wood-Mosaic.jpg',267,400,'Wood Mosaic','http://www4.clikpic.com/riverdon/images/Wood-Mosaic_thumb.jpg',130, 195,0, 0,'','','Geoff Banks','near Huntly','','');
photos[38] = new photo(1784740,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Sycamore-in-Spring.jpg',400,267,'Sycamore in Spring','http://www4.clikpic.com/riverdon/images/Sycamore-in-Spring_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Seaton Park','','');
photos[39] = new photo(1784751,'120009','','gallery','http://www4.clikpic.com/riverdon/images/Monkey-Puzzle-Tree.jpg',264,400,'Monkey Puzzle & Giant Sequoia','http://www4.clikpic.com/riverdon/images/Monkey-Puzzle-Tree_thumb.jpg',130, 197,0, 0,'','','Geoff Banks','Hazlehead Park','','');
photos[40] = new photo(1784771,'99284','','gallery','http://www4.clikpic.com/riverdon/images/Remanant-Plantation.jpg',400,267,'Remnant Plantation','http://www4.clikpic.com/riverdon/images/Remanant-Plantation_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','Near Dufftown','','');
photos[41] = new photo(1917466,'129693','','gallery','http://www4.clikpic.com/riverdon/images/Benachie.jpg',500,286,'Racing to the Top','http://www4.clikpic.com/riverdon/images/Benachie_thumb.jpg',130, 74,0, 0,'','','Geoff Banks','Benachie, Inverurie','','');
photos[42] = new photo(2088283,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Gills.jpg',335,500,'Mushroom Gills','http://www4.clikpic.com/riverdon/images/Gills_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','','','');
photos[43] = new photo(1514250,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Barbed-Wire.jpg',500,188,'Barbed Wire','http://www4.clikpic.com/riverdon/images/Barbed-Wire_thumb.jpg',130, 49,0, 0,'','','Geoff Banks','Heatheryfold, Aberdeen','','');
photos[44] = new photo(1565949,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Elm-Seed.jpg',400,286,'Elm Seeds','http://www4.clikpic.com/riverdon/images/Elm-Seed_thumb.jpg',130, 93,0, 0,'','','Geoff Banks','','','');
photos[45] = new photo(1456952,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Rustscape.jpg',500,332,'Rustscape','http://www4.clikpic.com/riverdon/images/Rustscape_thumb.jpg',130, 86,0, 0,'','','Geoff Banks','','','');
photos[46] = new photo(1586208,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Flower & Mug.jpg',400,261,'Flower & Mug','http://www4.clikpic.com/riverdon/images/Flower & Mug_thumb.jpg',130, 85,0, 0,'','','','','','');
photos[47] = new photo(1492624,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Dark Water.jpg',400,268,'Dark Water','http://www4.clikpic.com/riverdon/images/Dark Water_thumb.jpg',130, 87,0, 0,'','','Geoff Banks','The Burn, River North Esk','','');
photos[48] = new photo(1514231,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Flower.jpg',400,266,'\'Bell\' Flower','http://www4.clikpic.com/riverdon/images/Flower_thumb.jpg',130, 86,0, 0,'','','Geoff Banks','','','');
photos[49] = new photo(1473472,'120009','','gallery','http://www4.clikpic.com/riverdon/images/Scots-Pine-Bark.jpg',266,400,'Scots Pine Bark','http://www4.clikpic.com/riverdon/images/Scots-Pine-Bark_thumb.jpg',130, 195,0, 0,'','','Geoff Banks','Bogendreip, Banchory','','');
photos[50] = new photo(1473478,'120009','','gallery','http://www4.clikpic.com/riverdon/images/Beech-Leaves.jpg',267,400,'Winter Beech Leaves','http://www4.clikpic.com/riverdon/images/Beech-Leaves_thumb.jpg',130, 195,0, 0,'','','Geoff Banks','Lendrick Muir','','');
photos[51] = new photo(1498073,'120009','','gallery','http://www4.clikpic.com/riverdon/images/English-Elm.jpg',335,500,'English Elm','http://www4.clikpic.com/riverdon/images/English-Elm_thumb.jpg',130, 194,0, 0,'','','Geoff Banks','','','');
photos[52] = new photo(1457045,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Stone.jpg',259,400,'Agate','http://www4.clikpic.com/riverdon/images/Stone_thumb.jpg',130, 201,0, 0,'','','Geoff Banks','','','');
photos[53] = new photo(1457091,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Fence.jpg',266,400,'Corrugated Fence','http://www4.clikpic.com/riverdon/images/Fence_thumb.jpg',130, 195,0, 0,'','','Geoff Banks','Heatheryfold, Aberdeen','','');
photos[54] = new photo(1586232,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Rosebay.jpg',258,400,'Rosebay Willowherb','http://www4.clikpic.com/riverdon/images/Rosebay_thumb.jpg',130, 202,0, 0,'','','Geoff Banks','','','');
photos[55] = new photo(1514253,'100638','','gallery','http://www4.clikpic.com/riverdon/images/Door.jpg',263,400,'Old Door','http://www4.clikpic.com/riverdon/images/Door_thumb.jpg',130, 198,0, 0,'','','Geoff Banks','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(100635,'1586246,1586198,1586086,1514255,1486237,1457035,1457030','Cityscape','gallery');
galleries[1] = new gallery(141868,'1929245,1929214,1929197,1586499,1586480,1586463,1586452,1586444,1512879,1511570','Culture','gallery');
galleries[2] = new gallery(141886,'1784771,1784751,1784740,1784644,1784605,1784533,1707846,1687868,1586246,1586198','Environment','gallery');
galleries[3] = new gallery(141867,'1929245,1929214,1929197,1586499,1586480,1586463,1586452,1586444,1512879,1511570','Music','gallery');
galleries[4] = new gallery(100638,'2088283,1784691,1586232,1586208,1565949,1514253,1514250,1514231,1492624,1457091','Natural Abstracts','gallery');
galleries[5] = new gallery(129693,'2995857,2995850,2992018,2992015,2992014,1917466','People','gallery');
galleries[6] = new gallery(99284,'1784771,1784740,1784605,1784533,1707846,1687868,1486232,1473489,1473481,1473470','Trees 1','gallery');
galleries[7] = new gallery(120009,'1784751,1784644,1586104,1498073,1473478,1473472','Trees 2','gallery');

