window.thumbnails = {};
															thumbnails[8640490] = clik.newPhoto({"id":8640490,"src":"IMG_1333_853x1280_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":87,"caption":"","height":130});
															thumbnails[8640507] = clik.newPhoto({"id":8640507,"src":"choccyfountainlogo_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":50});
															thumbnails[8643651] = clik.newPhoto({"id":8643651,"src":"Heat_loss_House_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Heat loss House","height":107});
															thumbnails[8643660] = clik.newPhoto({"id":8643660,"src":"portacabinlosses_dampdoorframe_thumb.gif","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Extreme heat loss from top of door.","height":118});
															thumbnails[8643674] = clik.newPhoto({"id":8643674,"src":"FLIR-8482-i3-Wrmebildkamera.gif_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Thermal image camera","height":130});
															thumbnails[8547691] = clik.newPhoto({"id":8547691,"src":"001_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547691.html","width":130,"caption":"on the dance floor","height":87});
															thumbnails[8547697] = clik.newPhoto({"id":8547697,"src":"003_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547697.html","width":98,"caption":"Wee Button hole","height":130});
															thumbnails[8547761] = clik.newPhoto({"id":8547761,"src":"005_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547761.html","width":98,"caption":"in the palm of his hand","height":130});
															thumbnails[8547762] = clik.newPhoto({"id":8547762,"src":"006_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547762.html","width":130,"caption":"colourful confetti","height":98});
															thumbnails[8547771] = clik.newPhoto({"id":8547771,"src":"007_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547771.html","width":130,"caption":"","height":98});
															thumbnails[8547781] = clik.newPhoto({"id":8547781,"src":"011_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547781.html","width":98,"caption":"cake decoration","height":130});
															thumbnails[8547782] = clik.newPhoto({"id":8547782,"src":"012_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547782.html","width":98,"caption":"The Dress","height":130});
															thumbnails[8547784] = clik.newPhoto({"id":8547784,"src":"013_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547784.html","width":130,"caption":"Rain Rain won't spoil our day","height":98});
															thumbnails[8547785] = clik.newPhoto({"id":8547785,"src":"014_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547785.html","width":130,"caption":"The little details","height":98});
															thumbnails[8547787] = clik.newPhoto({"id":8547787,"src":"015_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547787.html","width":130,"caption":"if it wisnae for your wellies","height":98});
															thumbnails[8547788] = clik.newPhoto({"id":8547788,"src":"016_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547788.html","width":130,"caption":"Black and White","height":98});
															thumbnails[8547796] = clik.newPhoto({"id":8547796,"src":"017_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547796.html","width":130,"caption":"Silouettes","height":98});
															thumbnails[8547807] = clik.newPhoto({"id":8547807,"src":"020_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547807.html","width":130,"caption":"Mirror mirror on the wall","height":97});
															thumbnails[8547814] = clik.newPhoto({"id":8547814,"src":"McDonald_Wedding083_-_Copy_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547814.html","width":130,"caption":"I've to go in there?","height":98});
															thumbnails[8547817] = clik.newPhoto({"id":8547817,"src":"McDonald_Wedding422_-_Copy_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547817.html","width":98,"caption":"Wishing you Well!","height":130});
															thumbnails[8547819] = clik.newPhoto({"id":8547819,"src":"McDonald_Wedding424_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547819.html","width":98,"caption":"looking back on a great day","height":130});
															thumbnails[8547821] = clik.newPhoto({"id":8547821,"src":"McDonald_Wedding475_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547821.html","width":130,"caption":"wedding menu..","height":98});
															thumbnails[8547823] = clik.newPhoto({"id":8547823,"src":"Mclean_DVD_277_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547823.html","width":130,"caption":"Bride and groom","height":115});
															thumbnails[8547824] = clik.newPhoto({"id":8547824,"src":"Mclean_DVD_279_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547824.html","width":130,"caption":"The start of a great journey","height":98});
															thumbnails[8547828] = clik.newPhoto({"id":8547828,"src":"Mclean_DVD_436_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547828.html","width":130,"caption":"spiral","height":104});
															thumbnails[8547832] = clik.newPhoto({"id":8547832,"src":"Mclean_DVD_446_thumb.JPG","galleries_id":324947,"server_id":15,"link":"photo_8547832.html","width":104,"caption":"Roses and Rings","height":130});
															thumbnails[8547877] = clik.newPhoto({"id":8547877,"src":"Blacklaw_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547877.html","width":98,"caption":"Windfarm at night","height":130});
															thumbnails[8547879] = clik.newPhoto({"id":8547879,"src":"Finniston_Crane_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547879.html","width":130,"caption":"Black and White Clydeside.","height":98});
															thumbnails[8547880] = clik.newPhoto({"id":8547880,"src":"Foggy_night_in_Shotts_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547880.html","width":130,"caption":"Foggy Night in Shotts.","height":98});
															thumbnails[8547881] = clik.newPhoto({"id":8547881,"src":"Light_streaks_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547881.html","width":130,"caption":"M8 Salsburgh","height":98});
															thumbnails[8547882] = clik.newPhoto({"id":8547882,"src":"National_Monument_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547882.html","width":130,"caption":"National monument Edinburgh at night","height":104});
															thumbnails[8547883] = clik.newPhoto({"id":8547883,"src":"Nelsons_Monument_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547883.html","width":98,"caption":"Nelsons Monument","height":130});
															thumbnails[8547884] = clik.newPhoto({"id":8547884,"src":"S.Lan_HQ_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547884.html","width":130,"caption":"Hanilton","height":98});
															thumbnails[8547885] = clik.newPhoto({"id":8547885,"src":"Squinty_Bridge_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547885.html","width":92,"caption":"Squinty Bridge Glasgow","height":130});
															thumbnails[8547886] = clik.newPhoto({"id":8547886,"src":"The_Broons_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547886.html","width":130,"caption":"Frosty morning","height":98});
															thumbnails[8547887] = clik.newPhoto({"id":8547887,"src":"TV_Transmitter_Original_thumb.jpg","galleries_id":451677,"server_id":15,"link":"photo_8547887.html","width":130,"caption":"Blackhill TV tansmitter ","height":98});
															thumbnails[8548746] = clik.newPhoto({"id":8548746,"src":"P1185867_pp_thumb.jpg","galleries_id":264495,"server_id":15,"link":"photo_8548746.html","width":98,"caption":"","height":130});
															thumbnails[8548747] = clik.newPhoto({"id":8548747,"src":"P9284474_01_pp_thumb.jpg","galleries_id":264495,"server_id":15,"link":"photo_8548747.html","width":98,"caption":"","height":130});
															thumbnails[8548749] = clik.newPhoto({"id":8548749,"src":"P9284595_01_pp_thumb.jpg","galleries_id":264495,"server_id":15,"link":"photo_8548749.html","width":98,"caption":"","height":130});
															thumbnails[8548751] = clik.newPhoto({"id":8548751,"src":"PB305320_pp_thumb.jpg","galleries_id":264495,"server_id":15,"link":"photo_8548751.html","width":104,"caption":"","height":130});
															thumbnails[8548754] = clik.newPhoto({"id":8548754,"src":"Sandra_025_pp_thumb.JPG","galleries_id":264495,"server_id":15,"link":"photo_8548754.html","width":98,"caption":"","height":130});
															thumbnails[8548755] = clik.newPhoto({"id":8548755,"src":"Sandra-William_022_thumb.jpg","galleries_id":264495,"server_id":15,"link":"photo_8548755.html","width":104,"caption":"","height":130});
															thumbnails[8552872] = clik.newPhoto({"id":8552872,"src":"23rd_Sept.P1240774_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552872.html","width":130,"caption":"Alloa Atheltic Player","height":98});
															thumbnails[8552875] = clik.newPhoto({"id":8552875,"src":"Alex_Neil_SNPAirdrie_and_Shotts_012_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552875.html","width":130,"caption":"Alex Neil ","height":98});
															thumbnails[8552879] = clik.newPhoto({"id":8552879,"src":"AlexSalmondLanark08-04-11univ_thumb.jpg","galleries_id":451805,"server_id":15,"link":"photo_8552879.html","width":130,"caption":"Alex Salmond ","height":105});
															thumbnails[8552887] = clik.newPhoto({"id":8552887,"src":"Bon_accord_v_Rangers032_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552887.html","width":130,"caption":"","height":56});
															thumbnails[8552892] = clik.newPhoto({"id":8552892,"src":"Bonaccord007_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552892.html","width":130,"caption":"Alex Neil MSP and Graeme Souness ","height":111});
															thumbnails[8552895] = clik.newPhoto({"id":8552895,"src":"C-weathuniversal.060_thumb.jpg","galleries_id":451805,"server_id":15,"link":"photo_8552895.html","width":130,"caption":"Commonwealth Games team anouncement","height":87});
															thumbnails[8552908] = clik.newPhoto({"id":8552908,"src":"Motherwellpress05-04-11l008_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552908.html","width":130,"caption":"Stuart McCall Motherwell FC Manager","height":112});
															thumbnails[8552940] = clik.newPhoto({"id":8552940,"src":"P8161629_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552940.html","width":104,"caption":"Micheal Russel MSP Education minister","height":130});
															thumbnails[8552943] = clik.newPhoto({"id":8552943,"src":"p9023151_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8552943.html","width":130,"caption":"Margaret Mitchell MSP","height":98});
															thumbnails[8553106] = clik.newPhoto({"id":8553106,"src":"p9023286_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8553106.html","width":130,"caption":"Anabel Goldie MSP","height":98});
															thumbnails[8553108] = clik.newPhoto({"id":8553108,"src":"Scotland_v_Italy_010_thumb.jpg","galleries_id":451805,"server_id":15,"link":"photo_8553108.html","width":130,"caption":"","height":92});
															thumbnails[8553110] = clik.newPhoto({"id":8553110,"src":"Scotland_v_Italy_049_thumb.jpg","galleries_id":451805,"server_id":15,"link":"photo_8553110.html","width":130,"caption":"Scotland try ","height":98});
															thumbnails[8553112] = clik.newPhoto({"id":8553112,"src":"TunnocksAnnivuniv_014_thumb.JPG","galleries_id":451805,"server_id":15,"link":"photo_8553112.html","width":130,"caption":"First minister takes the Biscuit","height":98});
															thumbnails[8553197] = clik.newPhoto({"id":8553197,"src":"Jennifer_Pinches_1_thumb.jpg","galleries_id":451805,"server_id":15,"link":"photo_8553197.html","width":104,"caption":"Gymnastics","height":130});
															thumbnails[8553199] = clik.newPhoto({"id":8553199,"src":"P1010828_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553199.html","width":130,"caption":"Travel and resort Photography","height":98});
															thumbnails[8553202] = clik.newPhoto({"id":8553202,"src":"P1030115_photo-shotts_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553202.html","width":87,"caption":"Holiday brochure","height":130});
															thumbnails[8553206] = clik.newPhoto({"id":8553206,"src":"P2106707-2_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553206.html","width":130,"caption":"Food and Restaurant","height":98});
															thumbnails[8553208] = clik.newPhoto({"id":8553208,"src":"P3178095_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553208.html","width":130,"caption":"Product and advertising","height":98});
															thumbnails[8553210] = clik.newPhoto({"id":8553210,"src":"P5249769_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553210.html","width":98,"caption":"Visit Glasgow","height":130});
															thumbnails[8553212] = clik.newPhoto({"id":8553212,"src":"P6270184_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553212.html","width":130,"caption":"Medical and Product ","height":98});
															thumbnails[8553223] = clik.newPhoto({"id":8553223,"src":"P7230858_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553223.html","width":130,"caption":"Restaurant Advertising","height":98});
															thumbnails[8553226] = clik.newPhoto({"id":8553226,"src":"P7270965-1_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553226.html","width":130,"caption":"Album Covers","height":98});
															thumbnails[8553227] = clik.newPhoto({"id":8553227,"src":"P9023545_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553227.html","width":130,"caption":"Communication ","height":98});
															thumbnails[8553230] = clik.newPhoto({"id":8553230,"src":"PA234873_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553230.html","width":130,"caption":"Industrial Sites","height":98});
															thumbnails[8553233] = clik.newPhoto({"id":8553233,"src":"Paradise_sunset_photo-shotts_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553233.html","width":87,"caption":"Holiday Advertising","height":130});
															thumbnails[8553240] = clik.newPhoto({"id":8553240,"src":"Poundland_Rutherglen_001_thumb.jpg","galleries_id":451804,"server_id":15,"link":"photo_8553240.html","width":130,"caption":"Corporate Photography","height":121});
															thumbnails[8578428] = clik.newPhoto({"id":8578428,"src":"Front_Cover_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578428.html","width":130,"caption":"Name of Bride and Groom, date and venue can be added to this page.","height":111});
															thumbnails[8578432] = clik.newPhoto({"id":8578432,"src":"001_AB715A7F-1EC9-DFB6-09AFAD7CC66F6809_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578432.html","width":130,"caption":"","height":47});
															thumbnails[8578434] = clik.newPhoto({"id":8578434,"src":"003_AB759E11-1EC9-DFB6-092ADD81A86B54B2_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578434.html","width":130,"caption":"","height":47});
															thumbnails[8578439] = clik.newPhoto({"id":8578439,"src":"005_AB8ABDA9-1EC9-DFB6-0940025534F77453_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578439.html","width":130,"caption":"","height":47});
															thumbnails[8578440] = clik.newPhoto({"id":8578440,"src":"007_AB8FE75E-1EC9-DFB6-092D6394C3B09F6A_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578440.html","width":130,"caption":"","height":47});
															thumbnails[8578441] = clik.newPhoto({"id":8578441,"src":"009_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578441.html","width":130,"caption":"","height":47});
															thumbnails[8578443] = clik.newPhoto({"id":8578443,"src":"011_AB988983-1EC9-DFB6-099C2D83E4FD0A40_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578443.html","width":130,"caption":"","height":47});
															thumbnails[8578448] = clik.newPhoto({"id":8578448,"src":"013_ABB76A78-1EC9-DFB6-096C5D0475F1DB55_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578448.html","width":130,"caption":"","height":47});
															thumbnails[8578450] = clik.newPhoto({"id":8578450,"src":"015_ABBA5DD0-1EC9-DFB6-09DD74B9505D08FC_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578450.html","width":130,"caption":"","height":47});
															thumbnails[8578452] = clik.newPhoto({"id":8578452,"src":"017_ABBE6BEB-1EC9-DFB6-09E5612CB785EB4E_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578452.html","width":130,"caption":"","height":47});
															thumbnails[8578460] = clik.newPhoto({"id":8578460,"src":"019_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578460.html","width":130,"caption":"","height":47});
															thumbnails[8578462] = clik.newPhoto({"id":8578462,"src":"021_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578462.html","width":130,"caption":"","height":47});
															thumbnails[8578463] = clik.newPhoto({"id":8578463,"src":"023_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578463.html","width":130,"caption":"","height":47});
															thumbnails[8578468] = clik.newPhoto({"id":8578468,"src":"025_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578468.html","width":130,"caption":"","height":47});
															thumbnails[8578470] = clik.newPhoto({"id":8578470,"src":"027_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578470.html","width":130,"caption":"","height":47});
															thumbnails[8578471] = clik.newPhoto({"id":8578471,"src":"029_thumb.jpg","galleries_id":453508,"server_id":15,"link":"photo_8578471.html","width":130,"caption":"","height":47});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[451677] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Artistic ","link":"gallery_451677.html","maxRecords":0.0,"photoIDs":[8547877.0,8547879.0,8547880.0,8547881.0,8547882.0,8547883.0,8547884.0,8547885.0,8547886.0,8547887.0],"skipIndex":0,"section_code":"gallery","featured_images":8547887.0,"id":451677,"singleSection":false});				  						galleries[451804] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commercial Photography","link":"gallery_451804.html","maxRecords":0.0,"photoIDs":[8553199.0,8553202.0,8553206.0,8553208.0,8553210.0,8553212.0,8553223.0,8553226.0,8553227.0,8553230.0,8553233.0,8553240.0],"skipIndex":0,"section_code":"gallery","featured_images":"8553240,8553233,8553230,8553227,8553226,8553223,8553212,8553210,8553208,8553206","id":451804,"singleSection":false});				  						galleries[264495] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People and Portrait ","link":"gallery_264495.html","maxRecords":0.0,"photoIDs":[8548746.0,8548747.0,8548749.0,8548751.0,8548754.0,8548755.0],"skipIndex":0,"section_code":"gallery","featured_images":8548754.0,"id":264495,"singleSection":false});				  						galleries[451805] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Press and Sports Photography","link":"gallery_451805.html","maxRecords":0.0,"photoIDs":[8552872.0,8552875.0,8552879.0,8552887.0,8552892.0,8552895.0,8552908.0,8552940.0,8552943.0,8553106.0,8553108.0,8553110.0,8553112.0,8553197.0],"skipIndex":0,"section_code":"gallery","featured_images":8553110.0,"id":451805,"singleSection":false});				  						galleries[324947] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_324947.html","maxRecords":0.0,"photoIDs":[8547691.0,8547697.0,8547761.0,8547762.0,8547771.0,8547781.0,8547782.0,8547784.0,8547785.0,8547787.0,8547788.0,8547796.0,8547807.0,8547814.0,8547817.0,8547819.0,8547821.0,8547823.0,8547824.0,8547828.0,8547832.0],"skipIndex":0,"section_code":"gallery","featured_images":"8547832,8547828,8547824,8547823,8547821,8547819,8547817,8547814,8547807,8547796","id":324947,"singleSection":false});				  						galleries[453508] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding Album example.","link":"gallery_453508.html","maxRecords":0.0,"photoIDs":[8578428.0,8578432.0,8578434.0,8578439.0,8578440.0,8578441.0,8578443.0,8578448.0,8578450.0,8578452.0,8578460.0,8578462.0,8578463.0,8578468.0,8578470.0,8578471.0],"skipIndex":0,"section_code":"gallery","featured_images":"8578471,8578470,8578468,8578463,8578462,8578460,8578452,8578450,8578448,8578443","id":453508,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8553212,8553199,8553110,8552875,8548754,8547886,8547883,8547880,8547877,8547832,8547814,8547784,8547782,8547762,8547697,8547691';
imageSets[2] = '8553110,8548754,8547887';
imageSets[3] = '8643674,8643660,8643651,8640507,8640490,8578471,8578470,8578468,8578463,8578462,8578460,8578452,8578450,8578448,8578443,8578441,8578440,8578439,8578434,8578432,8578428,8553240,8553233,8553230,8553227,8553226,8553223,8553212,8553210,8553208,8553206,8553202,8553199,8553197,8553112,8553110,8553108,8553106,8552943,8552940,8552908,8552895,8552892,8552887,8552879,8552875,8552872,8548755,8548754,8548751';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/TommyCochrane/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/TommyCochrane/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 = 'Lanarkshire Professional Photography: ' + 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>Tommy Cochrane </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> &pound;' + (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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="tommycochrane@msn.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="tommycochrane@msn.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

