window.thumbnails = {};
															thumbnails[4771095] = clik.newPhoto({"id":4771095,"src":"title-page-cp_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"...coming to a bookshop near you in 2010...","height":130});
															thumbnails[8965167] = clik.newPhoto({"id":8965167,"src":"cp-egg_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2388313] = clik.newPhoto({"id":2388313,"src":"64 Artists Painting Themselves_clikpic_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_2388313.html","width":130,"caption":"Sixty Four Artists Painting Self Portraits ","height":130});
															thumbnails[1879599] = clik.newPhoto({"id":1879599,"src":"Redhead-for-clikpik_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1879599.html","width":112,"caption":"Redhead ","height":130});
															thumbnails[1879315] = clik.newPhoto({"id":1879315,"src":"Chuck-Close-for-clikpik_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1879315.html","width":129,"caption":"To Chuck Close ","height":130});
															thumbnails[1879321] = clik.newPhoto({"id":1879321,"src":"cp_HF_313_Hommage-to-Hockney41_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1879321.html","width":130,"caption":"Hommage to Hockney ","height":130});
															thumbnails[2482280] = clik.newPhoto({"id":2482280,"src":"Jasper clikpic_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_2482280.html","width":96,"caption":"Jasper 1999","height":130});
															thumbnails[4499875] = clik.newPhoto({"id":4499875,"src":"clikpic-cat-poster_thumb.jpg","galleries_id":262137,"server_id":1,"link":"photo_4499875.html","width":130,"caption":"Cats (poster)","height":130});
															thumbnails[4771135] = clik.newPhoto({"id":4771135,"src":"Velasquez-Talks-to-Las-Meninas-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771135.html","width":130,"caption":"Velasquez Talks To Las Meninas","height":130});
															thumbnails[5854048] = clik.newPhoto({"id":5854048,"src":"Old-Masters_medium_thumb.jpg","galleries_id":331082,"server_id":1,"link":"photo_5854048.html","width":110,"caption":"Old Masters Tea Towel","height":130});
															thumbnails[2388312] = clik.newPhoto({"id":2388312,"src":"A-Crowd-Of-Artists-clikpic_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_2388312.html","width":103,"caption":"A Crowd Of Artists ","height":130});
															thumbnails[1387975] = clik.newPhoto({"id":1387975,"src":"CP Nine-Lives_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1387975.html","width":128,"caption":"Nine Lives ","height":130});
															thumbnails[1387941] = clik.newPhoto({"id":1387941,"src":"CP 12 Old-Masters_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1387941.html","width":130,"caption":"Twelve Old Masters ","height":129});
															thumbnails[1387917] = clik.newPhoto({"id":1387917,"src":"CP Se-Ipsum-10_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1387917.html","width":116,"caption":"Se Ipsum No.10 ","height":130});
															thumbnails[1387940] = clik.newPhoto({"id":1387940,"src":"CP 90-Old-Masters(Backs)-11_thumb.06.jpg","galleries_id":153535,"server_id":1,"link":"photo_1387940.html","width":114,"caption":"Ninety Old Masters (Backviews) ","height":130});
															thumbnails[1625950] = clik.newPhoto({"id":1625950,"src":"Turn-Around-2_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1625950.html","width":124,"caption":"Forty Nine Hats ","height":130});
															thumbnails[1388142] = clik.newPhoto({"id":1388142,"src":"Goat+Tricycle_thumb.jpg","galleries_id":153535,"server_id":1,"link":"photo_1388142.html","width":130,"caption":"The Goat and Tricycle ","height":107});
															thumbnails[1612575] = clik.newPhoto({"id":1612575,"src":"A-Day-In-The-Life-Of-Picasso-No_thumb.2.jpg","galleries_id":153525,"server_id":1,"link":"photo_1612575.html","width":130,"caption":"A Day In The Life Of Picasso ","height":128});
															thumbnails[1879577] = clik.newPhoto({"id":1879577,"src":"Tony-Rickaby-for-clikpik_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_1879577.html","width":123,"caption":"Tony 2008 ","height":130});
															thumbnails[4499879] = clik.newPhoto({"id":4499879,"src":"clikpic-dog-poster_thumb.jpg","galleries_id":262137,"server_id":1,"link":"photo_4499879.html","width":130,"caption":"Dogs (poster)","height":130});
															thumbnails[4500010] = clik.newPhoto({"id":4500010,"src":"clik-grizzly_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500010.html","width":130,"caption":"'Grizzly Bear'","height":129});
															thumbnails[1388154] = clik.newPhoto({"id":1388154,"src":"Wall-Study-No_thumb.3.jpg","galleries_id":153535,"server_id":1,"link":"photo_1388154.html","width":130,"caption":"Picasso and the Donut Queen No.2","height":116});
															thumbnails[1879439] = clik.newPhoto({"id":1879439,"src":"Randell's-clikpic_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_1879439.html","width":129,"caption":"the Randells 2008","height":130});
															thumbnails[2991750] = clik.newPhoto({"id":2991750,"src":"catalogue-cover-small_thumb.jpg","galleries_id":301224,"server_id":1,"link":"photo_2991750.html","width":130,"caption":"catalogue 2008","height":130});
															thumbnails[4499893] = clik.newPhoto({"id":4499893,"src":"clikpic-cat-canvas_thumb.jpg","galleries_id":262137,"server_id":1,"link":"photo_4499893.html","width":130,"caption":"Cats (print on canvas)","height":129});
															thumbnails[4500024] = clik.newPhoto({"id":4500024,"src":"clik-pig_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500024.html","width":130,"caption":"'Hello Pig'","height":130});
															thumbnails[2275395] = clik.newPhoto({"id":2275395,"src":"Holly-Frean-'examples-of-Employee-of-the-Month-portraits'-oil-on-board-each-approx_thumb.-10-x-10-cm-SMALL.jpg","galleries_id":96497,"server_id":1,"link":"photo_2275395.html","width":130,"caption":"Employees of the Month ","height":124});
															thumbnails[4499895] = clik.newPhoto({"id":4499895,"src":"clikpic-dog-canvas_thumb.jpg","galleries_id":262137,"server_id":1,"link":"photo_4499895.html","width":130,"caption":"Dogs (print on canvas)","height":130});
															thumbnails[4500031] = clik.newPhoto({"id":4500031,"src":"clik-polar_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500031.html","width":130,"caption":"'Hello Polar Bear'","height":129});
															thumbnails[8742691] = clik.newPhoto({"id":8742691,"src":"book_thumb.jpg","galleries_id":301224,"server_id":1,"link":"photo_8742691.html","width":130,"caption":"book 2009","height":98});
															thumbnails[4499943] = clik.newPhoto({"id":4499943,"src":"clik-dog_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4499943.html","width":130,"caption":"'Hello Dog'","height":130});
															thumbnails[4500037] = clik.newPhoto({"id":4500037,"src":"clik-rhino_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500037.html","width":130,"caption":"'Hello Rhino'","height":129});
															thumbnails[4500040] = clik.newPhoto({"id":4500040,"src":"clik-mouse_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500040.html","width":130,"caption":"'Hello Mouse'","height":129});
															thumbnails[4500046] = clik.newPhoto({"id":4500046,"src":"clik-panda_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500046.html","width":130,"caption":"'Hello Panda'","height":129});
															thumbnails[4500049] = clik.newPhoto({"id":4500049,"src":"clik-sheep_thumb.jpg","galleries_id":262138,"server_id":1,"link":"photo_4500049.html","width":130,"caption":"'Hello Sheep'","height":129});
															thumbnails[1388130] = clik.newPhoto({"id":1388130,"src":"Old-Masters-Screenprint_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_1388130.html","width":104,"caption":"Old Master Grid No.1","height":130});
															thumbnails[3436167] = clik.newPhoto({"id":3436167,"src":"Roger-Watson-small_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_3436167.html","width":130,"caption":"Roger 2006","height":130});
															thumbnails[1388131] = clik.newPhoto({"id":1388131,"src":"CP OM re+bl_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_1388131.html","width":104,"caption":"Old Master Grid No.2","height":130});
															thumbnails[3436169] = clik.newPhoto({"id":3436169,"src":"Monty-Praying-small_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_3436169.html","width":130,"caption":"Monty 1999","height":130});
															thumbnails[3436219] = clik.newPhoto({"id":3436219,"src":"detail_thumb.red-head-small.jpg","galleries_id":96496,"server_id":1,"link":"photo_3436219.html","width":130,"caption":"Old Master Grid No.2 (detail)","height":130});
															thumbnails[1388132] = clik.newPhoto({"id":1388132,"src":"CP OM wh+pi_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_1388132.html","width":104,"caption":"Old Master Grid No.3 ","height":130});
															thumbnails[2639115] = clik.newPhoto({"id":2639115,"src":"Sean-Scully-small_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_2639115.html","width":130,"caption":"Sean Scully Painting 'Wall of Light, Light'","height":81});
															thumbnails[3436172] = clik.newPhoto({"id":3436172,"src":"Chubb-small_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_3436172.html","width":130,"caption":"Chubb 2005","height":130});
															thumbnails[4464108] = clik.newPhoto({"id":4464108,"src":"louis_portrait_clikpic_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4464108.html","width":109,"caption":"Louis 2005","height":130});
															thumbnails[1388109] = clik.newPhoto({"id":1388109,"src":"CP 72-Faces_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_1388109.html","width":119,"caption":"Seventy Two Faces ","height":130});
															thumbnails[2388314] = clik.newPhoto({"id":2388314,"src":"An-Afternon-With-Rothko-small_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_2388314.html","width":130,"caption":"A Day In The Life Of Rothko ","height":130});
															thumbnails[4464102] = clik.newPhoto({"id":4464102,"src":"Valerie_Otte_clikpic_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4464102.html","width":104,"caption":"Valerie 2004","height":130});
															thumbnails[3436187] = clik.newPhoto({"id":3436187,"src":"72-Faces-detail2-clikpic_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_3436187.html","width":98,"caption":"Seventy Two Faces (detail)","height":130});
															thumbnails[3837199] = clik.newPhoto({"id":3837199,"src":"Holly-Frean-A-Conversation-WIth-Matisse-oil-on-canvas-155-x-125cm-2008-AVAILABLEclikpicjpg_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_3837199.html","width":130,"caption":"A Conversation With Matisse","height":104});
															thumbnails[4464111] = clik.newPhoto({"id":4464111,"src":"clikpic-GusParker_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4464111.html","width":130,"caption":"Gus 2006","height":93});
															thumbnails[4359716] = clik.newPhoto({"id":4359716,"src":"cl-25-Rembrandts-HF-254_thumb.jpg","galleries_id":96496,"server_id":1,"link":"photo_4359716.html","width":130,"caption":"25 Rembrandts","height":130});
															thumbnails[4464113] = clik.newPhoto({"id":4464113,"src":"clikpicMichael-Handrick_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4464113.html","width":130,"caption":"Michael 2009","height":99});
															thumbnails[4464115] = clik.newPhoto({"id":4464115,"src":"clikpic-PaulV01_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4464115.html","width":98,"caption":"Paul 2002","height":130});
															thumbnails[2639111] = clik.newPhoto({"id":2639111,"src":"Hockney-In-Front-Of-His-Studio-Wall-2-small_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_2639111.html","width":130,"caption":"Hockney In His Studio ","height":130});
															thumbnails[4763296] = clik.newPhoto({"id":4763296,"src":"Betty-Jackson-cp_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4763296.html","width":110,"caption":"Betty 2008","height":130});
															thumbnails[2639113] = clik.newPhoto({"id":2639113,"src":"Lucien-Freud-Paints-The-Queen-small_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_2639113.html","width":130,"caption":"Lucien Freud Paints The Queen ","height":130});
															thumbnails[4763304] = clik.newPhoto({"id":4763304,"src":"Jens-cp_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4763304.html","width":95,"caption":"Jens 2007","height":130});
															thumbnails[3982377] = clik.newPhoto({"id":3982377,"src":"A-Day-in-the-Life-of-Picasso-small_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_3982377.html","width":130,"caption":"A Day In The Life Of Picasso No.2","height":130});
															thumbnails[4763336] = clik.newPhoto({"id":4763336,"src":"Juergen-cp_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4763336.html","width":130,"caption":"Juergen 2009","height":93});
															thumbnails[4771128] = clik.newPhoto({"id":4771128,"src":"A-Day-In-The-Life-Of-Leonardo-da-Vinci-No2-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771128.html","width":130,"caption":"A Day In The Life Of Leonardo da Vinci","height":130});
															thumbnails[4771133] = clik.newPhoto({"id":4771133,"src":"A-Day-In-The-Life-Of-Vuillard-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771133.html","width":130,"caption":"A Day In The Life Of Edouard Vuillard","height":130});
															thumbnails[4771134] = clik.newPhoto({"id":4771134,"src":"A-Day-In-The-Life-Of-Alfred-Wallis-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771134.html","width":130,"caption":"A Day In The Life Of Alfred Wallis","height":130});
															thumbnails[4359700] = clik.newPhoto({"id":4359700,"src":"cl-Leonardo-Paints-The-Mona-Lisa-copy_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4359700.html","width":130,"caption":"Leonardo Paints Mona Lisa","height":88});
															thumbnails[4359704] = clik.newPhoto({"id":4359704,"src":"cl-Picasso-Drawing-copy_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4359704.html","width":130,"caption":"Picasso Drawing","height":89});
															thumbnails[4763389] = clik.newPhoto({"id":4763389,"src":"Kate-cp_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4763389.html","width":105,"caption":"kate 2005","height":130});
															thumbnails[4359705] = clik.newPhoto({"id":4359705,"src":"cl-Pollock-Starts-A-New-Painting-copy_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4359705.html","width":130,"caption":"Pollock Begins a New Painting","height":95});
															thumbnails[4763398] = clik.newPhoto({"id":4763398,"src":"lindaw_clikpic_thumb.jpg","galleries_id":96497,"server_id":1,"link":"photo_4763398.html","width":102,"caption":"linda 2006","height":130});
															thumbnails[4771139] = clik.newPhoto({"id":4771139,"src":"Rembrandt-Hockney-fronts-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771139.html","width":130,"caption":"Rembrandt to Hockney (set of Russian dolls)","height":98});
															thumbnails[4771141] = clik.newPhoto({"id":4771141,"src":"Rembrandt-Hockney-cp_thumb.jpg","galleries_id":153525,"server_id":1,"link":"photo_4771141.html","width":130,"caption":"Rembrandt to Hockney (set of Russian Dolls)","height":98});
															thumbnails[2991802] = clik.newPhoto({"id":2991802,"src":"WoI-coveroct-08_thumb.jpg","galleries_id":184345,"server_id":1,"link":"photo_2991802.html","width":99,"caption":"Get Ready featured in World of Interiors, October 2008 issue","height":130});
															thumbnails[3982355] = clik.newPhoto({"id":3982355,"src":"holly-catalogue-pic-small2_thumb.jpg","galleries_id":206047,"server_id":1,"link":"photo_3982355.html","width":98,"caption":"","height":130});
															thumbnails[2991801] = clik.newPhoto({"id":2991801,"src":"WoI-listing_thumb.jpg","galleries_id":184345,"server_id":1,"link":"photo_2991801.html","width":130,"caption":"Get Ready featured in Exhibition Diary","height":107});
															thumbnails[5349785] = clik.newPhoto({"id":5349785,"src":"catalogue-cover-small_152FC5F8-1D09-001F-99811ED9BDB8C768_thumb.jpg","galleries_id":184345,"server_id":1,"link":"photo_5349785.html","width":130,"caption":"catalogue 2008","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[153525] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"recent","link":"gallery_153525.html","maxRecords":0.0,"photoIDs":[4771135.0,1612575.0,2639115.0,2388314.0,3837199.0,2639111.0,2639113.0,3982377.0,4771128.0,4771133.0,4771134.0,4359700.0,4359704.0,4359705.0,4771139.0,4771141.0],"skipIndex":0,"section_code":"gallery","featured_images":2388314.0,"id":153525,"singleSection":false});				  						galleries[153535] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"paintings","link":"gallery_153535.html","maxRecords":0.0,"photoIDs":[2388313.0,1879599.0,1879315.0,1879321.0,2388312.0,1387975.0,1387941.0,1387917.0,1387940.0,1625950.0,1388142.0,1388154.0],"skipIndex":0,"section_code":"gallery","featured_images":1387941.0,"id":153535,"singleSection":false});				  						galleries[96497] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"portraits","link":"gallery_96497.html","maxRecords":0.0,"photoIDs":[2482280.0,1879577.0,1879439.0,2275395.0,3436167.0,3436169.0,3436172.0,4464108.0,4464102.0,4464111.0,4464113.0,4464115.0,4763296.0,4763304.0,4763336.0,4763389.0,4763398.0],"skipIndex":0,"section_code":"gallery","featured_images":3436172.0,"id":96497,"singleSection":false});				  						galleries[96496] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"prints + drawings","link":"gallery_96496.html","maxRecords":0.0,"photoIDs":[1388130.0,1388131.0,3436219.0,1388132.0,1388109.0,3436187.0,4359716.0],"skipIndex":0,"section_code":"gallery","featured_images":"4359716,3436219,3436187,1388132,1388131,1388130,1388109","id":96496,"singleSection":false});				  						galleries[262137] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"posters + prints","link":"gallery_262137.html","maxRecords":0.0,"photoIDs":[4499875.0,4499879.0,4499893.0,4499895.0],"skipIndex":0,"section_code":"gallery","featured_images":4499875.0,"id":262137,"singleSection":false});				  						galleries[262138] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"greetings cards","link":"gallery_262138.html","maxRecords":0.0,"photoIDs":[4500010.0,4500024.0,4500031.0,4499943.0,4500037.0,4500040.0,4500046.0,4500049.0],"skipIndex":0,"section_code":"gallery","featured_images":4500010.0,"id":262138,"singleSection":false});				  						galleries[184345] = clik.newGallery({"parentGallery":"","usePopups":false,"title":" press 08","link":"section228435_184345.html","maxRecords":0.0,"photoIDs":[2991802.0,2991801.0,5349785.0],"skipIndex":0,"section_code":"section228435","featured_images":"5349785,2991802,2991801","id":184345,"singleSection":false});				  						galleries[301224] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"books","link":"gallery_301224.html","maxRecords":0.0,"photoIDs":[2991750.0,8742691.0],"skipIndex":0,"section_code":"gallery","featured_images":2991750.0,"id":301224,"singleSection":false});				  						galleries[206047] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"  ","link":"section228435_206047.html","maxRecords":0.0,"photoIDs":[3982355.0],"skipIndex":0,"section_code":"section228435","featured_images":3982355.0,"id":206047,"singleSection":false});				  						galleries[331082] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"tea towels","link":"gallery_331082.html","maxRecords":0.0,"photoIDs":[5854048.0],"skipIndex":0,"section_code":"gallery","featured_images":5854048.0,"id":331082,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8965167';
imageSets[2] = '5854048,4771095,4499875,1387941,4500010,2991750,3436172,2388314';
imageSets[3] = '8965167,8742691,5854048,5349785,4771141,4771139,4771135,4771134,4771133,4771128,4771095,4763398,4763389,4763336,4763304,4763296,4500049,4500046,4500040,4500037,4500031,4500024,4500010,4499943,4499895,4499893,4499879,4499875,4464115,4464113,4464111,4464108,4464102,4359716,4359705,4359704,4359700,3982377,3982355,3837199,3436219,3436187,3436172,3436169,3436167,2991802,2991801,2991750,2639115,2639113';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/hollyfrean/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/hollyfrean/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 = 'Holly Frean: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			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;
	}
}

			

