/***************************************************************************
* 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) {
	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;
}
/***************************************************************************
* 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('709631,703229,703224,703221,703216,703211,703210,703202,703160,703080,698260,698222,698025');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			if (!basic) {
			img.src = 'images/' + 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 = 'images/' + 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('709631,703229,703224,703221,703216,703211,703210,703202,703160,703080,698260,698222,698025');
	for (j = 0; j < photos.length; j++) {
		if (photos[j].id == imageID) {
			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="images/' + photos[j].src + '" width="' + photos[j].width + '" height="' + photos[j].height + '" class="mainhomepageimage" id="mainSample" name="mainSample" alt="' + photos[j].caption  + '" border="0">');
			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="images/' + 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;
			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>© Piers Allardyce </strong>' + photos[nextImg].photographer + '</p>';
			}
			if (temp != '') {				temp = temp + '<div class="spacer"></div>';			}					if (temp == '') {
			document.getElementById('imageDetails').style.visibility = 'hidden';
		}
		else {
			document.getElementById('imageDetails').style.visibility = 'visible';
		}
		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('Image = ' + 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 = 'images/' + 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(698038,'53599','','section78806','reduced100_0022.jpg',283,425,'London paramedics first on the scene during 7/7 bombings, for a real life story in Gay Times magazine ','reduced100_0022_thumb.jpg',130, 195,0, 1,'','','©PiersAllardyce','');
photos[1] = new photo(698041,'53592','','gallery','reduced100_0032.jpg',283,425,'Melanie C (former Spice Girl) ','reduced100_0032_thumb.jpg',130, 195,0, 1,'','','','');
photos[2] = new photo(698221,'53599','','section78806','reduced100_0077.jpg',333,500,'Lara McAllen, for a real life story in New! magazine','reduced100_0077_thumb.jpg',130, 195,0, 0,'','','','');
photos[3] = new photo(698222,'53594','','gallery','reduced100_0147.jpg',283,425,'Jack Dee','reduced100_0147_thumb.jpg',130, 195,1, 1,'','','','');
photos[4] = new photo(698224,'53592','','gallery','reduced100_0106.jpg',283,425,'MZ Fontaine (DJ)','reduced100_0106_thumb.jpg',130, 195,0, 0,'','','','');
photos[5] = new photo(698227,'53604','','gallery','reduced100_0119.jpg',283,425,'Nora-Jane Noone','reduced100_0119_thumb.jpg',130, 195,0, 0,'','','','');
photos[6] = new photo(698234,'53599','','section78806','reduced100_0197.jpg',283,425,'Lottery winners, a private commission','reduced100_0197_thumb.jpg',130, 195,0, 0,'','','','');
photos[7] = new photo(698252,'53604','','gallery','reducedDavid_Paisley.jpg',313,425,'David Paisley','reducedDavid_Paisley_thumb.jpg',130, 177,0, 1,'','','','');
photos[8] = new photo(698259,'53594','','gallery','reducedIMG_0026 copy.jpg',283,425,'Felix Dexter','reducedIMG_0026 copy_thumb.jpg',130, 195,0, 1,'','','','');
photos[9] = new photo(698260,'53594','','gallery','reducedIMG_0030.jpg',283,425,'Michael Barrymore','reducedIMG_0030_thumb.jpg',130, 195,1, 1,'','','','');
photos[10] = new photo(698262,'53604','','gallery','reducedIMG_0038 copy.jpg',283,425,'Janet Suzman','reducedIMG_0038 copy_thumb.jpg',130, 195,0, 0,'','','','');
photos[11] = new photo(698269,'53594',' ','gallery','reducedIMG_0114.jpg',283,425,'Alan Miller and Amy Lamé ','reducedIMG_0114_thumb.jpg',130, 195,0, 0,'','','','');
photos[12] = new photo(703080,'53593','','gallery','Norton2.jpg',283,425,'Graham Norton','Norton2_thumb.jpg',130, 195,1, 1,'','','','');
photos[13] = new photo(703138,'53608','','gallery','reducedBEST-PHOTO-Ackroyd.jpg',319,425,'Peter Ackroyd','reducedBEST-PHOTO-Ackroyd_thumb.jpg',130, 173,0, 0,'','','','');
photos[14] = new photo(703153,'53604','','gallery','reducedBEST-PHOTO-Callow.jpg',283,425,'Simon Callow ','reducedBEST-PHOTO-Callow_thumb.jpg',130, 195,0, 0,'','','','');
photos[15] = new photo(703156,'53596','','section78783','reducedBEST-PHOTO-Smith-&-W.jpg',283,425,'Lord Waheed Alli, Rt Hon Lord Chris Smith','reducedBEST-PHOTO-Smith-&-W_thumb.jpg',130, 195,0, 1,'','','','');
photos[16] = new photo(703157,'53604','','gallery','reducedBEST-PHOTO-Mark-Gatt.jpg',283,425,'Mark Gatiss','reducedBEST-PHOTO-Mark-Gatt_thumb.jpg',130, 195,0, 1,'','','','');
photos[17] = new photo(703159,'53592','','gallery','reducedBEST-PHOTO-Peter-Max.jpg',283,425,'Sir Peter Maxwell Davies (composer)','reducedBEST-PHOTO-Peter-Max_thumb.jpg',130, 195,0, 0,'','','','');
photos[18] = new photo(703160,'53604','','gallery','reducedJohn_Simm.jpg',269,425,'John Simm','reducedJohn_Simm_thumb.jpg',130, 205,1, 1,'','','','');
photos[19] = new photo(703161,'53594','','gallery','reducedLee_Evans.jpg',338,425,'Lee Evans','reducedLee_Evans_thumb.jpg',130, 163,0, 1,'','','','');
photos[20] = new photo(703169,'53594','','gallery','BEST-PHOTO-Chris-Green.jpg',364,277,'Chris Green','BEST-PHOTO-Chris-Green_thumb.jpg',130, 99,0, 1,'','','','');
photos[21] = new photo(703174,'53594','','gallery','reducedVic_and_Bob_1.jpg',425,339,'Vic Reeves and Bob Mortimer','reducedVic_and_Bob_1_thumb.jpg',130, 104,0, 1,'','','','');
photos[22] = new photo(703202,'53596','','section78783','reducedBEST-PHOTO-Cashman.jpg',283,425,'Michael Cashman MEP','reducedBEST-PHOTO-Cashman_thumb.jpg',130, 195,1, 1,'','','','');
photos[23] = new photo(703210,'54491','','gallery','reducedGilbert_and_George.jpg',282,425,'Gilbert and George','reducedGilbert_and_George_thumb.jpg',130, 196,1, 1,'','','','');
photos[24] = new photo(703211,'53608','','gallery','reducedBEST-PHOTO-Ned-Sheri.jpg',283,425,'Ned Sherrin','reducedBEST-PHOTO-Ned-Sheri_thumb.jpg',130, 195,1, 1,'','','','');
photos[25] = new photo(703212,'53604','','gallery','reducedBEST-PHOTO-Bourne.jpg',283,425,'Matthew Bourne (choreogapher)','reducedBEST-PHOTO-Bourne_thumb.jpg',130, 195,0, 0,'','','','');
photos[26] = new photo(703213,'54491','','gallery','reducedBEST-PHOTO-Maggie-Ha.jpg',283,425,'Maggi Hambling','reducedBEST-PHOTO-Maggie-Ha_thumb.jpg',130, 195,0, 1,'','','','');
photos[27] = new photo(703216,'53595','','section78783','reducedFinalBillClinton2.jpg',283,425,'Bill Clinton','reducedFinalBillClinton2_thumb.jpg',130, 195,1, 1,'','','','');
photos[28] = new photo(703220,'53592','','gallery','reducedDJ_Dimitri.jpg',273,425,'DJ Dimitri','reducedDJ_Dimitri_thumb.jpg',130, 202,0, 0,'','','','');
photos[29] = new photo(703224,'53594','','gallery','reducedBEST-PHOTO-Clary-&-G.jpg',425,283,'Julian Clary and Paul O\'Grady','reducedBEST-PHOTO-Clary-&-G_thumb.jpg',130, 87,1, 1,'','','','');
photos[30] = new photo(703226,'53604','','gallery','reducedBEST-PHOTO-Theatre-T.jpg',283,425,'Mark Ravenhill, Rikki Beadle-blair, Dr Anthony Field','reducedBEST-PHOTO-Theatre-T_thumb.jpg',130, 195,0, 1,'','','','');
photos[31] = new photo(703227,'53596','','section78783','reducedBEST-PHOTO-Paddick.jpg',283,425,'Brian Paddick (Deputy Assistant Commissioner for The Metropolitan Police)','reducedBEST-PHOTO-Paddick_thumb.jpg',130, 195,0, 1,'','','','');
photos[32] = new photo(703229,'54491','','gallery','reducedBEST-PHOTO-Cox.jpg',283,425,'Patrick Cox (shoe designer)','reducedBEST-PHOTO-Cox_thumb.jpg',130, 195,1, 1,'','','','');
photos[33] = new photo(703230,'53593','','gallery','reducedDonna_Air.jpg',274,425,'Donna Air','reducedDonna_Air_thumb.jpg',130, 202,0, 0,'','','','');
photos[34] = new photo(709296,'53592','','gallery','100_0051.jpg',283,425,'Dan Arborise','100_0051_thumb.jpg',130, 195,0, 1,'','','','');
photos[35] = new photo(709304,'53599','','section78806','reduced.jpg',283,425,'Terry Sanderson and Keith Woods, for a real life story in Gay Times magazine','reduced_thumb.jpg',130, 195,0, 0,'','','','');
photos[36] = new photo(709313,'53599','','section78806','reduced100_00071.jpg',283,425,'Johnathan Cresson and Mark Butcher, for a real life story in Gay Times magazine','reduced100_00071_thumb.jpg',130, 195,0, 0,'','','','');
photos[37] = new photo(709314,'53599','','section78806','reduced100_0010.jpg',283,425,'Phil Starr, for a real life story in Gay Times magazine','reduced100_0010_thumb.jpg',130, 195,0, 0,'','','','');
photos[38] = new photo(709629,'53598','','section78785','reduced100_0091.jpg',283,425,'HRH The Prince of Wales','reduced100_0091_thumb.jpg',130, 195,0, 0,'','','','');
photos[39] = new photo(709631,'53592','','gallery','reduced100_0236.jpg',283,425,'Singers and performers at the Vaisakhi Festival, Trafalgar Square','reduced100_0236_thumb.jpg',130, 195,1, 1,'','','','');
photos[40] = new photo(709632,'53599','','section78806','reduced100_4660.jpg',283,425,'Designer label obsessed family, for a real life story in Closer magazine','reduced100_4660_thumb.jpg',130, 195,0, 0,'','','','');
photos[41] = new photo(709633,'53592','','gallery','reduced100_7691.jpg',283,425,'Chico','reduced100_7691_thumb.jpg',130, 195,0, 0,'','','','');
photos[42] = new photo(709640,'53604','','gallery','Anthony-Sher.jpg',283,425,'Anthony Sher','Anthony-Sher_thumb.jpg',130, 195,0, 0,'','','','');
photos[43] = new photo(709651,'53599','','section78806','reducedIMG_0213.jpg',283,425,'Angus MacKinnon and his son, for a real life story in Now magazine','reducedIMG_0213_thumb.jpg',130, 195,0, 0,'','','','');
photos[44] = new photo(709875,'53593','','gallery','GordonRamsey.jpg',282,422,'Gordon Ramsay','GordonRamsey_thumb.jpg',130, 195,0, 0,'','','','');
photos[45] = new photo(710029,'53608','','gallery','Arnott.jpg',283,425,'Jake Arnott','Arnott_thumb.jpg',130, 195,0, 0,'','','','');
photos[46] = new photo(710038,'53593','','gallery','Quentin-Crisp-Writer,-actor.jpg',288,425,'Quentin Crisp','Quentin-Crisp-Writer,-actor_thumb.jpg',130, 192,0, 0,'','','','');
photos[47] = new photo(710040,'53604','','gallery','Richard-E-Grant,-Writer-&-a.jpg',286,425,'Richard E Grant','Richard-E-Grant,-Writer-&-a_thumb.jpg',130, 193,0, 0,'','','','');
photos[48] = new photo(711622,'53608','','gallery','reducedBriggs.jpg',279,425,'Ramond Briggs','reducedBriggs_thumb.jpg',130, 198,0, 0,'','','','');
photos[49] = new photo(711625,'53592','','gallery','reducedSarah_Nixey.jpg',275,425,'Sarah Nixey','reducedSarah_Nixey_thumb.jpg',130, 201,0, 0,'','','','');
photos[50] = new photo(711634,'53592','','gallery','reducedOrlando.jpg',272,425,'Orlando','reducedOrlando_thumb.jpg',130, 203,0, 0,'','','','');
photos[51] = new photo(711654,'53598','','section78785','reduced2.jpg',283,425,'HRH The Earl of Wessex','reduced2_thumb.jpg',130, 195,0, 0,'','','','');
photos[52] = new photo(711657,'53592','','gallery','jarvis.jpg',286,425,'Jarvis Cocker','jarvis_thumb.jpg',130, 193,0, 0,'','','','');
photos[53] = new photo(711755,'53598','','section78785','reducedIMG_0095.jpg',283,425,'HRH The Countess of Wessex','reducedIMG_0095_thumb.jpg',130, 195,0, 0,'','','','');
photos[54] = new photo(712120,'53597','','section78785','reduced219-1986_IMG.jpg',425,283,'','reduced219-1986_IMG_thumb.jpg',130, 87,0, 0,'118 118 Campaign','','','');
photos[55] = new photo(712151,'53595','','section78783','reduced102_02411.jpg',283,425,'Tony Blair','reduced102_02411_thumb.jpg',130, 195,0, 0,'','','','');
photos[56] = new photo(713142,'53608','','gallery','reducedJackie-Kaye.jpg',283,425,'Jackey Kaye','reducedJackie-Kaye_thumb.jpg',130, 195,0, 0,'','','','');
photos[57] = new photo(713437,'53593','','gallery','reduced100_0078.jpg',283,425,'Cilla Black','reduced100_0078_thumb.jpg',130, 195,0, 0,'','','','');
photos[58] = new photo(716483,'53598','','section78785','100_0091.jpg',283,425,'Neil Murray and J K Rowling','100_0091_thumb.jpg',130, 195,0, 0,'','','','');
photos[59] = new photo(737169,'53592','','gallery','Piers02.jpg',267,425,'Korn','Piers02_thumb.jpg',130, 207,0, 0,'','','','');
photos[60] = new photo(737398,'53608','','gallery','SarahWaters.jpg',313,425,'Sarah Waters','SarahWaters_thumb.jpg',130, 177,0, 0,'','','','');
photos[61] = new photo(738945,'53599','','section78806','100_0102.JPG',305,425,'Male nurses for a real life story in Positive Nation','100_0102_thumb.JPG',130, 181,0, 0,'','','','');
photos[62] = new photo(736950,'53592','','gallery','Piers07.jpg',284,425,'Cerys Mathews and Kelly Jones','Piers07_thumb.jpg',130, 195,0, 0,'','','','');
photos[63] = new photo(740200,'53596','','section78783','reduced0365.jpg',283,425,'Public Health Minister, Caroline Flint','reduced0365_thumb.jpg',130, 195,0, 0,'','','','');
photos[64] = new photo(736884,'53604','','gallery','Piers06.jpg',304,425,'Ewan McGregor','Piers06_thumb.jpg',130, 182,0, 0,'','','','');
photos[65] = new photo(710095,'53598','','section78785','reduced100_0039.jpg',284,425,'HRH The Princess Royal','reduced100_0039_thumb.jpg',130, 195,0, 0,'','','','');
photos[66] = new photo(712158,'53598','','section78785','reduced100_0109.jpg',283,425,'Sarah Ferguson','reduced100_0109_thumb.jpg',130, 195,0, 0,'','','','');
photos[67] = new photo(736776,'53592','','gallery','Piers051.jpg',311,425,'Coldplay','Piers051_thumb.jpg',130, 178,0, 0,'','','','');
photos[68] = new photo(736970,'53593','','gallery','Piers11.jpg',304,425,'Antonio Carluccio','Piers11_thumb.jpg',130, 182,0, 0,'','','','');
photos[69] = new photo(736977,'53592','','gallery','Piers12.jpg',365,425,'Bloodhound Gang','Piers12_thumb.jpg',130, 151,0, 0,'','','','');
photos[70] = new photo(737628,'53597','','section78785','1MG.jpg',334,425,'Betting online','1MG_thumb.jpg',130, 165,0, 0,'','','','');
photos[71] = new photo(740289,'54491','','gallery','reducedIMG_02551.jpg',309,425,'Reza Mahammad and Louis Mariette','reducedIMG_02551_thumb.jpg',130, 179,0, 0,'','','','');
photos[72] = new photo(754346,'53594','','gallery','Shappi 3.JPEG',294,425,'Shappi Khorsandi','Shappi 3_thumb.JPEG',130, 188,0, 0,'','','','');
photos[73] = new photo(703199,'53604','','gallery','reducedBEST-PHOTO-Barrowman.jpg',283,425,'John Barrowman','reducedBEST-PHOTO-Barrowman_thumb.jpg',130, 195,0, 0,'','','','');
photos[74] = new photo(698217,'53596','','section78783','reduced100_0060.jpg',283,425,'Rt Hon Lord Chris Smith','reduced100_0060_thumb.jpg',130, 195,0, 0,'','','','');
photos[75] = new photo(736964,'53604','','gallery','Piers10.jpg',289,425,'David Bedella','Piers10_thumb.jpg',130, 191,0, 0,'','','','');
photos[76] = new photo(737536,'53604','','gallery','Neil Bartlett2.jpg',302,425,'Neil Bartlett','Neil Bartlett2_thumb.jpg',130, 183,0, 0,'','','','');
photos[77] = new photo(737099,'53604','','gallery','Piers13.jpg',391,425,'Frantic Assembly, theatre troupe','Piers13_thumb.jpg',130, 141,0, 0,'','','','');
photos[78] = new photo(703167,'53592','','gallery','reducedKorn.jpg',338,425,'Korn','reducedKorn_thumb.jpg',130, 163,0, 1,'','','','');
photos[79] = new photo(703168,'54491','','gallery','reducedBishi.jpg',340,425,'Bishi ','reducedBishi_thumb.jpg',130, 163,0, 1,'','','','');
photos[80] = new photo(710041,'53592','','gallery','reduced Offspring.jpg',340,425,'The Offspring','reduced Offspring_thumb.jpg',130, 163,0, 0,'','','','');
photos[81] = new photo(710044,'53592','','gallery','reducedTravis.jpg',339,425,'Travis','reducedTravis_thumb.jpg',130, 163,0, 0,'','','','');
photos[82] = new photo(736991,'53599','','section78806','Piers14.jpg',287,425,'Mother and son','Piers14_thumb.jpg',130, 193,0, 0,'','','','');
photos[83] = new photo(851328,'53598','','section78785','reducedIMG_00501.jpg',312,425,'Tracey Emin','reducedIMG_00501_thumb.jpg',130, 177,0, 0,'','','','');
photos[84] = new photo(736824,'53592','','gallery','Piers041.jpg',500,314,'Cypress Hill','Piers041_thumb.jpg',130, 82,0, 0,'','','','');
photos[85] = new photo(709299,'53593','','gallery','100_0181.jpg',283,425,'Rebecca Loos and Jenny Shimizu','100_0181_thumb.jpg',130, 195,0, 1,'','','','');
photos[86] = new photo(716624,'53598','','section78785','100_0006.jpg',283,425,'Stephen Fry and Nick Partridge','100_0006_thumb.jpg',130, 195,0, 0,'','','','');
photos[87] = new photo(716633,'53598','','section78785','100_0189.jpg',283,425,'Jimmy Choo and Erin O\'Connor','100_0189_thumb.jpg',130, 195,0, 0,'','','','');
photos[88] = new photo(721861,'53596','','section78783','Sum.jpg',386,425,'Ben Summerskill and Alan Wardle at Madame Tussauds','Sum_thumb.jpg',130, 143,0, 0,'Ben Summerskill and Alan Wardle of Stonewall, Madame Tussauds','','','');
photos[89] = new photo(698223,'53594','','gallery','reducedAli_G_1.jpg',342,425,'Ali G (Sacha Baron Cohen)','reducedAli_G_1_thumb.jpg',130, 162,0, 0,'','','','');
photos[90] = new photo(698025,'54491','','gallery','reduced100_0007.jpg',425,283,'Peter and Richard Rogers (architects)','reduced100_0007_thumb.jpg',130, 87,1, 0,'','','©PiersAllardyce','');
photos[91] = new photo(698274,'54491','','gallery','reducedIMG_0161 copy.jpg',425,283,'Jemimer French (designer)','reducedIMG_0161 copy_thumb.jpg',130, 87,0, 0,'','','','');
photos[92] = new photo(698282,'53593','','gallery','reducedJason_Donovan.jpg',316,425,'Jason Donovan','reducedJason_Donovan_thumb.jpg',130, 175,0, 0,'','','','');
photos[93] = new photo(703165,'53604','','gallery','reducedBEST-PHOTO-Corrie.jpg',425,283,'Antony Cotton, Tony Warren, Jonathan Havey, Daran Little. At The Rovers\' Return, \'Coronation Street\'','reducedBEST-PHOTO-Corrie_thumb.jpg',130, 87,0, 0,'','','','');
photos[94] = new photo(703208,'53592','','gallery','reducedKent.jpg',500,315,'Kent ','reducedKent_thumb.jpg',130, 82,0, 0,'','','','');
photos[95] = new photo(703221,'53596','','section78783','reducedBEST-PHOTO-MP\'s.jpg',500,333,'Alan Duncan (Conservative MP), David Borrow (Labour MP), Chris Bryant (Labour MP) and Stephen Williams (Liberal Democrat MP)','reducedBEST-PHOTO-MP\'s_thumb.jpg',130, 87,1, 1,'','','','');
photos[96] = new photo(709636,'53599','','section78806','reduced100_7819.jpg',283,425,'Nadia Almada, for a real life story in Closer','reduced100_7819_thumb.jpg',130, 195,0, 0,'','','','');
photos[97] = new photo(709642,'53599','','section78806','IMG_0070.jpg',322,425,'Valentine\'s couples, for a real life story in Positive Nation magazine','IMG_0070_thumb.jpg',130, 172,0, 0,'','','','');
photos[98] = new photo(709648,'53596','','section78783','reducedIMG_0178.jpg',500,333,'Gordon Masterton (former President of Institution of Civil Engineers 2005-2006)','reducedIMG_0178_thumb.jpg',130, 87,0, 0,'','','','');
photos[99] = new photo(710035,'53593','','gallery','Paul-McKenna,-Writer-&-TV-p.jpg',309,425,'Paul McKenna','Paul-McKenna,-Writer-&-TV-p_thumb.jpg',130, 179,0, 0,'','','','');
photos[100] = new photo(710042,'53592','','gallery','reducedPaul Gam.jpg',425,256,'Paul Gambaccini','reducedPaul Gam_thumb.jpg',130, 78,0, 0,'','','','');
photos[101] = new photo(711649,'53592','','gallery','reduced1.jpg',500,322,'Alabama 3','reduced1_thumb.jpg',130, 84,0, 0,'','','','');
photos[102] = new photo(713034,'53608','','gallery','reducedStarkey1.jpg',425,283,'DR David Starkey','reducedStarkey1_thumb.jpg',130, 87,0, 0,'','','','');
photos[103] = new photo(720897,'53598','','section78785','100_01881.jpg',323,500,'Lily Cole, Erin O\'Connor and Jade Parfitt','100_01881_thumb.jpg',130, 201,0, 0,'','','','');
photos[104] = new photo(721845,'53599','','section78806','100_0036.jpg',326,425,'','100_0036_thumb.jpg',130, 169,0, 0,'','','','');
photos[105] = new photo(737926,'53597','','section78785','PRIMG1.jpg',425,276,'','PRIMG1_thumb.jpg',130, 84,0, 0,'','','','');
photos[106] = new photo(853483,'53598','','section78785','reducedKS9O0022.jpg',304,425,'Tony Blair and Ben Summerskill','reducedKS9O0022_thumb.jpg',130, 182,0, 0,'','','','');
photos[107] = new photo(703225,'53592','','gallery','reducedBush.jpg',425,362,'Bush','reducedBush_thumb.jpg',130, 111,0, 0,'','','','');
photos[108] = new photo(709348,'53599','','section78806','reduced100_0031.jpg',425,283,'Susanna Pelling, survivor of 7/7, for a real life story in New! magazine','reduced100_0031_thumb.jpg',130, 87,0, 0,'','','','');
photos[109] = new photo(710046,'53599','','section78806','reduceHIV.jpg',425,283,'HIV and AIDS campaigners: Clint Walters, Ford Hickson, Robin Brady, Stephen Bitti, Yusef Azad, Keith Alcorn and Carl Burnell','reduceHIV_thumb.jpg',130, 87,0, 0,'','','','');
photos[110] = new photo(711672,'53598','','section78785','reduced1373722IMG.jpg',500,333,'Gordon Brown at the treasury','reduced1373722IMG_thumb.jpg',130, 87,0, 0,'','','','');
photos[111] = new photo(716576,'53598','','section78785','101_0185.jpg',425,266,'Ronnie Wood and family','101_0185_thumb.jpg',130, 81,0, 0,'','','','');
photos[112] = new photo(720861,'53598','','section78785','100_00912.jpg',500,356,'Henry Cooper, Jimmy Hill, Martin Johnson and Alan Curbishley','100_00912_thumb.jpg',130, 93,0, 0,'','','','');
photos[113] = new photo(721838,'53604','','gallery','reducedPHOTO3.jpg',425,283,'Russell T Davies','reducedPHOTO3_thumb.jpg',130, 87,0, 0,'Russell T Davies','','','');
photos[114] = new photo(736956,'53598','','section78785','Piers09.jpg',425,314,'Francis Shand-Kydd','Piers09_thumb.jpg',130, 96,0, 0,'','','','');
photos[115] = new photo(737020,'53598','','section78785','Piers15.jpg',500,365,'Her Majesty The Queen, Stephen Hawkin, HRH Prince Philip, Duke of Edinburgh et al','Piers15_thumb.jpg',130, 95,0, 0,'','','','');
photos[116] = new photo(737163,'53598','','section78785','Piers03.jpg',500,328,'Rupert Everett','Piers03_thumb.jpg',130, 85,0, 0,'','','','');
photos[117] = new photo(737191,'53592','','gallery','Piers08.jpg',500,340,'My Vitriol','Piers08_thumb.jpg',130, 88,0, 0,'','','','');
photos[118] = new photo(737586,'53592','','gallery','BESTPromoters.jpg',425,379,'Club Promoters','BESTPromoters_thumb.jpg',130, 116,0, 0,'','','','');
photos[119] = new photo(738975,'53599','','section78806','reduced3.jpg',425,283,'Mildmay Director Steve Hall, for a real life story in Gay Times magazine','reduced3_thumb.jpg',130, 87,0, 0,'','','','');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
galleries = new Array();
galleries[0] = new gallery(53604,'703226,703160,703157,698252','Actors','gallery');
galleries[1] = new gallery(54491,'703229,703213,703210,703168','Artists','gallery');
galleries[2] = new gallery(53608,'703211','Authors','gallery');
galleries[3] = new gallery(53593,'709299,703080','Celebrity','gallery');
galleries[4] = new gallery(53594,'703224,703174,703169,703161,698260,698259,698222','Comedians','gallery');
galleries[5] = new gallery(53595,'703216','Corporate Events','section78783');
galleries[6] = new gallery(53596,'703227,703221,703202,703156','Corporate Portraits','section78783');
galleries[7] = new gallery(53592,'709631,709296,703167,698041','Musicians','gallery');
galleries[8] = new gallery(53597,'737926,737628,712120','Public Relation events','section78785');
galleries[9] = new gallery(53599,'698038','Real life','section78806');
galleries[10] = new gallery(53598,'853483,851328,737163,737020,736956,720897,720861,716633,716624,716576','Social diary','section78785');
galleries[11] = new gallery(53591,'','Weddings','section78785');

