window.thumbnails = new Object();
												thumbnails[6241326] = new thumbnail(6241326,'347363','','mod2_thumb.jpg',130, 86,18,'																			photo_6241326.html');
												thumbnails[2912116] = new thumbnail(2912116,'48583','','Upernavik Mountians-5jpg_thumb.jpg',130, 103,18,'																			photo_2912116.html');
												thumbnails[2912122] = new thumbnail(2912122,'48583','','Inuit Cemetry-Iluluisaat-2_thumb.jpg',130, 79,18,'																			photo_2912122.html');
												thumbnails[2912143] = new thumbnail(2912143,'48583','','In Search of Ice made In Heaven-1h_thumb.jpg',130, 125,18,'																			photo_2912143.html');
												thumbnails[2888063] = new thumbnail(2888063,'48583','','In Search of Ice made In Heaven-1dd_thumb.JPG',130, 147,18,'																			photo_2888063.html');
												thumbnails[2803705] = new thumbnail(2803705,'48583','Ilullisat Icefjords','Ice made in Heaven-1_thumb.JPG',130, 98,18,'																			photo_2803705.html');
												thumbnails[2803707] = new thumbnail(2803707,'48583','','Ice made in Heaven-2_thumb.JPG',130, 98,18,'																			photo_2803707.html');
												thumbnails[180076] = new thumbnail(180076,'27233','Title :- \'Fragile Earth\'- Ice Wind and Fire.<br>\r\n            based on Icelandic Landscape <br>\r\nMedium:-  Oil on Panel.<br>\r\nSize:-    120cm x 80cm<br>\r\nPrice:-   £500<br>\r\n<br>\r\n','icelandic Landscape-1bd_thumb.jpg',130, 55,18,'																			photo_180076.html');
												thumbnails[459833] = new thumbnail(459833,'27233','Icelandic Landscape Acrylics on canvas.<br>\r\nSize 120cm x 100cm<br>\r\n£1000','EXHIBITION5_thumb.JPG',130, 87,18,'																			photo_459833.html');
												thumbnails[459836] = new thumbnail(459836,'27233','Icelandic Landscape Acrylics on canvas.<br>\r\nSize 120 cm x 100cm<br>\r\nPrice £600','EXHIBTION4_thumb.JPG',130, 99,18,'																			photo_459836.html');
												thumbnails[459838] = new thumbnail(459838,'27233','Arctic Norway Svolvaer Acrylics on canvas.<br>\r\nSize 120cm x 100cm<br>\r\nPrice £600<br>\r\n','EXHIBTION7 NORWAY_thumb.JPG',130, 90,18,'																			photo_459838.html');
												thumbnails[459856] = new thumbnail(459856,'27233','Title:- After the snow melted.<br>\r\nArctic Landscape based on Tasiilaq in East Greenland. Acrylics on canvas Triptych size 460cm x 150cm.<br>\r\nPrice £3000','Greenlandic Landscape 1a jpg_thumb.jpg',130, 60,18,'																			photo_459856.html');
												thumbnails[459883] = new thumbnail(459883,'27233','Ittoqqortoormiit East Greenlandic Landscape Acrylics on canvas.<br>\r\nSize 120cm x 90cm<br>\r\nPrice £1000','Greenlandic Landscape-11_thumb.JPG',130, 78,18,'																			photo_459883.html');
												thumbnails[459884] = new thumbnail(459884,'27233','Greenlandic Landscape and Inuit Hut. <br>\r\nAcrylics on canvas <br>\r\nSize 80cm x 50cm<br>\r\nPrice £500<br>\r\n','Greenlandic Landscape and Inuit hut_thumb.JPG',130, 76,18,'																			photo_459884.html');
												thumbnails[459890] = new thumbnail(459890,'27233','Iceberg and Midnight sun.<br>\r\nAcrylics on canvas <br>\r\nSize 60cm x 80cm <br>\r\nNFS','Midnight sun and Iceberg_thumb.JPG',130, 182,18,'																			photo_459890.html');
												thumbnails[459924] = new thumbnail(459924,'27233','Arctic Landscape from the viewing it from the   sea.<br>\r\nOil on canvas <br>\r\nSize 90cm x 60cm<br>\r\nPrice £500','ArcticLandscape from the sea_thumb.JPG',130, 53,18,'																			photo_459924.html');
												thumbnails[589178] = new thumbnail(589178,'48583','Painting Plein Air  with the Inuit kids of  Ittoqqortoomiit East Greenland. Photo','Painting with the Inuits children of Ittoqqortoormiit East Greenland_thumb.jpg',130, 98,18,'																			photo_589178.html');
												thumbnails[589189] = new thumbnail(589189,'48583','Living on the edge- Ittoqqortoormiit East Greenland','ITTOQOOROOMIIT_thumb.JPG',130, 98,18,'																			photo_589189.html');
												thumbnails[589276] = new thumbnail(589276,'27233','Title:-Icelandic Landscape.<br>\r\nMedium:- Oil on MDF <br>\r\nSize:-   90cm x 50cm<br>\r\nPrice:-  £300','Icelandic 2a oil_thumb.jpg',130, 56,18,'																			photo_589276.html');
												thumbnails[596215] = new thumbnail(596215,'48583','','2006_0820Arctic-landscape0011_thumb.JPG',130, 98,18,'																			photo_596215.html');
												thumbnails[596216] = new thumbnail(596216,'48583','','2006_0820Arctic-landscape0008_thumb.JPG',130, 98,18,'																			photo_596216.html');
												thumbnails[596217] = new thumbnail(596217,'48583','','2006_0820Arctic-landscape0022_thumb.JPG',130, 98,18,'																			photo_596217.html');
												thumbnails[596218] = new thumbnail(596218,'48583','Walrus bay outside the village of Ittoqqortoormiit. ','2006_0820Arctic-landscape0006_thumb.JPG',130, 98,18,'																			photo_596218.html');
												thumbnails[596219] = new thumbnail(596219,'48583','','2006_0410Norway-Arctic-10110_thumb.JPG',130, 98,18,'																			photo_596219.html');
												thumbnails[643424] = new thumbnail(643424,'27233','Arctic Landscape - Norway.','Arctic Norway 1_thumb.jpg',130, 174,18,'																			photo_643424.html');
												thumbnails[643429] = new thumbnail(643429,'27233','Arctic Landscape-Norway 2','Arctic Norway 2_thumb.jpg',130, 163,18,'																			photo_643429.html');
												thumbnails[643435] = new thumbnail(643435,'27233','Arctic Landscapew - Norway-3<br>\r\nMedium:- Acrylics on board.<br>\r\nSize:-   40cm x 30cm.<br>\r\nPrice:-  £200 ','Arctic Norway 3_thumb.jpg',130, 173,18,'																			photo_643435.html');
												thumbnails[643634] = new thumbnail(643634,'48583','','Greenland 4_thumb.jpg',130, 98,18,'																			photo_643634.html');
												thumbnails[643637] = new thumbnail(643637,'48583','','Greenland 8_thumb.jpg',130, 98,18,'																			photo_643637.html');
												thumbnails[643641] = new thumbnail(643641,'48583','','Greenland 3_thumb.jpg',130, 98,18,'																			photo_643641.html');
												thumbnails[644093] = new thumbnail(644093,'48583','','Greenland 9_thumb.jpg',130, 98,18,'																			photo_644093.html');
												thumbnails[644101] = new thumbnail(644101,'48583','','Greenland 15_thumb.jpg',130, 98,18,'																			photo_644101.html');
												thumbnails[644104] = new thumbnail(644104,'48583','','Greenland 11_thumb.jpg',130, 98,18,'																			photo_644104.html');
												thumbnails[644109] = new thumbnail(644109,'48583','Sophie the Husky.','Greenland 13_thumb.jpg',130, 98,18,'																			photo_644109.html');
												thumbnails[1003899] = new thumbnail(1003899,'27233','Portraits of Iceberg.<br>\r\nSize 60cm x 25cm ','Portraits of Icebergs_thumb..jpg',130, 26,18,'																			photo_1003899.html');
												thumbnails[1003902] = new thumbnail(1003902,'27233','Arctic Landscape<br>\r\nSacred Landscapes - Fragile Earth<br>\r\nSize 60cm x 25cm<br>\r\nPrice £300','Arctic Landscape1_thumb.jpg',130, 40,18,'																			photo_1003902.html');
												thumbnails[1122855] = new thumbnail(1122855,'27233','Ice-Landscape.<br>\r\nSize 40cm x 30cm<br>\r\nPrice £300','Sacred Landscapes-Fragile Earth 3a_thumb.jpg',130, 98,18,'																			photo_1122855.html');
												thumbnails[1122862] = new thumbnail(1122862,'27233','Ice- Landscape.<br>\r\nSize 40cm x 30cm<br>\r\nPrice £300','Sacred Landscape Fragile Earth 2a_thumb.jpg',130, 98,18,'																			photo_1122862.html');
												thumbnails[1122867] = new thumbnail(1122867,'27233','Portrait of Iceberg.','Portrait of Icaberg 1a_thumb.jpg',130, 80,18,'																			photo_1122867.html');
												thumbnails[1214131] = new thumbnail(1214131,'27233','In search of Ice made in Heaven - Greenland.<br>\r\nOil on Mountboard.<br>\r\nSize 120cm x 80cm.<br>\r\nPrice £1200<br>\r\n','PORTRAIT OF ICEBERGS_thumb.jpg',130, 65,18,'																			photo_1214131.html');
												thumbnails[1214242] = new thumbnail(1214242,'27233','Arctic Landscape as viewed from the ship the MS Finnmarken.<br>\r\nOil on MountBoard.Size 120cm x 90cm<br>\r\nPrice £600','Portrait - Arctic Mountains 1a_thumb.jpg',130, 91,18,'																			photo_1214242.html');
												thumbnails[1215687] = new thumbnail(1215687,'27233','Title:- Portrait of Iceberg.<br>\r\nMedium:- Oil on Board.<br>\r\nSize:-100cm x 60cm.<br>\r\nPrice:- £1000 ','Iceberg Island 2_thumb.jpg',130, 77,18,'																			photo_1215687.html');
												thumbnails[1215688] = new thumbnail(1215688,'27233','Title:- Portrait of Iceberg.<br>\r\nMedium:- Oil on mountboard.<br>\r\nSize:-   70cm x 20cm<br>\r\nPrice:-  £400 ','Iceberg 2_thumb.jpg',130, 34,18,'																			photo_1215688.html');
												thumbnails[2803708] = new thumbnail(2803708,'48583','','Ice made in Heaven-3_thumb.JPG',130, 98,18,'																			photo_2803708.html');
												thumbnails[2803710] = new thumbnail(2803710,'48583','','Ice made in Heaven-5_thumb.JPG',130, 98,18,'																			photo_2803710.html');
												thumbnails[2803711] = new thumbnail(2803711,'48583','','Ice made in Heaven-6_thumb.JPG',130, 98,18,'																			photo_2803711.html');
												thumbnails[2803714] = new thumbnail(2803714,'48583','','Ice in the midnight sun_thumb.JPG',130, 98,18,'																			photo_2803714.html');
												thumbnails[2803716] = new thumbnail(2803716,'48583','','Ice made in Heaven-12_thumb.JPG',130, 98,18,'																			photo_2803716.html');
												thumbnails[2803719] = new thumbnail(2803719,'48583','','Ice made in Heaven-16_thumb.JPG',130, 98,18,'																			photo_2803719.html');
												thumbnails[2803720] = new thumbnail(2803720,'48583','','Ice made in Heaven-17_thumb.JPG',130, 98,18,'																			photo_2803720.html');
												thumbnails[2803721] = new thumbnail(2803721,'48583','','Ice made in Heaven-15_thumb.JPG',130, 98,18,'																			photo_2803721.html');
												thumbnails[2803722] = new thumbnail(2803722,'48583','','Icefjords_thumb.JPG',130, 55,18,'																			photo_2803722.html');
												thumbnails[2825929] = new thumbnail(2825929,'176311','','Painting-Upernavik-2_thumb.jpg',130, 82,18,'																			photo_2825929.html');
												thumbnails[2825932] = new thumbnail(2825932,'176311','','Painting-Upernavik-3_thumb.jpg',130, 95,18,'																			photo_2825932.html');
												thumbnails[2825935] = new thumbnail(2825935,'176311','','Painting-Upernavik-5_thumb.jpg',130, 89,18,'																			photo_2825935.html');
												thumbnails[2825942] = new thumbnail(2825942,'176311','','Painting-Upernavik-6jpg_thumb.jpg',130, 93,18,'																			photo_2825942.html');
												thumbnails[2825944] = new thumbnail(2825944,'176311','','Painting-Upernavik-7jpg_thumb.jpg',130, 87,18,'																			photo_2825944.html');
												thumbnails[2825947] = new thumbnail(2825947,'176311','','Painting-Upernavik-8jpg_thumb.jpg',130, 85,18,'																			photo_2825947.html');
												thumbnails[2825950] = new thumbnail(2825950,'176311','','Painting-Upernavik-9jpg_thumb.jpg',130, 88,18,'																			photo_2825950.html');
												thumbnails[2825952] = new thumbnail(2825952,'176311','','Painting-Upernavik-10ajpg_thumb.JPG',130, 78,18,'																			photo_2825952.html');
												thumbnails[2825955] = new thumbnail(2825955,'176311','','Painting-Upernavik-12_thumb.jpg',130, 96,18,'																			photo_2825955.html');
												thumbnails[2825956] = new thumbnail(2825956,'176311','','Painting-Upernavik-13_thumb.jpg',130, 86,18,'																			photo_2825956.html');
												thumbnails[2826655] = new thumbnail(2826655,'176311','','Upernavik sketchbook-a_thumb.jpg',130, 37,18,'																			photo_2826655.html');
												thumbnails[2826659] = new thumbnail(2826659,'176311','','Upernavik sketchbook-c_thumb.jpg',130, 83,18,'																			photo_2826659.html');
												thumbnails[2826663] = new thumbnail(2826663,'176311','','Upernavik sketchbook-d_thumb.jpg',130, 80,18,'																			photo_2826663.html');
												thumbnails[2826679] = new thumbnail(2826679,'176311','','Upernavik sketchbook-e_thumb.jpg',130, 65,18,'																			photo_2826679.html');
												thumbnails[2851711] = new thumbnail(2851711,'48583','','Ice 1aaa_thumb.jpg',130, 143,18,'																			photo_2851711.html');
												thumbnails[2851759] = new thumbnail(2851759,'48583','','Ice 2aa_thumb.jpg',130, 62,18,'																			photo_2851759.html');
												thumbnails[2851812] = new thumbnail(2851812,'48583','','Painting the Icefjords_thumb.jpg',130, 156,18,'																			photo_2851812.html');
												thumbnails[3223971] = new thumbnail(3223971,'176311','Midnight Sun','new-2_thumb.JPG',130, 98,18,'																			photo_3223971.html');
												thumbnails[3223984] = new thumbnail(3223984,'176311','Midnight Sun Upernavik August 2008','new-3_thumb.JPG',130, 98,18,'																			photo_3223984.html');
												thumbnails[3223985] = new thumbnail(3223985,'176311','UPERNAVIK MIDNIGHT SUN.','new-4_thumb.JPG',130, 98,18,'																			photo_3223985.html');
												thumbnails[3223987] = new thumbnail(3223987,'176311','','new-6_thumb.JPG',130, 98,18,'																			photo_3223987.html');
												thumbnails[3223988] = new thumbnail(3223988,'176311','','new-7_thumb.JPG',130, 98,18,'																			photo_3223988.html');
												thumbnails[3223989] = new thumbnail(3223989,'176311','','new-8_thumb.JPG',130, 98,18,'																			photo_3223989.html');
												thumbnails[3223992] = new thumbnail(3223992,'176311','','new-9_thumb.JPG',130, 173,18,'																			photo_3223992.html');
												thumbnails[6226928] = new thumbnail(6226928,'332334','The Maltese Flag with the George Cross','Maltese_FlagA_thumb.jpg',130, 196,18,'																			photo_6226928.html');
												thumbnails[6227524] = new thumbnail(6227524,'332334','','VallettaA_thumb.jpg',130, 63,18,'																			photo_6227524.html');
												thumbnails[6227904] = new thumbnail(6227904,'332334','','BalconiesA1_thumb.jpg',130, 196,18,'																			photo_6227904.html');
												thumbnails[6227907] = new thumbnail(6227907,'332334','','Birgu_Grand_Harbour_8A1_thumb.jpg',130, 86,18,'																			photo_6227907.html');
												thumbnails[6227938] = new thumbnail(6227938,'332334','','BormlaA1_thumb.jpg',130, 196,18,'																			photo_6227938.html');
												thumbnails[6227965] = new thumbnail(6227965,'332334','','Valletta_detailsA1_thumb.jpg',130, 85,18,'																			photo_6227965.html');
												thumbnails[6227968] = new thumbnail(6227968,'332334','','Siesta_gossipA1_thumb.jpg',130, 86,18,'																			photo_6227968.html');
												thumbnails[6228022] = new thumbnail(6228022,'332334','','Marsaxlokk_Fishing_boats_2A1_thumb.jpg',130, 86,18,'																			photo_6228022.html');
												thumbnails[6228025] = new thumbnail(6228025,'332334','','Marsaxlokk_Fishing_boatsA1_thumb.jpg',130, 86,18,'																			photo_6228025.html');
												thumbnails[6234421] = new thumbnail(6234421,'16368','','DSC_0029_thumb.JPG',130, 63,18,'																			photo_6234421.html');
												thumbnails[6234423] = new thumbnail(6234423,'16368','','MOD3_thumb.jpg',130, 56,18,'																			photo_6234423.html');
												thumbnails[6234425] = new thumbnail(6234425,'16368','','MOD5_thumb.jpg',130, 76,18,'																			photo_6234425.html');
												thumbnails[6234475] = new thumbnail(6234475,'16368','','MOD6_thumb.jpg',130, 75,18,'																			photo_6234475.html');
												thumbnails[6234484] = new thumbnail(6234484,'16368','','MOD7_thumb.jpg',130, 77,18,'																			photo_6234484.html');
												thumbnails[6234529] = new thumbnail(6234529,'16368','','MOD8_thumb.jpg',130, 78,18,'																			photo_6234529.html');
												thumbnails[6234531] = new thumbnail(6234531,'16368','','modA_thumb.jpg',130, 64,18,'																			photo_6234531.html');
												thumbnails[6234533] = new thumbnail(6234533,'16368','','MOD11_thumb.jpg',130, 118,18,'																			photo_6234533.html');
												thumbnails[6234537] = new thumbnail(6234537,'27233','','DSC_0043_thumb.JPG',130, 46,18,'																			photo_6234537.html');
												thumbnails[6234564] = new thumbnail(6234564,'27233','','MOD4_thumb.jpg',130, 81,18,'																			photo_6234564.html');
												thumbnails[6234967] = new thumbnail(6234967,'16368','','DSC_0003_thumb.JPG',130, 35,18,'																			photo_6234967.html');
												thumbnails[6241325] = new thumbnail(6241325,'347363','','mod12_thumb.jpg',130, 86,18,'																			photo_6241325.html');
												thumbnails[6241327] = new thumbnail(6241327,'347363','','mod3_803E0D85-24E8-5EC4-4F5B65F8B70B382B_thumb.jpg',130, 86,18,'																			photo_6241327.html');
												thumbnails[6241329] = new thumbnail(6241329,'347363','','mod4_803ECD8B-24E8-5EC4-4FC47EEFEF549CE9_thumb.jpg',130, 86,18,'																			photo_6241329.html');
												thumbnails[6241331] = new thumbnail(6241331,'347363','','mod5_803F7A95-24E8-5EC4-4F902C11E643DEB9_thumb.jpg',130, 86,18,'																			photo_6241331.html');
												thumbnails[6241334] = new thumbnail(6241334,'347363','','mod6_80405A77-24E8-5EC4-4F1A0425B2A853D5_thumb.jpg',130, 86,18,'																			photo_6241334.html');
												thumbnails[6241336] = new thumbnail(6241336,'347363','','mod7_8040ECA6-24E8-5EC4-4F7FC7F686E8A4F4_thumb.jpg',130, 86,18,'																			photo_6241336.html');
												thumbnails[6241338] = new thumbnail(6241338,'347363','','mod8_80418397-24E8-5EC4-4FDBD54F1D6EF434_thumb.jpg',130, 86,18,'																			photo_6241338.html');
												thumbnails[6241340] = new thumbnail(6241340,'347363','','mod9_thumb.jpg',130, 86,18,'																			photo_6241340.html');
												thumbnails[6244552] = new thumbnail(6244552,'347485','Images still to load','lion_mod_A_thumb.jpg',130, 86,18,'																			photo_6244552.html');
												thumbnails[6244700] = new thumbnail(6244700,'347485','I completed this Lion on behalf of Born Free Foundation. ','mod_lion_JU_thumb.jpg',130, 86,18,'																			photo_6244700.html');
												thumbnails[6244708] = new thumbnail(6244708,'347485','','Mod_Lion_Ju1_thumb.jpg',130, 86,18,'																			photo_6244708.html');
												thumbnails[6244720] = new thumbnail(6244720,'347485','My Lion in the Den, 40 were painted.','Mod_Lion_4_thumb.jpg',130, 86,18,'																			photo_6244720.html');
												thumbnails[6244724] = new thumbnail(6244724,'347485','','Mod_lion_5_thumb.jpg',130, 86,18,'																			photo_6244724.html');
												thumbnails[6244741] = new thumbnail(6244741,'347485','During a painting session.','Mod_Lion_A2_thumb.jpg',130, 86,18,'																			photo_6244741.html');
												thumbnails[6281266] = new thumbnail(6281266,'347363','','mod10A_thumb.jpg',130, 86,18,'																			photo_6281266.html');
												thumbnails[6281296] = new thumbnail(6281296,'347363','','mod8A_thumb.jpg',130, 86,18,'																			photo_6281296.html');
												thumbnails[6281300] = new thumbnail(6281300,'347363','','mod6A_thumb.jpg',130, 86,18,'																			photo_6281300.html');
												thumbnails[6281303] = new thumbnail(6281303,'347363','','mod7A_thumb.jpg',130, 86,18,'																			photo_6281303.html');
												thumbnails[6281312] = new thumbnail(6281312,'27233','','mod_AA_thumb.jpg',130, 166,18,'																			photo_6281312.html');
												thumbnails[6281316] = new thumbnail(6281316,'27233','','Upernavik_painting_thumb.jpg',130, 109,18,'																			photo_6281316.html');
												thumbnails[6281321] = new thumbnail(6281321,'347485','','Photo03_3A_thumb.jpg',130, 231,18,'																			photo_6281321.html');
												thumbnails[6281324] = new thumbnail(6281324,'347485','','Photo11_11A_thumb.jpg',130, 134,18,'																			photo_6281324.html');
												thumbnails[6281325] = new thumbnail(6281325,'347485','','Photo12_12_thumb.jpg',130, 73,18,'																			photo_6281325.html');
												thumbnails[6281326] = new thumbnail(6281326,'347485','','Photo17_17A_thumb.jpg',130, 73,18,'																			photo_6281326.html');
												thumbnails[6281328] = new thumbnail(6281328,'347485','','SAHARA-2AA_thumb.jpg',130, 73,18,'																			photo_6281328.html');
												thumbnails[6302612] = new thumbnail(6302612,'27233','Sedna-Mother of the Sea','mod_A_thumb.jpg',130, 159,18,'																			photo_6302612.html');
												thumbnails[6302942] = new thumbnail(6302942,'332334','','Mod-A_thumb.jpg',130, 98,18,'																			photo_6302942.html');
												thumbnails[6302944] = new thumbnail(6302944,'332334','','mod_f_thumb.jpg',130, 87,18,'																			photo_6302944.html');
												thumbnails[6302949] = new thumbnail(6302949,'332334','','mod_h_thumb.jpg',130, 172,18,'																			photo_6302949.html');
												thumbnails[6302953] = new thumbnail(6302953,'332334','','mod_e_thumb.jpg',130, 95,18,'																			photo_6302953.html');
												thumbnails[6302954] = new thumbnail(6302954,'332334','','mod_k_thumb.jpg',130, 82,18,'																			photo_6302954.html');
												thumbnails[6302957] = new thumbnail(6302957,'332334','','St_Publius_Church_thumb.jpg',130, 128,18,'																			photo_6302957.html');
												thumbnails[6302959] = new thumbnail(6302959,'332334','','Mod_B_thumb.jpg',130, 147,18,'																			photo_6302959.html');
												thumbnails[6302960] = new thumbnail(6302960,'332334','','mod_d_thumb.jpg',130, 98,18,'																			photo_6302960.html');
												thumbnails[2825807] = new thumbnail(2825807,'176311','','Painting-Upernavik-1a_thumb.JPG',130, 86,18,'																			photo_2825807.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[27233] = new gallery(27233,'6302612,6281316,6281312,6234564,6234537,1215688,1215687,1214242,1214131,1122867','Gallery 2 Arctic Landscape','gallery',[180076,459833,459836,459838,459856,459883,459884,459890,459924,589276,643424,643429,643435,1003899,1003902,1122855,1122862,1122867,1214131,1214242,1215687,1215688,6234537,6234564,6281312,6281316,6302612],0, 0, '', '																																																																																																							gallery_27233.html',0,0);
				  					galleries[48583] = new gallery(48583,'2912143,2912122,2912116,2888063,2851812,2851759,2851711,2803722,2803721,2803720','Gallery 3','gallery',[2912116,2912122,2912143,2888063,2803705,2803707,589178,589189,596215,596216,596217,596218,596219,643634,643637,643641,644093,644101,644104,644109,2803708,2803710,2803711,2803714,2803716,2803719,2803720,2803721,2803722,2851711,2851759,2851812],0, 0, '', '																																																																																																							gallery_48583.html',0,0);
				  					galleries[332334] = new gallery(332334,'6302960,6302959,6302957,6302954,6302953,6302949,6302944,6302942,6228025,6228022','Gallery 4-Malta','gallery',[6226928,6227524,6227904,6227907,6227938,6227965,6227968,6228022,6228025,6302942,6302944,6302949,6302953,6302954,6302957,6302959,6302960],0, 0, '', '																																																																																																							gallery_332334.html',0,0);
				  					galleries[347363] = new gallery(347363,'6281303,6281300,6281296,6281266,6241340,6241338,6241336,6241334,6241331,6241329','Gallery 5 Norway','gallery',[6241326,6241325,6241327,6241329,6241331,6241334,6241336,6241338,6241340,6281266,6281296,6281300,6281303],0, 0, '', '																																																																																																							gallery_347363.html',0,0);
				  					galleries[347485] = new gallery(347485,'6281328,6281326,6281325,6281324,6281321,6244741,6244724,6244720,6244708,6244700','Gallery 6 General Art & Photography','gallery',[6244552,6244700,6244708,6244720,6244724,6244741,6281321,6281324,6281325,6281326,6281328],0, 0, '', '																																																																																																							gallery_347485.html',0,0);
				  					galleries[16368] = new gallery(16368,'6234967,6234533,6234531,6234529,6234484,6234475,6234425,6234423,6234421','Gallery 1','gallery',[6234421,6234423,6234425,6234475,6234484,6234529,6234531,6234533,6234967],0, 0, '', '																																																																																																							gallery_16368.html',0,0);
				  					galleries[176311] = new gallery(176311,'3223992,3223989,3223988,3223987,3223985,3223984,3223971,2826679,2826663,2826659','Upernavik North Greenland','gallery',[2825929,2825932,2825935,2825942,2825944,2825947,2825950,2825952,2825955,2825956,2826655,2826659,2826663,2826679,3223971,3223984,3223985,3223987,3223988,3223989,3223992,2825807],0, 0, '', '																																																																																																							gallery_176311.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '2803705,180076';
imageSets[3] = '6302960,6302959,6302957,6302954,6302953,6302949,6302944,6302942,6302612,6281328,6281326,6281325,6281324,6281321,6281316,6281312,6281303,6281300,6281296,6281266,6244741,6244724,6244720,6244708,6244700,6244552,6241340,6241338,6241336,6241334,6241331,6241329,6241327,6241326,6241325,6234967,6234564,6234537,6234533,6234531,6234529,6234484,6234475,6234425,6234423,6234421,6228025,6228022,6227968,6227965';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/charlesb/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/charlesb/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/charlesb/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/charlesb/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/charlesb/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/charlesb/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));		}, 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 = 'Charles Bezzina Art: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      		      options.centre = true;	          	        	      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));    }        
    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 = 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 				&pound;' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = 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 = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="charliebezzina@hotmail.com">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="charliebezzina@hotmail.com">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

