/***************************************************************************
* 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('1878657,1137832,1137604');
	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('1878657,1137832,1137604');
	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 = 'marc downing 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(1878623,'81115','','gallery','http://www4.clikpic.com/marcad/images/001_1.jpg',360,540,'','http://www4.clikpic.com/marcad/images/001_1_thumb.jpg',130, 195,0, 0,'Devon coast.<br>\r\n<br>\r\nCopyright &copy; marc downing 2008','','','','','');
photos[1] = new photo(1878625,'81115','','gallery','http://www4.clikpic.com/marcad/images/013.jpg',333,500,'','http://www4.clikpic.com/marcad/images/013_thumb.jpg',130, 195,0, 0,'Becky Falls, Dartmoor<br>\r\n<br>\r\nCopyright &copy; marc downing 2008','','','','','');
photos[2] = new photo(1569059,'81115','','gallery','http://www4.clikpic.com/marcad/images/wells2.jpg',500,241,'','http://www4.clikpic.com/marcad/images/wells3.jpg',130, 63,0, 0,'Wells-Next-The-Sea.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[3] = new photo(1568729,'81115','','gallery','http://www4.clikpic.com/marcad/images/7 sisters.jpg',500,224,'','http://www4.clikpic.com/marcad/images/7 sisters1.jpg',130, 58,0, 0,'This is the Seven Sisters viewed from berling Gap.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[4] = new photo(1137851,'81115','','gallery','http://www4.clikpic.com/marcad/images/Snowdon2.JPG',500,333,'','http://www4.clikpic.com/marcad/images/Snowdon3.JPG',130, 87,0, 1,'Mount Snowdon.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[5] = new photo(1646880,'81115','','gallery','http://www4.clikpic.com/marcad/images/LV07-11.jpg',500,333,'','http://www4.clikpic.com/marcad/images/LV07-11_thumb.jpg',130, 87,0, 0,'The Grand Canyon.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[6] = new photo(1137838,'81115','','gallery','http://www4.clikpic.com/marcad/images/Misty.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Misty1.jpg',130, 87,0, 0,'A misty morning at Derwent Water, Cumbria.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[7] = new photo(1878631,'81115','','gallery','http://www4.clikpic.com/marcad/images/002_1.jpg',500,333,'','http://www4.clikpic.com/marcad/images/002_1_thumb.jpg',130, 87,0, 0,'Becky Falls, Dartmoor<br>\r\n<br>\r\nCopyright &copy; marc downing 2008','','','','','');
photos[8] = new photo(2371724,'81115','','gallery','http://www4.clikpic.com/marcad/images/Windmill Sunset.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Windmill Sunset_thumb.jpg',130, 87,0, 0,'Norfolk Windmill<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[9] = new photo(1899592,'82332','','gallery','http://www4.clikpic.com/marcad/images/subway.jpg',333,500,'','http://www4.clikpic.com/marcad/images/subway_thumb.jpg',130, 195,0, 0,'Subway.<br>\r\n<br>\r\nCopyright &copy; marc downing','','','','','');
photos[10] = new photo(1137858,'82332','','gallery','http://www4.clikpic.com/marcad/images/Ivy.jpg',500,750,'','http://www4.clikpic.com/marcad/images/Ivy1.jpg',130, 195,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[11] = new photo(1137868,'82332','','gallery','http://www4.clikpic.com/marcad/images/columns.JPG',333,500,'','http://www4.clikpic.com/marcad/images/columns_thumb.JPG',130, 195,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[12] = new photo(1137758,'82332','','gallery','http://www4.clikpic.com/marcad/images/Waiting.jpg',500,750,'','http://www4.clikpic.com/marcad/images/Waiting1.jpg',130, 195,0, 0,'Waiting.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[13] = new photo(1569008,'82332','','gallery','http://www4.clikpic.com/marcad/images/mud shower.JPG',333,500,'','http://www4.clikpic.com/marcad/images/mud shower_thumb.JPG',130, 195,0, 0,'Maldon Mud Race. Very cold shower time.<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[14] = new photo(2973995,'82332','','gallery','http://www4.clikpic.com/marcad/images/1a.jpg',266,500,'','http://www4.clikpic.com/marcad/images/1a_thumb.jpg',130, 244,0, 0,'Dissused Thames Bridge<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[15] = new photo(2973957,'82332','','gallery','http://www4.clikpic.com/marcad/images/batersea.jpg',500,333,'','http://www4.clikpic.com/marcad/images/batersea_thumb.jpg',130, 87,0, 0,'Batersea Power Station<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[16] = new photo(1905908,'82332','','gallery','http://www4.clikpic.com/marcad/images/NY hotel night b&w.jpg',500,378,'','http://www4.clikpic.com/marcad/images/NY hotel night b&w_thumb.jpg',130, 98,0, 1,'New York Hotel, Las Vegas<br>\r\n<br>\r\nCopyright &copy; marc downing','','','','','');
photos[17] = new photo(2371733,'82332','','gallery','http://www4.clikpic.com/marcad/images/hello.jpg',500,333,'','http://www4.clikpic.com/marcad/images/hello_thumb.jpg',130, 87,0, 0,'Hello<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[18] = new photo(2973997,'82332','','gallery','http://www4.clikpic.com/marcad/images/3.jpg',500,273,'','http://www4.clikpic.com/marcad/images/3_thumb.jpg',130, 71,0, 0,'Thames View<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[19] = new photo(1137571,'127779','','gallery','http://www4.clikpic.com/marcad/images/tower & gherkin.JPG',333,500,'','http://www4.clikpic.com/marcad/images/tower & gherkin_thumb.JPG',130, 195,0, 0,'Built 100 years apart, the gherkin viewed through Tower Bridge.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[20] = new photo(1137584,'127779','','gallery','http://www4.clikpic.com/marcad/images/st stephens ug.jpg',332,500,'','http://www4.clikpic.com/marcad/images/st stephens ug_thumb.jpg',130, 196,0, 0,'St. Stephens Tower at Westminster Underground.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[21] = new photo(1137864,'127779','','gallery','http://www4.clikpic.com/marcad/images/trevor.JPG',375,500,'','http://www4.clikpic.com/marcad/images/trevor_thumb.JPG',130, 173,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[22] = new photo(1137604,'127779','','gallery','http://www4.clikpic.com/marcad/images/Westminster.jpg',500,264,'','http://www4.clikpic.com/marcad/images/Westminster1.jpg',130, 69,1, 0,'This is the view from Waterloo Bridge looking along the Thames towards the London Eye and Parliament.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[23] = new photo(1137643,'127779','','gallery','http://www4.clikpic.com/marcad/images/Library.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Library1.jpg',130, 87,0, 1,'The British Library, which is within the British Museum.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[24] = new photo(1137903,'127779','','gallery','http://www4.clikpic.com/marcad/images/Wembely2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Wembely3.jpg',130, 87,0, 0,'','','','','','');
photos[25] = new photo(1137906,'127779','','gallery','http://www4.clikpic.com/marcad/images/Bodiam2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Bodiam3.jpg',130, 87,0, 1,'Copyright &copy; Marc Downing 2007','','','','','');
photos[26] = new photo(2973916,'127779','','gallery','http://www4.clikpic.com/marcad/images/westminster_1.jpg',500,333,'','http://www4.clikpic.com/marcad/images/westminster_1_thumb.jpg',130, 87,0, 0,'Westminster<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[27] = new photo(2973951,'127779','','gallery','http://www4.clikpic.com/marcad/images/foot bridge.jpg',333,500,'','http://www4.clikpic.com/marcad/images/foot bridge_thumb.jpg',130, 195,0, 0,'Thames Foot Bridge<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[28] = new photo(1137800,'82344','','gallery','http://www4.clikpic.com/marcad/images/Dozing2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Dozing3.jpg',130, 87,0, 1,'Copyright &copy; Marc Downing 2007','','','','','');
photos[29] = new photo(1137801,'82344','','gallery','http://www4.clikpic.com/marcad/images/Giraffe2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Giraffe3.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[30] = new photo(1137802,'82344','','gallery','http://www4.clikpic.com/marcad/images/Lioness.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Lioness1.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[31] = new photo(1137803,'82344','','gallery','http://www4.clikpic.com/marcad/images/Bullock2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Bullock3.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[32] = new photo(1568792,'82344','','gallery','http://www4.clikpic.com/marcad/images/giraffe4.jpg',500,333,'','http://www4.clikpic.com/marcad/images/giraffe5.jpg',130, 87,0, 0,'This beautiful giraffe is being fed by my beautiful daughter.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[33] = new photo(1568785,'82344','','gallery','http://www4.clikpic.com/marcad/images/elephant.jpg',500,333,'','http://www4.clikpic.com/marcad/images/elephant1.jpg',130, 87,0, 0,'Feeding time at Colchester.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[34] = new photo(2376312,'82344','','gallery','http://www4.clikpic.com/marcad/images/Robin.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Robin_thumb.jpg',130, 87,0, 0,'Robin<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[35] = new photo(1568738,'82345','','gallery','http://www4.clikpic.com/marcad/images/grafitti bike 1.jpg',500,333,'','http://www4.clikpic.com/marcad/images/grafitti bike 11.jpg',130, 87,0, 1,'Londons South Bank.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[36] = new photo(1568963,'82345','','gallery','http://www4.clikpic.com/marcad/images/canal.jpg',500,400,'','http://www4.clikpic.com/marcad/images/canal1.jpg',130, 104,0, 0,'The Regents Canal.<br>\r\nLondon throws up many suprises.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[37] = new photo(1137852,'82345','','gallery','http://www4.clikpic.com/marcad/images/Wrecked.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Wrecked1.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[38] = new photo(1899583,'82345','','gallery','http://www4.clikpic.com/marcad/images/hever reflection.jpg',500,288,'','http://www4.clikpic.com/marcad/images/hever reflection_thumb.jpg',130, 75,0, 0,'A very English afternoon at Hever Castle.<br>\r\n<br>\r\nCopyright &copy; marc downing','','','','','');
photos[39] = new photo(1137839,'82345','','gallery','http://www4.clikpic.com/marcad/images/Lochnagar2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Lochnagar3.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[40] = new photo(2371727,'82345','','gallery','http://www4.clikpic.com/marcad/images/Love Shack.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Love Shack_thumb.jpg',130, 87,0, 0,'Loveshack<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[41] = new photo(2371735,'82345','','gallery','http://www4.clikpic.com/marcad/images/sexy goth.jpg',500,333,'','http://www4.clikpic.com/marcad/images/sexy goth_thumb.jpg',130, 87,0, 0,'Sexy Goth<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[42] = new photo(1568737,'127780','','gallery','http://www4.clikpic.com/marcad/images/french cops in london.jpg',500,333,'','http://www4.clikpic.com/marcad/images/french cops in london1.jpg',130, 87,0, 0,'The Tour De France brought the French Police to london.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[43] = new photo(1137829,'127780','','gallery','http://www4.clikpic.com/marcad/images/Chain2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Chain3.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[44] = new photo(1137831,'127780','','gallery','http://www4.clikpic.com/marcad/images/Boots2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Boots3.jpg',130, 87,0, 1,'Copyright &copy; Marc Downing 2007','','','','','');
photos[45] = new photo(1137832,'127780','','gallery','http://www4.clikpic.com/marcad/images/Guard.jpg',500,332,'','http://www4.clikpic.com/marcad/images/Guard1.jpg',130, 86,1, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[46] = new photo(2974000,'127780','','gallery','http://www4.clikpic.com/marcad/images/triathlon-009-09-08-08a.jpg',500,500,'','http://www4.clikpic.com/marcad/images/triathlon-009-09-08-08a_thumb.jpg',130, 130,0, 0,'Triathlon<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[47] = new photo(2974002,'127780','','gallery','http://www4.clikpic.com/marcad/images/157.jpg',333,500,'','http://www4.clikpic.com/marcad/images/157_thumb.jpg',130, 195,0, 0,'The John lenon Wall-Prague<br>\r\n<br>\r\ncopyright &copy; marc downing 2008','','','','','');
photos[48] = new photo(1137867,'127780','','gallery','http://www4.clikpic.com/marcad/images/Snetterton.jpg',500,750,'','http://www4.clikpic.com/marcad/images/Snetterton1.jpg',130, 195,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[49] = new photo(2376197,'127780','','gallery','http://www4.clikpic.com/marcad/images/Ulting.jpg',333,500,'','http://www4.clikpic.com/marcad/images/Ulting_thumb.jpg',130, 195,0, 0,'Ulting, Essex<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[50] = new photo(1878657,'127781','','gallery','http://www4.clikpic.com/marcad/images/D38047-040-21-02-08-MAD.jpg',374,500,'','http://www4.clikpic.com/marcad/images/D38047-040-21-02-08-MAD_thumb.jpg',130, 174,1, 0,'The Queen<br>\r\n<br>\r\nCopyright &copy; LFB','','','','','');
photos[51] = new photo(1137731,'127781','','gallery','http://www4.clikpic.com/marcad/images/Patsy2.jpg',500,750,'','http://www4.clikpic.com/marcad/images/Patsy3.jpg',130, 195,0, 0,'A fashion event at London\'s Oxford Street saw many familiar faces.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[52] = new photo(1137732,'127781','','gallery','http://www4.clikpic.com/marcad/images/punk.jpg',363,500,'','http://www4.clikpic.com/marcad/images/punk_thumb.jpg',130, 179,0, 0,'Well, I did ask for attitude!<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[53] = new photo(1137745,'127781','','gallery','http://www4.clikpic.com/marcad/images/mud man.JPG',400,500,'','http://www4.clikpic.com/marcad/images/mud man_thumb.JPG',130, 163,0, 0,'At the beginning of every year in the town of Maldon in Essex, an ever increasing number of slightly mad people race out into the mud and freezing water.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[54] = new photo(1137672,'127781','','gallery','http://www4.clikpic.com/marcad/images/CNY2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/CNY3.jpg',130, 87,0, 1,'The Chinese New Year procession in London.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[55] = new photo(1586070,'127781','','gallery','http://www4.clikpic.com/marcad/images/008.jpg',500,333,'','http://www4.clikpic.com/marcad/images/0081.jpg',130, 87,0, 0,'','','','','','');
photos[56] = new photo(1137674,'127781','','gallery','http://www4.clikpic.com/marcad/images/Skewer2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Skewer3.jpg',130, 87,0, 0,'Copyright &copy; marc downing 2007','','','','','');
photos[57] = new photo(1137730,'127781','','gallery','http://www4.clikpic.com/marcad/images/Feet.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Feet1.jpg',130, 87,0, 0,'Happy Feet.<br>\r\n<br>\r\nCopyright &copy; marc downing 2007','','','','','');
photos[58] = new photo(2376311,'127781','','gallery','http://www4.clikpic.com/marcad/images/rocker.jpg',333,500,'','http://www4.clikpic.com/marcad/images/rocker_thumb.jpg',130, 195,0, 0,'Rocker<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[59] = new photo(1646881,'127782','','gallery','http://www4.clikpic.com/marcad/images/LV07-28.jpg',500,333,'','http://www4.clikpic.com/marcad/images/LV07-28_thumb.jpg',130, 87,0, 0,'New York Hotel Casino, Las Vegas.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[60] = new photo(1137840,'127782','','gallery','http://www4.clikpic.com/marcad/images/NYNY.jpg',500,333,'','http://www4.clikpic.com/marcad/images/NYNY1.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing 2007','','','','','');
photos[61] = new photo(1646879,'127782','','gallery','http://www4.clikpic.com/marcad/images/LV07-03.jpg',500,259,'','http://www4.clikpic.com/marcad/images/LV07-03_thumb.jpg',130, 67,0, 0,'Skywalk at the Grand Canyon.<br>\r\n<br>\r\nCopyright &copy; Marc Downing 2007','','','','','');
photos[62] = new photo(1905925,'127782','','gallery','http://www4.clikpic.com/marcad/images/belagio fountains.jpg',500,333,'','http://www4.clikpic.com/marcad/images/belagio fountains_thumb.jpg',130, 87,0, 1,'Belagio<br>\r\n<br>\r\nCopyright &copy; marc downing','','','','','');
photos[63] = new photo(1905928,'127782','','gallery','http://www4.clikpic.com/marcad/images/paris hotel lv.jpg',333,500,'','http://www4.clikpic.com/marcad/images/paris hotel lv_thumb.jpg',130, 195,0, 0,'Paris Hotel, Las Vegas<br>\r\n<br>\r\nCopyright &copy; marc downing','','','','','');
photos[64] = new photo(1137696,'82338','','gallery','http://www4.clikpic.com/marcad/images/Whale2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Whale3.jpg',130, 87,0, 1,'','','','','','');
photos[65] = new photo(1137766,'82338','','gallery','http://www4.clikpic.com/marcad/images/Backup2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Backup3.jpg',130, 87,0, 0,'','','','','','');
photos[66] = new photo(1137769,'82338','','gallery','http://www4.clikpic.com/marcad/images/HP2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/HP3.jpg',130, 87,0, 1,'','','','','','');
photos[67] = new photo(1137771,'82338','','gallery','http://www4.clikpic.com/marcad/images/Sark2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Sark3.jpg',130, 87,0, 0,'','','','','','');
photos[68] = new photo(1367081,'82338','','gallery','http://www4.clikpic.com/marcad/images/fireball.jpg',500,374,'','http://www4.clikpic.com/marcad/images/fireball1.jpg',130, 97,0, 0,'','','','','','');
photos[69] = new photo(1586060,'82338','','gallery','http://www4.clikpic.com/marcad/images/001.jpg',500,333,'','http://www4.clikpic.com/marcad/images/0011.jpg',130, 87,0, 0,'','','','','','');
photos[70] = new photo(1586061,'82338','','gallery','http://www4.clikpic.com/marcad/images/002.jpg',500,333,'','http://www4.clikpic.com/marcad/images/0022.jpg',130, 87,0, 0,'','','','','','');
photos[71] = new photo(1586065,'82338','','gallery','http://www4.clikpic.com/marcad/images/006.jpg',500,333,'','http://www4.clikpic.com/marcad/images/0061.jpg',130, 87,0, 0,'','','','','','');
photos[72] = new photo(1586067,'82338','','gallery','http://www4.clikpic.com/marcad/images/004.jpg',500,750,'','http://www4.clikpic.com/marcad/images/0041.jpg',130, 195,0, 0,'','','','','','');
photos[73] = new photo(1586068,'82338','','gallery','http://www4.clikpic.com/marcad/images/005.jpg',500,750,'','http://www4.clikpic.com/marcad/images/0051.jpg',130, 195,0, 0,'','','','','','');
photos[74] = new photo(1972617,'132597','','gallery','http://www4.clikpic.com/marcad/images/Rose-01.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Rose-01_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[75] = new photo(1972622,'132597','','gallery','http://www4.clikpic.com/marcad/images/Rose-03.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Rose-03_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[76] = new photo(1972634,'132597','','gallery','http://www4.clikpic.com/marcad/images/Rose-07.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Rose-07_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[77] = new photo(1972700,'132597','','gallery','http://www4.clikpic.com/marcad/images/Lily-15.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Lily-15_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[78] = new photo(1137806,'132597','','gallery','http://www4.clikpic.com/marcad/images/Cornflower2.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Cornflower3.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing','','','','','');
photos[79] = new photo(1972630,'132597','','gallery','http://www4.clikpic.com/marcad/images/Rose-04.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Rose-04_thumb.jpg',130, 87,0, 1,'copyright &copy; marc downing','','','','','');
photos[80] = new photo(1210755,'132597','','gallery','http://www4.clikpic.com/marcad/images/bee1.jpg',450,300,'','http://www4.clikpic.com/marcad/images/bee11.jpg',130, 87,0, 0,'Copyright &copy; Marc Downing','','','','','');
photos[81] = new photo(1972708,'132597','','gallery','http://www4.clikpic.com/marcad/images/Lily-13.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Lily-13_thumb.jpg',130, 87,0, 0,'copyright &copy; marc downing','','','','','');
photos[82] = new photo(1972604,'132597','','gallery','http://www4.clikpic.com/marcad/images/stamen.jpg',373,500,'','http://www4.clikpic.com/marcad/images/stamen_thumb.jpg',130, 174,0, 0,'copyright &copy; marc downing','','','','','');
photos[83] = new photo(1972607,'132597','','gallery','http://www4.clikpic.com/marcad/images/stamen 2.jpg',375,500,'','http://www4.clikpic.com/marcad/images/stamen 2_thumb.jpg',130, 173,0, 0,'copyright &copy; marc downing','','','','','');
photos[84] = new photo(1972710,'132597','','gallery','http://www4.clikpic.com/marcad/images/Lily-05.jpg',333,500,'','http://www4.clikpic.com/marcad/images/Lily-05_thumb.jpg',130, 195,0, 0,'copyright &copy; marc downing','','','','','');
photos[85] = new photo(1972713,'132597','','gallery','http://www4.clikpic.com/marcad/images/Lily-07.jpg',333,500,'','http://www4.clikpic.com/marcad/images/Lily-07_thumb.jpg',130, 195,0, 0,'copyright &copy; marc downing','','','','','');
photos[86] = new photo(2371750,'132597','','gallery','http://www4.clikpic.com/marcad/images/Poppy.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Poppy_thumb.jpg',130, 87,0, 0,'Poppy<br>\r\n<br>\r\nCopyright &copy; Marc Downing','','','','','');
photos[87] = new photo(1972778,'132598','','gallery','http://www4.clikpic.com/marcad/images/Apple-05.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Apple-05_thumb.jpg',130, 87,0, 1,'copyright &copy; marc downing','','','','','');
photos[88] = new photo(1972799,'132598','','gallery','http://www4.clikpic.com/marcad/images/Pepper-07.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Pepper-07_thumb.jpg',130, 87,0, 0,'copyright &copy; marc downing','','','','','');
photos[89] = new photo(1972803,'132598','','gallery','http://www4.clikpic.com/marcad/images/Pepper-09.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Pepper-09_thumb.jpg',130, 87,0, 0,'copyright &copy; marc downing','','','','','');
photos[90] = new photo(1972805,'132598','','gallery','http://www4.clikpic.com/marcad/images/Tomato-07.jpg',500,333,'','http://www4.clikpic.com/marcad/images/Tomato-07_thumb.jpg',130, 87,0, 0,'copyright &copy; marc downing','','','','','');
photos[91] = new photo(1972755,'132598','','gallery','http://www4.clikpic.com/marcad/images/Apple-04.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Apple-04_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[92] = new photo(1972782,'132598','','gallery','http://www4.clikpic.com/marcad/images/Lemon-04.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Lemon-04_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[93] = new photo(1972790,'132598','','gallery','http://www4.clikpic.com/marcad/images/Pepper-06.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Pepper-06_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[94] = new photo(1972808,'132598','','gallery','http://www4.clikpic.com/marcad/images/Tomato-03.jpg',500,500,'','http://www4.clikpic.com/marcad/images/Tomato-03_thumb.jpg',130, 130,0, 0,'copyright &copy; marc downing','','','','','');
photos[95] = new photo(3274812,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0009.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0009_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[96] = new photo(3274813,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0017.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0017_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[97] = new photo(3274836,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0059.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0059_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[98] = new photo(3274842,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0065.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0065_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[99] = new photo(3274845,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0082.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0082_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[100] = new photo(3274847,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0119.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0119_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[101] = new photo(3274850,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0164.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0164_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[102] = new photo(3274853,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0171.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0171_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[103] = new photo(3274861,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0177.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0177_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[104] = new photo(3274864,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0183.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0183_thumb.jpg',130, 87,0, 0,'','','','','','');
photos[105] = new photo(3274867,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0093.jpg',500,333,'','http://admin.clikpic.com/marcad/images/DSC_0093_thumb.jpg',130, 87,0, 1,'','','','','','');
photos[106] = new photo(3274869,'199677','','gallery','http://admin.clikpic.com/marcad/images/DSC_0188.jpg',500,241,'','http://admin.clikpic.com/marcad/images/DSC_0188_thumb.jpg',130, 63,0, 0,'','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(81115,'1137851','Gallery 1','gallery');
galleries[1] = new gallery(82332,'1905908','Gallery 2','gallery');
galleries[2] = new gallery(127779,'1137906,1137643','Gallery 3','gallery');
galleries[3] = new gallery(82344,'1137800','Gallery 4','gallery');
galleries[4] = new gallery(82345,'1568738','Gallery 5','gallery');
galleries[5] = new gallery(127780,'1137831','Gallery 6','gallery');
galleries[6] = new gallery(127781,'1137672','Gallery 7','gallery');
galleries[7] = new gallery(127782,'1905925','Gallery 8','gallery');
galleries[8] = new gallery(82338,'1137769,1137696','Gallery 9','gallery');
galleries[9] = new gallery(132597,'1972630','Gallery 10','gallery');
galleries[10] = new gallery(132598,'1972778','Gallery 11','gallery');
galleries[11] = new gallery(199677,'3274867','Maldon Mud Race 09','gallery');

