window.thumbnails = new Object();
												thumbnails[3620352] = new thumbnail(3620352,'221445','Monet in the Rockies','Grassi_Lake_thumb.jpg',130, 87,15,'photo_3620352.html');
												thumbnails[3625129] = new thumbnail(3625129,'221472','A Walk around the Grange','Walk_Round_Grange_thumb.jpg',130, 65,15,'photo_3625129.html');
												thumbnails[4959783] = new thumbnail(4959783,'282079','BT Orphan','BT_orphan_0771_thumb.jpg',130, 195,15,'photo_4959783.html');
												thumbnails[8049517] = new thumbnail(8049517,'221848','Falling tide','Bridge_Tide_3579w_thumb.jpg',130, 86,15,'photo_8049517.html');
												thumbnails[8055358] = new thumbnail(8055358,'431962','Castle approach','Castle_Approach_3034w_thumb.jpg',130, 86,15,'photo_8055358.html');
												thumbnails[4959954] = new thumbnail(4959954,'221472','Lewes Castle composite','Castle_Composite_thumb.jpg',130, 79,15,'photo_4959954.html');
												thumbnails[3620349] = new thumbnail(3620349,'221445','Blue','Blue_thumb.jpg',130, 87,15,'photo_3620349.html');
												thumbnails[4959730] = new thumbnail(4959730,'282079','121 High Street','121_High_St_0932_thumb.jpg',130, 195,15,'photo_4959730.html');
												thumbnails[8049519] = new thumbnail(8049519,'221848','End of the world','End_of_world_4605w_thumb.jpg',130, 86,15,'photo_8049519.html');
												thumbnails[8055647] = new thumbnail(8055647,'431962','Closing Down Sale','Closing_Down_0519w_thumb.jpg',130, 86,15,'photo_8055647.html');
												thumbnails[3620423] = new thumbnail(3620423,'221445','Keere Street','Keir_Street_thumb.jpg',130, 87,15,'photo_3620423.html');
												thumbnails[3620790] = new thumbnail(3620790,'221472','Double Knot','Knot_Gardens_Double_thumb.jpg',130, 70,15,'photo_3620790.html');
												thumbnails[4959750] = new thumbnail(4959750,'282079','Fence','Fence_0576_thumb.jpg',130, 195,15,'photo_4959750.html');
												thumbnails[8049550] = new thumbnail(8049550,'221848','Isle of Wight ferry','IOW_Ferry_4755w_thumb.jpg',130, 86,15,'photo_8049550.html');
												thumbnails[8055702] = new thumbnail(8055702,'431962','Fence','Fence_3015w_thumb.jpg',130, 86,15,'photo_8055702.html');
												thumbnails[3620347] = new thumbnail(3620347,'221445','Brick-Slab Pavement','Andre_thumb.jpg',130, 195,15,'photo_3620347.html');
												thumbnails[4959756] = new thumbnail(4959756,'282079','Boots','Boots_0039_thumb.jpg',130, 87,15,'photo_4959756.html');
												thumbnails[8049554] = new thumbnail(8049554,'221848','M6, near Knutsford services, busy Monday','Motorway_0432w_thumb.jpg',130, 86,15,'photo_8049554.html');
												thumbnails[8055708] = new thumbnail(8055708,'431962','Keere Street','Keere_St_3046w_thumb.jpg',130, 86,15,'photo_8055708.html');
												thumbnails[3620403] = new thumbnail(3620403,'221445','Jackson Newman','Jackson_Newman_thumb.jpg',130, 195,15,'photo_3620403.html');
												thumbnails[3625104] = new thumbnail(3625104,'221472','Church Twitten','Twitten_thumb.jpg',130, 130,15,'photo_3625104.html');
												thumbnails[4959723] = new thumbnail(4959723,'282079','102 High Street','102_High_St_0993_thumb.jpg',130, 87,15,'photo_4959723.html');
												thumbnails[8049558] = new thumbnail(8049558,'221848','Point','Point_3864w_thumb.jpg',130, 86,15,'photo_8049558.html');
												thumbnails[8055711] = new thumbnail(8055711,'431962','Marlow Church','Marlow_Church_4041w_thumb.jpg',130, 86,15,'photo_8055711.html');
												thumbnails[3620464] = new thumbnail(3620464,'221445','De Stijl composition','Mondrian_thumb.jpg',130, 195,15,'photo_3620464.html');
												thumbnails[4959786] = new thumbnail(4959786,'282079','Blue-Tree-Stake','Grange_Ground_1081_thumb.jpg',130, 87,15,'photo_4959786.html');
												thumbnails[4962278] = new thumbnail(4962278,'431962','The smallest cloud','Smallest_cloud_0757_thumb.jpg',130, 87,15,'photo_4962278.html');
												thumbnails[8049508] = new thumbnail(8049508,'221472','Summer Heat (Brighton Beach)','Summer_heat_w_thumb.jpg',130, 29,15,'photo_8049508.html');
												thumbnails[8049581] = new thumbnail(8049581,'221848','Galaxy/Weir','Weir_4146w_thumb.jpg',130, 86,15,'photo_8049581.html');
												thumbnails[3620425] = new thumbnail(3620425,'221445','L9','L9_thumb.jpg',130, 87,15,'photo_3620425.html');
												thumbnails[4959893] = new thumbnail(4959893,'282079','Trees','Grange_Trees_1091_thumb.jpg',130, 87,15,'photo_4959893.html');
												thumbnails[3620426] = new thumbnail(3620426,'221445','Leaf River','Leaf_River_thumb.jpg',130, 87,15,'photo_3620426.html');
												thumbnails[4962272] = new thumbnail(4962272,'282079','Swimming pool','Swimming_pool_0881_thumb.jpg',130, 87,15,'photo_4962272.html');
												thumbnails[3620429] = new thumbnail(3620429,'221445','Grey','Miro_Grey_thumb.jpg',130, 87,15,'photo_3620429.html');
												thumbnails[3620516] = new thumbnail(3620516,'221445','Winter Rhythm','Pollock_thumb.jpg',130, 87,15,'photo_3620516.html');
												thumbnails[4962281] = new thumbnail(4962281,'282079','Minimalist wall','Min_Wall_0360_thumb.jpg',130, 87,15,'photo_4962281.html');
												thumbnails[4962334] = new thumbnail(4962334,'282079','Cubist fish','Grange_Wall_1083_thumb.jpg',130, 87,15,'photo_4962334.html');
												thumbnails[3631008] = new thumbnail(3631008,'222024','Sydney Opera House','Sydney_Opera_House_thumb.jpg',130, 98,15,'photo_3631008.html');
												thumbnails[3620553] = new thumbnail(3620553,'221446','North Arm','North_Arm_thumb.jpg',130, 87,15,'photo_3620553.html');
												thumbnails[3620802] = new thumbnail(3620802,'221478','Keere Street','Keir_Street_BW_thumb.jpg',130, 87,15,'photo_3620802.html');
												thumbnails[3623121] = new thumbnail(3623121,'221483','Lewes Castle above Baxter\'s Field','Castle_Baxter_Panorama_thumb.jpg',130, 39,15,'photo_3623121.html');
												thumbnails[3631014] = new thumbnail(3631014,'222024','Dawn in Renmark','Renmark_Dawn_thumb.jpg',130, 98,15,'photo_3631014.html');
												thumbnails[4962480] = new thumbnail(4962480,'282114','5 sisters','7_sisters_0660_thumb.jpg',130, 87,15,'photo_4962480.html');
												thumbnails[3637846] = new thumbnail(3637846,'222024','Sydney Harbour Bridge','SHB_in_SOH_thumb.jpg',130, 98,15,'photo_3637846.html');
												thumbnails[3620542] = new thumbnail(3620542,'221446','Dawson City, Yukon','Dawson_City_thumb.jpg',130, 87,15,'photo_3620542.html');
												thumbnails[3620805] = new thumbnail(3620805,'221478','Misty morning','Misty_Lewes_BW_thumb.jpg',130, 87,15,'photo_3620805.html');
												thumbnails[3630913] = new thumbnail(3630913,'221483','Floodplain','Floodplain_thumb.jpg',130, 27,15,'photo_3630913.html');
												thumbnails[3631010] = new thumbnail(3631010,'222024','Bennetts Bluff, evening','Bennetts_Bluff_thumb.jpg',130, 98,15,'photo_3631010.html');
												thumbnails[4962487] = new thumbnail(4962487,'282114','Buddha & the Bottleneck','Buddha_Bottleneck_0043_thumb.jpg',130, 87,15,'photo_4962487.html');
												thumbnails[3637855] = new thumbnail(3637855,'222024','Mirror Lake','Mirror_Lake_thumb.jpg',130, 98,15,'photo_3637855.html');
												thumbnails[3620546] = new thumbnail(3620546,'221446','Great Slave Lake at Yellowknife','GS_Lake_Yknife_thumb.jpg',130, 89,15,'photo_3620546.html');
												thumbnails[3620814] = new thumbnail(3620814,'221478','Autumn colours','Red_Tree_thumb.jpg',130, 87,15,'photo_3620814.html');
												thumbnails[3630914] = new thumbnail(3630914,'221483','Pells Pond','Pells_Panorama_thumb.jpg',130, 31,15,'photo_3630914.html');
												thumbnails[3637858] = new thumbnail(3637858,'222024','Sperm whale diving','Whale_dive_thumb.jpg',130, 98,15,'photo_3637858.html');
												thumbnails[4962491] = new thumbnail(4962491,'282114','C curve','C_Curve_9686_thumb.jpg',130, 87,15,'photo_4962491.html');
												thumbnails[3637860] = new thumbnail(3637860,'222024','Dunedin, early morning','Dunedin_thumb.jpg',130, 98,15,'photo_3637860.html');
												thumbnails[3620537] = new thumbnail(3620537,'221446','Cemetery in Tuktoyaktuk, NWT','Cemetery_Tuktoyaktuk_thumb.jpg',130, 66,15,'photo_3620537.html');
												thumbnails[3620822] = new thumbnail(3620822,'221478','Woodland Path','Woodland_Path_thumb.jpg',130, 87,15,'photo_3620822.html');
												thumbnails[3630813] = new thumbnail(3630813,'221483','Lewes Castle above the Paddock','Castle_Terraces_Panorama_thumb.jpg',130, 25,15,'photo_3630813.html');
												thumbnails[3631015] = new thumbnail(3631015,'222024','Group of boys in Lindos','Boys_in_Lindos__Rhodes_thumb.jpg',130, 87,15,'photo_3631015.html');
												thumbnails[4962494] = new thumbnail(4962494,'282114','Out of step','Chairs_1472_thumb.jpg',130, 87,15,'photo_4962494.html');
												thumbnails[3765163] = new thumbnail(3765163,'221478','Lewes Castle and town','Lewes_Castle_BW_thumb.jpg',130, 87,15,'photo_3765163.html');
												thumbnails[3620575] = new thumbnail(3620575,'221446','Peel River & Dust Plume','Peel_River_and_Dust_Plume_thumb.jpg',130, 66,15,'photo_3620575.html');
												thumbnails[3630921] = new thumbnail(3630921,'221483','Ploughed field','Ploughed_Field_Panorama_thumb.jpg',130, 24,15,'photo_3630921.html');
												thumbnails[3631824] = new thumbnail(3631824,'222024','Ippoton; \'Street of the Knights\'','Ippoton_thumb.jpg',130, 87,15,'photo_3631824.html');
												thumbnails[3693055] = new thumbnail(3693055,'221478','Willeys Bridge','Willeys_Bridge_thumb.jpg',130, 87,15,'photo_3693055.html');
												thumbnails[4962551] = new thumbnail(4962551,'282114','Grass','Grass_9931_thumb.jpg',130, 87,15,'photo_4962551.html');
												thumbnails[3620597] = new thumbnail(3620597,'221446','Buoy, Great Slave Lake','Slave_Lake_Buoy_thumb.jpg',130, 66,15,'photo_3620597.html');
												thumbnails[3630936] = new thumbnail(3630936,'221483','Road Junction near Lewes Station','St_Andrews_Panorama_thumb.jpg',130, 45,15,'photo_3630936.html');
												thumbnails[3631830] = new thumbnail(3631830,'222024','Clock Tower','Clock_Tower_thumb.jpg',130, 87,15,'photo_3631830.html');
												thumbnails[3693065] = new thumbnail(3693065,'221478','Lewes Castle','Lewes_Castle_thumb.jpg',130, 87,15,'photo_3693065.html');
												thumbnails[4962558] = new thumbnail(4962558,'282114','Hawthorn bouquet','Hawthorn_bouquet_1451_thumb.jpg',130, 87,15,'photo_4962558.html');
												thumbnails[3620581] = new thumbnail(3620581,'221446','Pool by the Dempster Highway','Pool_by_Dempster_Hwy_thumb.jpg',130, 87,15,'photo_3620581.html');
												thumbnails[3631834] = new thumbnail(3631834,'222024','Rhodes Old Town','Rhodes_Old_Town_thumb.jpg',130, 90,15,'photo_3631834.html');
												thumbnails[3703116] = new thumbnail(3703116,'221478','The Downs above Kingston','Kingston_Downs_BW_thumb.jpg',130, 87,15,'photo_3703116.html');
												thumbnails[4962659] = new thumbnail(4962659,'282114','Lewes High Street, late evening','High_St_Late_evg_0036_thumb.jpg',130, 87,15,'photo_4962659.html');
												thumbnails[3620586] = new thumbnail(3620586,'221446','Salt Plains','Salt_Plains_WB_Park_thumb.jpg',130, 87,15,'photo_3620586.html');
												thumbnails[3631841] = new thumbnail(3631841,'222024','Lindos, Rhodes, Greece','Lindos_Roofs_thumb.jpg',130, 87,15,'photo_3631841.html');
												thumbnails[3810341] = new thumbnail(3810341,'221478','Dewpond','Dewpond_2_thumb.jpg',130, 87,15,'photo_3810341.html');
												thumbnails[4962680] = new thumbnail(4962680,'282114','Fountain','KG_Fountain_Fast_9518_thumb.jpg',130, 87,15,'photo_4962680.html');
												thumbnails[3620592] = new thumbnail(3620592,'221446','Sambaa Deh Falls','Sambaa_Deh_Falls_thumb.jpg',130, 87,15,'photo_3620592.html');
												thumbnails[3631852] = new thumbnail(3631852,'222024','Rhodian Landscape','Rhodian_Landscape_thumb.jpg',130, 87,15,'photo_3631852.html');
												thumbnails[3810344] = new thumbnail(3810344,'221478','Heathy Brow','Heathy_brow_thumb.jpg',130, 87,15,'photo_3810344.html');
												thumbnails[3620636] = new thumbnail(3620636,'221446','Wallace Creek','Wallace_Creek_thumb.jpg',130, 87,15,'photo_3620636.html');
												thumbnails[3631861] = new thumbnail(3631861,'222024','Athabasca Glacier, Columbia Icefield','Columbia_Icefield_thumb.jpg',130, 87,15,'photo_3631861.html');
												thumbnails[4962685] = new thumbnail(4962685,'282114','Yachts','Yachts_1625_thumb.jpg',130, 87,15,'photo_4962685.html');
												thumbnails[3620644] = new thumbnail(3620644,'221446','Yellowknife Sunset','Yellowknife_Sunset_thumb.jpg',130, 87,15,'photo_3620644.html');
												thumbnails[3631867] = new thumbnail(3631867,'222024','Lake Louise, Alberta','Lake_Louise_thumb.jpg',130, 87,15,'photo_3631867.html');
												thumbnails[3620629] = new thumbnail(3620629,'221446','View into Tombstone','Tombstone_thumb.jpg',130, 87,15,'photo_3620629.html');
												thumbnails[3631877] = new thumbnail(3631877,'222024','Early summer storm above Lake Louise village','Storm_Lake_Louise_thumb.jpg',130, 98,15,'photo_3631877.html');
												thumbnails[3620654] = new thumbnail(3620654,'221446','Yukon River at Dawson City','Yukon_River_thumb.jpg',130, 87,15,'photo_3620654.html');
												thumbnails[3631882] = new thumbnail(3631882,'222024','Eagle Ridge','Eagle_Ridge_thumb.jpg',130, 98,15,'photo_3631882.html');
												thumbnails[3620618] = new thumbnail(3620618,'221446','Waterfall by Telegraph Creek Road','Telegraph_Creek_Rd_Waterfall_thumb.jpg',130, 195,15,'photo_3620618.html');
												thumbnails[3631889] = new thumbnail(3631889,'222024','Shopping Mall, Grande Cache','Mall_Grande_Cache_thumb.jpg',130, 66,15,'photo_3631889.html');
												thumbnails[3638120] = new thumbnail(3638120,'222024','Hong Kong harbour','Hong_Kong_Harbour__dawn_thumb.jpg',130, 98,15,'photo_3638120.html');
												thumbnails[3638127] = new thumbnail(3638127,'222024','Buddha','Buddha_HK_thumb.jpg',130, 173,15,'photo_3638127.html');
												thumbnails[8055879] = new thumbnail(8055879,'222024','Staubbach Falls, Lauterbrunnen','Lauterbrunnen_w_thumb.jpg',130, 198,15,'photo_8055879.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[221445] = new gallery(221445,'3620516,3620464,3620429,3620426,3620425,3620423,3620403,3620352,3620349,3620347','Abstract','gallery',[3620352,3620349,3620423,3620347,3620403,3620464,3620425,3620426,3620429,3620516],0, 0, '', 'gallery_221445.html',0,0);
				  					galleries[282079] = new gallery(282079,'4962334,4962281,4962272,4959893,4959786,4959783,4959756,4959750,4959730,4959723','Abstract 2','gallery',[4959783,4959730,4959750,4959756,4959723,4959786,4959893,4962272,4962281,4962334],0, 0, '', 'gallery_282079.html',0,0);
				  					galleries[221848] = new gallery(221848,'8049581,8049558,8049554,8049550,8049519,8049517','Long Exposures','gallery',[8049517,8049519,8049550,8049554,8049558,8049581],0, 0, '', 'gallery_221848.html',0,0);
				  					galleries[221472] = new gallery(221472,'8049508,4959954,3625129,3625104,3620790','Composite','gallery',[3625129,4959954,3620790,3625104,8049508],0, 0, '', 'gallery_221472.html',0,0);
				  					galleries[431962] = new gallery(431962,'8055711,8055708,8055702,8055647,8055358,4962278','Perspectives','gallery',[8055358,8055647,8055702,8055708,8055711,4962278],0, 0, '', 'gallery_431962.html',0,0);
				  					galleries[221478] = new gallery(221478,'3810344,3810341,3765163,3703116,3693065,3693055,3620822,3620814,3620805,3620802','Lewes Area','section338601',[3620802,3620805,3620814,3620822,3765163,3693055,3693065,3703116,3810341,3810344],0, 0, '', 'section338601_221478.html',0,0);
				  					galleries[221446] = new gallery(221446,'3620654,3620644,3620636,3620629,3620618,3620597,3620592,3620586,3620581,3620575,3620553,3620546,3620542,3620537','North West Canada','section338601',[3620553,3620542,3620546,3620537,3620575,3620597,3620581,3620586,3620592,3620636,3620644,3620629,3620654,3620618],0, 0, '', 'section338601_221446.html',0,0);
				  					galleries[222024] = new gallery(222024,'8055879,3638127,3638120,3637860,3637858,3637855,3637846,3631889,3631882,3631877,3631867,3631861,3631852,3631841,3631834,3631830,3631824,3631015,3631014,3631010,3631008','Other locations','section338601',[3631008,3631014,3637846,3631010,3637855,3637858,3637860,3631015,3631824,3631830,3631834,3631841,3631852,3631861,3631867,3631877,3631882,3631889,3638120,3638127,8055879],0, 0, '', 'section338601_222024.html',0,0);
				  					galleries[282114] = new gallery(282114,'4962685,4962680,4962659,4962558,4962551,4962494,4962491,4962487,4962480','Viva Lewes!','section338601',[4962480,4962487,4962491,4962494,4962551,4962558,4962659,4962680,4962685],0, 0, '', 'section338601_282114.html',0,0);
				  					galleries[221483] = new gallery(221483,'3630936,3630921,3630914,3630913,3630813,3623121','Panoramas','section338601',[3623121,3630913,3630914,3630813,3630921,3630936],0, 0, '', 'section338601_221483.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '8055879,8055711,8055708,8055702,8055647,8055358,8049581,8049558,8049554,8049550,8049519,8049517,8049508,4962685,4962680,4962659,4962558,4962551,4962494,4962491,4962487,4962480,4962334,4962281,4962278,4962272,4959954,4959893,4959786,4959783,4959756,4959750,4959730,4959723,3810344,3810341,3765163,3703116,3693065,3693055,3638127,3638120,3637860,3637858,3637855,3637846,3631889,3631882,3631877,3631867,3631861,3631852,3631841,3631834,3631830,3631824,3631015,3631014,3631010,3631008,3630936,3630921,3630914,3630913,3630813,3625129,3625104,3623121,3620822,3620814,3620805,3620802,3620790,3620654,3620644,3620636,3620629,3620618,3620597,3620592,3620586,3620581,3620575,3620553,3620546,3620537,3620516,3620464,3620429,3620426,3620425,3620423,3620403,3620352,3620349,3620347';
imageSets[2] = '8055879,8055711,8055708,8055702,8055647,8055358,8049581,8049558,8049554,8049550,8049519,8049517,8049508,4962685,4962680,4962659,4962558,4962551,4962494,4962491,4962487,4962480,4962334,4962281,4962278,4962272,4959954,4959893,4959786,4959783,4959756,4959750,4959730,4959723,3810344,3810341,3765163,3703116,3693065,3693055,3638127,3638120,3637860,3637858,3637855,3637846,3631889,3631882,3631877,3631867,3631861,3631852,3631841,3631834,3631830,3631824,3631015,3631014,3631010,3631008,3630936,3630921,3630914,3630913,3630813,3625129,3625104,3623121,3620822,3620814,3620805,3620802,3620790,3620654,3620644,3620636,3620629,3620618,3620597,3620592,3620586,3620581,3620575,3620553,3620546,3620542,3620537,3620516,3620464,3620429,3620426,3620425,3620423,3620403,3620352,3620349,3620347';
imageSets[3] = '8055879,8055711,8055708,8055702,8055647,8055358,8049581,8049558,8049554,8049550,8049519,8049517,8049508,4962685,4962680,4962659,4962558,4962551,4962494,4962491,4962487,4962480,4962334,4962281,4962278,4962272,4959954,4959893,4959786,4959783,4959756,4959750,4959730,4959723,3810344,3810341,3765163,3703116,3693065,3693055,3638127,3638120,3637860,3637858,3637855,3637846,3631889,3631882,3631877,3631867';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Sigood/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Sigood/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Sigood/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Sigood/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Sigood/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Sigood/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Phocus Pocus: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object' || array == undefined) {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

