window.thumbnails = {};
															thumbnails[2504924] = clik.newPhoto({"id":2504924,"src":"RWP_64941_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Location","height":194});
															thumbnails[5095570] = clik.newPhoto({"id":5095570,"src":"GraphiProductShot3_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":133});
															thumbnails[2223849] = clik.newPhoto({"id":2223849,"src":"RWP_3903_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Creative","height":239});
															thumbnails[2230367] = clik.newPhoto({"id":2230367,"src":"RWP_4119_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"'Trash The Dress'","height":194});
															thumbnails[2238552] = clik.newPhoto({"id":2238552,"src":"RWP_4899_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Reportage","height":100});
															thumbnails[5169051] = clik.newPhoto({"id":5169051,"src":"RWP_8073_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":99,"caption":"RWP 8073","height":130});
															thumbnails[2238550] = clik.newPhoto({"id":2238550,"src":"DSC_4552_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Classic","height":86});
															thumbnails[2238554] = clik.newPhoto({"id":2238554,"src":"DSC_5147_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Location","height":86});
															thumbnails[2238553] = clik.newPhoto({"id":2238553,"src":"RWP_6087_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Ambience","height":87});
															thumbnails[2238551] = clik.newPhoto({"id":2238551,"src":"RWP_4986_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Relaxed, informal","height":195});
															thumbnails[2238555] = clik.newPhoto({"id":2238555,"src":"DSC_4452_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Reportage","height":195});
															thumbnails[2238903] = clik.newPhoto({"id":2238903,"src":"DSC_5131_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Bridesmaid","height":86});
															thumbnails[2238910] = clik.newPhoto({"id":2238910,"src":"RWP_44571_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Reportage","height":169});
															thumbnails[2238926] = clik.newPhoto({"id":2238926,"src":"DSC_5288_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Group","height":76});
															thumbnails[2238930] = clik.newPhoto({"id":2238930,"src":"RWP_6382_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Details","height":204});
															thumbnails[2238904] = clik.newPhoto({"id":2238904,"src":"RWP_3960_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Reportage","height":95});
															thumbnails[2235323] = clik.newPhoto({"id":2235323,"src":"RWP_0177_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2235323.html","width":130,"caption":"Reportage","height":102});
															thumbnails[2235340] = clik.newPhoto({"id":2235340,"src":"_RWP7482B&W_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2235340.html","width":130,"caption":"Portraits at Home","height":89});
															thumbnails[2236122] = clik.newPhoto({"id":2236122,"src":"Corporate Portraiture_3161_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2236122.html","width":130,"caption":"Corporate Portraiture","height":194});
															thumbnails[2238414] = clik.newPhoto({"id":2238414,"src":"Photomural_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2238414.html","width":130,"caption":"Exterior Photomural","height":118});
															thumbnails[2238415] = clik.newPhoto({"id":2238415,"src":"Canvas A 10x2_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2238415.html","width":130,"caption":"Interior Photomural","height":37});
															thumbnails[2238431] = clik.newPhoto({"id":2238431,"src":"Prom_0561_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238431.html","width":130,"caption":"College Ball","height":93});
															thumbnails[2238440] = clik.newPhoto({"id":2238440,"src":"Fancy Dress Ball_8706_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238440.html","width":130,"caption":"Fancy Dress Gala Party","height":195});
															thumbnails[2238477] = clik.newPhoto({"id":2238477,"src":"RWP_2134_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238477.html","width":130,"caption":"Party Time","height":86});
															thumbnails[2238478] = clik.newPhoto({"id":2238478,"src":"RWP_0437_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238478.html","width":130,"caption":"Sports Day","height":101});
															thumbnails[2238484] = clik.newPhoto({"id":2238484,"src":"Red Carpet_8540_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238484.html","width":130,"caption":"Red Carpet Occasions","height":195});
															thumbnails[2238490] = clik.newPhoto({"id":2238490,"src":"School Days_0222_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238490.html","width":130,"caption":"School Days","height":118});
															thumbnails[2238491] = clik.newPhoto({"id":2238491,"src":"RWP_0067_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2238491.html","width":130,"caption":"Corporate Events","height":88});
															thumbnails[2238492] = clik.newPhoto({"id":2238492,"src":"UGO 08_0057_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2238492.html","width":130,"caption":"Family Portraits","height":98});
															thumbnails[2238493] = clik.newPhoto({"id":2238493,"src":"Bringewood Winter Dawn_0934 18x12_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238493.html","width":130,"caption":"'The Bringewood - Winter Dawn 1'","height":87});
															thumbnails[2238494] = clik.newPhoto({"id":2238494,"src":"RWP_2352_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238494.html","width":130,"caption":"'Whitesands Sunset'","height":92});
															thumbnails[2238497] = clik.newPhoto({"id":2238497,"src":"Yellow Suburban Fields 8X8_0819_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238497.html","width":130,"caption":"'Yellow Suburban Fields'","height":130});
															thumbnails[2238502] = clik.newPhoto({"id":2238502,"src":"Incoming_4264_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238502.html","width":130,"caption":"'Incoming'","height":45});
															thumbnails[2238506] = clik.newPhoto({"id":2238506,"src":"Tower Power RWP_3288_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238506.html","width":130,"caption":"'Tower Power'","height":194});
															thumbnails[2238510] = clik.newPhoto({"id":2238510,"src":"Red Flower Wycliffe  12x8 4416_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238510.html","width":130,"caption":"'Red Bloom on Wood'","height":102});
															thumbnails[2238513] = clik.newPhoto({"id":2238513,"src":"Tenby Beach Scene_3967_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2238513.html","width":130,"caption":"'Tenby Beach'","height":62});
															thumbnails[2253793] = clik.newPhoto({"id":2253793,"src":"Studio Portraiture_3552_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2253793.html","width":130,"caption":"Fashion","height":206});
															thumbnails[2253794] = clik.newPhoto({"id":2253794,"src":"RWP_6686_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2253794.html","width":130,"caption":"Agriculture","height":87});
															thumbnails[2253795] = clik.newPhoto({"id":2253795,"src":"Press & PR_3057_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2253795.html","width":130,"caption":"Portraiture for Business","height":205});
															thumbnails[2257363] = clik.newPhoto({"id":2257363,"src":"Golden Bales 4547_thumb.jpg","galleries_id":145584,"server_id":5,"link":"photo_2257363.html","width":130,"caption":"'Golden Bales'","height":87});
															thumbnails[2579554] = clik.newPhoto({"id":2579554,"src":"Architecture_26851_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2579554.html","width":130,"caption":"Interiors","height":79});
															thumbnails[2579559] = clik.newPhoto({"id":2579559,"src":"Architecture Montage_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2579559.html","width":130,"caption":"Architectural details - photo montage","height":153});
															thumbnails[5153238] = clik.newPhoto({"id":5153238,"src":"_RWP3668112_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5153238.html","width":130,"caption":"","height":194});
															thumbnails[5168922] = clik.newPhoto({"id":5168922,"src":"RWP_51472_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5168922.html","width":130,"caption":"","height":87});
															thumbnails[5168949] = clik.newPhoto({"id":5168949,"src":"RWP_49345_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5168949.html","width":130,"caption":"","height":87});
															thumbnails[5169186] = clik.newPhoto({"id":5169186,"src":"RWP_7335_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169186.html","width":96,"caption":"","height":130});
															thumbnails[5169189] = clik.newPhoto({"id":5169189,"src":"RWP_9039_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169189.html","width":98,"caption":"","height":130});
															thumbnails[5169190] = clik.newPhoto({"id":5169190,"src":"RWP_91403_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169190.html","width":81,"caption":"","height":130});
															thumbnails[5169192] = clik.newPhoto({"id":5169192,"src":"RWP_7083_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169192.html","width":97,"caption":"","height":130});
															thumbnails[5169195] = clik.newPhoto({"id":5169195,"src":"RWP_4119_35782557-2219-B5B5-4CA5950C9035B8A7_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169195.html","width":87,"caption":"","height":130});
															thumbnails[5169197] = clik.newPhoto({"id":5169197,"src":"RWP_4296_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169197.html","width":100,"caption":"","height":130});
															thumbnails[5169199] = clik.newPhoto({"id":5169199,"src":"RWP_4538_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169199.html","width":94,"caption":"","height":130});
															thumbnails[5169200] = clik.newPhoto({"id":5169200,"src":"RWP_4557_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169200.html","width":67,"caption":"","height":130});
															thumbnails[5995914] = clik.newPhoto({"id":5995914,"src":"_RWP4453_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_5995914.html","width":87,"caption":"","height":130});
															thumbnails[5117510] = clik.newPhoto({"id":5117510,"src":"RWP_22005_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5117510.html","width":130,"caption":"","height":181});
															thumbnails[5184758] = clik.newPhoto({"id":5184758,"src":"RWP_9805_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5184758.html","width":90,"caption":"Wedding Portraiture","height":130});
															thumbnails[6657712] = clik.newPhoto({"id":6657712,"src":"RWP_7830_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_6657712.html","width":54,"caption":"Product Shoot","height":130});
															thumbnails[6657797] = clik.newPhoto({"id":6657797,"src":"_RWP3741_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_6657797.html","width":130,"caption":"The Day, The Moment, The Memory","height":50});
															thumbnails[7831014] = clik.newPhoto({"id":7831014,"src":"_RWP87794_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_7831014.html","width":104,"caption":"Maternity Shoot","height":130});
															thumbnails[5560713] = clik.newPhoto({"id":5560713,"src":"RWP_5653_Spot_Colour_21_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_5560713.html","width":130,"caption":"Advertising","height":78});
															thumbnails[6729487] = clik.newPhoto({"id":6729487,"src":"_RWP8511_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_6729487.html","width":101,"caption":"Sport","height":130});
															thumbnails[6657768] = clik.newPhoto({"id":6657768,"src":"RWP_7633_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_6657768.html","width":86,"caption":"Product Shoot","height":130});
															thumbnails[3215730] = clik.newPhoto({"id":3215730,"src":"RWP_8209_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_3215730.html","width":130,"caption":"Promotion and Advertising","height":166});
															thumbnails[3962081] = clik.newPhoto({"id":3962081,"src":"RWP_8072_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_3962081.html","width":130,"caption":"Prom Night","height":157});
															thumbnails[5169046] = clik.newPhoto({"id":5169046,"src":"Graphi_Product_Shot_Comp_65F83CA0-1D09-001F-990C5733A8E48CAF_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169046.html","width":127,"caption":"","height":130});
															thumbnails[2224462] = clik.newPhoto({"id":2224462,"src":"Portraiture at Home_ 98581_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2224462.html","width":130,"caption":"Portraits at Home","height":88});
															thumbnails[5169047] = clik.newPhoto({"id":5169047,"src":"RWP_1383_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_5169047.html","width":80,"caption":"Llandovery College Ball: Coral Lewis, lifeguard hero ","height":130});
															thumbnails[5169048] = clik.newPhoto({"id":5169048,"src":"RWP_1315_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169048.html","width":130,"caption":"","height":98});
															thumbnails[2224386] = clik.newPhoto({"id":2224386,"src":"_RWP7844_thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2224386.html","width":130,"caption":"Studio Portraits","height":182});
															thumbnails[5169050] = clik.newPhoto({"id":5169050,"src":"RWP_1498_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169050.html","width":130,"caption":"","height":81});
															thumbnails[2224340] = clik.newPhoto({"id":2224340,"src":"21st Birthday_0568_thumb.jpg","galleries_id":145984,"server_id":5,"link":"photo_2224340.html","width":130,"caption":"College Ball","height":207});
															thumbnails[5169053] = clik.newPhoto({"id":5169053,"src":"RWP_1659_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169053.html","width":130,"caption":"","height":89});
															thumbnails[2238409] = clik.newPhoto({"id":2238409,"src":"APC Cliff CMS_3401_thumb.jpg","galleries_id":145987,"server_id":5,"link":"photo_2238409.html","width":130,"caption":"Industrial","height":117});
															thumbnails[5169054] = clik.newPhoto({"id":5169054,"src":"RWP_1986_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169054.html","width":93,"caption":"","height":130});
															thumbnails[2238549] = clik.newPhoto({"id":2238549,"src":"RWP_5141_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_2238549.html","width":130,"caption":"The day, the moment, the memory","height":97});
															thumbnails[5169055] = clik.newPhoto({"id":5169055,"src":"RWP_2200_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169055.html","width":93,"caption":"","height":130});
															thumbnails[2236018] = clik.newPhoto({"id":2236018,"src":"Lucy Warhol Poster Ad _thumb.jpg","galleries_id":145983,"server_id":5,"link":"photo_2236018.html","width":130,"caption":"Pop Art Prints","height":160});
															thumbnails[5169056] = clik.newPhoto({"id":5169056,"src":"RWP_3167_3564CF3F-2219-B5B5-4CB98EC08C65B26C_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169056.html","width":83,"caption":"","height":130});
															thumbnails[5169057] = clik.newPhoto({"id":5169057,"src":"RWP_3664_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169057.html","width":130,"caption":"","height":86});
															thumbnails[5169058] = clik.newPhoto({"id":5169058,"src":"RWP_3925_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169058.html","width":130,"caption":"","height":74});
															thumbnails[5169059] = clik.newPhoto({"id":5169059,"src":"RWP_3947_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169059.html","width":130,"caption":"","height":73});
															thumbnails[5169060] = clik.newPhoto({"id":5169060,"src":"RWP_5018_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169060.html","width":130,"caption":"","height":87});
															thumbnails[5169061] = clik.newPhoto({"id":5169061,"src":"RWP_5141_3564DBC2-2219-B5B5-4C594C280282EA12_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169061.html","width":130,"caption":"","height":86});
															thumbnails[5169062] = clik.newPhoto({"id":5169062,"src":"RWP_5147_3564DC01-2219-B5B5-4CCFA0E19063A98C_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169062.html","width":130,"caption":"","height":87});
															thumbnails[5169063] = clik.newPhoto({"id":5169063,"src":"RWP_6502_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169063.html","width":74,"caption":"","height":130});
															thumbnails[5169064] = clik.newPhoto({"id":5169064,"src":"RWP_7024_thumb.jpg","galleries_id":291226,"server_id":5,"link":"photo_5169064.html","width":94,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[291226] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Wedding Photography","link":"gallery_291226.html","maxRecords":0.0,"photoIDs":[5153238.0,5168922.0,5168949.0,5169186.0,5169189.0,5169190.0,5169192.0,5169195.0,5169197.0,5169199.0,5169200.0,5117510.0,5184758.0,6657797.0,5169046.0,5169048.0,5169050.0,5169053.0,5169054.0,2238549.0,5169055.0,5169056.0,5169057.0,5169058.0,5169059.0,5169060.0,5169061.0,5169062.0,5169063.0,5169064.0],"skipIndex":0,"section_code":"gallery","featured_images":5169053.0,"id":291226,"singleSection":false});				  						galleries[145584] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Fine Art Prints","link":"gallery_145584.html","maxRecords":0.0,"photoIDs":[2238493.0,2238494.0,2238497.0,2238502.0,2238506.0,2238510.0,2238513.0,2257363.0],"skipIndex":0,"section_code":"gallery","featured_images":"2257363,2238513,2238510,2238506,2238502,2238497,2238494,2238493","id":145584,"singleSection":false});				  						galleries[145987] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Commercial","link":"gallery_145987.html","maxRecords":0.0,"photoIDs":[2238414.0,2238415.0,2253793.0,2253794.0,2253795.0,2579554.0,2579559.0,5995914.0,6657712.0,5560713.0,6657768.0,3215730.0,2238409.0],"skipIndex":0,"section_code":"gallery","featured_images":5560713.0,"id":145987,"singleSection":false});				  						galleries[145984] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Event Photography","link":"gallery_145984.html","maxRecords":0.0,"photoIDs":[2238431.0,2238440.0,2238477.0,2238478.0,2238484.0,2238490.0,2238491.0,6729487.0,3962081.0,5169047.0,2224340.0],"skipIndex":0,"section_code":"gallery","featured_images":"6729487,5169047,2224340","id":145984,"singleSection":false});				  						galleries[145983] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Portraiture","link":"gallery_145983.html","maxRecords":0.0,"photoIDs":[2235323.0,2235340.0,2236122.0,2238492.0,7831014.0,2224462.0,2224386.0,2236018.0],"skipIndex":0,"section_code":"gallery","featured_images":2224462.0,"id":145983,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7831014,5995914,5184758,5560713,6729487,2223849,2230367,2224462,2224386,2224340,2236018';
imageSets[2] = '5560713,6729487,2223849,5169047,2224462,5169053,2224340';
imageSets[3] = '6657797,5560713';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/richardweaverphoto/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/richardweaverphoto/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 = 'Richard Weaver 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</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="richardweaverphoto@gmail.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="richardweaverphoto@gmail.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;
	}
}

			

