/***************************************************************************
* 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('1802936,1765233,1743101,1743095,1740105,1740091,1740090,1740087,1740083,1740076,1740074,1740071,1740066,1740065,1740058,1740055,1740051,1740047,1740045,1740000,1739997,1739990,1739987,1739984,1739978,1739976,1739971,1739970,1739968,1739959,1739958,1739957,1739955,1739954,1739952,1738485,1738478,1738461,1738376,1738362,1738357,1738307,1738293,1738266,1738232,1738202,1738188,1738164,1738155,1738144');
	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('1802936,1765233,1743101,1743095,1740105,1740091,1740090,1740087,1740083,1740076,1740074,1740071,1740066,1740065,1740058,1740055,1740051,1740047,1740045,1740000,1739997,1739990,1739987,1739984,1739978,1739976,1739971,1739970,1739968,1739959,1739958,1739957,1739955,1739954,1739952,1738485,1738478,1738461,1738376,1738362,1738357,1738307,1738293,1738266,1738232,1738202,1738188,1738164,1738155,1738144');
	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(1737263,'116672','Ingleborough 1','gallery','http://www1.clikpic.com/allanw/images/DSC_0161_edited-1.jpg',581,389,'Ingleborough','http://www1.clikpic.com/allanw/images/DSC_0161_edited-1_thumb.jpg',130, 87,0, 0,'Cairn on limestone pavement in front of Ingleborough','','Allan Wilkinson','Ingleborough North Yorkshire','','');
photos[1] = new photo(1738136,'116672','Pen y ghent 1','gallery','http://www1.clikpic.com/allanw/images/DSC_0117.jpg',579,389,'Eastern slopes of Pen y Ghent Yorkshire Dales','http://www1.clikpic.com/allanw/images/DSC_0117_thumb.jpg',130, 87,0, 1,'','','Allan Wilkinson','','','');
photos[2] = new photo(1738155,'116672','Pen y Ghent 3','gallery','http://www1.clikpic.com/allanw/images/DSC_0058.jpg',581,389,'Pen y Ghent from Helwith Bridge path','http://www1.clikpic.com/allanw/images/DSC_0058_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','','','');
photos[3] = new photo(1738164,'116672','Top Withens','gallery','http://www1.clikpic.com/allanw/images/DSCN2883_edited-1.jpg',454,341,'Top Withens','http://www1.clikpic.com/allanw/images/DSCN2883_edited-1_thumb.jpg',130, 98,0, 0,'','','Allan Wilkinson','Haworth Moors West Yorkshire','','');
photos[4] = new photo(1738202,'116672','Wharfedale 1','gallery','http://www1.clikpic.com/allanw/images/DSC_0021_edited-1.jpg',434,291,'Rocking Hall','http://www1.clikpic.com/allanw/images/DSC_0021_edited-1_thumb.jpg',130, 87,0, 0,'Rocking Hall Shooting cabins Wharfedale','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[5] = new photo(1738188,'116672','Ponden','gallery','http://www1.clikpic.com/allanw/images/DSC_0048_edited-2.jpg',389,581,'Reflections of Ponden','http://www1.clikpic.com/allanw/images/DSC_0048_edited-2_thumb.jpg',130, 194,0, 0,'Reflections of cottages on Ponden Reservoir.','','Allan Wilkinson','Ponden Haworth West Yorkshire','','');
photos[6] = new photo(1738144,'116672','Pen y Ghent 2','gallery','http://www1.clikpic.com/allanw/images/DSC_0090.jpg',389,581,'Track Down to Horton','http://www1.clikpic.com/allanw/images/DSC_0090_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','','','');
photos[7] = new photo(1738232,'116672','Wharfedale 2','gallery','http://www1.clikpic.com/allanw/images/B0000636.jpg',581,389,'Hebden Suspension Bridge','http://www1.clikpic.com/allanw/images/B0000636_thumb.jpg',130, 87,0, 0,'Footpath suspension bridge over the River Wharfe','','Allan Wilkinson','Hebden Yorkshire Dales','','');
photos[8] = new photo(1738266,'116672','Wharfedale 3','gallery','http://www1.clikpic.com/allanw/images/B0000599.jpg',581,389,'Stormy skies over Conistone','http://www1.clikpic.com/allanw/images/B0000599_thumb.jpg',130, 87,0, 0,'Storm brewing over sunlit Conistone in Wharfedale','','Allan Wilkinson','Conistone Grassington Yorkshire Dales','','');
photos[9] = new photo(1738293,'116672','Wensleydale 2','gallery','http://www1.clikpic.com/allanw/images/DSC_0176.jpg',389,581,'Field barn and wall','http://www1.clikpic.com/allanw/images/DSC_0176_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Wensleydale Yorkshire Dales','','');
photos[10] = new photo(1738307,'116672','Wensleydale 3','gallery','http://www1.clikpic.com/allanw/images/DSC_0180.jpg',330,492,'Wall Corner','http://www1.clikpic.com/allanw/images/DSC_0180_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Wensleydale Yorkshire Dales','','');
photos[11] = new photo(1738357,'116672','High Cup Nick 1','gallery','http://www1.clikpic.com/allanw/images/DSC_0064.jpg',581,389,'High Cup Nick','http://www1.clikpic.com/allanw/images/DSC_0064_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','High Cup NIck Cumbria','','');
photos[12] = new photo(1738362,'116672','High Cup Nick 2','gallery','http://www1.clikpic.com/allanw/images/DSC_0066.jpg',581,389,'Murton Fell','http://www1.clikpic.com/allanw/images/DSC_0066_thumb.jpg',130, 87,0, 0,'Murton Fell from the Pennine Way','','Allan Wilkinson','Dufton Cumbria','','');
photos[13] = new photo(1738376,'116672','Hewenden 1','gallery','http://www1.clikpic.com/allanw/images/DSCN2897.jpg',290,386,'Viaduct shadows','http://www1.clikpic.com/allanw/images/DSCN2897_thumb.jpg',130, 173,0, 0,'Shadows cast on fields from the Hewenden Viaduct, part of The Great North Trail','','Allan Wilkinson','Cullingworth West Yorkshire','','');
photos[14] = new photo(1765233,'116672','Wensleydale 4','gallery','http://www1.clikpic.com/allanw/images/B0000613.jpg',259,388,'Wensleydale wall','http://www1.clikpic.com/allanw/images/B0000613_thumb.jpg',130, 195,0, 0,'Tree at junctionh of wall','','Allan Wilkinson','Wensleydale Yorkshire Dales','','');
photos[15] = new photo(1743101,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0211.jpg',389,579,'','http://www1.clikpic.com/allanw/images/DSC_0211_thumb.jpg',130, 193,0, 0,'','','Allan Wilkinson','Ingleton Yorkshire Dales','','');
photos[16] = new photo(1802936,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0057.jpg',389,581,'Waterfall in the Valley Of Desolation','http://www1.clikpic.com/allanw/images/DSC_0057_thumb.jpg',130, 194,0, 0,'A lovely little waterfall at the head of the Valley of Desolation','27/01/08','AllanWilkinson','Wharfedale Yorkshire Dales','','');
photos[17] = new photo(1739970,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0132.jpg',389,581,'Posforth Gill waterfall','http://www1.clikpic.com/allanw/images/DSC_0132_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','','','');
photos[18] = new photo(1739971,'116673','Posforth Gill 2','gallery','http://www1.clikpic.com/allanw/images/DSC_0126.jpg',389,581,'Posforth Gill Waterfall ','http://www1.clikpic.com/allanw/images/DSC_0126_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[19] = new photo(1739976,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0103.jpg',389,581,'Valley of Desolation','http://www1.clikpic.com/allanw/images/DSC_0103_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[20] = new photo(1739978,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0140_edited-2.jpg',389,581,'Valley Of Desolation','http://www1.clikpic.com/allanw/images/DSC_0140_edited-2_thumb.jpg',130, 194,0, 0,'','','','Wharfedale Yorkshire Dales','','');
photos[21] = new photo(1740083,'116673','','gallery','http://www1.clikpic.com/allanw/images/B0000711.jpg',581,389,'Scaleber Force','http://www1.clikpic.com/allanw/images/B0000711_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Settle Yorkshire Dales','','');
photos[22] = new photo(1740087,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0086_edited-1.jpg',434,292,'Falls above Goitstock','http://www1.clikpic.com/allanw/images/DSC_0086_edited-1_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Cullingworth West Yorkshire','','');
photos[23] = new photo(1740090,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0096_edited-1.jpg',581,389,'Goitstock Falls','http://www1.clikpic.com/allanw/images/DSC_0096_edited-1_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Cullingworth West Yorkshire','','');
photos[24] = new photo(1740091,'116673','','gallery','http://www1.clikpic.com/allanw/images/DSC_0100_edited-1.jpg',581,389,'Goitstock Falls','http://www1.clikpic.com/allanw/images/DSC_0100_edited-1_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Cullingworth West Yorkshire','','');
photos[25] = new photo(1738478,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_01091.jpg',389,581,'River Ribble ','http://www1.clikpic.com/allanw/images/DSC_01091_thumb.jpg',130, 194,0, 1,'','','Allan Wilkinson','','','');
photos[26] = new photo(1739984,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_0026.jpg',389,581,'Upper reaches of the River Tees','http://www1.clikpic.com/allanw/images/DSC_0026_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','North Pennines','','');
photos[27] = new photo(1739987,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_0027.jpg',581,389,'Foam pattern','http://www1.clikpic.com/allanw/images/DSC_0027_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','North Pennines','','');
photos[28] = new photo(1739990,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_0101.jpg',389,581,'Force Beck','http://www1.clikpic.com/allanw/images/DSC_0101_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Lake District','','');
photos[29] = new photo(1739997,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_0102.jpg',581,389,'Foam pattern','http://www1.clikpic.com/allanw/images/DSC_0102_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[30] = new photo(1743095,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_0160.jpg',579,389,'River Wharfe near The Strid','http://www1.clikpic.com/allanw/images/DSC_0160_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[31] = new photo(1740105,'116675','','gallery','http://www1.clikpic.com/allanw/images/DSC_01011.jpg',581,389,'Reflections on the Ribble','http://www1.clikpic.com/allanw/images/DSC_01011_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','River Ribble Yorkshire Dales','','');
photos[32] = new photo(1738461,'116677','','gallery','http://www1.clikpic.com/allanw/images/DSC_0069.jpg',579,389,'El Castillo  Antequera','http://www1.clikpic.com/allanw/images/DSC_0069_thumb.jpg',130, 87,0, 1,'','','','','','');
photos[33] = new photo(1738485,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSCN4368_edited-1.jpg',265,286,'','http://www1.clikpic.com/allanw/images/DSCN4368_edited-1_thumb.jpg',130, 140,0, 1,'','','Allan Wilkinson','','','');
photos[34] = new photo(1739952,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSCN5154_edited-1.jpg',516,264,'Bracken','http://www1.clikpic.com/allanw/images/DSCN5154_edited-1_thumb.jpg',130, 67,0, 0,'','','Allan Wilkinson','','','');
photos[35] = new photo(1740000,'116677','','gallery','http://www1.clikpic.com/allanw/images/DSC_0007.jpg',579,389,'Mountain view from El Torcal','http://www1.clikpic.com/allanw/images/DSC_0007_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Andalucia Spain','','');
photos[36] = new photo(1739954,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSCN3893_edited-1.jpg',282,265,'','http://www1.clikpic.com/allanw/images/DSCN3893_edited-1_thumb.jpg',130, 122,0, 0,'','','Allan Wilkinson','','','');
photos[37] = new photo(1740045,'116677','El Torcal 2','gallery','http://www1.clikpic.com/allanw/images/DSC_0010.jpg',581,389,'Rock formations at El Tocal','http://www1.clikpic.com/allanw/images/DSC_0010_thumb.jpg',130, 87,0, 0,'Rock formations at the El Torcal nature rererve','','Allan Wilkinson','Andalucia Spain','','');
photos[38] = new photo(1739955,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSC_0021.jpg',266,264,'','http://www1.clikpic.com/allanw/images/DSC_0021_thumb.jpg',130, 129,0, 0,'','','Allan Wilkinson','','','');
photos[39] = new photo(1740047,'116677','El Torcal 3','gallery','http://www1.clikpic.com/allanw/images/DSC_0041_edited-1.jpg',389,579,'Natural Rock formations El Torcal','http://www1.clikpic.com/allanw/images/DSC_0041_edited-1_thumb.jpg',130, 193,0, 0,'','','Allan Wilkinson','Andalucia Spain','','');
photos[40] = new photo(1739957,'116676','','gallery','http://www1.clikpic.com/allanw/images/B0001940.jpg',290,386,'Teasels','http://www1.clikpic.com/allanw/images/B0001940_thumb.jpg',130, 173,0, 0,'','','Allan Wilkinson','','','');
photos[41] = new photo(1740051,'116677','El Torcal 4','gallery','http://www1.clikpic.com/allanw/images/DSC_0042_edited-1.jpg',579,389,'Eroded rock formations at El Torcal','http://www1.clikpic.com/allanw/images/DSC_0042_edited-1_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Andalucia Spain','','');
photos[42] = new photo(1739958,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSCN1810_edited-1.jpg',290,386,'Leaves on water','http://www1.clikpic.com/allanw/images/DSCN1810_edited-1_thumb.jpg',130, 173,0, 0,'','','Allan Wilkinson','','','');
photos[43] = new photo(1740055,'116677','','gallery','http://www1.clikpic.com/allanw/images/DSC_0105.jpg',389,581,'Almond Blossom','http://www1.clikpic.com/allanw/images/DSC_0105_thumb.jpg',130, 194,0, 0,'','','Allan Wilkinson','Andalucia Spain','','');
photos[44] = new photo(1739959,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSCN3686_edited-1.jpg',290,386,'Young Oak leaves','http://www1.clikpic.com/allanw/images/DSCN3686_edited-1_thumb.jpg',130, 173,0, 0,'','','Allan Wilkinson','','','');
photos[45] = new photo(1740058,'116677','','gallery','http://www1.clikpic.com/allanw/images/DSC_0312.jpg',579,389,'Pool at Cortijo Valverde','http://www1.clikpic.com/allanw/images/DSC_0312_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Andalucia Spain','','');
photos[46] = new photo(1739968,'116676','','gallery','http://www1.clikpic.com/allanw/images/DSC_0342.jpg',437,373,'Autumn leaves','http://www1.clikpic.com/allanw/images/DSC_0342_thumb.jpg',130, 111,0, 0,'','','Allan Wilkinson','','','');
photos[47] = new photo(1740066,'116680','','gallery','http://www1.clikpic.com/allanw/images/DSC_0020_edited-1.jpg',176,478,'Log Pile','http://www1.clikpic.com/allanw/images/DSC_0020_edited-1_thumb.jpg',130, 353,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');
photos[48] = new photo(1740065,'116680','','gallery','http://www1.clikpic.com/allanw/images/DSCN2413.jpg',386,290,'Driftwood','http://www1.clikpic.com/allanw/images/DSCN2413_thumb.jpg',130, 98,0, 1,'','','Allan Wilkinson','Vancouver Island Canada','','');
photos[49] = new photo(1740071,'116680','','gallery','http://www1.clikpic.com/allanw/images/B0000443_edited-11.jpg',118,306,'Inquisitive lambs','http://www1.clikpic.com/allanw/images/B0000443_edited-11_thumb.jpg',130, 337,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire dales','','');
photos[50] = new photo(1740074,'116680','','gallery','http://www1.clikpic.com/allanw/images/DSC_0064_edited-2.jpg',581,389,'Alcombden Stones','http://www1.clikpic.com/allanw/images/DSC_0064_edited-2_thumb.jpg',130, 87,0, 0,'','','Allan Wilkinson','Haworth Moor West Yorkshire','','');
photos[51] = new photo(1740076,'116680','','gallery','http://www1.clikpic.com/allanw/images/DSCN3243.jpg',386,290,'Disused sheep fold','http://www1.clikpic.com/allanw/images/DSCN3243_thumb.jpg',130, 98,0, 0,'','','Allan Wilkinson','Wharfedale Yorkshire Dales','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(116672,'1738136','Landscapes','gallery');
galleries[1] = new gallery(116673,'1802936,1743101,1740091,1740090,1740087,1740083,1739978,1739976,1739971,1739970','Waterfalls','gallery');
galleries[2] = new gallery(116675,'1738478','Rivers','gallery');
galleries[3] = new gallery(116677,'1738461','Andalucia','gallery');
galleries[4] = new gallery(116676,'1738485','Flora','gallery');
galleries[5] = new gallery(116678,'','Italy','gallery');
galleries[6] = new gallery(116680,'1740065','Miscellaneous','gallery');

