window.thumbnails = new Object();
												thumbnails[5683890] = new thumbnail(5683890,'','Northumberland Try-a-Tri Day 2','triTryDay2-BJ2_thumb.jpg',130, 98,1,'#');
												thumbnails[5412052] = new thumbnail(5412052,'','Tri Northumberland 2010 Events','2010Events72dpi_thumb.jpg',130, 92,1,'#');
												thumbnails[579040] = new thumbnail(579040,'','Ripon 2006 Swim','riponswim1_thumb.jpg',130, 87,1,'#');
												thumbnails[579042] = new thumbnail(579042,'','Ian Walton at Almere, Holland, 2008.','holland 020_thumb.jpg',130, 87,1,'#');
												thumbnails[580131] = new thumbnail(580131,'','Meadowfield 2006 Run','Meadowfieldrun1_thumb.jpg',130, 130,1,'#');
												thumbnails[582982] = new thumbnail(582982,'','Jem Lawson','Jem Lawson1.jpg',130, 130,1,'#');
												thumbnails[583034] = new thumbnail(583034,'','Graham Beal','Graham Beal1.jpg',130, 130,1,'#');
												thumbnails[583041] = new thumbnail(583041,'','Marietta Van Der Linden-Beal','Marietta Van Der Linden-Beal1.jpg',130, 130,1,'#');
												thumbnails[583053] = new thumbnail(583053,'','hartlepooltriathletes.com','hartlepooltriathletes.com1.jpg',130, 87,1,'#');
												thumbnails[583077] = new thumbnail(583077,'','North East Logo','NorthEastLogo20055.jpg',110, 156,1,'#');
												thumbnails[584383] = new thumbnail(584383,'','Ripon 2005 swim','riponswim21.jpg',130, 87,1,'#');
												thumbnails[594030] = new thumbnail(594030,'','','nirvanalogo31.jpg',130, 27,1,'#');
												thumbnails[594180] = new thumbnail(594180,'','Cleveland Steelman Start 2006','steelmanstart061.jpg',130, 87,1,'#');
												thumbnails[594193] = new thumbnail(594193,'','Cleveland Steelman Start 2006','steelmanstart0621.jpg',130, 65,1,'#');
												thumbnails[597454] = new thumbnail(597454,'','','NECT_thumb.jpg',130, 67,1,'#');
												thumbnails[598797] = new thumbnail(598797,'','','montage1 copy1.jpg',130, 87,1,'#');
												thumbnails[610512] = new thumbnail(610512,'','Prince Bishops 2006','PBtransition1.jpg',130, 195,1,'#');
												thumbnails[612471] = new thumbnail(612471,'','Alnwick Castle','Alnwick_thumb.jpg',130, 43,1,'#');
												thumbnails[612552] = new thumbnail(612552,'','Hartlepool Marina Triathlon 2006 Swim Start','HartlepoolSwim20063.jpg',130, 52,1,'#');
												thumbnails[612652] = new thumbnail(612652,'','Hartlepool Marina','HartlepoolMarina3.jpg',130, 52,1,'#');
												thumbnails[612798] = new thumbnail(612798,'','','CastleMorpeth11.jpg',130, 52,1,'#');
												thumbnails[612800] = new thumbnail(612800,'','','CastleMorpeth21.jpg',130, 52,1,'#');
												thumbnails[612801] = new thumbnail(612801,'','','CastleMorpeth31.jpg',130, 52,1,'#');
												thumbnails[612802] = new thumbnail(612802,'','','CastleMorpeth41.jpg',130, 52,1,'#');
												thumbnails[613532] = new thumbnail(613532,'','','Meadowfield_thumb.jpg',130, 43,1,'#');
												thumbnails[613651] = new thumbnail(613651,'','','Hamforspringstart1.jpg',130, 52,1,'#');
												thumbnails[613652] = new thumbnail(613652,'','','Hamforspringmarshalls1.jpg',130, 52,1,'#');
												thumbnails[614771] = new thumbnail(614771,'','','PeterleeMensWinner20061.jpg',130, 52,1,'#');
												thumbnails[614773] = new thumbnail(614773,'','','PeterleeLadiesWinner20061.jpg',130, 52,1,'#');
												thumbnails[614837] = new thumbnail(614837,'','','Cleveland Sprint_thumb.jpg',130, 43,1,'#');
												thumbnails[615179] = new thumbnail(615179,'','','WeardaleFord20051.jpg',130, 52,1,'#');
												thumbnails[615181] = new thumbnail(615181,'','','WeardaleMensWinner20061.jpg',130, 52,1,'#');
												thumbnails[615369] = new thumbnail(615369,'','','CleveShortBriefing20061.jpg',130, 52,1,'#');
												thumbnails[615371] = new thumbnail(615371,'','','CleveShortSwim20061.jpg',130, 52,1,'#');
												thumbnails[619376] = new thumbnail(619376,'','','SteelmanBriefing1.jpg',130, 52,1,'#');
												thumbnails[619378] = new thumbnail(619378,'','','JenMilsomSteelman06_edited-11.jpg',130, 52,1,'#');
												thumbnails[619582] = new thumbnail(619582,'','','SunCitySwimStart20051.jpg',130, 52,1,'#');
												thumbnails[619584] = new thumbnail(619584,'','','SunCityBike20051.jpg',130, 52,1,'#');
												thumbnails[621377] = new thumbnail(621377,'','','DerwentReservoir1.jpg',130, 52,1,'#');
												thumbnails[621381] = new thumbnail(621381,'','','PBStart20061.jpg',130, 52,1,'#');
												thumbnails[621560] = new thumbnail(621560,'','','HpoolMens Winner20061.jpg',130, 52,1,'#');
												thumbnails[621585] = new thumbnail(621585,'','','Helvellyn11.jpg',130, 52,1,'#');
												thumbnails[621586] = new thumbnail(621586,'','','Helvellyn21.jpg',130, 52,1,'#');
												thumbnails[621588] = new thumbnail(621588,'','','Helvellyn31.jpg',130, 52,1,'#');
												thumbnails[623660] = new thumbnail(623660,'','','Ripon11.jpg',130, 52,1,'#');
												thumbnails[623662] = new thumbnail(623662,'','','Ripon21.jpg',130, 52,1,'#');
												thumbnails[623781] = new thumbnail(623781,'','','Hebburn11.jpg',130, 52,1,'#');
												thumbnails[623784] = new thumbnail(623784,'','','Hebburn21.jpg',130, 52,1,'#');
												thumbnails[630073] = new thumbnail(630073,'','','Hamsterley Hammer_thumb.jpg',130, 43,1,'#');
												thumbnails[637787] = new thumbnail(637787,'','Arthur at the Peterlee Triathlon 2006','APPeterlee06run1.jpg',130, 195,1,'#');
												thumbnails[637992] = new thumbnail(637992,'','Arthur at the Cleveland Sprint Triathlon 2006','APClSprint06run1.jpg',130, 195,1,'#');
												thumbnails[640034] = new thumbnail(640034,'','Arthur at the Castle Morpeth Triathlon 2005','APCMorp05run1.jpg',130, 195,1,'#');
												thumbnails[648074] = new thumbnail(648074,'','Arthur at the Peterlee Triathlon 2006','APPeterlee06bike1.jpg',130, 195,1,'#');
												thumbnails[649441] = new thumbnail(649441,'','Tony Main of Cleveland Bike Traks Tri Club, the North-East Referee of the Year 2006, at the Hartlepool Marina Triathlon.','TonyMain1.jpg',130, 195,1,'#');
												thumbnails[650376] = new thumbnail(650376,'','Tracey Sample of Alnwick Tri Club, the North East Region Volunteer of the Year 2006 at the Alnwick Triathlon.','TraceySample1.jpg',130, 195,1,'#');
												thumbnails[650504] = new thumbnail(650504,'','','TraceySample33.jpg',130, 195,1,'#');
												thumbnails[651949] = new thumbnail(651949,'','Arthur at the Cleveland Short Course 2005','APClShort05run1.jpg',130, 195,1,'#');
												thumbnails[655146] = new thumbnail(655146,'','Sandra Main of Cleveland Bike Traks Tri Club at the Peterlee Triathlon 2006','Sandra Main1.jpg',130, 195,1,'#');
												thumbnails[658274] = new thumbnail(658274,'','Arthur at the Cleveland Sprint Triathlon 2006','APClSprint06bike1.jpg',130, 195,1,'#');
												thumbnails[660052] = new thumbnail(660052,'','The swim start at the Ripon Triathlon 2005','Swim11.jpg',130, 195,1,'#');
												thumbnails[661285] = new thumbnail(661285,'','Arthur at the Alnwick Triathlon 2005.','APAlnwick05bike1.jpg',130, 194,1,'#');
												thumbnails[662561] = new thumbnail(662561,'','Jen at the Kirkby \"Killer\" Duathlon 2005','JenMilsom21.jpg',130, 195,1,'#');
												thumbnails[663558] = new thumbnail(663558,'','','Christmas copy1.jpg',130, 195,1,'#');
												thumbnails[667472] = new thumbnail(667472,'','Mike at the Cleveland Steelman 2006','MikeCharltonSteelman061.jpg',130, 195,1,'#');
												thumbnails[667493] = new thumbnail(667493,'','Rob at the Prince Bishops 2006','RobForrestPB062.jpg',130, 195,1,'#');
												thumbnails[667521] = new thumbnail(667521,'','Eric at the Prince Bishops Triathlon 2005','EricBlakey21.jpg',130, 195,1,'#');
												thumbnails[667880] = new thumbnail(667880,'','Tony at the Prince Bishops Triathlon 2005','TonyRees1.jpg',130, 195,1,'#');
												thumbnails[667892] = new thumbnail(667892,'','Mark at the Prince Bishops Triathlon 2005','MarkRichardson1.jpg',130, 195,1,'#');
												thumbnails[667905] = new thumbnail(667905,'','David at the Hamsterley Forest Spring Duathlon 2006','DavidMasterman1.jpg',130, 195,1,'#');
												thumbnails[676932] = new thumbnail(676932,'','Tim Humphries of Ryton Tri Club and John Turner of Sun City Tri Club at the Cleveland Steelman Triathlon 2006.','TimHumpriesJohnTurner1.jpg',130, 195,1,'#');
												thumbnails[678548] = new thumbnail(678548,'','Kath Blakey of Cleveland Bike Traks Tri Club.','KathBlakey_edited-11.jpg',130, 195,1,'#');
												thumbnails[681099] = new thumbnail(681099,'','Dave Stevens of One Life Racing at the Alnwick Triathlon 2006.','DaveStevens1.jpg',130, 195,1,'#');
												thumbnails[683619] = new thumbnail(683619,'','John Manders of hartlepooltriathletes.com at the Cleveland Steelman 2006','JohnManders1.jpg',130, 195,1,'#');
												thumbnails[685616] = new thumbnail(685616,'','Clockwise, from top left - Donna James of Durham Tri, Phil Gray of One Life, Jen Milsom of Cleveland and Tony Dixon of Hartlepool.','montage2 copy1.jpg',130, 195,1,'#');
												thumbnails[686770] = new thumbnail(686770,'','Jane McLoughlin of hartlepooltriathletes.com at the Castle Morpeth Triathlon 2006.','JaneMcLoughlin1.jpg',130, 195,1,'#');
												thumbnails[688613] = new thumbnail(688613,'','Tony Dixon of hartlepooltriathletes.com at the Prince Bishops Triathlon 2006.','TonyDixon21.jpg',130, 195,1,'#');
												thumbnails[690815] = new thumbnail(690815,'','David Davison of Alnwick Tri Club at the Castle Morpeth Triathlon 2006','DavidDavison21.jpg',130, 195,1,'#');
												thumbnails[696873] = new thumbnail(696873,'','Frank Whitelock of Durham Tri Club at the Hartlepool Marina Triathlon 2006.','FrankWhitelock1.jpg',130, 195,1,'#');
												thumbnails[704090] = new thumbnail(704090,'','Clive Blakey of Ryton Tri Club at the Castle Morpeth Triathlon 2006.','CliveBlakey1.jpg',130, 195,1,'#');
												thumbnails[705844] = new thumbnail(705844,'','','StokDu10_-_1st_Run_06_thumb.jpg',130, 87,1,'#');
												thumbnails[708163] = new thumbnail(708163,'','Jem Lawson of Tyne Tri Club, the new Chair of Triathlon England at last evening\'s Regional Committee Meeting.','JemLawson21.jpg',130, 195,1,'#');
												thumbnails[710894] = new thumbnail(710894,'','Emily Rowbothom at the Cleveland Short Course Triathlon 2006.','EmilyRowbothom1.jpg',130, 195,1,'#');
												thumbnails[729467] = new thumbnail(729467,'','Organiser Paul Jones at last year\'s Northumberland Triathlon Festival race briefing.','PaulJones51.jpg',130, 130,1,'#');
												thumbnails[729535] = new thumbnail(729535,'','','KayStokes1.jpg',130, 130,1,'#');
												thumbnails[768739] = new thumbnail(768739,'','A competitor climbing out of Stanhope on the return journey.','JohnWoods1.jpg',130, 87,1,'#');
												thumbnails[768810] = new thumbnail(768810,'','','SemerWater1.jpg',130, 87,1,'#');
												thumbnails[781874] = new thumbnail(781874,'','Hilary at the Cleveland Sprint Triathlon in 2005.','HilaryDickinson3.jpg',130, 130,1,'#');
												thumbnails[854663] = new thumbnail(854663,'','','Stokesley_thumb.jpg',130, 43,1,'#');
												thumbnails[854855] = new thumbnail(854855,'','Nathaniel Williams, the winner of Sunday\'s Stokesley Duathlon.','NathanielWilliams21.jpg',130, 195,1,'#');
												thumbnails[857162] = new thumbnail(857162,'','','NathanielWilliamsNP1.jpg',130, 130,1,'#');
												thumbnails[857164] = new thumbnail(857164,'','','KristinaSlaterNP1.jpg',130, 130,1,'#');
												thumbnails[857167] = new thumbnail(857167,'','','Stokesleystart2.jpg',130, 52,1,'#');
												thumbnails[857325] = new thumbnail(857325,'','Donna James, F40-44 World Duathlon Champion, seen here at the Hamsterley Forest Sprint Duathlon earlier this month.','Donna James1.jpg',130, 195,1,'#');
												thumbnails[932846] = new thumbnail(932846,'','','tryatri transition1.jpg',130, 98,1,'#');
												thumbnails[957729] = new thumbnail(957729,'','Start of 2007 race.','Hamsterley Sprint_thumb.jpg',130, 43,1,'#');
												thumbnails[1005543] = new thumbnail(1005543,'','','PaulJones21.jpg',130, 195,1,'#');
												thumbnails[1030887] = new thumbnail(1030887,'','','Ridgeback1a1.jpg',130, 98,1,'#');
												thumbnails[1030889] = new thumbnail(1030889,'','','Trek1a1.jpg',130, 98,1,'#');
												thumbnails[1034659] = new thumbnail(1034659,'','','RaleighChimera21.jpg',130, 80,1,'#');
												thumbnails[1135612] = new thumbnail(1135612,'','','Swim 21.jpg',130, 35,1,'#');
												thumbnails[1197126] = new thumbnail(1197126,'','','Sun City Banner1.jpg',130, 32,1,'#');
												thumbnails[1215468] = new thumbnail(1215468,'','Paul at the Prince Bishops Triathlon 2005.','PaulJones91.jpg',130, 130,1,'#');
												thumbnails[1309688] = new thumbnail(1309688,'','Swim Start','Swim Start1.jpg',130, 87,1,'#');
												thumbnails[1366363] = new thumbnail(1366363,'','Elliott Gowland leading a group up The Struggle.','Kirkstone 251.jpg',130, 87,1,'#');
												thumbnails[1405762] = new thumbnail(1405762,'','Alistair Brownlee.','Alistair Brownlee run One Life07-31.jpg',130, 195,1,'#');
												thumbnails[1405763] = new thumbnail(1405763,'','Alice Hector','Alice Hector21.jpg',130, 87,1,'#');
												thumbnails[1453861] = new thumbnail(1453861,'','','Ed\'s Invite_thumb.jpg',130, 87,1,'#');
												thumbnails[1480981] = new thumbnail(1480981,'','','MikeHall32.jpg',130, 130,1,'#');
												thumbnails[1497687] = new thumbnail(1497687,'','Kerry on her wedding day.','Kerry Gowland1.jpg',130, 87,1,'#');
												thumbnails[1505251] = new thumbnail(1505251,'','Jim College, Will Kemp and Paul Christon in today\'s event.','College Kemp Christon1.jpg',130, 87,1,'#');
												thumbnails[1610845] = new thumbnail(1610845,'','Kirkstone 117','Kirkstone 1171.jpg',130, 87,1,'#');
												thumbnails[1708494] = new thumbnail(1708494,'','','Darlington 2_thumb.jpg',130, 43,1,'#');
												thumbnails[1708566] = new thumbnail(1708566,'','','Short Course_thumb.jpg',130, 43,1,'#');
												thumbnails[1787277] = new thumbnail(1787277,'','','georgierutherford_thumb.jpg',100, 202,1,'#');
												thumbnails[1795328] = new thumbnail(1795328,'','','trek_thumb.jpg',130, 91,1,'#');
												thumbnails[1828035] = new thumbnail(1828035,'','','Steelman_thumb.jpg',130, 43,1,'#');
												thumbnails[1828117] = new thumbnail(1828117,'','','Ripon_thumb.jpg',130, 43,1,'#');
												thumbnails[1828644] = new thumbnail(1828644,'','','Helvellyn 1_thumb.jpg',130, 43,1,'#');
												thumbnails[1958528] = new thumbnail(1958528,'','Start of Hamsterley Hammer Duathlon 2008.','Start General for clikpic_thumb.jpg',130, 87,1,'#');
												thumbnails[2011522] = new thumbnail(2011522,'','','Stokesley Start_thumb.jpg',130, 87,1,'#');
												thumbnails[2088704] = new thumbnail(2088704,'','','Start 2_thumb.jpg',130, 59,1,'#');
												thumbnails[3073326] = new thumbnail(3073326,'','Alistair Brownlee in Beijing','Alistair Brownlee_thumb.jpg',130, 81,1,'#');
												thumbnails[3089816] = new thumbnail(3089816,'','Kay at the Durham Duathlon yesterday.','044 for NP_thumb.jpg',130, 195,1,'#');
												thumbnails[3091392] = new thumbnail(3091392,'','','034 for NP_thumb.jpg',130, 195,1,'#');
												thumbnails[3130838] = new thumbnail(3130838,'','The Junior Regional Academy at Hamsterley Forest on 22 November.','academy hamsterley_thumb.jpg',130, 87,1,'#');
												thumbnails[3151596] = new thumbnail(3151596,'','','club&coach2_thumb.jpg',130, 87,1,'#');
												thumbnails[3234085] = new thumbnail(3234085,'','','Base for new Christmas homepage photo 3-2 copy_thumb.jpg',130, 119,1,'#');
												thumbnails[3300778] = new thumbnail(3300778,'','','tri4u_thumb.jpg',130, 57,1,'#');
												thumbnails[3311340] = new thumbnail(3311340,'','','One Life banner_thumb.jpg',130, 65,1,'#');
												thumbnails[3361324] = new thumbnail(3361324,'','','Transition 3_thumb.jpg',130, 195,1,'#');
												thumbnails[3361330] = new thumbnail(3361330,'','','Swim2_thumb.jpg',130, 195,1,'#');
												thumbnails[3361334] = new thumbnail(3361334,'','','Bike 1jpg_thumb.jpg',130, 195,1,'#');
												thumbnails[3361335] = new thumbnail(3361335,'','','Run 3_thumb.jpg',130, 195,1,'#');
												thumbnails[3402750] = new thumbnail(3402750,'','','DarlingtonTriClub2008-2_thumb.jpg',130, 58,1,'#');
												thumbnails[3438054] = new thumbnail(3438054,'','','activeberwick_thumb.jpg',130, 168,1,'#');
												thumbnails[3532456] = new thumbnail(3532456,'','Adam Druett with his bike.','Adam_Druett_Cycling_Pic1_thumb.jpg',130, 98,1,'#');
												thumbnails[3615173] = new thumbnail(3615173,'','The start of Sunday\'s race.','Stokesley_09-_00251_thumb.jpg',130, 87,1,'#');
												thumbnails[3639717] = new thumbnail(3639717,'','','aquasphere-logo1a_thumb.jpg',130, 23,1,'#');
												thumbnails[3684049] = new thumbnail(3684049,'','Runners dominated by Ampleforth Priory.','Ampleforth_Coll_thumb.jpg',130, 87,1,'#');
												thumbnails[3730495] = new thumbnail(3730495,'','','Ashington_Poster_thumb.jpg',130, 178,1,'#');
												thumbnails[3847111] = new thumbnail(3847111,'','','in_the_lake001_thumb.jpg',130, 87,1,'#');
												thumbnails[3847116] = new thumbnail(3847116,'','','swim_start_002_thumb.jpg',130, 87,1,'#');
												thumbnails[3885201] = new thumbnail(3885201,'','Ullswater','Venues_-_Lake_District_3_thumb.jpg',130, 98,1,'#');
												thumbnails[3920969] = new thumbnail(3920969,'','Tracey Sample winning at Alnwick Triathlon 2009','TraceySample4_thumb.jpg',130, 87,1,'#');
												thumbnails[3920974] = new thumbnail(3920974,'','Alan Copland winning at Alnwick Triathlon 2009','Alan_Copland_thumb.jpg',130, 87,1,'#');
												thumbnails[3923247] = new thumbnail(3923247,'','','KeswickBike09-1_thumb.jpg',130, 87,1,'#');
												thumbnails[4048639] = new thumbnail(4048639,'','','Wansbeck_Swim_Start_thumb.jpg',130, 48,1,'#');
												thumbnails[4052956] = new thumbnail(4052956,'','','PrinceBishops2006a_thumb.jpg',130, 55,1,'#');
												thumbnails[4135826] = new thumbnail(4135826,'','Rob West, Barry Jameson, Tim Wylie and Alan Copland, all of One Life and all National Champions!','One_Life_Champions_2009_thumb.jpg',130, 87,1,'#');
												thumbnails[4163836] = new thumbnail(4163836,'','Newbiggin Bay','Newbiggin_Bay2_thumb.jpg',130, 55,1,'#');
												thumbnails[4299192] = new thumbnail(4299192,'','','Hetton_OWS_Tri_2009_013a_thumb.jpg',130, 98,1,'#');
												thumbnails[4560214] = new thumbnail(4560214,'','','JohnMandersDavidWilson_thumb.jpg',130, 199,1,'#');
												thumbnails[4631994] = new thumbnail(4631994,'','','Nottingham_2009a_thumb.jpg',130, 98,1,'#');
												thumbnails[4750080] = new thumbnail(4750080,'','','IRC2009image002a_thumb.jpg',130, 88,1,'#');
												thumbnails[5498396] = new thumbnail(5498396,'','','Junior_duathlon_training_day_poster_A5_thumb.jpg',130, 184,1,'#');
												thumbnails[5645721] = new thumbnail(5645721,'','','MBT_Shoe_thumb.jpg',130, 73,1,'#');
												thumbnails[5988982] = new thumbnail(5988982,'','','Emma_bike_Alnwick_2010_thumb.jpg',130, 195,1,'#');
												thumbnails[6035616] = new thumbnail(6035616,'','','Steve_Backley_with_awards_winners_and_sponsors_thumb.jpg',130, 87,1,'#');
												thumbnails[6086792] = new thumbnail(6086792,'','','lanzarote_1_thumb.jpg',130, 87,1,'#');
												thumbnails[6086793] = new thumbnail(6086793,'','','lanzarote_2_thumb.jpg',130, 62,1,'#');
												thumbnails[6086812] = new thumbnail(6086812,'','','lanzarote_3_thumb.jpg',130, 87,1,'#');
												thumbnails[6145575] = new thumbnail(6145575,'','','Chris_Cook_thumb.jpg',130, 88,1,'#');
												thumbnails[7224118] = new thumbnail(7224118,'','','Christmas_3-2_copy_thumb.jpg',130, 87,1,'#');
												thumbnails[7501127] = new thumbnail(7501127,'','','MikeHallsprint06bike_thumb.jpg',130, 195,1,'#');
												thumbnails[608769] = new thumbnail(608769,'44497','Andrew Wilde - Cleveland Steelman 2006','AndrewWilde1.jpg',130, 195,1,'photo_608769.html');
												thumbnails[3439326] = new thumbnail(3439326,'','Kay S and NC1','Kay S and NC1_thumb.jpg',130, 87,1,'#');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '705844';
imageSets[3] = '5412052';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/johnbhowells/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/johnbhowells/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += '.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && '' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Northern Pulse : ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																				temp = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* 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, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

