window.thumbnails = {};
															thumbnails[2261420] = clik.newPhoto({"id":2261420,"src":"31_Oulton_Park_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2261420.html","width":130,"caption":"Oulton Park Wirral 100","height":87});
															thumbnails[2261421] = clik.newPhoto({"id":2261421,"src":"another_lap_thumb.jpg","galleries_id":148211,"server_id":32,"link":"photo_2261421.html","width":130,"caption":"Triathlon Girl","height":87});
															thumbnails[2261423] = clik.newPhoto({"id":2261423,"src":"big_air_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2261423.html","width":130,"caption":"Mountain Mayhem Elite Rider catching air","height":87});
															thumbnails[2261425] = clik.newPhoto({"id":2261425,"src":"BMX_air_thumb.jpg","galleries_id":148188,"server_id":32,"link":"photo_2261425.html","width":130,"caption":"BMX Rider","height":195});
															thumbnails[2261427] = clik.newPhoto({"id":2261427,"src":"BMX_Lance_thumb.jpg","galleries_id":148188,"server_id":32,"link":"photo_2261427.html","width":130,"caption":"Lance McDermot looks down","height":195});
															thumbnails[2261431] = clik.newPhoto({"id":2261431,"src":"Broken_earth_broken_sky_thumb.jpg","galleries_id":148664,"server_id":32,"link":"photo_2261431.html","width":130,"caption":"Scottish Coastline","height":195});
															thumbnails[2261439] = clik.newPhoto({"id":2261439,"src":"Dainese_visitor_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2261439.html","width":130,"caption":"Rizla Suzuki bike in Dainese","height":195});
															thumbnails[2261440] = clik.newPhoto({"id":2261440,"src":"Dirt_jumping_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2261440.html","width":130,"caption":"Dirt Jumping at Filthy 48","height":173});
															thumbnails[2261443] = clik.newPhoto({"id":2261443,"src":"Fire_thumb.jpg","galleries_id":148204,"server_id":32,"link":"photo_2261443.html","width":130,"caption":"Saab Salomon entertainment","height":195});
															thumbnails[2261444] = clik.newPhoto({"id":2261444,"src":"Franco_Marvulli_thumb.jpg","galleries_id":148203,"server_id":32,"link":"photo_2261444.html","width":130,"caption":"Franco Marvuli in full flight","height":173});
															thumbnails[2261445] = clik.newPhoto({"id":2261445,"src":"Jason_Finn_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2261445.html","width":130,"caption":"Jason Finn wheelies","height":87});
															thumbnails[2261446] = clik.newPhoto({"id":2261446,"src":"Lowrider_on_Fire_Escape_thumb.jpg","galleries_id":148204,"server_id":32,"link":"photo_2261446.html","width":130,"caption":"Urban Lowrider","height":98});
															thumbnails[2261448] = clik.newPhoto({"id":2261448,"src":"Lowry_Sail_thumb.jpg","galleries_id":148214,"server_id":32,"link":"photo_2261448.html","width":130,"caption":"Lowry Sail at night","height":173});
															thumbnails[2262647] = clik.newPhoto({"id":2262647,"src":"Mechanics_at_night_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2262647.html","width":130,"caption":"Mechanics working during the night","height":87});
															thumbnails[2262652] = clik.newPhoto({"id":2262652,"src":"New_bridge_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2262652.html","width":130,"caption":"Lizzie in Monochrome","height":98});
															thumbnails[2262654] = clik.newPhoto({"id":2262654,"src":"The_Ball_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2262654.html","width":130,"caption":"Fran and the Ball","height":173});
															thumbnails[2262656] = clik.newPhoto({"id":2262656,"src":"night_lights_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2262656.html","width":130,"caption":"Night Lights - Long Exposure","height":87});
															thumbnails[2262665] = clik.newPhoto({"id":2262665,"src":"Onza_Trials_thumb.jpg","galleries_id":148187,"server_id":32,"link":"photo_2262665.html","width":130,"caption":"Onza Trials landscape","height":87});
															thumbnails[2262679] = clik.newPhoto({"id":2262679,"src":"Onza_Trials_Team_2_thumb.jpg","galleries_id":148187,"server_id":32,"link":"photo_2262679.html","width":130,"caption":"Onza Trials portrait","height":196});
															thumbnails[2262722] = clik.newPhoto({"id":2262722,"src":"Orlaith_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2262722.html","width":130,"caption":"Orlath at Fashion Show","height":196});
															thumbnails[2262728] = clik.newPhoto({"id":2262728,"src":"pink_ladies_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2262728.html","width":130,"caption":"Ally Pally girls at GMEX","height":87});
															thumbnails[2262732] = clik.newPhoto({"id":2262732,"src":"Rail_perspective_thumb.jpg","galleries_id":148664,"server_id":32,"link":"photo_2262732.html","width":130,"caption":"Into the distance","height":195});
															thumbnails[2262738] = clik.newPhoto({"id":2262738,"src":"Russ_Swift_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2262738.html","width":130,"caption":"Russ Swift","height":87});
															thumbnails[2262751] = clik.newPhoto({"id":2262751,"src":"Sprockets_thumb.jpg","galleries_id":148188,"server_id":32,"link":"photo_2262751.html","width":130,"caption":"Sprockets","height":195});
															thumbnails[2262797] = clik.newPhoto({"id":2262797,"src":"Urbis_lowrider_thumb.jpg","galleries_id":148214,"server_id":32,"link":"photo_2262797.html","width":130,"caption":"Urbis Lowrider","height":173});
															thumbnails[2262806] = clik.newPhoto({"id":2262806,"src":"Xmas Ridelow Shoot_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2262806.html","width":130,"caption":"Ridelow client Christmas Photo Shoot","height":195});
															thumbnails[2266684] = clik.newPhoto({"id":2266684,"src":"Manchester Beetham Tower_thumb.jpg","galleries_id":148214,"server_id":32,"link":"photo_2266684.html","width":130,"caption":"Skyscraper . . . I love you","height":194});
															thumbnails[2266733] = clik.newPhoto({"id":2266733,"src":"Land HTN Bomb hole_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2266733.html","width":130,"caption":"Negotiating the Bombhole","height":86});
															thumbnails[2303836] = clik.newPhoto({"id":2303836,"src":"31 takes the bend_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2303836.html","width":130,"caption":"3 Sisters Karting","height":86});
															thumbnails[2303838] = clik.newPhoto({"id":2303838,"src":"Ben Swift_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2303838.html","width":130,"caption":"Preparing to race","height":195});
															thumbnails[2303839] = clik.newPhoto({"id":2303839,"src":"Firemen have some pride_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2303839.html","width":130,"caption":"Call the fire brigade ?","height":86});
															thumbnails[2303840] = clik.newPhoto({"id":2303840,"src":"Graham Bell_thumb.jpg","galleries_id":148150,"server_id":32,"link":"photo_2303840.html","width":130,"caption":"Graham Bell prepares for Mayhem","height":86});
															thumbnails[2303843] = clik.newPhoto({"id":2303843,"src":"Lewis socks it to him_thumb.jpg","galleries_id":155238,"server_id":32,"link":"photo_2303843.html","width":130,"caption":"Lewis delivers","height":86});
															thumbnails[2303844] = clik.newPhoto({"id":2303844,"src":"ToB finish_thumb.jpg","galleries_id":148186,"server_id":32,"link":"photo_2303844.html","width":130,"caption":"Crossing the line","height":173});
															thumbnails[2303847] = clik.newPhoto({"id":2303847,"src":"Tri Start_thumb.jpg","galleries_id":148211,"server_id":32,"link":"photo_2303847.html","width":130,"caption":"Salford tri Elite Men start","height":62});
															thumbnails[2303850] = clik.newPhoto({"id":2303850,"src":"14 flat out_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2303850.html","width":130,"caption":"Oulton Park 125","height":86});
															thumbnails[2303851] = clik.newPhoto({"id":2303851,"src":"36 flat out_thumb.jpg","galleries_id":148210,"server_id":32,"link":"photo_2303851.html","width":130,"caption":"36 at speed","height":86});
															thumbnails[2303869] = clik.newPhoto({"id":2303869,"src":"Dusk helmets_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_2303869.html","width":130,"caption":"Night falls over a 24 hour race","height":86});
															thumbnails[2303872] = clik.newPhoto({"id":2303872,"src":"George Cross_thumb.jpg","galleries_id":155238,"server_id":32,"link":"photo_2303872.html","width":130,"caption":"George Cross defends","height":86});
															thumbnails[2303873] = clik.newPhoto({"id":2303873,"src":"Lazing by the pool_thumb.jpg","galleries_id":148211,"server_id":32,"link":"photo_2303873.html","width":130,"caption":"Catching the sun before the start","height":86});
															thumbnails[2303875] = clik.newPhoto({"id":2303875,"src":"Sir Rocco tests the water_thumb.jpg","galleries_id":148211,"server_id":32,"link":"photo_2303875.html","width":130,"caption":"Sir Rocco Forte tests the waters in Salford","height":195});
															thumbnails[2303876] = clik.newPhoto({"id":2303876,"src":"ToB start_thumb.jpg","galleries_id":148186,"server_id":32,"link":"photo_2303876.html","width":130,"caption":"Tour of Britain start","height":98});
															thumbnails[8972796] = clik.newPhoto({"id":8972796,"src":"DanAthertonDH_1_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_8972796.html","width":130,"caption":"Dan Atherton","height":63});
															thumbnails[8972802] = clik.newPhoto({"id":8972802,"src":"Danny_MacAskill_Red_Bull_Street_Lights_thumb.jpg","galleries_id":148187,"server_id":32,"link":"photo_8972802.html","width":130,"caption":"Danny MacAskill at SLS","height":72});
															thumbnails[8972807] = clik.newPhoto({"id":8972807,"src":"DannyMacAskillRedBullColours_thumb.jpg","galleries_id":148187,"server_id":32,"link":"photo_8972807.html","width":130,"caption":"Danny MacAskill","height":86});
															thumbnails[8972810] = clik.newPhoto({"id":8972810,"src":"DannyMacAskillStepUpRaining_thumb.jpg","galleries_id":148187,"server_id":32,"link":"photo_8972810.html","width":130,"caption":"Danny MacAskill steps up","height":64});
															thumbnails[8972812] = clik.newPhoto({"id":8972812,"src":"foto_veloBehind28_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972812.html","width":130,"caption":"Behind 28","height":69});
															thumbnails[8972816] = clik.newPhoto({"id":8972816,"src":"foto_veloKevinSireau_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972816.html","width":130,"caption":"Kevin Sireau Diagonal","height":55});
															thumbnails[8972819] = clik.newPhoto({"id":8972819,"src":"foto_veloOiberaAgression_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972819.html","width":130,"caption":"Oliberra Agression","height":63});
															thumbnails[8972820] = clik.newPhoto({"id":8972820,"src":"foto_veloOnTheBlackLine_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972820.html","width":130,"caption":"On the Black Line","height":58});
															thumbnails[8972822] = clik.newPhoto({"id":8972822,"src":"foto_veloSirChrisHoy_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972822.html","width":130,"caption":"Sir Chris Hoy sprints for the line","height":98});
															thumbnails[8972832] = clik.newPhoto({"id":8972832,"src":"foto_veloSirChrisHoy2_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972832.html","width":130,"caption":"Sir Chris Hoy on the Apron","height":121});
															thumbnails[8972849] = clik.newPhoto({"id":8972849,"src":"foto_veloStalker_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972849.html","width":130,"caption":"Stalker -Sir Chris Hoy hounds Jason Kenny","height":57});
															thumbnails[8972877] = clik.newPhoto({"id":8972877,"src":"foto_veloSuperG_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972877.html","width":130,"caption":"Super G","height":63});
															thumbnails[8972905] = clik.newPhoto({"id":8972905,"src":"foto_veloUCI_Poster_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972905.html","width":130,"caption":"foto velo poster boy","height":54});
															thumbnails[8972917] = clik.newPhoto({"id":8972917,"src":"foto_veloVickiPCloseUp_thumb.jpg","galleries_id":472428,"server_id":32,"link":"photo_8972917.html","width":130,"caption":"Victoria Pendleton","height":86});
															thumbnails[8972937] = clik.newPhoto({"id":8972937,"src":"GeeAthertonDH_1_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_8972937.html","width":130,"caption":"Gee Atherton in the woods","height":86});
															thumbnails[8972963] = clik.newPhoto({"id":8972963,"src":"RedBulledgebank1_thumb.jpg","galleries_id":148203,"server_id":32,"link":"photo_8972963.html","width":130,"caption":"MiniDrome banking","height":86});
															thumbnails[8972965] = clik.newPhoto({"id":8972965,"src":"RedBulledgebank2_thumb.jpg","galleries_id":148203,"server_id":32,"link":"photo_8972965.html","width":130,"caption":"Red Bull Mini Drome","height":86});
															thumbnails[8972967] = clik.newPhoto({"id":8972967,"src":"RobWarnerMoody_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_8972967.html","width":86,"caption":"Rob Warner in the Woods","height":130});
															thumbnails[8972970] = clik.newPhoto({"id":8972970,"src":"RobWarnerStretchedOut_thumb.jpg","galleries_id":148185,"server_id":32,"link":"photo_8972970.html","width":130,"caption":"Rob Warner pinning it","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[148184] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cycling","link":"gallery_148184.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"8972970,8972967,8972937,8972917,8972905,8972877,8972849,8972832,8972822,8972820,8972816,8972812,8972810,8972807,8972802,8972796,2262751,2262679,2261444","id":148184,"singleSection":false});				  						galleries[472428] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"foto velo","link":"gallery_472428.html","maxRecords":0.0,"photoIDs":[8972812.0,8972816.0,8972819.0,8972820.0,8972822.0,8972832.0,8972849.0,8972877.0,8972905.0,8972917.0],"skipIndex":0,"section_code":"gallery","featured_images":"8972917,8972905,8972877,8972849,8972832,8972822,8972820,8972816,8972812","id":472428,"singleSection":false});				  						galleries[148214] = clik.newGallery({"parentGallery":148182,"usePopups":false,"title":"Manchester - my kinda city","link":"gallery_148214.html","maxRecords":0.0,"photoIDs":[2261448.0,2262797.0,2266684.0],"skipIndex":0,"section_code":"gallery","featured_images":"2266684,2262797,2261448","id":148214,"singleSection":false});				  						galleries[148210] = clik.newGallery({"parentGallery":148208,"usePopups":false,"title":"Motorsports","link":"gallery_148210.html","maxRecords":0.0,"photoIDs":[2261420.0,2261439.0,2261445.0,2262738.0,2303836.0,2303850.0,2303851.0],"skipIndex":0,"section_code":"gallery","featured_images":2261439.0,"id":148210,"singleSection":false});				  						galleries[148185] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"Mountain","link":"gallery_148185.html","maxRecords":0.0,"photoIDs":[2261423.0,2261440.0,2262647.0,2262656.0,2266733.0,2303869.0,8972796.0,8972937.0,8972967.0,8972970.0],"skipIndex":0,"section_code":"gallery","featured_images":"8972970,8972967,8972937,8972796","id":148185,"singleSection":false});				  						galleries[148150] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Faces","link":"gallery_148150.html","maxRecords":0.0,"photoIDs":[2262652.0,2262654.0,2262722.0,2262728.0,2262806.0,2303838.0,2303839.0,2303840.0],"skipIndex":0,"section_code":"gallery","featured_images":"2262806,2262654","id":148150,"singleSection":false});				  						galleries[148186] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"Road","link":"gallery_148186.html","maxRecords":0.0,"photoIDs":[2303844.0,2303876.0],"skipIndex":0,"section_code":"gallery","featured_images":"2303876,2303844","id":148186,"singleSection":false});				  						galleries[148211] = clik.newGallery({"parentGallery":148208,"usePopups":false,"title":"Triathlon","link":"gallery_148211.html","maxRecords":0.0,"photoIDs":[2261421.0,2303847.0,2303873.0,2303875.0],"skipIndex":0,"section_code":"gallery","featured_images":"2303875,2303873,2303847,2261421","id":148211,"singleSection":false});				  						galleries[148664] = clik.newGallery({"parentGallery":148182,"usePopups":false,"title":"Other Places ","link":"gallery_148664.html","maxRecords":0.0,"photoIDs":[2261431.0,2262732.0],"skipIndex":0,"section_code":"gallery","featured_images":"2262732,2261431","id":148664,"singleSection":false});				  						galleries[148182] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Places","link":"gallery_148182.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"2266684,2262797,2261448","id":148182,"singleSection":false});				  						galleries[148203] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"Track","link":"gallery_148203.html","maxRecords":0.0,"photoIDs":[2261444.0,8972963.0,8972965.0],"skipIndex":0,"section_code":"gallery","featured_images":2261444.0,"id":148203,"singleSection":false});				  						galleries[148188] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"BMX","link":"gallery_148188.html","maxRecords":0.0,"photoIDs":[2261425.0,2261427.0,2262751.0],"skipIndex":0,"section_code":"gallery","featured_images":2262751.0,"id":148188,"singleSection":false});				  						galleries[148208] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sports","link":"gallery_148208.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":2261439.0,"id":148208,"singleSection":false});				  						galleries[148204] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miscellaneous","link":"gallery_148204.html","maxRecords":0.0,"photoIDs":[2261443.0,2261446.0],"skipIndex":0,"section_code":"gallery","featured_images":2261443.0,"id":148204,"singleSection":false});				  						galleries[155238] = clik.newGallery({"parentGallery":148208,"usePopups":false,"title":"Other Sports","link":"gallery_155238.html","maxRecords":0.0,"photoIDs":[2303843.0,2303872.0],"skipIndex":0,"section_code":"gallery","featured_images":"2303872,2303843","id":155238,"singleSection":false});				  						galleries[148187] = clik.newGallery({"parentGallery":148184,"usePopups":false,"title":"Trials","link":"gallery_148187.html","maxRecords":0.0,"photoIDs":[2262665.0,2262679.0,8972802.0,8972807.0,8972810.0],"skipIndex":0,"section_code":"gallery","featured_images":"8972810,8972807,8972802,2262679","id":148187,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8972967,8972917,8972905,8972810,8972807,8972802,8972796,2261448,2261423';
imageSets[2] = '8972970,8972967,8972937,8972917,8972905,8972877,8972849,8972832,8972822,8972820,8972816,8972812,8972810,8972807,8972802,8972796,2266684,2262806,2262797,2262751,2262679,2262654,2261448,2261444,2261443,2261439';
imageSets[3] = '8972970,8972967,8972965,8972963,8972937,8972917,8972905,8972877,8972849,8972832,8972822,8972820,8972819,8972816,8972812,8972810,8972807,8972802,8972796,2303876,2303875,2303873,2303872,2303869,2303851,2303850,2303847,2303844,2303843,2303840,2303839,2303838,2303836,2266733,2266684,2262806,2262797,2262751,2262738,2262732,2262728,2262722,2262679,2262665,2262656,2262654,2262652,2262647,2261448,2261446';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/crankmtb/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/crankmtb/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 || photos || {})[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.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 && 'gallery' != '') {
					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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'crank photo: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

