window.thumbnails = {};
															thumbnails[7437989] = clik.newPhoto({"id":7437989,"src":"IMG_9641_49E2D70C-1EC9-D45B-1CCC295732A1F344_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":86});
															thumbnails[3415621] = clik.newPhoto({"id":3415621,"src":"Waterlilly Black and White small_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Waterlilly","height":130});
															thumbnails[3415936] = clik.newPhoto({"id":3415936,"src":"Cows_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Highland Cows","height":87});
															thumbnails[3859954] = clik.newPhoto({"id":3859954,"src":"Morningstroll24_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":55});
															thumbnails[5611669] = clik.newPhoto({"id":5611669,"src":"IMG_3181bw_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7390569] = clik.newPhoto({"id":7390569,"src":"IMG_2898-1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6120925] = clik.newPhoto({"id":6120925,"src":"IMG_9342_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7668175] = clik.newPhoto({"id":7668175,"src":"IMG_1419-Edit-2_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5611673] = clik.newPhoto({"id":5611673,"src":"IMG_3354toned2_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6932676] = clik.newPhoto({"id":6932676,"src":"IMG_1957-1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6120911] = clik.newPhoto({"id":6120911,"src":"IMG_9485_crop_ed_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":195});
															thumbnails[6120901] = clik.newPhoto({"id":6120901,"src":"IMG_9321_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4569431] = clik.newPhoto({"id":4569431,"src":"Seth_Lakeman_31_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4569431.html","width":130,"caption":"Seth Lakeman","height":94});
															thumbnails[4569126] = clik.newPhoto({"id":4569126,"src":"Cast-of-Capital-003_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4569126.html","width":130,"caption":"Cast of the Capital","height":195});
															thumbnails[4569457] = clik.newPhoto({"id":4569457,"src":"Kid-British1_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4569457.html","width":130,"caption":"Kid British","height":87});
															thumbnails[6120895] = clik.newPhoto({"id":6120895,"src":"IMG_3272_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_6120895.html","width":130,"caption":"","height":195});
															thumbnails[7390535] = clik.newPhoto({"id":7390535,"src":"IMG_0101-Edit-1_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_7390535.html","width":130,"caption":"","height":195});
															thumbnails[3596815] = clik.newPhoto({"id":3596815,"src":"CP007_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_3596815.html","width":130,"caption":"The Colour Proposal","height":195});
															thumbnails[6261355] = clik.newPhoto({"id":6261355,"src":"20100613-IMG_3592-Edit_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_6261355.html","width":130,"caption":"","height":195});
															thumbnails[6261379] = clik.newPhoto({"id":6261379,"src":"IMG_3524-Edit_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_6261379.html","width":130,"caption":"State Road 10","height":87});
															thumbnails[7668018] = clik.newPhoto({"id":7668018,"src":"IMG_2360-Edit-1_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_7668018.html","width":130,"caption":"","height":87});
															thumbnails[6261380] = clik.newPhoto({"id":6261380,"src":"IMG_3541-Edit-Edit-Edit_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_6261380.html","width":130,"caption":"State Road 10","height":87});
															thumbnails[4299780] = clik.newPhoto({"id":4299780,"src":"strange-013_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4299780.html","width":130,"caption":"Strangeling","height":195});
															thumbnails[7667931] = clik.newPhoto({"id":7667931,"src":"IMG_2640-1_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_7667931.html","width":130,"caption":"","height":87});
															thumbnails[7857753] = clik.newPhoto({"id":7857753,"src":"IMG_0331-Edit-8_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857753.html","width":130,"caption":"","height":87});
															thumbnails[3596817] = clik.newPhoto({"id":3596817,"src":"HMG016_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_3596817.html","width":130,"caption":"Hot Mangu","height":195});
															thumbnails[7390551] = clik.newPhoto({"id":7390551,"src":"IMG_0204-Edit-2-1_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_7390551.html","width":130,"caption":"","height":195});
															thumbnails[7667932] = clik.newPhoto({"id":7667932,"src":"IMG_3497-4_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_7667932.html","width":130,"caption":"","height":87});
															thumbnails[3859829] = clik.newPhoto({"id":3859829,"src":"DCweb1_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_3859829.html","width":130,"caption":"Debbie Cline BandOriginal line up","height":87});
															thumbnails[5909837] = clik.newPhoto({"id":5909837,"src":"IMG_7906_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_5909837.html","width":130,"caption":"","height":87});
															thumbnails[6261348] = clik.newPhoto({"id":6261348,"src":"IMG_0095-Edit_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_6261348.html","width":130,"caption":"","height":87});
															thumbnails[6358988] = clik.newPhoto({"id":6358988,"src":"IMG_5510-Edit_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_6358988.html","width":130,"caption":"","height":195});
															thumbnails[7668171] = clik.newPhoto({"id":7668171,"src":"IMG_0253-Edit-1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7668171.html","width":130,"caption":"","height":195});
															thumbnails[6261349] = clik.newPhoto({"id":6261349,"src":"IMG_3391_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_6261349.html","width":130,"caption":"","height":67});
															thumbnails[6932631] = clik.newPhoto({"id":6932631,"src":"IMG_1626-Edit-Edit-1_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_6932631.html","width":130,"caption":"","height":195});
															thumbnails[6261350] = clik.newPhoto({"id":6261350,"src":"IMG_9641_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_6261350.html","width":130,"caption":"","height":87});
															thumbnails[6261358] = clik.newPhoto({"id":6261358,"src":"IMG_8946_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_6261358.html","width":130,"caption":"","height":195});
															thumbnails[7857754] = clik.newPhoto({"id":7857754,"src":"IMG_0389-9_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857754.html","width":130,"caption":"","height":87});
															thumbnails[3596816] = clik.newPhoto({"id":3596816,"src":"San029_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_3596816.html","width":130,"caption":"Sanctury","height":87});
															thumbnails[3496758] = clik.newPhoto({"id":3496758,"src":"VSA2_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_3496758.html","width":130,"caption":"","height":130});
															thumbnails[3859836] = clik.newPhoto({"id":3859836,"src":"TCP0011_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_3859836.html","width":130,"caption":"The Colour Proposal","height":87});
															thumbnails[4107540] = clik.newPhoto({"id":4107540,"src":"Camaro-4-small_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_4107540.html","width":130,"caption":"","height":87});
															thumbnails[5611659] = clik.newPhoto({"id":5611659,"src":"IMG_3796_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5611659.html","width":130,"caption":"","height":195});
															thumbnails[5909842] = clik.newPhoto({"id":5909842,"src":"IMG_7979_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_5909842.html","width":130,"caption":"","height":87});
															thumbnails[7857759] = clik.newPhoto({"id":7857759,"src":"IMG_9277-Edit-5_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857759.html","width":130,"caption":"","height":195});
															thumbnails[4299788] = clik.newPhoto({"id":4299788,"src":"strange-015_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4299788.html","width":130,"caption":"Strangeling","height":87});
															thumbnails[4292835] = clik.newPhoto({"id":4292835,"src":"Range-rover_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_4292835.html","width":130,"caption":"","height":87});
															thumbnails[7390554] = clik.newPhoto({"id":7390554,"src":"IMG_9939-Edit-Edit-1_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_7390554.html","width":130,"caption":"","height":87});
															thumbnails[7857756] = clik.newPhoto({"id":7857756,"src":"IMG_2871-1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857756.html","width":130,"caption":"","height":87});
															thumbnails[4107535] = clik.newPhoto({"id":4107535,"src":"Camaro-1-small_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_4107535.html","width":130,"caption":"","height":87});
															thumbnails[6261357] = clik.newPhoto({"id":6261357,"src":"IMG_9010_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_6261357.html","width":130,"caption":"","height":87});
															thumbnails[7857752] = clik.newPhoto({"id":7857752,"src":"IMG_0277-Edit-Edit-3_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857752.html","width":130,"caption":"","height":195});
															thumbnails[3861217] = clik.newPhoto({"id":3861217,"src":"Holy-Sock-Scooby_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_3861217.html","width":130,"caption":"","height":87});
															thumbnails[7857763] = clik.newPhoto({"id":7857763,"src":"IMG_9879-Edit-Edit-7_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857763.html","width":130,"caption":"","height":87});
															thumbnails[5074825] = clik.newPhoto({"id":5074825,"src":"Kirsty_003web_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5074825.html","width":130,"caption":"","height":195});
															thumbnails[3861216] = clik.newPhoto({"id":3861216,"src":"EVO-David-Bogie_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_3861216.html","width":130,"caption":"","height":87});
															thumbnails[4299856] = clik.newPhoto({"id":4299856,"src":"BSK_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4299856.html","width":130,"caption":"Bash Street Kids","height":195});
															thumbnails[5905300] = clik.newPhoto({"id":5905300,"src":"IMG_5497_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5905300.html","width":130,"caption":"","height":195});
															thumbnails[5910908] = clik.newPhoto({"id":5910908,"src":"wave002_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_5910908.html","width":130,"caption":"","height":87});
															thumbnails[6120846] = clik.newPhoto({"id":6120846,"src":"IMG_3199_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_6120846.html","width":130,"caption":"","height":195});
															thumbnails[5905412] = clik.newPhoto({"id":5905412,"src":"IMG_7666_small_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_5905412.html","width":130,"caption":"","height":87});
															thumbnails[7857758] = clik.newPhoto({"id":7857758,"src":"IMG_6473-2_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857758.html","width":130,"caption":"","height":87});
															thumbnails[3496757] = clik.newPhoto({"id":3496757,"src":"VSA1_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_3496757.html","width":130,"caption":"","height":195});
															thumbnails[3860503] = clik.newPhoto({"id":3860503,"src":"TCP010_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_3860503.html","width":130,"caption":"The Colour Proposal","height":183});
															thumbnails[5910923] = clik.newPhoto({"id":5910923,"src":"IMG_4295_re_ed1_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_5910923.html","width":130,"caption":"","height":87});
															thumbnails[7857762] = clik.newPhoto({"id":7857762,"src":"IMG_9795-6_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857762.html","width":130,"caption":"","height":195});
															thumbnails[7857760] = clik.newPhoto({"id":7857760,"src":"IMG_9460-Edit-1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857760.html","width":130,"caption":"","height":87});
															thumbnails[3859840] = clik.newPhoto({"id":3859840,"src":"TCP0051_thumb.jpg","galleries_id":234770,"server_id":15,"link":"photo_3859840.html","width":130,"caption":"The Colour Proposal","height":87});
															thumbnails[4299839] = clik.newPhoto({"id":4299839,"src":"DC_thumb.jpg","galleries_id":234769,"server_id":15,"link":"photo_4299839.html","width":130,"caption":"Debbie Cline Band","height":198});
															thumbnails[5074859] = clik.newPhoto({"id":5074859,"src":"Victoria-Slains-4_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5074859.html","width":130,"caption":"","height":195});
															thumbnails[5905606] = clik.newPhoto({"id":5905606,"src":"IMG_7503_small_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_5905606.html","width":130,"caption":"","height":87});
															thumbnails[7857755] = clik.newPhoto({"id":7857755,"src":"IMG_1068-Edit-4_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857755.html","width":130,"caption":"","height":87});
															thumbnails[3860887] = clik.newPhoto({"id":3860887,"src":"Nat-Beach-walk-st-cyrus-jan_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_3860887.html","width":130,"caption":"","height":195});
															thumbnails[5074830] = clik.newPhoto({"id":5074830,"src":"Victoria_004s2_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5074830.html","width":130,"caption":"","height":130});
															thumbnails[4493935] = clik.newPhoto({"id":4493935,"src":"owen-11_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_4493935.html","width":130,"caption":"","height":87});
															thumbnails[6358983] = clik.newPhoto({"id":6358983,"src":"IMG_5227_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_6358983.html","width":130,"caption":"","height":87});
															thumbnails[5074863] = clik.newPhoto({"id":5074863,"src":"K1web_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5074863.html","width":130,"caption":"","height":87});
															thumbnails[5611664] = clik.newPhoto({"id":5611664,"src":"IMG_2100_thumb.jpg","galleries_id":259903,"server_id":15,"link":"photo_5611664.html","width":130,"caption":"","height":87});
															thumbnails[6120841] = clik.newPhoto({"id":6120841,"src":"IMG_0758_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_6120841.html","width":130,"caption":"","height":87});
															thumbnails[6358984] = clik.newPhoto({"id":6358984,"src":"IMG_5142-Edit_thumb.jpg","galleries_id":234860,"server_id":15,"link":"photo_6358984.html","width":130,"caption":"","height":73});
															thumbnails[6932432] = clik.newPhoto({"id":6932432,"src":"IMG_0430-Edit_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_6932432.html","width":130,"caption":"","height":98});
															thumbnails[4445786] = clik.newPhoto({"id":4445786,"src":"Frazer-010bw1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_4445786.html","width":130,"caption":"","height":87});
															thumbnails[5910926] = clik.newPhoto({"id":5910926,"src":"IMG_48771_thumb.jpg","galleries_id":234857,"server_id":15,"link":"photo_5910926.html","width":130,"caption":"","height":87});
															thumbnails[7390579] = clik.newPhoto({"id":7390579,"src":"IMG_3359-1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7390579.html","width":130,"caption":"","height":87});
															thumbnails[7857761] = clik.newPhoto({"id":7857761,"src":"IMG_9517-Edit-1_thumb.jpg","galleries_id":209435,"server_id":15,"link":"photo_7857761.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[259903] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Portraits","link":"gallery_259903.html","maxRecords":0.0,"photoIDs":[7390535.0,6261355.0,7390551.0,6358988.0,6932631.0,6261358.0,5611659.0,6261357.0,5074825.0,5905300.0,5074859.0,3860887.0,5074830.0,5074863.0,5611664.0],"skipIndex":0,"section_code":"gallery","featured_images":"7390535,6358988","id":259903,"singleSection":false});				  						galleries[209435] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Children","link":"gallery_209435.html","maxRecords":0.0,"photoIDs":[6120895.0,7857753.0,7668171.0,7857754.0,7857759.0,7857756.0,7857752.0,7857763.0,6120846.0,7857758.0,7857762.0,7857760.0,7857755.0,4493935.0,6120841.0,4445786.0,7390579.0,7857761.0],"skipIndex":0,"section_code":"gallery","featured_images":6120895.0,"id":209435,"singleSection":false});				  						galleries[234770] = clik.newGallery({"parentGallery":209436,"usePopups":true,"title":"Music Promo","link":"gallery_234770.html","maxRecords":0.0,"photoIDs":[6261379.0,6261380.0,3859829.0,3859836.0,3860503.0,3859840.0],"skipIndex":0,"section_code":"gallery","featured_images":3860503.0,"id":234770,"singleSection":false});				  						galleries[234769] = clik.newGallery({"parentGallery":209436,"usePopups":true,"title":"Live Music and Events","link":"gallery_234769.html","maxRecords":0.0,"photoIDs":[4569431.0,4569126.0,4569457.0,3596815.0,4299780.0,3596817.0,3596816.0,3496758.0,4299788.0,4299856.0,3496757.0,4299839.0],"skipIndex":0,"section_code":"gallery","featured_images":3596817.0,"id":234769,"singleSection":false});				  						galleries[209436] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Music and Events","link":"gallery_209436.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"3860503,3596817","id":209436,"singleSection":false});				  						galleries[234860] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Automotive","link":"gallery_234860.html","maxRecords":0.0,"photoIDs":[7668018.0,7667931.0,7667932.0,6261348.0,6261349.0,6261350.0,4107540.0,4292835.0,4107535.0,3861217.0,3861216.0,5905412.0,5905606.0,6358983.0,6358984.0],"skipIndex":0,"section_code":"gallery","featured_images":3861216.0,"id":234860,"singleSection":false});				  						galleries[234857] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landscapes","link":"gallery_234857.html","maxRecords":0.0,"photoIDs":[5909837.0,5909842.0,7390554.0,5910908.0,5910923.0,6932432.0,5910926.0],"skipIndex":0,"section_code":"gallery","featured_images":5909837.0,"id":234857,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6120895';
imageSets[2] = '7390535,6358988,6120895,5909837,3861216,3860503,3596817,3415621';
imageSets[3] = '5074825';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/alastairrobbphoto/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/alastairrobbphoto/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 = 'Alastair Robb 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>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> &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.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({					href: thumbnails[imageID].fnGalleryLink(gallery_id),					title: galleries[gallery_id].title				});
			}
		}
	}
}

/***************************************************************************
* 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;
	}
}

			

