window.thumbnails = {};
															thumbnails[6626019] = clik.newPhoto({"id":6626019,"src":"GINNY_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":206});
															thumbnails[6332168] = clik.newPhoto({"id":6332168,"src":"2a_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6332168.html","width":130,"caption":"Brassed Off","height":86});
															thumbnails[6332241] = clik.newPhoto({"id":6332241,"src":"DRUM_HORSE_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6332241.html","width":130,"caption":"Drum Horse","height":92});
															thumbnails[6345149] = clik.newPhoto({"id":6345149,"src":"DSC_0071_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6345149.html","width":130,"caption":"Thoughts","height":86});
															thumbnails[6355626] = clik.newPhoto({"id":6355626,"src":"pbIMAGESa27_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6355626.html","width":130,"caption":"Sunset on the Indian Ocean","height":196});
															thumbnails[6355638] = clik.newPhoto({"id":6355638,"src":"pbIMAGESa29_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6355638.html","width":130,"caption":"Town on The Thames","height":87});
															thumbnails[6355652] = clik.newPhoto({"id":6355652,"src":"pbIMAGESa30_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6355652.html","width":130,"caption":"Pointless","height":117});
															thumbnails[6355655] = clik.newPhoto({"id":6355655,"src":"pbIMAGESa31_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6355655.html","width":130,"caption":"Alight","height":196});
															thumbnails[6355661] = clik.newPhoto({"id":6355661,"src":"pbIMAGESa38_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6355661.html","width":130,"caption":"Stripey","height":86});
															thumbnails[6384551] = clik.newPhoto({"id":6384551,"src":"pbIMAGESa14_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384551.html","width":130,"caption":"Archway","height":86});
															thumbnails[6384559] = clik.newPhoto({"id":6384559,"src":"pbIMAGESa15_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384559.html","width":130,"caption":"Snow Train","height":92});
															thumbnails[6384642] = clik.newPhoto({"id":6384642,"src":"pbIMAGESa16_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384642.html","width":130,"caption":"Resting","height":121});
															thumbnails[6384802] = clik.newPhoto({"id":6384802,"src":"pbIMAGESa20_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384802.html","width":130,"caption":"Straw Village","height":86});
															thumbnails[6384826] = clik.newPhoto({"id":6384826,"src":"pbIMAGESa21_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384826.html","width":130,"caption":"Spring","height":196});
															thumbnails[6384834] = clik.newPhoto({"id":6384834,"src":"pbIMAGESa22_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6384834.html","width":130,"caption":"Just a tree","height":196});
															thumbnails[6384851] = clik.newPhoto({"id":6384851,"src":"pbIMAGESa23_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384851.html","width":130,"caption":"Rome in England","height":196});
															thumbnails[6384942] = clik.newPhoto({"id":6384942,"src":"pbIMAGESa24_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6384942.html","width":130,"caption":"Royal","height":196});
															thumbnails[6384968] = clik.newPhoto({"id":6384968,"src":"pbIMAGESa39_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6384968.html","width":130,"caption":"Concert Time","height":62});
															thumbnails[6384973] = clik.newPhoto({"id":6384973,"src":"pbIMAGESa40_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6384973.html","width":130,"caption":"Follow Me","height":86});
															thumbnails[6384981] = clik.newPhoto({"id":6384981,"src":"pbIMAGESa41_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6384981.html","width":130,"caption":"Royal Music","height":86});
															thumbnails[6385004] = clik.newPhoto({"id":6385004,"src":"pbIMAGESa43_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6385004.html","width":130,"caption":"Morniog","height":184});
															thumbnails[6385010] = clik.newPhoto({"id":6385010,"src":"pbIMAGESa45_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6385010.html","width":130,"caption":"Concentration","height":195});
															thumbnails[6401306] = clik.newPhoto({"id":6401306,"src":"pbIMAGESa32_thumb.jpg","galleries_id":353772,"server_id":5,"link":"photo_6401306.html","width":130,"caption":"Steam","height":86});
															thumbnails[6401313] = clik.newPhoto({"id":6401313,"src":"pbIMAGESa33_thumb.jpg","galleries_id":353772,"server_id":5,"link":"photo_6401313.html","width":130,"caption":"Splash Landing","height":79});
															thumbnails[6401317] = clik.newPhoto({"id":6401317,"src":"pbIMAGESa34_thumb.jpg","galleries_id":353772,"server_id":5,"link":"photo_6401317.html","width":130,"caption":"On The Mend","height":196});
															thumbnails[6401320] = clik.newPhoto({"id":6401320,"src":"pbIMAGESa35_thumb.jpg","galleries_id":353772,"server_id":5,"link":"photo_6401320.html","width":130,"caption":"Top Class","height":180});
															thumbnails[6401325] = clik.newPhoto({"id":6401325,"src":"pbIMAGESa36_thumb.JPG","galleries_id":353772,"server_id":5,"link":"photo_6401325.html","width":130,"caption":"Part Merc","height":86});
															thumbnails[6401335] = clik.newPhoto({"id":6401335,"src":"pbIMAGESa37_thumb.jpg","galleries_id":353772,"server_id":5,"link":"photo_6401335.html","width":130,"caption":"Top Gun","height":60});
															thumbnails[6420380] = clik.newPhoto({"id":6420380,"src":"pbIMAGESa38_0FCC8154-1D09-001F-998048327B61E0AD_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6420380.html","width":130,"caption":"Mystery","height":64});
															thumbnails[6446370] = clik.newPhoto({"id":6446370,"src":"pbIMAGESa51_thumb.jpg","galleries_id":355669,"server_id":5,"link":"photo_6446370.html","width":130,"caption":"Stoned","height":85});
															thumbnails[6446371] = clik.newPhoto({"id":6446371,"src":"pbIMAGESa61_thumb.jpg","galleries_id":355669,"server_id":5,"link":"photo_6446371.html","width":130,"caption":"Old Steam","height":95});
															thumbnails[6446373] = clik.newPhoto({"id":6446373,"src":"pbIMAGESa7_thumb.jpg","galleries_id":355669,"server_id":5,"link":"photo_6446373.html","width":130,"caption":"Double Wing","height":87});
															thumbnails[6446376] = clik.newPhoto({"id":6446376,"src":"pbIMAGESa8_thumb.JPG","galleries_id":355669,"server_id":5,"link":"photo_6446376.html","width":130,"caption":"Swanning","height":64});
															thumbnails[6446399] = clik.newPhoto({"id":6446399,"src":"1A_thumb.JPG","galleries_id":355686,"server_id":5,"link":"photo_6446399.html","width":130,"caption":"Polo Horse","height":165});
															thumbnails[6446415] = clik.newPhoto({"id":6446415,"src":"1g_copy_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446415.html","width":130,"caption":"Action !!","height":97});
															thumbnails[6446456] = clik.newPhoto({"id":6446456,"src":"pbIMAGES121_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446456.html","width":130,"caption":"Seeing Double","height":127});
															thumbnails[6446492] = clik.newPhoto({"id":6446492,"src":"pbIMAGESa9_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446492.html","width":130,"caption":"New ","height":86});
															thumbnails[6446494] = clik.newPhoto({"id":6446494,"src":"pbIMAGESa10_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446494.html","width":130,"caption":" Heron","height":196});
															thumbnails[6446517] = clik.newPhoto({"id":6446517,"src":"pbIMAGESa11_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446517.html","width":130,"caption":"Family outing","height":48});
															thumbnails[6446520] = clik.newPhoto({"id":6446520,"src":"pbIMAGESa131_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_6446520.html","width":130,"caption":"Zzzzzzzz.......","height":88});
															thumbnails[6468637] = clik.newPhoto({"id":6468637,"src":"CSC_0095_copy_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6468637.html","width":130,"caption":"Strike Up The Band","height":86});
															thumbnails[6515778] = clik.newPhoto({"id":6515778,"src":"pbIMAGESa69_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6515778.html","width":130,"caption":"Spectacular !!","height":196});
															thumbnails[6515783] = clik.newPhoto({"id":6515783,"src":"pbIMAGESa68_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6515783.html","width":130,"caption":"Pass Out","height":86});
															thumbnails[6605135] = clik.newPhoto({"id":6605135,"src":"pbIMAGES70_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6605135.html","width":130,"caption":"Dont Look Behind","height":98});
															thumbnails[6605138] = clik.newPhoto({"id":6605138,"src":"pbIMAGES71_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6605138.html","width":130,"caption":"Blues and Royals","height":82});
															thumbnails[6605141] = clik.newPhoto({"id":6605141,"src":"pbIMAGES72_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6605141.html","width":130,"caption":"Pageant","height":92});
															thumbnails[6625844] = clik.newPhoto({"id":6625844,"src":"2_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6625844.html","width":130,"caption":"Harbour Village","height":52});
															thumbnails[6625847] = clik.newPhoto({"id":6625847,"src":"126_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6625847.html","width":130,"caption":"Passing Through","height":86});
															thumbnails[6625871] = clik.newPhoto({"id":6625871,"src":"DSC_0038_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_6625871.html","width":130,"caption":"Village Impressions","height":75});
															thumbnails[6937573] = clik.newPhoto({"id":6937573,"src":"pbIMAGESa_D92EF2E6-1D09-001F-99908FAC0847EB8C_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6937573.html","width":130,"caption":"Alight","height":63});
															thumbnails[6937691] = clik.newPhoto({"id":6937691,"src":"pbIMAGES701_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_6937691.html","width":130,"caption":"On The March","height":83});
															thumbnails[7206082] = clik.newPhoto({"id":7206082,"src":"BPI_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_7206082.html","width":130,"caption":"Lit Up","height":86});
															thumbnails[7206084] = clik.newPhoto({"id":7206084,"src":"BP2_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_7206084.html","width":130,"caption":"By Night","height":86});
															thumbnails[7206133] = clik.newPhoto({"id":7206133,"src":"KN1_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_7206133.html","width":130,"caption":"Tranquil moment","height":86});
															thumbnails[7206138] = clik.newPhoto({"id":7206138,"src":"kn2_thumb.jpg","galleries_id":351033,"server_id":5,"link":"photo_7206138.html","width":130,"caption":"Lost World","height":191});
															thumbnails[7581222] = clik.newPhoto({"id":7581222,"src":"pbIMAGES74_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_7581222.html","width":130,"caption":"All The Queens Horses","height":78});
															thumbnails[7581227] = clik.newPhoto({"id":7581227,"src":"pbIMAGES77_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_7581227.html","width":130,"caption":"Passing By","height":86});
															thumbnails[7581234] = clik.newPhoto({"id":7581234,"src":"pbIMAGES76_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_7581234.html","width":130,"caption":"Running In","height":70});
															thumbnails[7581244] = clik.newPhoto({"id":7581244,"src":"pbImages73_thumb.jpg","galleries_id":350656,"server_id":5,"link":"photo_7581244.html","width":130,"caption":"All In","height":86});
															thumbnails[7581252] = clik.newPhoto({"id":7581252,"src":"pbIMAGES75_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_7581252.html","width":130,"caption":"Royal Landscape","height":196});
															thumbnails[8258487] = clik.newPhoto({"id":8258487,"src":"asc1_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_8258487.html","width":130,"caption":"In A Hurry ","height":62});
															thumbnails[8258571] = clik.newPhoto({"id":8258571,"src":"asc2_thumb.jpg","galleries_id":355686,"server_id":5,"link":"photo_8258571.html","width":130,"caption":"Easy Rider","height":184});
															thumbnails[8706936] = clik.newPhoto({"id":8706936,"src":"4_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706936.html","width":130,"caption":"Farm House","height":86});
															thumbnails[8706939] = clik.newPhoto({"id":8706939,"src":"5_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706939.html","width":130,"caption":"Coastal Image","height":86});
															thumbnails[8706945] = clik.newPhoto({"id":8706945,"src":"6_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706945.html","width":130,"caption":"Sea View","height":86});
															thumbnails[8706950] = clik.newPhoto({"id":8706950,"src":"10_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706950.html","width":130,"caption":"Mountain Panorama","height":33});
															thumbnails[8706953] = clik.newPhoto({"id":8706953,"src":"DSC_0041_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706953.html","width":130,"caption":"Viewtiful","height":81});
															thumbnails[8706955] = clik.newPhoto({"id":8706955,"src":"DSC_0048_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706955.html","width":130,"caption":"Coast","height":86});
															thumbnails[8706957] = clik.newPhoto({"id":8706957,"src":"DSC_0108_copy_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706957.html","width":130,"caption":"Promenade","height":86});
															thumbnails[8706960] = clik.newPhoto({"id":8706960,"src":"DSC_0122_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706960.html","width":130,"caption":"Square","height":196});
															thumbnails[6322932] = clik.newPhoto({"id":6322932,"src":"131_thumb.jpg","galleries_id":350657,"server_id":5,"link":"photo_6322932.html","width":130,"caption":"REFLECTION","height":196});
															thumbnails[8706948] = clik.newPhoto({"id":8706948,"src":"9_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8706948.html","width":130,"caption":"Churchills Perch","height":196});
															thumbnails[8635447] = clik.newPhoto({"id":8635447,"src":"35353_thumb.jpg","galleries_id":459226,"server_id":5,"link":"photo_8635447.html","width":130,"caption":"Imagine","height":196});
															thumbnails[8706951] = clik.newPhoto({"id":8706951,"src":"DSC_0007_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706951.html","width":130,"caption":"Home for a week","height":196});
															thumbnails[8706956] = clik.newPhoto({"id":8706956,"src":"DSC_0099_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706956.html","width":130,"caption":"Capital","height":196});
															thumbnails[8706962] = clik.newPhoto({"id":8706962,"src":"DSC_0137_thumb.JPG","galleries_id":459226,"server_id":5,"link":"photo_8706962.html","width":130,"caption":"Town Hall Square","height":196});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[459226] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Madeira","link":"gallery_459226.html","maxRecords":0.0,"photoIDs":[8706936.0,8706939.0,8706945.0,8706950.0,8706953.0,8706955.0,8706957.0,8706960.0,8706948.0,8635447.0,8706951.0,8706956.0,8706962.0],"skipIndex":0,"section_code":"gallery","featured_images":8635447.0,"id":459226,"singleSection":false});				  						galleries[350656] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Music and Pageant","link":"gallery_350656.html","maxRecords":0.0,"photoIDs":[6332168.0,6332241.0,6384968.0,6384973.0,6384981.0,6385004.0,6385010.0,6468637.0,6515778.0,6515783.0,6605135.0,6605138.0,6605141.0,6937691.0,7581222.0,7581227.0,7581234.0,7581244.0],"skipIndex":0,"section_code":"gallery","featured_images":6385010.0,"id":350656,"singleSection":false});				  						galleries[351033] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Coastal and Waterways","link":"gallery_351033.html","maxRecords":0.0,"photoIDs":[6345149.0,6355626.0,6355638.0,6355652.0,6355655.0,6355661.0,6625844.0,6625847.0,6625871.0,7206082.0,7206084.0,7206133.0,7206138.0],"skipIndex":0,"section_code":"gallery","featured_images":6355655.0,"id":351033,"singleSection":false});				  						galleries[350657] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes and Places of Interest","link":"gallery_350657.html","maxRecords":0.0,"photoIDs":[6384551.0,6384559.0,6384642.0,6384802.0,6384826.0,6384851.0,6384942.0,6420380.0,6937573.0,7581252.0,6322932.0],"skipIndex":0,"section_code":"gallery","featured_images":7581252.0,"id":350657,"singleSection":false});				  						galleries[355686] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animal & Wildlife","link":"gallery_355686.html","maxRecords":0.0,"photoIDs":[6384834.0,6446399.0,6446415.0,6446456.0,6446492.0,6446494.0,6446517.0,6446520.0,8258487.0,8258571.0],"skipIndex":0,"section_code":"gallery","featured_images":6446494.0,"id":355686,"singleSection":false});				  						galleries[353772] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Transport","link":"gallery_353772.html","maxRecords":0.0,"photoIDs":[6401306.0,6401313.0,6401317.0,6401320.0,6401325.0,6401335.0],"skipIndex":0,"section_code":"gallery","featured_images":6401320.0,"id":353772,"singleSection":false});				  						galleries[355669] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Black and White","link":"gallery_355669.html","maxRecords":0.0,"photoIDs":[6446370.0,6446371.0,6446373.0,6446376.0],"skipIndex":0,"section_code":"gallery","featured_images":"6446376,6446373,6446371,6446370","id":355669,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8706948';
imageSets[2] = '7581252,6446494,6401320,6385010,6355655,8635447';
imageSets[3] = '8706962,8706960,8706957,8706956,8706955,8706953,8706951,8706950,8706948,8706945,8706939,8706936,8635447,8258571,8258487,7581252,7581244,7581234,7581227,7581222,7206138,7206133,7206084,7206082,6937691,6937573,6626019,6625871,6625847,6625844,6605141,6605138,6605135,6515783,6515778,6468637,6446520,6446517,6446494,6446492,6446456,6446415,6446399,6446376,6446373,6446371,6446370,6420380,6401335,6401325';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/pauljb/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/pauljb/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/pauljb/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/pauljb/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/pauljb/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/pauljb/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/pauljb/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 = 'Paul Barker Images: ' + 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;
	}
}

			

