window.thumbnails = {};
															thumbnails[4705755] = clik.newPhoto({"id":4705755,"src":"14julydiannhared2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"delicate","height":103});
															thumbnails[8426629] = clik.newPhoto({"id":8426629,"src":"47--Facing-the-world-ok-prep600pix_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"spnp #47","height":94});
															thumbnails[8764039] = clik.newPhoto({"id":8764039,"src":"Copy_of_poss17R0014825_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"#17","height":98});
															thumbnails[7084684] = clik.newPhoto({"id":7084684,"src":"Copy-of-poss6prob_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_7084684.html","width":130,"caption":"","height":86});
															thumbnails[5292313] = clik.newPhoto({"id":5292313,"src":"archesgraffittisav_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_5292313.html","width":130,"caption":"","height":98});
															thumbnails[4701570] = clik.newPhoto({"id":4701570,"src":"DSCtreepaint_thumb.jpg","galleries_id":270383,"server_id":1,"link":"photo_4701570.html","width":130,"caption":2009.0,"height":173});
															thumbnails[3839119] = clik.newPhoto({"id":3839119,"src":"R0012904_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3839119.html","width":130,"caption":"sox festival 2009","height":75});
															thumbnails[3686197] = clik.newPhoto({"id":3686197,"src":"CNV00007_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3686197.html","width":130,"caption":"speakers corner.","height":102});
															thumbnails[3625348] = clik.newPhoto({"id":3625348,"src":"R0012718_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_3625348.html","width":130,"caption":"","height":173});
															thumbnails[3366629] = clik.newPhoto({"id":3366629,"src":"1000pixbeb_thumb.JPG","galleries_id":33049,"server_id":1,"link":"photo_3366629.html","width":130,"caption":"Protest  outside the BBC over Gaza appeal....","height":98});
															thumbnails[3579308] = clik.newPhoto({"id":3579308,"src":"R0010166_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_3579308.html","width":130,"caption":"","height":81});
															thumbnails[4430879] = clik.newPhoto({"id":4430879,"src":"streetamstdam3021_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_4430879.html","width":130,"caption":"Amsterdam","height":84});
															thumbnails[3378030] = clik.newPhoto({"id":3378030,"src":"Copy-of-R0011723_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3378030.html","width":130,"caption":"calm after the busy night","height":107});
															thumbnails[3378050] = clik.newPhoto({"id":3378050,"src":"rysmth209_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3378050.html","width":130,"caption":"Ray Smith","height":198});
															thumbnails[3388931] = clik.newPhoto({"id":3388931,"src":"gasbw2651_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_3388931.html","width":130,"caption":"sunday 8am","height":88});
															thumbnails[3431303] = clik.newPhoto({"id":3431303,"src":"Copy of spud203_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3431303.html","width":130,"caption":"","height":93});
															thumbnails[3475423] = clik.newPhoto({"id":3475423,"src":"mayanarchy537_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3475423.html","width":130,"caption":"Mayday protest 2003","height":83});
															thumbnails[3495794] = clik.newPhoto({"id":3495794,"src":"peacecamp547_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3495794.html","width":130,"caption":"Peace camp","height":88});
															thumbnails[3625342] = clik.newPhoto({"id":3625342,"src":"newbuild_thumb.jpeg","galleries_id":216675,"server_id":1,"link":"photo_3625342.html","width":130,"caption":"","height":87});
															thumbnails[4527336] = clik.newPhoto({"id":4527336,"src":"girlpolsov609save_thumb.jpg","galleries_id":202914,"server_id":1,"link":"photo_4527336.html","width":130,"caption":"Mayday 2000.","height":165});
															thumbnails[4545186] = clik.newPhoto({"id":4545186,"src":"carrige_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545186.html","width":130,"caption":"","height":174});
															thumbnails[4545190] = clik.newPhoto({"id":4545190,"src":"esculater_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545190.html","width":130,"caption":"feel","height":98});
															thumbnails[4660439] = clik.newPhoto({"id":4660439,"src":"test-600pixsav_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_4660439.html","width":130,"caption":"Trafalqar Sq","height":80});
															thumbnails[5339012] = clik.newPhoto({"id":5339012,"src":"mossportsaved_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_5339012.html","width":130,"caption":"","height":103});
															thumbnails[8406022] = clik.newPhoto({"id":8406022,"src":"Copy-of-R0015432poss32prepstation_thumb.jpg","galleries_id":296094,"server_id":1,"link":"photo_8406022.html","width":130,"caption":"graphic journey #32","height":91});
															thumbnails[8425284] = clik.newPhoto({"id":8425284,"src":"29ok600pix_thumb.jpg","galleries_id":296094,"server_id":1,"link":"photo_8425284.html","width":130,"caption":" spnp #20","height":88});
															thumbnails[3838883] = clik.newPhoto({"id":3838883,"src":"clik1000_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3838883.html","width":130,"caption":"BBC Community choir South Oxhey","height":93});
															thumbnails[4693904] = clik.newPhoto({"id":4693904,"src":"Copy_of_red_gate_two_thumb.JPG","galleries_id":59403,"server_id":1,"link":"photo_4693904.html","width":130,"caption":"","height":98});
															thumbnails[5269230] = clik.newPhoto({"id":5269230,"src":"shadowshoeslegs_thumb.jpg","galleries_id":270383,"server_id":1,"link":"photo_5269230.html","width":130,"caption":"","height":98});
															thumbnails[5543652] = clik.newPhoto({"id":5543652,"src":"tot-rd-skysav600_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_5543652.html","width":130,"caption":"","height":98});
															thumbnails[3495729] = clik.newPhoto({"id":3495729,"src":"parlwhite552_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3495729.html","width":130,"caption":"Freedom to photograph 2003","height":91});
															thumbnails[3495763] = clik.newPhoto({"id":3495763,"src":"anarchy535_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3495763.html","width":130,"caption":"Mayday 2003","height":96});
															thumbnails[4455166] = clik.newPhoto({"id":4455166,"src":"manstairs450pix_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_4455166.html","width":130,"caption":2001.0,"height":189});
															thumbnails[4637164] = clik.newPhoto({"id":4637164,"src":"sepiax3o600pixsaved_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4637164.html","width":130,"caption":"","height":98});
															thumbnails[5354009] = clik.newPhoto({"id":5354009,"src":"spkrscrnrsav111_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_5354009.html","width":130,"caption":"","height":83});
															thumbnails[7084663] = clik.newPhoto({"id":7084663,"src":"Copy-of-R0014371trsqsav_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_7084663.html","width":130,"caption":"","height":179});
															thumbnails[3839069] = clik.newPhoto({"id":3839069,"src":"R0012900_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3839069.html","width":130,"caption":"","height":89});
															thumbnails[3318999] = clik.newPhoto({"id":3318999,"src":"Copy of dayinalife_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_3318999.html","width":130,"caption":"one moment in a life","height":86});
															thumbnails[3475395] = clik.newPhoto({"id":3475395,"src":"Copy-of-tim01_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3475395.html","width":130,"caption":"Tim","height":90});
															thumbnails[3495780] = clik.newPhoto({"id":3495780,"src":"antiwar543_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3495780.html","width":130,"caption":"","height":88});
															thumbnails[5292318] = clik.newPhoto({"id":5292318,"src":"Copy-of-sandmandalasave_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_5292318.html","width":130,"caption":"","height":83});
															thumbnails[6425081] = clik.newPhoto({"id":6425081,"src":"policeguards1994sav600_thumb.jpg","galleries_id":202914,"server_id":1,"link":"photo_6425081.html","width":130,"caption":" Whitehall 1994","height":188});
															thumbnails[4660836] = clik.newPhoto({"id":4660836,"src":"chritian600pixsave_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_4660836.html","width":130,"caption":"","height":94});
															thumbnails[3321381] = clik.newPhoto({"id":3321381,"src":"Copy of tatestpaul529_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_3321381.html","width":130,"caption":"Inside looking out","height":83});
															thumbnails[4485602] = clik.newPhoto({"id":4485602,"src":"martinjeffsav500pix_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_4485602.html","width":130,"caption":"","height":84});
															thumbnails[4527368] = clik.newPhoto({"id":4527368,"src":"lfm12_thumb.jpg","galleries_id":202914,"server_id":1,"link":"photo_4527368.html","width":130,"caption":"mayday 2000.","height":202});
															thumbnails[8405947] = clik.newPhoto({"id":8405947,"src":"Copy-2-of-29ok-clikpic_thumb.jpg","galleries_id":296094,"server_id":1,"link":"photo_8405947.html","width":130,"caption":"week #29","height":100});
															thumbnails[5904888] = clik.newPhoto({"id":5904888,"src":"spkscrnersace600pix_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_5904888.html","width":130,"caption":"The Lecture","height":91});
															thumbnails[3328471] = clik.newPhoto({"id":3328471,"src":"Copy of P1010123_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_3328471.html","width":130,"caption":"","height":173});
															thumbnails[3495749] = clik.newPhoto({"id":3495749,"src":"candid549_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3495749.html","width":130,"caption":"","height":75});
															thumbnails[4545011] = clik.newPhoto({"id":4545011,"src":"girlprotestsave450pix_thumb.jpg","galleries_id":202914,"server_id":1,"link":"photo_4545011.html","width":130,"caption":"Two million march ","height":222});
															thumbnails[4720432] = clik.newPhoto({"id":4720432,"src":"Copy-of-vcgood1sav_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_4720432.html","width":130,"caption":" Hoi-an  Vietnam 1998","height":198});
															thumbnails[8405980] = clik.newPhoto({"id":8405980,"src":"Copy-of-poss31okprepclikpic_thumb.jpg","galleries_id":296094,"server_id":1,"link":"photo_8405980.html","width":130,"caption":" #31","height":173});
															thumbnails[4650145] = clik.newPhoto({"id":4650145,"src":"brixton600pixsav_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_4650145.html","width":130,"caption":2008.0,"height":96});
															thumbnails[3321468] = clik.newPhoto({"id":3321468,"src":"ladypidgeons_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_3321468.html","width":130,"caption":"Friends","height":91});
															thumbnails[3319008] = clik.newPhoto({"id":3319008,"src":"4police245_thumb.jpg","galleries_id":33049,"server_id":1,"link":"photo_3319008.html","width":130,"caption":"Mayday 2000","height":76});
															thumbnails[3475408] = clik.newPhoto({"id":3475408,"src":"mickshaun207_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_3475408.html","width":130,"caption":"","height":86});
															thumbnails[3431307] = clik.newPhoto({"id":3431307,"src":"Copy of run07192_thumb.jpg","galleries_id":216675,"server_id":1,"link":"photo_3431307.html","width":130,"caption":"Motionless Shoe","height":181});
															thumbnails[4545437] = clik.newPhoto({"id":4545437,"src":"imagsenses01sav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545437.html","width":130,"caption":"feel","height":98});
															thumbnails[5317547] = clik.newPhoto({"id":5317547,"src":"stationappsav11_thumb.jpg","galleries_id":61194,"server_id":1,"link":"photo_5317547.html","width":130,"caption":"","height":173});
															thumbnails[4528633] = clik.newPhoto({"id":4528633,"src":"maydysqt02_thumb.jpg","galleries_id":202914,"server_id":1,"link":"photo_4528633.html","width":130,"caption":"mayday 2003. ","height":149});
															thumbnails[4545366] = clik.newPhoto({"id":4545366,"src":"shoessav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545366.html","width":130,"caption":"feel","height":98});
															thumbnails[4545200] = clik.newPhoto({"id":4545200,"src":"R00image004_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545200.html","width":130,"caption":"","height":174});
															thumbnails[4545193] = clik.newPhoto({"id":4545193,"src":"esculater2_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545193.html","width":130,"caption":"feel","height":98});
															thumbnails[4545205] = clik.newPhoto({"id":4545205,"src":"mindgapsav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545205.html","width":130,"caption":"","height":98});
															thumbnails[4545184] = clik.newPhoto({"id":4545184,"src":"booksav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545184.html","width":130,"caption":"","height":174});
															thumbnails[4545196] = clik.newPhoto({"id":4545196,"src":"imagsav003_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545196.html","width":130,"caption":"","height":98});
															thumbnails[4545165] = clik.newPhoto({"id":4545165,"src":"bkerlootnnelssav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545165.html","width":130,"caption":"","height":98});
															thumbnails[3475411] = clik.newPhoto({"id":3475411,"src":"Copy of scan1_thumb.jpg","galleries_id":59403,"server_id":1,"link":"photo_3475411.html","width":130,"caption":"World cup fever","height":80});
															thumbnails[4545440] = clik.newPhoto({"id":4545440,"src":"window_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545440.html","width":130,"caption":"feel","height":139});
															thumbnails[4545150] = clik.newPhoto({"id":4545150,"src":"beasssignsav_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545150.html","width":130,"caption":"feel","height":105});
															thumbnails[4545451] = clik.newPhoto({"id":4545451,"src":"sumjourneysav1_thumb.jpg","galleries_id":132440,"server_id":1,"link":"photo_4545451.html","width":130,"caption":"feel","height":95});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[296094] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Street Photography Now Project","link":"gallery_296094.html","maxRecords":0.0,"photoIDs":[8406022.0,8425284.0,8405947.0,8405980.0],"skipIndex":0,"section_code":"gallery","featured_images":"8425284,8406022","id":296094,"singleSection":false});				  						galleries[461508] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Street Photography Now Project Year 2","link":"gallery_461508.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":461508,"singleSection":false});				  						galleries[33049] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"protest","link":"gallery_33049.html","maxRecords":0.0,"photoIDs":[3686197.0,3366629.0,3475423.0,3495794.0,4660439.0,3495729.0,3495763.0,3495780.0,4660836.0,5904888.0,3495749.0,3319008.0],"skipIndex":0,"section_code":"gallery","featured_images":"5904888,4660836,4660439,3495780,3495763,3495749,3495729,3319008","id":33049,"singleSection":false});				  						galleries[202914] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"protest 2","link":"gallery_202914.html","maxRecords":0.0,"photoIDs":[4527336.0,6425081.0,4527368.0,4545011.0,4528633.0],"skipIndex":0,"section_code":"gallery","featured_images":"6425081,4545011,4528633,4527368","id":202914,"singleSection":false});				  						galleries[61194] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"South Oxhey ","link":"gallery_61194.html","maxRecords":0.0,"photoIDs":[3839119.0,3378030.0,3378050.0,3431303.0,3838883.0,3839069.0,3475395.0,4485602.0,3475408.0,5317547.0],"skipIndex":0,"section_code":"gallery","featured_images":"4485602,3839119,3839069,3475408,3475395","id":61194,"singleSection":false});				  						galleries[59403] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"street ","link":"gallery_59403.html","maxRecords":0.0,"photoIDs":[7084684.0,5292313.0,3579308.0,4430879.0,3388931.0,5339012.0,4693904.0,5354009.0,5292318.0,3321381.0,4650145.0,3321468.0,3475411.0],"skipIndex":0,"section_code":"gallery","featured_images":"7084684,5354009,5339012,5292318,5292313,4693904,4650145,4430879,3579308,3475411,3388931,3321468,3321381","id":59403,"singleSection":false});				  						galleries[216675] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"street 2","link":"gallery_216675.html","maxRecords":0.0,"photoIDs":[3625348.0,3625342.0,5543652.0,4455166.0,7084663.0,3318999.0,3328471.0,4720432.0,3431307.0],"skipIndex":0,"section_code":"gallery","featured_images":"5543652,4720432,4455166,3431307,3328471,3318999","id":216675,"singleSection":false});				  						galleries[132440] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"city journey \"image + senses\"...","link":"gallery_132440.html","maxRecords":0.0,"photoIDs":[4545186.0,4545190.0,4637164.0,4545437.0,4545366.0,4545200.0,4545193.0,4545205.0,4545184.0,4545196.0,4545165.0,4545440.0,4545150.0,4545451.0],"skipIndex":0,"section_code":"gallery","featured_images":"4545451,4545193,4545165,4545150","id":132440,"singleSection":false});				  						galleries[270383] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"camera phone","link":"gallery_270383.html","maxRecords":0.0,"photoIDs":[4701570.0,5269230.0],"skipIndex":0,"section_code":"gallery","featured_images":"5269230,4701570","id":270383,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8425284,4455166,6425081,3318999,4660836,8405947,4720432,3475408,3321468';
imageSets[2] = '7084684,5339012,5292313,4705755,4701570,4660439,4430879,3839119,3579308,3388931,8425284,8406022,5543652,5354009,5269230,4693904,4455166,3495763,3495729,6425081,5292318,3839069,3495780,3475395,3318999,8426629,4660836,4527368,4485602,3321381,5904888,4720432,4545011,3495749,3328471,4650145,3475408,3321468,3319008,3431307,4528633,4545193,4545165,3475411,4545150,4545451';
imageSets[3] = '3686197';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/lolmacphotos/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/lolmacphotos/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 = 'Laurie Macdonald photos: ' + 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;
	}
}

			

