window.thumbnails = {};
															thumbnails[4343663] = clik.newPhoto({"id":4343663,"src":"Pauline001_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4343663.html","width":130,"caption":"Bull headed man and model. Pauline Rignall","height":107});
															thumbnails[4343854] = clik.newPhoto({"id":4343854,"src":"student_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4343854.html","width":130,"caption":"Student work","height":151});
															thumbnails[4343871] = clik.newPhoto({"id":4343871,"src":"studentwork_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4343871.html","width":130,"caption":"Jane Millward","height":107});
															thumbnails[4343883] = clik.newPhoto({"id":4343883,"src":"walledgarden_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4343883.html","width":130,"caption":"Student work","height":183});
															thumbnails[4343955] = clik.newPhoto({"id":4343955,"src":"walledgarden2_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4343955.html","width":130,"caption":"Drawing","height":184});
															thumbnails[4343959] = clik.newPhoto({"id":4343959,"src":"walledgarden4_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4343959.html","width":130,"caption":"Drawing","height":169});
															thumbnails[4343985] = clik.newPhoto({"id":4343985,"src":"Prague3_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4343985.html","width":130,"caption":"PRAGUE","height":171});
															thumbnails[4344032] = clik.newPhoto({"id":4344032,"src":"2009_0720ARTWORK07090006_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4344032.html","width":130,"caption":"Frances Lewis","height":86});
															thumbnails[4344224] = clik.newPhoto({"id":4344224,"src":"marion_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4344224.html","width":130,"caption":"Collagraph","height":130});
															thumbnails[4415604] = clik.newPhoto({"id":4415604,"src":"Anthea_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4415604.html","width":130,"caption":"Anthea","height":97});
															thumbnails[4435831] = clik.newPhoto({"id":4435831,"src":"ANNIERUSSEL_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4435831.html","width":130,"caption":"Annie Russell","height":176});
															thumbnails[4435836] = clik.newPhoto({"id":4435836,"src":"Kathwilliamson_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4435836.html","width":130,"caption":"Kath Williamson","height":82});
															thumbnails[4435849] = clik.newPhoto({"id":4435849,"src":"Augustclass2_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4435849.html","width":130,"caption":"August summer school 2009","height":98});
															thumbnails[4435858] = clik.newPhoto({"id":4435858,"src":"Augustclass09_thumb.JPG","galleries_id":254066,"server_id":15,"link":"photo_4435858.html","width":130,"caption":"August summer school 2009","height":98});
															thumbnails[4449956] = clik.newPhoto({"id":4449956,"src":"JoPye0809001_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4449956.html","width":130,"caption":"Jo Pye","height":177});
															thumbnails[4449959] = clik.newPhoto({"id":4449959,"src":"Sally0809001_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_4449959.html","width":130,"caption":"Sally Brooks","height":93});
															thumbnails[7601331] = clik.newPhoto({"id":7601331,"src":"Cath_Harnett_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_7601331.html","width":130,"caption":"","height":193});
															thumbnails[7601339] = clik.newPhoto({"id":7601339,"src":"Frances_Lewis_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_7601339.html","width":130,"caption":"","height":154});
															thumbnails[7601366] = clik.newPhoto({"id":7601366,"src":"Gerry_Smith_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_7601366.html","width":130,"caption":"","height":258});
															thumbnails[7601372] = clik.newPhoto({"id":7601372,"src":"Jan_Beautytman_thumb.jpg","galleries_id":254066,"server_id":15,"link":"photo_7601372.html","width":130,"caption":"","height":89});
															thumbnails[4323800] = clik.newPhoto({"id":4323800,"src":"ARLEYKINGS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323800.html","width":130,"caption":"ARLEY KINGS","height":108});
															thumbnails[4324595] = clik.newPhoto({"id":4324595,"src":"SISTERHOUSE_thumb.JPG","galleries_id":254065,"server_id":15,"link":"photo_4324595.html","width":130,"caption":"SISTER HOUSE PEMBROKE","height":95});
															thumbnails[4324626] = clik.newPhoto({"id":4324626,"src":"SISTERSHOUSE2_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324626.html","width":130,"caption":"SISTERS HOUSE PEMBROKESHIRE","height":95});
															thumbnails[6107569] = clik.newPhoto({"id":6107569,"src":"walled_garden_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_6107569.html","width":130,"caption":"Walled garden tree","height":206});
															thumbnails[6108644] = clik.newPhoto({"id":6108644,"src":"Sacre_Coeur_Gargoyle_3123_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_6108644.html","width":130,"caption":"Sacre Coeur gargoyle","height":187});
															thumbnails[6616150] = clik.newPhoto({"id":6616150,"src":"Notre-Dame-3_thumb.gif","galleries_id":254065,"server_id":15,"link":"photo_6616150.html","width":130,"caption":"Notre Dame","height":189});
															thumbnails[6616177] = clik.newPhoto({"id":6616177,"src":"Gordale_Scar_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_6616177.html","width":130,"caption":"Gordale Scar","height":188});
															thumbnails[6616502] = clik.newPhoto({"id":6616502,"src":"2010_0827august10WorkNew0019_thumb.JPG","galleries_id":254065,"server_id":15,"link":"photo_6616502.html","width":130,"caption":"Gordale Scar","height":190});
															thumbnails[8768899] = clik.newPhoto({"id":8768899,"src":"Witley_skyline_1_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8768899.html","width":130,"caption":"Witley Court Worcestershire","height":91});
															thumbnails[8768900] = clik.newPhoto({"id":8768900,"src":"Witley_window_1_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8768900.html","width":130,"caption":"Witley Court window","height":178});
															thumbnails[8974613] = clik.newPhoto({"id":8974613,"src":"Blue_bird_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8974613.html","width":130,"caption":"Blue Bird","height":185});
															thumbnails[8974618] = clik.newPhoto({"id":8974618,"src":"red_bird_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8974618.html","width":130,"caption":"Red Bird","height":181});
															thumbnails[8974632] = clik.newPhoto({"id":8974632,"src":"BS_triptych_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8974632.html","width":130,"caption":"Birds and Snake triptych","height":247});
															thumbnails[8974633] = clik.newPhoto({"id":8974633,"src":"BS_triptych1_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8974633.html","width":130,"caption":"Birds and Snake triptych","height":247});
															thumbnails[8974647] = clik.newPhoto({"id":8974647,"src":"brids_snake_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8974647.html","width":130,"caption":"Birds and Snake","height":208});
															thumbnails[8997797] = clik.newPhoto({"id":8997797,"src":"Heartbeat_show1_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8997797.html","width":130,"caption":"Heartbeat Gallery","height":98});
															thumbnails[8997799] = clik.newPhoto({"id":8997799,"src":"Heartbeat_show2_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8997799.html","width":130,"caption":"Heartbeat Gallery","height":98});
															thumbnails[4323754] = clik.newPhoto({"id":4323754,"src":"BODYSCAPE_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323754.html","width":130,"caption":"BODYSCAPE","height":178});
															thumbnails[4323813] = clik.newPhoto({"id":4323813,"src":"BELOW_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323813.html","width":130,"caption":"BELOW ","height":166});
															thumbnails[4324486] = clik.newPhoto({"id":4324486,"src":"GATED_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324486.html","width":130,"caption":"GATED WORLD","height":182});
															thumbnails[4324580] = clik.newPhoto({"id":4324580,"src":"NIGHTSCAPE_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324580.html","width":130,"caption":"NIGHT SCAPE","height":92});
															thumbnails[4324589] = clik.newPhoto({"id":4324589,"src":"SEASCAPE_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324589.html","width":130,"caption":"SUN OVER THE SEA","height":95});
															thumbnails[4324998] = clik.newPhoto({"id":4324998,"src":"THEFALL_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324998.html","width":130,"caption":"THE FALL","height":211});
															thumbnails[4344223] = clik.newPhoto({"id":4344223,"src":"alloftheladies3_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4344223.html","width":130,"caption":"All of the Ladies","height":132});
															thumbnails[6616496] = clik.newPhoto({"id":6616496,"src":"2010_0827august10WorkNew0014_thumb.JPG","galleries_id":254065,"server_id":15,"link":"photo_6616496.html","width":130,"caption":"Light from below","height":442});
															thumbnails[6616505] = clik.newPhoto({"id":6616505,"src":"2010_0827august10WorkNew0016_thumb.JPG","galleries_id":254065,"server_id":15,"link":"photo_6616505.html","width":130,"caption":"The Flags","height":132});
															thumbnails[7542535] = clik.newPhoto({"id":7542535,"src":"Hotel_de_Ville_Aix_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_7542535.html","width":130,"caption":"","height":94});
															thumbnails[7600930] = clik.newPhoto({"id":7600930,"src":"Hotel_de_Ville_Aix_AE55AE45-1EC9-DFB6-09F3221EC870573F_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_7600930.html","width":130,"caption":"Fragment Hotel de Ville, Aix en Provence","height":121});
															thumbnails[8768837] = clik.newPhoto({"id":8768837,"src":"Cave_dale_1_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_8768837.html","width":130,"caption":"Cave Dale Castleton","height":186});
															thumbnails[4324199] = clik.newPhoto({"id":4324199,"src":"DARK_CROSS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324199.html","width":130,"caption":"DARK CROSS","height":102});
															thumbnails[4312002] = clik.newPhoto({"id":4312002,"src":"APRIL2009_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4312002.html","width":130,"caption":"","height":120});
															thumbnails[4323588] = clik.newPhoto({"id":4323588,"src":"BELT_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323588.html","width":130,"caption":"BELT","height":89});
															thumbnails[4323750] = clik.newPhoto({"id":4323750,"src":"BIRD_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323750.html","width":130,"caption":"BIRD","height":165});
															thumbnails[4323782] = clik.newPhoto({"id":4323782,"src":"CIRCLE_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323782.html","width":130,"caption":"CIRCLE","height":128});
															thumbnails[4323818] = clik.newPhoto({"id":4323818,"src":"CROSS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4323818.html","width":130,"caption":"CROSS","height":129});
															thumbnails[4324342] = clik.newPhoto({"id":4324342,"src":"FLYING_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324342.html","width":130,"caption":"FLYING ISLAND","height":130});
															thumbnails[4324495] = clik.newPhoto({"id":4324495,"src":"HOTSUNS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324495.html","width":130,"caption":"HOT SUN","height":95});
															thumbnails[4324502] = clik.newPhoto({"id":4324502,"src":"MAY2009_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324502.html","width":130,"caption":"MAY 2009","height":118});
															thumbnails[4324539] = clik.newPhoto({"id":4324539,"src":"MOONS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324539.html","width":130,"caption":"MOONS OVER ","height":103});
															thumbnails[4324586] = clik.newPhoto({"id":4324586,"src":"ROADS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324586.html","width":130,"caption":"THE ROADS","height":89});
															thumbnails[4324996] = clik.newPhoto({"id":4324996,"src":"SUN_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4324996.html","width":130,"caption":"SUN","height":94});
															thumbnails[4325059] = clik.newPhoto({"id":4325059,"src":"THINGS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325059.html","width":130,"caption":"SHAPES WITHIN","height":104});
															thumbnails[4325062] = clik.newPhoto({"id":4325062,"src":"THINGS2_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325062.html","width":130,"caption":"THE SHAPES WITHIN 2","height":105});
															thumbnails[4325097] = clik.newPhoto({"id":4325097,"src":"TURQTHINGS_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325097.html","width":130,"caption":"TURQUOISE SHAPES","height":103});
															thumbnails[4325099] = clik.newPhoto({"id":4325099,"src":"Two_Pages_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325099.html","width":130,"caption":"TWO PAGES FROM THE BOOK","height":94});
															thumbnails[4325111] = clik.newPhoto({"id":4325111,"src":"TWOPAGES_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325111.html","width":130,"caption":"TWO PAGES ","height":93});
															thumbnails[4325136] = clik.newPhoto({"id":4325136,"src":"Circle_plate_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325136.html","width":130,"caption":"MACHINE","height":252});
															thumbnails[4325137] = clik.newPhoto({"id":4325137,"src":"Small_plates002_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325137.html","width":130,"caption":"CIRCLE","height":140});
															thumbnails[4325142] = clik.newPhoto({"id":4325142,"src":"Small_plates005_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4325142.html","width":130,"caption":"LINE ","height":309});
															thumbnails[7600934] = clik.newPhoto({"id":7600934,"src":"Lower_steps_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_7600934.html","width":130,"caption":"Lower steps","height":189});
															thumbnails[4343666] = clik.newPhoto({"id":4343666,"src":"Sketchbook001_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343666.html","width":130,"caption":"Sketcbook work","height":96});
															thumbnails[4343667] = clik.newPhoto({"id":4343667,"src":"Sketchbook002_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343667.html","width":130,"caption":"Sketch book work","height":175});
															thumbnails[4343670] = clik.newPhoto({"id":4343670,"src":"Sketchbook003_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343670.html","width":130,"caption":"Sketch book work","height":187});
															thumbnails[4343779] = clik.newPhoto({"id":4343779,"src":"Sketchbook003A_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343779.html","width":130,"caption":"Sketch book work","height":93});
															thumbnails[4343799] = clik.newPhoto({"id":4343799,"src":"Sketchbook004_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343799.html","width":130,"caption":"Working page","height":186});
															thumbnails[4343804] = clik.newPhoto({"id":4343804,"src":"Sketchbook005_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343804.html","width":130,"caption":"Ideas pages","height":71});
															thumbnails[4343849] = clik.newPhoto({"id":4343849,"src":"Sketchbook008_thumb.jpg","galleries_id":254065,"server_id":15,"link":"photo_4343849.html","width":130,"caption":"Sketch book page","height":147});
															thumbnails[4324332] = clik.newPhoto({"id":4324332,"src":"Drawing_thumb.JPG","galleries_id":254065,"server_id":15,"link":"photo_4324332.html","width":130,"caption":"Drawing","height":173});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[254065] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_254065.html","maxRecords":0.0,"photoIDs":[4323800.0,4324595.0,4324626.0,6107569.0,6108644.0,6616150.0,6616177.0,6616502.0,8768899.0,8768900.0,8974613.0,8974618.0,8974632.0,8974633.0,8974647.0,8997797.0,8997799.0,4323754.0,4323813.0,4324486.0,4324580.0,4324589.0,4324998.0,4344223.0,6616496.0,6616505.0,7542535.0,7600930.0,8768837.0,4324199.0,4312002.0,4323588.0,4323750.0,4323782.0,4323818.0,4324342.0,4324495.0,4324502.0,4324539.0,4324586.0,4324996.0,4325059.0,4325062.0,4325097.0,4325099.0,4325111.0,4325136.0,4325137.0,4325142.0,7600934.0,4343666.0,4343667.0,4343670.0,4343779.0,4343799.0,4343804.0,4343849.0,4324332.0],"skipIndex":0,"section_code":"gallery","featured_images":"8997799,8997797,8974647,8974633,8974632,8974618,8974613,8768900,8768899,8768837","id":254065,"singleSection":false});				  						galleries[254066] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_254066.html","maxRecords":0.0,"photoIDs":[4343663.0,4343854.0,4343871.0,4343883.0,4343955.0,4343959.0,4343985.0,4344032.0,4344224.0,4415604.0,4435831.0,4435836.0,4435849.0,4435858.0,4449956.0,4449959.0,7601331.0,7601339.0,7601366.0,7601372.0],"skipIndex":0,"section_code":"gallery","featured_images":"7601372,7601366,7601339,7601331,4449959,4449956,4435858,4435849,4435836,4435831","id":254066,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8997799,8997797,8974647,8974633,8974632,8974618,8974613,8768900,8768899,8768837,7601372,7601366,7601339,7601331,7600934,7600930,7542535,6616505,6616502,6616496,6616177,6616150,6108644,6107569,4449959,4449956,4435858,4435849,4435836,4435831,4415604,4344224,4344223,4344032,4343985,4343959,4343955,4343883,4343871,4343854,4343849,4343804,4343799,4343779,4343670,4343667,4343666,4343663,4325142,4325137';
imageSets[3] = '8997799,8997797,8974647,8974633,8974632,8974618,8974613,8768900,8768899,8768837,7601372,7601366,7601339,7601331,7600934,7600930,7542535,6616505,6616502,6616496,6616177,6616150,6108644,6107569,4449959,4449956,4435858,4435849,4435836,4435831,4415604,4344224,4344223,4344032,4343985,4343959,4343955,4343883,4343871,4343854,4343849,4343804,4343799,4343779,4343670,4343667,4343666,4343663,4325142,4325137';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/peterpainter54/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/peterpainter54/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 = 'peterpainterprintmaker: ' + 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;
	}
}

			

