window.thumbnails = {};
															thumbnails[3620984] = clik.newPhoto({"id":3620984,"src":"cardboardboxes_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3626149] = clik.newPhoto({"id":3626149,"src":"plasticcarpet1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3960370] = clik.newPhoto({"id":3960370,"src":"desk_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[4104137] = clik.newPhoto({"id":4104137,"src":"DSC_0811_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4104137.html","width":130,"caption":"","height":86});
															thumbnails[3620893] = clik.newPhoto({"id":3620893,"src":"atrium_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620893.html","width":130,"caption":"","height":87});
															thumbnails[3620933] = clik.newPhoto({"id":3620933,"src":"Untitled2_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620933.html","width":130,"caption":"","height":109});
															thumbnails[3626179] = clik.newPhoto({"id":3626179,"src":"whitetower_thumb.jpg","galleries_id":430425,"server_id":15,"link":"photo_3626179.html","width":130,"caption":"","height":87});
															thumbnails[3626190] = clik.newPhoto({"id":3626190,"src":"BW1_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626190.html","width":130,"caption":"","height":86});
															thumbnails[3626255] = clik.newPhoto({"id":3626255,"src":"surgeon_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626255.html","width":130,"caption":"","height":86});
															thumbnails[3626369] = clik.newPhoto({"id":3626369,"src":"image1_thumb.jpg","galleries_id":246150,"server_id":15,"link":"photo_3626369.html","width":130,"caption":"","height":89});
															thumbnails[4116439] = clik.newPhoto({"id":4116439,"src":"DSC_0835_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116439.html","width":130,"caption":"","height":86});
															thumbnails[3620901] = clik.newPhoto({"id":3620901,"src":"Beatson1_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620901.html","width":130,"caption":"","height":87});
															thumbnails[3626154] = clik.newPhoto({"id":3626154,"src":"bigbluewall1_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3626154.html","width":130,"caption":"","height":110});
															thumbnails[3626180] = clik.newPhoto({"id":3626180,"src":"mussels2_thumb.jpg","galleries_id":430425,"server_id":15,"link":"photo_3626180.html","width":130,"caption":"","height":87});
															thumbnails[3626197] = clik.newPhoto({"id":3626197,"src":"DSC_0062_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626197.html","width":130,"caption":"","height":86});
															thumbnails[3626260] = clik.newPhoto({"id":3626260,"src":"2surgeons_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626260.html","width":130,"caption":"","height":86});
															thumbnails[3626373] = clik.newPhoto({"id":3626373,"src":"image2_thumb.jpg","galleries_id":246150,"server_id":15,"link":"photo_3626373.html","width":130,"caption":"","height":95});
															thumbnails[4104135] = clik.newPhoto({"id":4104135,"src":"DSC_0796_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4104135.html","width":130,"caption":"","height":86});
															thumbnails[3620913] = clik.newPhoto({"id":3620913,"src":"linktunnel_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620913.html","width":130,"caption":"","height":87});
															thumbnails[3626147] = clik.newPhoto({"id":3626147,"src":"cloth_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3626147.html","width":130,"caption":"","height":92});
															thumbnails[3626181] = clik.newPhoto({"id":3626181,"src":"seaweed1_thumb.jpg","galleries_id":430425,"server_id":15,"link":"photo_3626181.html","width":130,"caption":"","height":87});
															thumbnails[3626209] = clik.newPhoto({"id":3626209,"src":"DSC_0151_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626209.html","width":130,"caption":"","height":86});
															thumbnails[3626375] = clik.newPhoto({"id":3626375,"src":"image4_thumb.jpg","galleries_id":246150,"server_id":15,"link":"photo_3626375.html","width":130,"caption":"","height":88});
															thumbnails[3620917] = clik.newPhoto({"id":3620917,"src":"studio_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620917.html","width":130,"caption":"","height":87});
															thumbnails[3626182] = clik.newPhoto({"id":3626182,"src":"dogsbumfinal_thumb.jpg","galleries_id":430425,"server_id":15,"link":"photo_3626182.html","width":130,"caption":"","height":87});
															thumbnails[3626212] = clik.newPhoto({"id":3626212,"src":"blood_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626212.html","width":130,"caption":"","height":86});
															thumbnails[3874603] = clik.newPhoto({"id":3874603,"src":"03_thumb.jpg","galleries_id":246151,"server_id":15,"link":"photo_3874603.html","width":130,"caption":"","height":87});
															thumbnails[4104139] = clik.newPhoto({"id":4104139,"src":"DSC_0829_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4104139.html","width":130,"caption":"","height":86});
															thumbnails[3626183] = clik.newPhoto({"id":3626183,"src":"mole_thumb.jpg","galleries_id":430425,"server_id":15,"link":"photo_3626183.html","width":130,"caption":"","height":87});
															thumbnails[3735762] = clik.newPhoto({"id":3735762,"src":"DSC_0275new_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3735762.html","width":130,"caption":"","height":86});
															thumbnails[3874617] = clik.newPhoto({"id":3874617,"src":"15_thumb.jpg","galleries_id":246151,"server_id":15,"link":"photo_3874617.html","width":130,"caption":"","height":87});
															thumbnails[4116434] = clik.newPhoto({"id":4116434,"src":"DSC_0797_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116434.html","width":130,"caption":"","height":86});
															thumbnails[4116443] = clik.newPhoto({"id":4116443,"src":"DSC_08411_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116443.html","width":130,"caption":"","height":86});
															thumbnails[8341270] = clik.newPhoto({"id":8341270,"src":"DSC_4211web2_thumb.jpg","galleries_id":221491,"server_id":35,"link":"photo_8341270.html","width":160,"caption":"","height":114});
															thumbnails[3620927] = clik.newPhoto({"id":3620927,"src":"chip_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620927.html","width":130,"caption":"","height":87});
															thumbnails[3626157] = clik.newPhoto({"id":3626157,"src":"skylight_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3626157.html","width":130,"caption":"","height":87});
															thumbnails[3626225] = clik.newPhoto({"id":3626225,"src":"excercise_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626225.html","width":130,"caption":"","height":86});
															thumbnails[3626276] = clik.newPhoto({"id":3626276,"src":"NuclearMedNurse_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626276.html","width":130,"caption":"","height":86});
															thumbnails[3874616] = clik.newPhoto({"id":3874616,"src":"12_thumb.jpg","galleries_id":246151,"server_id":15,"link":"photo_3874616.html","width":130,"caption":"","height":87});
															thumbnails[4116444] = clik.newPhoto({"id":4116444,"src":"DSC_0846_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116444.html","width":130,"caption":"","height":86});
															thumbnails[4116446] = clik.newPhoto({"id":4116446,"src":"DSC_0877_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116446.html","width":130,"caption":"","height":86});
															thumbnails[3620920] = clik.newPhoto({"id":3620920,"src":"pink_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3620920.html","width":130,"caption":"","height":94});
															thumbnails[3626231] = clik.newPhoto({"id":3626231,"src":"DSC_0772_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626231.html","width":130,"caption":"","height":86});
															thumbnails[3626281] = clik.newPhoto({"id":3626281,"src":"auxillary_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626281.html","width":130,"caption":"","height":86});
															thumbnails[3874668] = clik.newPhoto({"id":3874668,"src":"03-1_thumb.jpg","galleries_id":246151,"server_id":15,"link":"photo_3874668.html","width":130,"caption":"","height":87});
															thumbnails[4116448] = clik.newPhoto({"id":4116448,"src":"DSC_0940_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116448.html","width":130,"caption":"","height":86});
															thumbnails[3626302] = clik.newPhoto({"id":3626302,"src":"legs_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626302.html","width":130,"caption":"","height":86});
															thumbnails[4116459] = clik.newPhoto({"id":4116459,"src":"DSC_0967_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116459.html","width":130,"caption":"","height":86});
															thumbnails[3626236] = clik.newPhoto({"id":3626236,"src":"orange_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626236.html","width":130,"caption":"","height":86});
															thumbnails[3626312] = clik.newPhoto({"id":3626312,"src":"nurse_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626312.html","width":130,"caption":"","height":87});
															thumbnails[3781756] = clik.newPhoto({"id":3781756,"src":"DSC_0097crop_thumb.jpg","galleries_id":221491,"server_id":15,"link":"photo_3781756.html","width":130,"caption":"","height":107});
															thumbnails[3960368] = clik.newPhoto({"id":3960368,"src":"purplereception1_thumb.jpg","galleries_id":430142,"server_id":15,"link":"photo_3960368.html","width":130,"caption":"","height":86});
															thumbnails[4116526] = clik.newPhoto({"id":4116526,"src":"DSC_0978_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4116526.html","width":130,"caption":"","height":86});
															thumbnails[3626318] = clik.newPhoto({"id":3626318,"src":"scannedbuilder1_thumb.jpg","galleries_id":221491,"server_id":15,"link":"photo_3626318.html","width":130,"caption":"","height":129});
															thumbnails[3626604] = clik.newPhoto({"id":3626604,"src":"labcoats_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626604.html","width":130,"caption":"","height":86});
															thumbnails[4104068] = clik.newPhoto({"id":4104068,"src":"DSC_0781_thumb.jpg","galleries_id":246153,"server_id":15,"link":"photo_4104068.html","width":130,"caption":"","height":86});
															thumbnails[4104157] = clik.newPhoto({"id":4104157,"src":"DSC_0072NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4104157.html","width":130,"caption":"","height":86});
															thumbnails[3626243] = clik.newPhoto({"id":3626243,"src":"scrubs_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626243.html","width":130,"caption":"","height":85});
															thumbnails[3626323] = clik.newPhoto({"id":3626323,"src":"teatime-oldcouple_thumb.jpg","galleries_id":221491,"server_id":15,"link":"photo_3626323.html","width":130,"caption":"","height":87});
															thumbnails[4104161] = clik.newPhoto({"id":4104161,"src":"DSC_0073NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4104161.html","width":130,"caption":"","height":86});
															thumbnails[3626240] = clik.newPhoto({"id":3626240,"src":"petri_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626240.html","width":130,"caption":"","height":88});
															thumbnails[3626344] = clik.newPhoto({"id":3626344,"src":"exhibitC_thumb.jpg","galleries_id":221491,"server_id":15,"link":"photo_3626344.html","width":130,"caption":"","height":87});
															thumbnails[4104177] = clik.newPhoto({"id":4104177,"src":"DSC_0119NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4104177.html","width":130,"caption":"","height":86});
															thumbnails[3626578] = clik.newPhoto({"id":3626578,"src":"DSC_0215recropped_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3626578.html","width":130,"caption":"","height":101});
															thumbnails[3800130] = clik.newPhoto({"id":3800130,"src":"DSC_0548new_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3800130.html","width":130,"caption":"","height":86});
															thumbnails[3800134] = clik.newPhoto({"id":3800134,"src":"clock-in_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3800134.html","width":130,"caption":"","height":86});
															thumbnails[3960358] = clik.newPhoto({"id":3960358,"src":"DSC_0536NEW2_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_3960358.html","width":130,"caption":"","height":86});
															thumbnails[4097239] = clik.newPhoto({"id":4097239,"src":"DSC_0101NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4097239.html","width":130,"caption":"","height":86});
															thumbnails[4097243] = clik.newPhoto({"id":4097243,"src":"DSC_0027-2new_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4097243.html","width":130,"caption":"","height":87});
															thumbnails[4105281] = clik.newPhoto({"id":4105281,"src":"DSC_0034NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4105281.html","width":130,"caption":"","height":86});
															thumbnails[4105286] = clik.newPhoto({"id":4105286,"src":"DSC_0337NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4105286.html","width":130,"caption":"","height":86});
															thumbnails[4105319] = clik.newPhoto({"id":4105319,"src":"DSC_0700NEW_thumb.jpg","galleries_id":430146,"server_id":15,"link":"photo_4105319.html","width":130,"caption":"","height":86});
															thumbnails[7912560] = clik.newPhoto({"id":7912560,"src":"businesscardfront1_thumb.gif","galleries_id":430146,"server_id":15,"link":"photo_7912560.html","width":160,"caption":"","height":92});
															thumbnails[4116800] = clik.newPhoto({"id":4116800,"src":"book2_thumb.jpg","galleries_id":246688,"server_id":15,"link":"photo_4116800.html","width":130,"caption":"A book work of photographs taken from a solo exhibition at the Glasgow Royal Infirmary.","height":109});
															thumbnails[4116766] = clik.newPhoto({"id":4116766,"src":"bookopen_thumb.jpg","galleries_id":246688,"server_id":15,"link":"photo_4116766.html","width":130,"caption":"","height":86});
															thumbnails[6503400] = clik.newPhoto({"id":6503400,"src":"scotsman-review-11_thumb.jpg","galleries_id":357941,"server_id":15,"link":"photo_6503400.html","width":130,"caption":"","height":313});
															thumbnails[6503424] = clik.newPhoto({"id":6503424,"src":"poster3sized_thumb.jpg","galleries_id":246688,"server_id":15,"link":"photo_6503424.html","width":130,"caption":"","height":184});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[246688] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"On Call","link":"section299231_246688.html","maxRecords":0.0,"photoIDs":[4116800.0,4116766.0,6503424.0],"skipIndex":0,"section_code":"section299231","featured_images":"6503424,4116800,4116766","id":246688,"singleSection":false});				  						galleries[430142] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture","link":"gallery_430142.html","maxRecords":0.0,"photoIDs":[3620893.0,3620933.0,3620901.0,3626154.0,3620913.0,3626147.0,3620917.0,3620927.0,3626157.0,3620920.0,3960368.0],"skipIndex":0,"section_code":"gallery","featured_images":"3626147,3620917","id":430142,"singleSection":false});				  						galleries[246150] = clik.newGallery({"parentGallery":221753,"usePopups":false,"title":"The Glasgow School of Art Degree Show 2008","link":"gallery_246150.html","maxRecords":0.0,"photoIDs":[3626369.0,3626373.0,3626375.0],"skipIndex":0,"section_code":"gallery","featured_images":"3626375,3626373,3626369","id":246150,"singleSection":false});				  						galleries[357941] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Articles","link":"section299231_357941.html","maxRecords":0.0,"photoIDs":[6503400.0],"skipIndex":0,"section_code":"section299231","featured_images":6503400.0,"id":357941,"singleSection":false});				  						galleries[430146] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commissions","link":"gallery_430146.html","maxRecords":0.0,"photoIDs":[3626190.0,3626255.0,3626197.0,3626260.0,3626209.0,3626212.0,3735762.0,3626225.0,3626276.0,3626231.0,3626281.0,3626302.0,3626236.0,3626312.0,3626604.0,4104157.0,3626243.0,4104161.0,3626240.0,4104177.0,3626578.0,3800130.0,3800134.0,3960358.0,4097239.0,4097243.0,4105281.0,4105286.0,4105319.0,7912560.0],"skipIndex":0,"section_code":"gallery","featured_images":"3735762,3626312,3626236","id":430146,"singleSection":false});				  						galleries[246151] = clik.newGallery({"parentGallery":221753,"usePopups":false,"title":"Futureproof","link":"gallery_246151.html","maxRecords":0.0,"photoIDs":[3874603.0,3874617.0,3874616.0,3874668.0],"skipIndex":0,"section_code":"gallery","featured_images":"3874668,3874617,3874616,3874603","id":246151,"singleSection":false});				  						galleries[221491] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_221491.html","maxRecords":0.0,"photoIDs":[8341270.0,3781756.0,3626318.0,3626323.0,3626344.0],"skipIndex":0,"section_code":"gallery","featured_images":3781756.0,"id":221491,"singleSection":false});				  						galleries[246153] = clik.newGallery({"parentGallery":221753,"usePopups":false,"title":"The Glasgow Royal Infirmary Link Corridor Exhibit","link":"gallery_246153.html","maxRecords":0.0,"photoIDs":[4104137.0,4116439.0,4104135.0,4104139.0,4116434.0,4116443.0,4116444.0,4116446.0,4116448.0,4116459.0,4116526.0,4104068.0],"skipIndex":0,"section_code":"gallery","featured_images":"4116526,4116459,4116448,4116446,4116444,4116443,4116439,4116434,4104139,4104137","id":246153,"singleSection":false});				  						galleries[221753] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Exhibition Images","link":"gallery_221753.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"4116526,4116459,4116448,4116446,4116444,4116443,4116439,4116434,4104139,4104137","id":221753,"singleSection":false});				  						galleries[430425] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Extra Photography","link":"gallery_430425.html","maxRecords":0.0,"photoIDs":[3626179.0,3626180.0,3626181.0,3626182.0,3626183.0],"skipIndex":0,"section_code":"gallery","featured_images":"3626183,3626182,3626181,3626180,3626179","id":430425,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3626225';
imageSets[2] = '3781756,3735762,3626312,3626236,3626147,3620917';
imageSets[3] = '8341270,7912560,6503424,6503400,4116800,4116766,4116526,4116459,4116448,4116446,4116444,4116443,4116439,4116434,4105319,4105286,4105281,4104177,4104161,4104157,4104139,4104137,4104135,4104068,4097243,4097239,3960370,3960368,3960358,3874668,3874617,3874616,3874603,3800134,3800130,3781756,3735762,3626604,3626578,3626375,3626373,3626369,3626344,3626323,3626318,3626312,3626302,3626281,3626276,3626260';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/VictoriaBaker/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/VictoriaBaker/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 = 'Victoria Baker 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>Title </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>Medium </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({					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;
	}
}

			

