/***************************************************************************
* 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('1898608');
	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('1898608');
	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 = 'Chris Ratcliffe 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(1434610,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/BritishSailors_01.JPG',500,340,'','http://www3.clikpic.com/chrisratcliffe/images/BritishSailors_01_thumb.JPG',130, 88,0, 0,'One of the released British sailors taken hostage in Iranian waters looks out of an RAF helicopter at Heathrow airport hours after being freed','','','','','');
photos[1] = new photo(1898595,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_9562.jpg',500,389,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_9562_thumb.jpg',130, 101,0, 1,'A Greek Cypriot student celebrates the Communist Party, Akel, winning the General Election, Nicosia, Feb 2008','','','','','');
photos[2] = new photo(1434619,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Foot&Mouth_10.JPG',500,336,'','http://www3.clikpic.com/chrisratcliffe/images/Foot&Mouth_10_thumb.JPG',130, 87,0, 0,'A culled cow is loaded in to a truck in Surrey after a Foot and Mouth outbreak was diagnosed just yards from a government laboratory researching the disease','','','','','');
photos[3] = new photo(1434621,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_0860.JPG',500,341,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_0860_thumb.JPG',130, 89,0, 1,'Gordon Borwn launches his successful bid for the leadership of the Labour Party and therefore the right to become Prime Minister of Britain','','','','','');
photos[4] = new photo(1434624,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/IPhone_01.JPG',500,355,'','http://www3.clikpic.com/chrisratcliffe/images/IPhone_01_thumb.JPG',130, 92,0, 0,'The Apple IPhone is launched in the UK at the Apple store on Regents Street, Central London','','','','','');
photos[5] = new photo(1434631,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/ClimateProtest_01.JPG',500,335,'','http://www3.clikpic.com/chrisratcliffe/images/ClimateProtest_01_thumb.JPG',130, 87,0, 0,'A Police Officer escorts a Climate Change and third runway protester round the \'Climate Camp\' near to Heathrow airport','','','','','');
photos[6] = new photo(1434658,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/NorthernRock_021.JPG',500,698,'','http://www3.clikpic.com/chrisratcliffe/images/NorthernRock_021_thumb.JPG',130, 181,0, 0,'Two businessmen walk past a Northern Rock branch on the morning it was revealed that the bank had called on a lending facility from the Bank of England thus sparking fears of a bank run','','','','','');
photos[7] = new photo(1434648,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Mandela_Statue_024.JPG',500,690,'','http://www3.clikpic.com/chrisratcliffe/images/Mandela_Statue_024_thumb.JPG',130, 179,0, 0,'Nelson Mandela in Parliament Square after a statue of him was unvelied to mark his services to democracy and human endeavor','','','','','');
photos[8] = new photo(1436182,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/BlairScouts_072.JPG',500,694,'','http://www3.clikpic.com/chrisratcliffe/images/BlairScouts_072_thumb.JPG',130, 180,0, 0,'Tony Blair looks to the sky during his last week as British Prime Minister','','','','','');
photos[9] = new photo(1436168,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CR_RastaRaid_03.JPG',500,327,'','http://www3.clikpic.com/chrisratcliffe/images/CR_RastaRaid_03_thumb.JPG',130, 85,0, 0,'A female Police Officer removes a protester from a rastafarian temple in South London after a drugs raid','','','','','');
photos[10] = new photo(1571771,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Floods_031.JPG',500,341,'','http://www3.clikpic.com/chrisratcliffe/images/Floods_031_thumb.JPG',130, 89,0, 0,'A young girl watches on as waves crash over the sea wall at Gorleston, Norfolk. The region breathed a collective sigh of relief as floods from the Spring tides failed to materialise.','','','','','');
photos[11] = new photo(1436175,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/DavidCameron_035.JPG',500,340,'','http://www3.clikpic.com/chrisratcliffe/images/DavidCameron_035_thumb.JPG',130, 88,0, 0,'Conservative Leader David Cameron presents his policies on Social Order to the media in Central London','','','','','');
photos[12] = new photo(1436186,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CRBlair_26.JPG',500,345,'','http://www3.clikpic.com/chrisratcliffe/images/CRBlair_26_thumb.JPG',130, 90,0, 0,'Afer being sworn in by the Queen, British Prime Minister Gordon Brown and his wife Sarah arrive at number 10 Downing Street','','','','','');
photos[13] = new photo(1436188,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/DianaInquest_06.JPG',500,345,'','http://www3.clikpic.com/chrisratcliffe/images/DianaInquest_06_thumb.JPG',130, 90,0, 0,'Mohamed Al Fayed arrives at the High Court in Central London as the inquest in to the death of his son Dodi and Diana Princess of Wales continues','','','','','');
photos[14] = new photo(1436197,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CRSecurity_01.JPG',500,336,'','http://www3.clikpic.com/chrisratcliffe/images/CRSecurity_01_thumb.JPG',130, 87,0, 0,'Two Police Officers pass the front of the Cabinet Office entrance on Whitehall, Central London','','','','','');
photos[15] = new photo(1898608,'60035','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_9026_a.jpg',500,343,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_9026_a_thumb.jpg',130, 89,1, 0,'Turkish Cypriot boys try to retrieve their football from the barbed wire marking the Green Line through Nicosia as fresh attempts to unify the island are encouraged byt he General Election, Feb 2008','','','','','');
photos[16] = new photo(1436200,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/PROP150807_22_Fulham_Bolton.JPG',500,346,'','http://www3.clikpic.com/chrisratcliffe/images/PROP150807_22_Fulham_Bolton_thumb.JPG',130, 90,0, 0,'El Hadji Diouf celebrates his goal for Bolton against Fulham in the torrential rain at Craven Cottage','','','','','');
photos[17] = new photo(1436201,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/DogRacing.JPG',500,349,'','http://www3.clikpic.com/chrisratcliffe/images/DogRacing_thumb.JPG',130, 91,0, 0,'Dog racing on a cold January afternoon, Romford, Essex','','','','','');
photos[18] = new photo(1436203,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/OpenGolf_04.JPG',500,335,'','http://www3.clikpic.com/chrisratcliffe/images/OpenGolf_04_thumb.JPG',130, 87,0, 0,'Segio Garcia is the centre of attention amongst the press as he tees off the 6th hole at Carnoustie during the 2007 British Open','','','','','');
photos[19] = new photo(1436205,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/TourDeFRance_08.JPG',500,326,'','http://www3.clikpic.com/chrisratcliffe/images/TourDeFRance_08_thumb.JPG',130, 85,0, 1,'Levi Leipheimer of the USA and the Discovery Channel passes Buckingham Palace during the opening prologue stage of the 2007 Tour de France','','','','','');
photos[20] = new photo(1436223,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Walcott1.JPG',500,341,'','http://www3.clikpic.com/chrisratcliffe/images/Walcott1_thumb.JPG',130, 89,0, 0,'Theo Walcott takes his place on the England bench for the opening 2006 World Cup game against Paraguay','','','','','');
photos[21] = new photo(1436212,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Snooker.JPG',500,328,'','http://www3.clikpic.com/chrisratcliffe/images/Snooker_thumb.JPG',130, 85,0, 0,'Ronnie O\'sullivan in action during the 2006 UK Masters event at Wembley arena','','','','','');
photos[22] = new photo(1687879,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/WycombeSmoke.jpg',500,646,'','http://www3.clikpic.com/chrisratcliffe/images/WycombeSmoke_thumb.jpg',130, 168,0, 0,'Elliott Braithwaite of Wycombe Wanderers Youth team on a cold December evening as his team lose to Liverpool in the youth Cup.','','','','','');
photos[23] = new photo(1436248,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Poulter1.JPG',500,697,'','http://www3.clikpic.com/chrisratcliffe/images/Poulter1_thumb.JPG',130, 181,0, 0,'England\'s Ian Poulter tees up at the 18th hole at Wentworth during the European Tour BMW Championship 2006','','','','','');
photos[24] = new photo(1436233,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_1578.JPG',500,672,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_1578_thumb.JPG',130, 175,0, 0,'Thierry Henry of Arsenal takes the ball from the watchful David Bentley of Blackburn, Emirates Stadium, 2007','','','','','');
photos[25] = new photo(1436239,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/QV5X0288.JPG',500,339,'','http://www3.clikpic.com/chrisratcliffe/images/QV5X0288_thumb.JPG',130, 88,0, 0,'An England fan takes some refreshment before his team lose to Portugal in the Quarter finals of the 2006 World Cup, Gelsenkirchen, Germany','','','','','');
photos[26] = new photo(1436242,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/OpenGolf_10.JPG',500,317,'','http://www3.clikpic.com/chrisratcliffe/images/OpenGolf_10_thumb.JPG',130, 82,0, 0,'Spectators gather at the 2nd hole on the opening day of the 2007 British Open at Carnousite, Scotland','','','','','');
photos[27] = new photo(1436250,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/GerrardCele.JPG',500,344,'','http://www3.clikpic.com/chrisratcliffe/images/GerrardCele_thumb.JPG',130, 89,0, 0,'Steven Gerrard celebrates making it 2-1 to England against Sweden in the group phase of the 2006 World Cup, Cologne, Germany','','','','','');
photos[28] = new photo(1436259,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/ChariotRacingItaly.JPG',500,328,'','http://www3.clikpic.com/chrisratcliffe/images/ChariotRacingItaly_thumb.JPG',130, 85,0, 0,'A Chariot Racer at the San Siro Ippodrome, Milan, April 2006','','','','','');
photos[29] = new photo(1436260,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/VanDeMaart.JPG',500,350,'','http://www3.clikpic.com/chrisratcliffe/images/VanDeMaart_thumb.JPG',130, 91,0, 0,'Rafael Van der Vaart of Holland tries an acrobatic kick during the group match against Ivory Coast of the 2006 World Cup, Stuttgart, Germany','','','','','');
photos[30] = new photo(1436262,'60042','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_2589.JPG',500,343,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_2589_thumb.JPG',130, 89,0, 0,'','','','','','');
photos[31] = new photo(1423274,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/BobOddy_04.JPG',500,345,'','http://www3.clikpic.com/chrisratcliffe/images/BobOddy_04_thumb.JPG',130, 90,0, 0,'Bob Oddy, Secretary General of the London Taxi Drivers Association - photographed outside the offices in West London. Commission for Bloomberg News','','','','','');
photos[32] = new photo(1427395,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_12061.JPG',500,358,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_12061_thumb.JPG',130, 93,0, 0,'Marcus, Skateboarder on the near to the Festival Hall, South Bank. Personal Feature piece.','','','','','');
photos[33] = new photo(1423277,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_1479.JPG',500,361,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_1479_thumb.JPG',130, 94,0, 0,'William John Ratcliffe, my beautiful boy! Photographed at home. Portfolio piece.','','','','','');
photos[34] = new photo(1489658,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_36352.JPG',339,450,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_36352_thumb.JPG',130, 173,0, 0,'Emily Ould - Financial Consultant photographed at Blackfriars Bridge, Central London. Commission for the Daily Mail','','','','','');
photos[35] = new photo(1489736,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_11732.JPG',333,450,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_11732_thumb.JPG',130, 176,0, 0,'Josh, Skateboarder on the near to the Festival Hall, South Bank. Personal Feature piece.','','','','','');
photos[36] = new photo(1489528,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/AlexGilady_131.jpg',300,428,'','http://www3.clikpic.com/chrisratcliffe/images/AlexGilady_131_thumb.jpg',130, 185,0, 0,'Alex Gilday, International Olympic Committee member for Israel, photographed on the South Bank. Commission for G Globe, Israeli magazine.','','','','','');
photos[37] = new photo(1423283,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_32191.JPG',500,342,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_32191_thumb.JPG',130, 89,0, 0,'David Walsh, Holiday cottage owner - photographed in Weymouth. Commission for the Daily Mail','','','','','');
photos[38] = new photo(1427397,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_35821.JPG',500,346,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_35821_thumb.JPG',130, 90,0, 0,'Emily Ould - Financial Consultant photographed at Blackfriars Bridge, Central London. Commission for the Daily Mail','','','','','');
photos[39] = new photo(1635477,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/TroikaLondonArt_130.JPG',500,367,'','http://www3.clikpic.com/chrisratcliffe/images/TroikaLondonArt_130_thumb.JPG',130, 95,0, 0,'Oleg Sheiko, CEO of Metal Solutions Ltd, photographed at the White Cube Gallery in London, Nov 2007. Commission for Troika.','','','','','');
photos[40] = new photo(3807107,'98398','','gallery','http://admin.clikpic.com/chrisratcliffe/images/MarcoPierreWhite_03.JPG',500,332,'','http://admin.clikpic.com/chrisratcliffe/images/MarcoPierreWhite_03_thumb.JPG',130, 86,0, 1,'Chef Marco Pierre White at Lanes Restaurant in the city of London, commission for Bloomberg News','','','','','');
photos[41] = new photo(1428842,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/Claudia_Stolze_01.JPG',500,370,'','http://www3.clikpic.com/chrisratcliffe/images/Claudia_Stolze_01_thumb.JPG',130, 96,0, 0,'Claudia Stolze, Head of Make-up and Wigs at the Royal Opera House - photographed in the main workshop. Commission for Management Today magazine','','','','','');
photos[42] = new photo(1428859,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CJR_8061_1.JPG',500,357,'','http://www3.clikpic.com/chrisratcliffe/images/CJR_8061_1_thumb.JPG',130, 93,0, 0,'Claire, modelling DKNY dress in Hyde Park, commission for Daily Mail.','','','','','');
photos[43] = new photo(1562457,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/BrickLane_06.jpg',286,400,'','http://www3.clikpic.com/chrisratcliffe/images/BrickLane_06_thumb.jpg',130, 182,0, 0,'Leo Epstein, owner of Epra Fabrics on Brick Lane photographed in his shop, feature piece commissioned by Bloomberg News.','','','','','');
photos[44] = new photo(1635488,'98398','','gallery','http://www3.clikpic.com/chrisratcliffe/images/TroikaLondonArt_113.jpg',500,673,'','http://www3.clikpic.com/chrisratcliffe/images/TroikaLondonArt_113_thumb.jpg',130, 175,0, 0,'Dr Pavel Teplukhin, President of Troika Dialog Asset Management, photographed at the Haunch of Venison Gallery, Central London. Commission for Ogilvy Russia.','','','','','');
photos[45] = new photo(1899507,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_01.JPG',500,352,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_01_thumb.JPG',130, 92,0, 0,'An election worker removes posters as campaigning is banned in the 24 hours prior to voting.','','','','','');
photos[46] = new photo(1899511,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_05.JPG',500,353,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_05_thumb.JPG',130, 92,0, 0,'Turkish boys play football on the Green Line or \'No Man\'s Land\' with a decaying UN post in the background.','','','','','');
photos[47] = new photo(1899513,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_09.JPG',500,380,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_09_thumb.JPG',130, 99,0, 0,'Turkish Cypriot boys attempt to retrieve their ball from barbed wire markling the Green Line.','','','','','');
photos[48] = new photo(1899514,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_15.JPG',500,357,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_15_thumb.JPG',130, 93,0, 0,'An old UN border post sign with Turkish flags flying in Turkish controlled Nicosia','','','','','');
photos[49] = new photo(1899515,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_02.JPG',500,350,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_02_thumb.JPG',130, 91,0, 1,'An election 2008box with wax seal','','','','','');
photos[50] = new photo(1899516,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_03.JPG',500,351,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_03_thumb.JPG',130, 91,0, 0,'A elderly voter is passed her voting card complete with picture of the two candidates.','','','','','');
photos[51] = new photo(1899554,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_071.JPG',450,625,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_071_thumb.JPG',130, 181,0, 0,'Turkish flags are defiantley displayed on Mountains visible to Greek Cypriot residents of Nicosia','','','','','');
photos[52] = new photo(1899555,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_111.JPG',400,545,'','http://www3.clikpic.com/chrisratcliffe/images/CypriotElections_111_thumb.JPG',130, 177,0, 0,'A Greek Cypriot Soldier guards his post in Old Town Nicosia','','','','','');
photos[53] = new photo(1899556,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_121.JPG',450,595,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_121_thumb.JPG',130, 172,0, 0,'Demitris Christofias celebrates victory','','','','','');
photos[54] = new photo(1899521,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_06.JPG',500,366,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_06_thumb.JPG',130, 95,0, 0,'Ioannis Kasoulides delivers a speech to the media having cast his vote in central Nicosia','','','','','');
photos[55] = new photo(1899524,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_03A.JPG',500,346,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_03A_thumb.JPG',130, 90,0, 0,'A Demitris Christofias supporter outside the party headquarters displays his allegiance','','','','','');
photos[56] = new photo(1899526,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_51.JPG',500,362,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_51_thumb.JPG',130, 94,0, 0,'A Greek Cypriot student supporting the Communist party leader Demitris Christofias celebrates victory','','','','','');
photos[57] = new photo(1899529,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_16.JPG',500,374,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_16_thumb.JPG',130, 97,0, 0,'Demitris Christofias delivers a speech to the people of Cyprus at the Eletheran Stadium in Nicosia','','','','','');
photos[58] = new photo(1899531,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_10.JPG',500,333,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_10_thumb.JPG',130, 87,0, 0,'Supporters of the Communits party Akel celebrate victory','','','','','');
photos[59] = new photo(1899543,'127318','','gallery','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_14.JPG',500,694,'','http://www3.clikpic.com/chrisratcliffe/images/CyprusElections_14_thumb.JPG',130, 180,0, 0,'A supporter of Demitris Christofias outside the Eleftheren Stadium celebrating victory','','','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(60035,'1898595,1434621','News','gallery');
galleries[1] = new gallery(60042,'1436205','Sport','gallery');
galleries[2] = new gallery(98398,'3807107','Portraits','gallery');
galleries[3] = new gallery(127318,'1899515','Recent Events - Cyprus Elections','gallery');


