window.thumbnails = {};
															thumbnails[5432378] = clik.newPhoto({"id":5432378,"src":"IMG_1690_thumb.JPG","galleries_id":306560,"server_id":5,"link":"photo_5432378.html","width":130,"caption":"","height":87});
															thumbnails[5432381] = clik.newPhoto({"id":5432381,"src":"IMG_1693_thumb.JPG","galleries_id":306560,"server_id":5,"link":"photo_5432381.html","width":130,"caption":"","height":87});
															thumbnails[5432384] = clik.newPhoto({"id":5432384,"src":"IMG_1698_thumb.JPG","galleries_id":306560,"server_id":5,"link":"photo_5432384.html","width":130,"caption":"","height":87});
															thumbnails[5432385] = clik.newPhoto({"id":5432385,"src":"IMG_3124_thumb.JPG","galleries_id":306560,"server_id":5,"link":"photo_5432385.html","width":130,"caption":"","height":87});
															thumbnails[5432394] = clik.newPhoto({"id":5432394,"src":"Summer_2008_Photos_220_thumb.jpg","galleries_id":306560,"server_id":5,"link":"photo_5432394.html","width":130,"caption":"","height":87});
															thumbnails[5432397] = clik.newPhoto({"id":5432397,"src":"Summer_2008_Photos_224_thumb.jpg","galleries_id":306560,"server_id":5,"link":"photo_5432397.html","width":130,"caption":"","height":87});
															thumbnails[5432399] = clik.newPhoto({"id":5432399,"src":"Summer_2008_Photos_240_thumb.jpg","galleries_id":306560,"server_id":5,"link":"photo_5432399.html","width":130,"caption":"","height":195});
															thumbnails[5432514] = clik.newPhoto({"id":5432514,"src":"IMG_4781_thumb.jpg","galleries_id":306558,"server_id":5,"link":"photo_5432514.html","width":130,"caption":"","height":87});
															thumbnails[8523762] = clik.newPhoto({"id":8523762,"src":"excavtion_web_pic112_thumb.jpg","galleries_id":398769,"server_id":19,"link":"photo_8523762.html","width":130,"caption":"","height":92});
															thumbnails[8523833] = clik.newPhoto({"id":8523833,"src":"excavation_web_pic_2_thumb.jpg","galleries_id":398769,"server_id":19,"link":"photo_8523833.html","width":130,"caption":"","height":92});
															thumbnails[8523843] = clik.newPhoto({"id":8523843,"src":"excavation_web_pic_3_thumb.jpg","galleries_id":398769,"server_id":19,"link":"photo_8523843.html","width":130,"caption":"","height":92});
															thumbnails[8523850] = clik.newPhoto({"id":8523850,"src":"excavation_web_pic_4_thumb.jpg","galleries_id":398769,"server_id":19,"link":"photo_8523850.html","width":130,"caption":"","height":92});
															thumbnails[5432208] = clik.newPhoto({"id":5432208,"src":"Image259_thumb.jpg","galleries_id":306564,"server_id":5,"link":"photo_5432208.html","width":130,"caption":"","height":98});
															thumbnails[5432251] = clik.newPhoto({"id":5432251,"src":"Latest_Pics_038_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432251.html","width":130,"caption":"","height":195});
															thumbnails[5486566] = clik.newPhoto({"id":5486566,"src":"DSC08409_thumb.JPG","galleries_id":307016,"server_id":5,"link":"photo_5486566.html","width":130,"caption":"","height":98});
															thumbnails[5486580] = clik.newPhoto({"id":5486580,"src":"fringe_show_012_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486580.html","width":130,"caption":"","height":87});
															thumbnails[5487270] = clik.newPhoto({"id":5487270,"src":"IMG_4895_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487270.html","width":130,"caption":"","height":87});
															thumbnails[6389524] = clik.newPhoto({"id":6389524,"src":"resize_1561_thumb.jpg","galleries_id":306514,"server_id":5,"link":"photo_6389524.html","width":130,"caption":"","height":98});
															thumbnails[6862291] = clik.newPhoto({"id":6862291,"src":"resize_10_thumb.jpg","galleries_id":372525,"server_id":5,"link":"photo_6862291.html","width":130,"caption":"","height":87});
															thumbnails[8524312] = clik.newPhoto({"id":8524312,"src":"gallery_opening_mkg_web1_thumb.jpg","galleries_id":450518,"server_id":19,"link":"photo_8524312.html","width":130,"caption":"","height":92});
															thumbnails[5424462] = clik.newPhoto({"id":5424462,"src":"DSC03220_thumb.JPG","galleries_id":306564,"server_id":5,"link":"photo_5424462.html","width":130,"caption":"","height":173});
															thumbnails[5432253] = clik.newPhoto({"id":5432253,"src":"Latest_Pics_056_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432253.html","width":130,"caption":"","height":195});
															thumbnails[5432518] = clik.newPhoto({"id":5432518,"src":"IMG_4811_thumb.jpg","galleries_id":306558,"server_id":5,"link":"photo_5432518.html","width":130,"caption":"","height":87});
															thumbnails[5486568] = clik.newPhoto({"id":5486568,"src":"DSC08411_thumb.JPG","galleries_id":307016,"server_id":5,"link":"photo_5486568.html","width":130,"caption":"","height":98});
															thumbnails[5486581] = clik.newPhoto({"id":5486581,"src":"IMG_4954_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486581.html","width":130,"caption":"","height":87});
															thumbnails[5487279] = clik.newPhoto({"id":5487279,"src":"IMG_4904_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487279.html","width":130,"caption":"","height":87});
															thumbnails[6389579] = clik.newPhoto({"id":6389579,"src":"resize158_thumb.jpg","galleries_id":306514,"server_id":5,"link":"photo_6389579.html","width":130,"caption":"","height":98});
															thumbnails[6862293] = clik.newPhoto({"id":6862293,"src":"resize_20_thumb.jpg","galleries_id":372525,"server_id":5,"link":"photo_6862293.html","width":130,"caption":"","height":87});
															thumbnails[8524362] = clik.newPhoto({"id":8524362,"src":"gallery_opening_mkg_web2_thumb.jpg","galleries_id":450518,"server_id":19,"link":"photo_8524362.html","width":130,"caption":"","height":92});
															thumbnails[5424442] = clik.newPhoto({"id":5424442,"src":"DSC03212_thumb.JPG","galleries_id":306564,"server_id":5,"link":"photo_5424442.html","width":130,"caption":"","height":98});
															thumbnails[5432280] = clik.newPhoto({"id":5432280,"src":"Latest_Pics_059_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432280.html","width":130,"caption":"","height":195});
															thumbnails[5432522] = clik.newPhoto({"id":5432522,"src":"IMG_4835_thumb.jpg","galleries_id":306558,"server_id":5,"link":"photo_5432522.html","width":130,"caption":"","height":87});
															thumbnails[5486570] = clik.newPhoto({"id":5486570,"src":"DSC08412_thumb.JPG","galleries_id":307016,"server_id":5,"link":"photo_5486570.html","width":130,"caption":"","height":98});
															thumbnails[5486585] = clik.newPhoto({"id":5486585,"src":"IMG_3770_thumb.JPG","galleries_id":307010,"server_id":5,"link":"photo_5486585.html","width":130,"caption":"","height":87});
															thumbnails[5487281] = clik.newPhoto({"id":5487281,"src":"IMG_4922_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487281.html","width":130,"caption":"","height":87});
															thumbnails[6389582] = clik.newPhoto({"id":6389582,"src":"resize175_thumb.jpg","galleries_id":306514,"server_id":5,"link":"photo_6389582.html","width":130,"caption":"","height":98});
															thumbnails[6862294] = clik.newPhoto({"id":6862294,"src":"resize_30_thumb.jpg","galleries_id":372525,"server_id":5,"link":"photo_6862294.html","width":130,"caption":"","height":87});
															thumbnails[8524364] = clik.newPhoto({"id":8524364,"src":"gallery_opening_mkg_web3_thumb.jpg","galleries_id":450518,"server_id":19,"link":"photo_8524364.html","width":130,"caption":"","height":92});
															thumbnails[5432201] = clik.newPhoto({"id":5432201,"src":"DSC03231_thumb.JPG","galleries_id":306564,"server_id":5,"link":"photo_5432201.html","width":130,"caption":"","height":98});
															thumbnails[5432282] = clik.newPhoto({"id":5432282,"src":"Latest_Pics_110_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432282.html","width":130,"caption":"","height":195});
															thumbnails[5432527] = clik.newPhoto({"id":5432527,"src":"IMG_4851_thumb.jpg","galleries_id":306558,"server_id":5,"link":"photo_5432527.html","width":130,"caption":"","height":87});
															thumbnails[5486572] = clik.newPhoto({"id":5486572,"src":"DSC08413_thumb.JPG","galleries_id":307016,"server_id":5,"link":"photo_5486572.html","width":130,"caption":"","height":98});
															thumbnails[5486586] = clik.newPhoto({"id":5486586,"src":"Copy_of_IMG_3778_thumb.JPG","galleries_id":307010,"server_id":5,"link":"photo_5486586.html","width":130,"caption":"","height":87});
															thumbnails[5487283] = clik.newPhoto({"id":5487283,"src":"IMG_4935_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487283.html","width":130,"caption":"","height":195});
															thumbnails[6389584] = clik.newPhoto({"id":6389584,"src":"resize177_thumb.jpg","galleries_id":306514,"server_id":5,"link":"photo_6389584.html","width":130,"caption":"","height":98});
															thumbnails[6862296] = clik.newPhoto({"id":6862296,"src":"resize_40_thumb.jpg","galleries_id":372525,"server_id":5,"link":"photo_6862296.html","width":130,"caption":"","height":87});
															thumbnails[8524366] = clik.newPhoto({"id":8524366,"src":"gallery_opening_mkg_web4_thumb.jpg","galleries_id":450518,"server_id":19,"link":"photo_8524366.html","width":130,"caption":"","height":92});
															thumbnails[5432206] = clik.newPhoto({"id":5432206,"src":"Image006_thumb.jpg","galleries_id":306564,"server_id":5,"link":"photo_5432206.html","width":130,"caption":"","height":98});
															thumbnails[5432283] = clik.newPhoto({"id":5432283,"src":"Latest_Pics_113_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432283.html","width":130,"caption":"","height":195});
															thumbnails[5486573] = clik.newPhoto({"id":5486573,"src":"DSC08415_thumb.JPG","galleries_id":307016,"server_id":5,"link":"photo_5486573.html","width":130,"caption":"","height":98});
															thumbnails[5486587] = clik.newPhoto({"id":5486587,"src":"IMG_3766_thumb.JPG","galleries_id":307010,"server_id":5,"link":"photo_5486587.html","width":130,"caption":"","height":87});
															thumbnails[5487288] = clik.newPhoto({"id":5487288,"src":"IMG_4952_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487288.html","width":130,"caption":"","height":195});
															thumbnails[6389606] = clik.newPhoto({"id":6389606,"src":"resize179_thumb.jpg","galleries_id":306514,"server_id":5,"link":"photo_6389606.html","width":130,"caption":"","height":98});
															thumbnails[8524368] = clik.newPhoto({"id":8524368,"src":"gallery_opening_mkg_web5_thumb.jpg","galleries_id":450518,"server_id":19,"link":"photo_8524368.html","width":130,"caption":"","height":92});
															thumbnails[5432286] = clik.newPhoto({"id":5432286,"src":"Latest_Pics_137_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432286.html","width":130,"caption":"","height":87});
															thumbnails[5486590] = clik.newPhoto({"id":5486590,"src":"IMG_3772_thumb.JPG","galleries_id":307010,"server_id":5,"link":"photo_5486590.html","width":130,"caption":"","height":87});
															thumbnails[5487291] = clik.newPhoto({"id":5487291,"src":"IMG_5005_-_Copy_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487291.html","width":130,"caption":"","height":87});
															thumbnails[5432291] = clik.newPhoto({"id":5432291,"src":"Latest_Pics_155_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432291.html","width":130,"caption":"","height":87});
															thumbnails[5486593] = clik.newPhoto({"id":5486593,"src":"fringe_show_030_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486593.html","width":130,"caption":"","height":87});
															thumbnails[5487295] = clik.newPhoto({"id":5487295,"src":"IMG_5051_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487295.html","width":130,"caption":"","height":87});
															thumbnails[5432289] = clik.newPhoto({"id":5432289,"src":"Latest_Pics_150_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432289.html","width":130,"caption":"","height":87});
															thumbnails[5486596] = clik.newPhoto({"id":5486596,"src":"fringe_show_031_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486596.html","width":130,"caption":"","height":87});
															thumbnails[5487296] = clik.newPhoto({"id":5487296,"src":"IMG_5072_thumb.jpg","galleries_id":306515,"server_id":5,"link":"photo_5487296.html","width":130,"caption":"","height":87});
															thumbnails[6389613] = clik.newPhoto({"id":6389613,"src":"resize213_thumb.jpg","galleries_id":353643,"server_id":5,"link":"photo_6389613.html","width":130,"caption":"","height":98});
															thumbnails[5432293] = clik.newPhoto({"id":5432293,"src":"Latest_Pics_157_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432293.html","width":130,"caption":"","height":87});
															thumbnails[5486676] = clik.newPhoto({"id":5486676,"src":"fringe_show_032_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486676.html","width":130,"caption":"","height":87});
															thumbnails[6389616] = clik.newPhoto({"id":6389616,"src":"resize_217_thumb.jpg","galleries_id":353643,"server_id":5,"link":"photo_6389616.html","width":130,"caption":"","height":173});
															thumbnails[5432287] = clik.newPhoto({"id":5432287,"src":"Latest_Pics_148_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432287.html","width":130,"caption":"","height":87});
															thumbnails[5486677] = clik.newPhoto({"id":5486677,"src":"fringe_show_033_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486677.html","width":130,"caption":"","height":87});
															thumbnails[5432285] = clik.newPhoto({"id":5432285,"src":"Latest_Pics_128_thumb.jpg","galleries_id":306562,"server_id":5,"link":"photo_5432285.html","width":130,"caption":"","height":87});
															thumbnails[5486678] = clik.newPhoto({"id":5486678,"src":"fringe_show_034_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486678.html","width":130,"caption":"","height":87});
															thumbnails[5486680] = clik.newPhoto({"id":5486680,"src":"fringe_show_035_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486680.html","width":130,"caption":"","height":87});
															thumbnails[5486682] = clik.newPhoto({"id":5486682,"src":"fringe_show_036_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486682.html","width":130,"caption":"","height":87});
															thumbnails[5486686] = clik.newPhoto({"id":5486686,"src":"fringe_show_037_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486686.html","width":130,"caption":"","height":87});
															thumbnails[5486687] = clik.newPhoto({"id":5486687,"src":"fringe_show_038_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486687.html","width":130,"caption":"","height":87});
															thumbnails[5486690] = clik.newPhoto({"id":5486690,"src":"fringe_show_039_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486690.html","width":130,"caption":"","height":87});
															thumbnails[5486692] = clik.newPhoto({"id":5486692,"src":"fringe_show_040_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486692.html","width":130,"caption":"","height":87});
															thumbnails[5486693] = clik.newPhoto({"id":5486693,"src":"fringe_show_041_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486693.html","width":130,"caption":"","height":87});
															thumbnails[5486694] = clik.newPhoto({"id":5486694,"src":"fringe_show_042_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486694.html","width":130,"caption":"","height":87});
															thumbnails[5486696] = clik.newPhoto({"id":5486696,"src":"fringe_show_043_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486696.html","width":130,"caption":"","height":87});
															thumbnails[5486699] = clik.newPhoto({"id":5486699,"src":"fringe_show_044_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486699.html","width":130,"caption":"","height":87});
															thumbnails[5486700] = clik.newPhoto({"id":5486700,"src":"fringe_show_045_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486700.html","width":130,"caption":"","height":87});
															thumbnails[5486702] = clik.newPhoto({"id":5486702,"src":"fringe_show_046_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486702.html","width":130,"caption":"","height":87});
															thumbnails[5486703] = clik.newPhoto({"id":5486703,"src":"fringe_show_047_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486703.html","width":130,"caption":"","height":87});
															thumbnails[5486705] = clik.newPhoto({"id":5486705,"src":"fringe_show_048_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486705.html","width":130,"caption":"","height":87});
															thumbnails[5486706] = clik.newPhoto({"id":5486706,"src":"fringe_show_049_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486706.html","width":130,"caption":"","height":87});
															thumbnails[5486707] = clik.newPhoto({"id":5486707,"src":"fringe_show_050_thumb.jpg","galleries_id":307010,"server_id":5,"link":"photo_5486707.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[450518] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"MK Gallery 'New Art MK' '2011'","link":"gallery_450518.html","maxRecords":0.0,"photoIDs":[8524312.0,8524362.0,8524364.0,8524366.0,8524368.0],"skipIndex":0,"section_code":"gallery","featured_images":"8524368,8524366,8524364,8524362,8524312","id":450518,"singleSection":false});				  						galleries[398769] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Excavation '2011' ","link":"gallery_398769.html","maxRecords":0.0,"photoIDs":[8523762.0,8523833.0,8523843.0,8523850.0],"skipIndex":0,"section_code":"gallery","featured_images":"8523850,8523843,8523833,8523762","id":398769,"singleSection":false});				  						galleries[372525] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Revealing Worlds '2010'","link":"gallery_372525.html","maxRecords":0.0,"photoIDs":[6862291.0,6862293.0,6862294.0,6862296.0],"skipIndex":0,"section_code":"gallery","featured_images":"6862296,6862294,6862293,6862291","id":372525,"singleSection":false});				  						galleries[306514] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Work & Commissions '2010'","link":"gallery_306514.html","maxRecords":0.0,"photoIDs":[6389524.0,6389579.0,6389582.0,6389584.0,6389606.0],"skipIndex":0,"section_code":"gallery","featured_images":"6389606,6389584,6389582,6389579,6389524","id":306514,"singleSection":false});				  						galleries[353643] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Woburn Artbeat '2010'","link":"gallery_353643.html","maxRecords":0.0,"photoIDs":[6389613.0,6389616.0],"skipIndex":0,"section_code":"gallery","featured_images":"6389616,6389613","id":353643,"singleSection":false});				  						galleries[306515] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Milton Keynes City Centre [#1] '2009'","link":"gallery_306515.html","maxRecords":0.0,"photoIDs":[5487270.0,5487279.0,5487281.0,5487283.0,5487288.0,5487291.0,5487295.0,5487296.0],"skipIndex":0,"section_code":"gallery","featured_images":5487291.0,"id":306515,"singleSection":false});				  						galleries[307010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Milton Keynes City Centre [#2] '2009'","link":"gallery_307010.html","maxRecords":0.0,"photoIDs":[5486580.0,5486581.0,5486585.0,5486586.0,5486587.0,5486590.0,5486593.0,5486596.0,5486676.0,5486677.0,5486678.0,5486680.0,5486682.0,5486686.0,5486687.0,5486690.0,5486692.0,5486693.0,5486694.0,5486696.0,5486699.0,5486700.0,5486702.0,5486703.0,5486705.0,5486706.0,5486707.0],"skipIndex":0,"section_code":"gallery","featured_images":5486692.0,"id":307010,"singleSection":false});				  						galleries[306558] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Open University '2009'","link":"gallery_306558.html","maxRecords":0.0,"photoIDs":[5432514.0,5432518.0,5432522.0,5432527.0],"skipIndex":0,"section_code":"gallery","featured_images":"5432527,5432522,5432518,5432514","id":306558,"singleSection":false});				  						galleries[306560] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Sphere '2008'","link":"gallery_306560.html","maxRecords":0.0,"photoIDs":[5432378.0,5432381.0,5432384.0,5432385.0,5432394.0,5432397.0,5432399.0],"skipIndex":0,"section_code":"gallery","featured_images":5432397.0,"id":306560,"singleSection":false});				  						galleries[306562] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Adaptable Factory '2007'","link":"gallery_306562.html","maxRecords":0.0,"photoIDs":[5432251.0,5432253.0,5432280.0,5432282.0,5432283.0,5432286.0,5432291.0,5432289.0,5432293.0,5432287.0,5432285.0],"skipIndex":0,"section_code":"gallery","featured_images":5432286.0,"id":306562,"singleSection":false});				  						galleries[307016] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Gallery Opening '2007'","link":"gallery_307016.html","maxRecords":0.0,"photoIDs":[5486566.0,5486568.0,5486570.0,5486572.0,5486573.0],"skipIndex":0,"section_code":"gallery","featured_images":"5486573,5486572,5486570,5486568,5486566","id":307016,"singleSection":false});				  						galleries[306564] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Personal Medium '2006'","link":"gallery_306564.html","maxRecords":0.0,"photoIDs":[5432208.0,5424462.0,5424442.0,5432201.0,5432206.0],"skipIndex":0,"section_code":"gallery","featured_images":5424442.0,"id":306564,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8524312';
imageSets[2] = '5487291,5486692,5432397,5432286,5424442';
imageSets[3] = '8524368,8524366,8524364,8524362,8524312,8523850,8523843,8523833,8523762,6862296,6862294,6862293,6862291,6389616,6389613,6389606,6389584,6389582,6389579,6389524,5487296,5487295,5487291,5487288,5487283,5487281,5487279,5487270,5486707,5486706,5486705,5486703,5486702,5486700,5486699,5486696,5486694,5486693,5486692,5486690,5486687,5486686,5486682,5486680,5486678,5486677,5486676,5486596,5486593,5486590';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jsmith6/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jsmith6/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 += '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 = 'Jason Smith: ' + 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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<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;
	}
}

			

