window.thumbnails = {};
															thumbnails[1784888] = clik.newPhoto({"id":1784888,"src":"DSC_3086web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Heidkampf","height":86});
															thumbnails[1827284] = clik.newPhoto({"id":1827284,"src":"DSC_5812web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Wreck hull","height":93});
															thumbnails[3192913] = clik.newPhoto({"id":3192913,"src":"Web_name_graphic_21_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":10});
															thumbnails[3243206] = clik.newPhoto({"id":3243206,"src":"CanonCompacts_web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Canon Compacts","height":49});
															thumbnails[3359722] = clik.newPhoto({"id":3359722,"src":"AboutMe_7web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"About Me_7","height":65});
															thumbnails[3413746] = clik.newPhoto({"id":3413746,"src":"DX-D80_90web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"DX-D80_90web","height":65});
															thumbnails[3581088] = clik.newPhoto({"id":3581088,"src":"DSC_0285cWeb_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Ultimate Reading","height":107});
															thumbnails[3597945] = clik.newPhoto({"id":3597945,"src":"TrevBio_web_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Trev Biography","height":61});
															thumbnails[3622307] = clik.newPhoto({"id":3622307,"src":"DSC_2965cWeb_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Cuckoo","height":97});
															thumbnails[5280648] = clik.newPhoto({"id":5280648,"src":"DSC_2751r.weblinks_2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Links page photo","height":60});
															thumbnails[5681244] = clik.newPhoto({"id":5681244,"src":"DSC_2374cwebcontact_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":171});
															thumbnails[6180965] = clik.newPhoto({"id":6180965,"src":"DX-D80_web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"DX-D80 photos","height":35});
															thumbnails[7602081] = clik.newPhoto({"id":7602081,"src":"WebSiteBioPic_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Bio Pic","height":61});
															thumbnails[8468197] = clik.newPhoto({"id":8468197,"src":"LensesLatest.2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Latest lenses","height":54});
															thumbnails[9056645] = clik.newPhoto({"id":9056645,"src":"DSC_3882crwebart_CE366B04-24E8-5EC4-4F5906D0E70768BD_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Nauti mini dome","height":91});
															thumbnails[5095666] = clik.newPhoto({"id":5095666,"src":"DSC_3339zb2web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Anglerfish","height":92});
															thumbnails[3765228] = clik.newPhoto({"id":3765228,"src":"DSC_1206xmweb21_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Freediver","height":92});
															thumbnails[3641548] = clik.newPhoto({"id":3641548,"src":"tompotsX3web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Blennies","height":85});
															thumbnails[1788081] = clik.newPhoto({"id":1788081,"src":"IMG_5121cweb_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Soup Tin","height":95});
															thumbnails[3220899] = clik.newPhoto({"id":3220899,"src":"DSC_6364mweb_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Hermits","height":92});
															thumbnails[5299216] = clik.newPhoto({"id":5299216,"src":"DSC_6283web_DB4F204F-1D09-001F-9947115E7D23DD32_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sunken boat","height":92});
															thumbnails[3244465] = clik.newPhoto({"id":3244465,"src":"DSC_2845web2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Cool Urchin","height":100});
															thumbnails[4937710] = clik.newPhoto({"id":4937710,"src":"DSC_4449web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"China Rockfish","height":99});
															thumbnails[4937693] = clik.newPhoto({"id":4937693,"src":"DSC_4590web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Metridium","height":182});
															thumbnails[2957672] = clik.newPhoto({"id":2957672,"src":"DSC_1991m2web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_2957672.html","width":130,"caption":"Clown fish","height":102});
															thumbnails[3219567] = clik.newPhoto({"id":3219567,"src":"DSC_7070cmweb_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_3219567.html","width":130,"caption":"Ballan wrasse","height":98});
															thumbnails[3446207] = clik.newPhoto({"id":3446207,"src":"T_ReesBUPGanemonebwwebart_36CBFF99-1E4F-37DC-71C625822949752B_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_3446207.html","width":130,"caption":"Anemone","height":99});
															thumbnails[3568365] = clik.newPhoto({"id":3568365,"src":"DSC_1622m2web_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3568365.html","width":130,"caption":"Perch ","height":184});
															thumbnails[3612167] = clik.newPhoto({"id":3612167,"src":"DSC_6038c2web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_3612167.html","width":130,"caption":"Sunstar & kelp","height":184});
															thumbnails[4066377] = clik.newPhoto({"id":4066377,"src":"DSC_2237cweb_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_4066377.html","width":130,"caption":"Nudibranch","height":92});
															thumbnails[5093370] = clik.newPhoto({"id":5093370,"src":"DSC_3356web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_5093370.html","width":130,"caption":"Goldsinny","height":100});
															thumbnails[8662951] = clik.newPhoto({"id":8662951,"src":"T_Rees_BSoUP_BestofBrit_11web_36EA8829-24E8-5EC4-4FB562DF571AF597_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_8662951.html","width":130,"caption":"Best of British 2011","height":45});
															thumbnails[1783216] = clik.newPhoto({"id":1783216,"src":"DSC_2812web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_1783216.html","width":130,"caption":"Hand\/shotline","height":196});
															thumbnails[1787891] = clik.newPhoto({"id":1787891,"src":"DSC_1641web_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_1787891.html","width":130,"caption":"Wolf fish","height":93});
															thumbnails[3373788] = clik.newPhoto({"id":3373788,"src":"DSC_0568web_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_3373788.html","width":130,"caption":"Mussels","height":86});
															thumbnails[3374423] = clik.newPhoto({"id":3374423,"src":"MartHavNudi_web_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_3374423.html","width":130,"caption":"Nudibranch","height":97});
															thumbnails[3837147] = clik.newPhoto({"id":3837147,"src":"DSC_2384webart_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3837147.html","width":130,"caption":"Frog","height":157});
															thumbnails[4937716] = clik.newPhoto({"id":4937716,"src":"DSC_4962web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937716.html","width":130,"caption":"Nudibranch","height":99});
															thumbnails[5816931] = clik.newPhoto({"id":5816931,"src":"puffersx2webart_12E46A1A-24E8-5EC4-4F10C6DFD63AF957_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_5816931.html","width":130,"caption":"Box fish","height":92});
															thumbnails[7538737] = clik.newPhoto({"id":7538737,"src":"T_Rees.BSoUP_theme_11web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_7538737.html","width":130,"caption":"Theme portfolio 2011","height":98});
															thumbnails[3123281] = clik.newPhoto({"id":3123281,"src":"DSC_1421cweb_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3123281.html","width":130,"caption":"Crayfish","height":173});
															thumbnails[3244499] = clik.newPhoto({"id":3244499,"src":"DSC_2805cweb_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_3244499.html","width":130,"caption":"Umbrella","height":184});
															thumbnails[3375121] = clik.newPhoto({"id":3375121,"src":"DSC_7086bwWeb_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_3375121.html","width":130,"caption":"Wrasse","height":99});
															thumbnails[4085940] = clik.newPhoto({"id":4085940,"src":"DSC_2920web2_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_4085940.html","width":130,"caption":"Sea-gooseberry","height":88});
															thumbnails[4937699] = clik.newPhoto({"id":4937699,"src":"DSC_4168web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937699.html","width":130,"caption":"Red Eye Medusa","height":104});
															thumbnails[5552439] = clik.newPhoto({"id":5552439,"src":"DSC_2072cweb_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_5552439.html","width":130,"caption":"Shrimp","height":100});
															thumbnails[5934449] = clik.newPhoto({"id":5934449,"src":"DSC_0708cwebart_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_5934449.html","width":130,"caption":"Rockling","height":83});
															thumbnails[8662987] = clik.newPhoto({"id":8662987,"src":"DSC_9790web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_8662987.html","width":130,"caption":"Nudibranch","height":92});
															thumbnails[1780121] = clik.newPhoto({"id":1780121,"src":"IMG_2289web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1780121.html","width":130,"caption":"Cave Divers","height":97});
															thumbnails[2468776] = clik.newPhoto({"id":2468776,"src":"DSC_9232cweb_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_2468776.html","width":130,"caption":"Conger eel","height":87});
															thumbnails[3216575] = clik.newPhoto({"id":3216575,"src":"IMG_7468web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_3216575.html","width":130,"caption":"Light rays","height":184});
															thumbnails[3373827] = clik.newPhoto({"id":3373827,"src":"DSC_0596cweb_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_3373827.html","width":130,"caption":"Flame shell","height":92});
															thumbnails[3375054] = clik.newPhoto({"id":3375054,"src":"DSC_0677cbwweb12_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_3375054.html","width":130,"caption":"Sea squirts","height":93});
															thumbnails[3836350] = clik.newPhoto({"id":3836350,"src":"DSC_2102web_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3836350.html","width":130,"caption":"Common Newt","height":184});
															thumbnails[5093266] = clik.newPhoto({"id":5093266,"src":"DSC_3096web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_5093266.html","width":130,"caption":"Plaice","height":89});
															thumbnails[5816967] = clik.newPhoto({"id":5816967,"src":"DSC_2878webart_12EF0108-24E8-5EC4-4F67DB1FD383B427_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_5816967.html","width":130,"caption":"Spider crab","height":92});
															thumbnails[1783143] = clik.newPhoto({"id":1783143,"src":"IMG_2502web_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_1783143.html","width":130,"caption":"Hermit crab","height":92});
															thumbnails[1791119] = clik.newPhoto({"id":1791119,"src":"DSC_3380web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_1791119.html","width":130,"caption":"Hamburg wreck","height":89});
															thumbnails[1827306] = clik.newPhoto({"id":1827306,"src":"DSC_5727b&wWeb_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_1827306.html","width":130,"caption":"Mini","height":87});
															thumbnails[3097925] = clik.newPhoto({"id":3097925,"src":"DSC_1510web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_3097925.html","width":130,"caption":"Puffer fish eye","height":108});
															thumbnails[3122219] = clik.newPhoto({"id":3122219,"src":"DSC_1490web_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3122219.html","width":130,"caption":"Pike","height":82});
															thumbnails[3220901] = clik.newPhoto({"id":3220901,"src":"DSC_5998cweb_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_3220901.html","width":130,"caption":"Edible Crabs","height":92});
															thumbnails[5263406] = clik.newPhoto({"id":5263406,"src":"T_Rees_Op09web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_5263406.html","width":130,"caption":"Open portfolio 2009","height":98});
															thumbnails[5956551] = clik.newPhoto({"id":5956551,"src":"DSC_3532web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_5956551.html","width":130,"caption":"Grey Seal","height":89});
															thumbnails[1784882] = clik.newPhoto({"id":1784882,"src":"DSC_7175web_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_1784882.html","width":130,"caption":"Norway lobster","height":92});
															thumbnails[1784891] = clik.newPhoto({"id":1784891,"src":"IMG_0023web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1784891.html","width":130,"caption":"Tubeworm","height":92});
															thumbnails[1784917] = clik.newPhoto({"id":1784917,"src":"IMG_1648web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_1784917.html","width":130,"caption":"Cuttlefish ","height":92});
															thumbnails[2211283] = clik.newPhoto({"id":2211283,"src":"T_Rees_thumb.MacroWeb.jpg","galleries_id":119300,"server_id":1,"link":"photo_2211283.html","width":130,"caption":"Jewels","height":97});
															thumbnails[3375072] = clik.newPhoto({"id":3375072,"src":"IMG_3711cB&Wweb_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_3375072.html","width":130,"caption":"Dahlia ","height":92});
															thumbnails[3568677] = clik.newPhoto({"id":3568677,"src":"DSC_0555cWeb_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3568677.html","width":130,"caption":"Trout","height":90});
															thumbnails[4954237] = clik.newPhoto({"id":4954237,"src":"T_Rees_Brit09web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_4954237.html","width":130,"caption":"UK Portfolio 2009","height":97});
															thumbnails[5095674] = clik.newPhoto({"id":5095674,"src":"DSC_3487web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_5095674.html","width":130,"caption":"Lumpsucker","height":92});
															thumbnails[1779594] = clik.newPhoto({"id":1779594,"src":"IMG_1655web_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_1779594.html","width":130,"caption":"Cuttlefish ","height":92});
															thumbnails[1783078] = clik.newPhoto({"id":1783078,"src":"DSC_1758mweb_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1783078.html","width":130,"caption":"Big Eye","height":92});
															thumbnails[2257861] = clik.newPhoto({"id":2257861,"src":"DSC_8208web_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_2257861.html","width":130,"caption":"Lobster","height":92});
															thumbnails[2468908] = clik.newPhoto({"id":2468908,"src":"DSC_9183bw-web_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_2468908.html","width":130,"caption":"Flatworm","height":87});
															thumbnails[3568805] = clik.newPhoto({"id":3568805,"src":"DSC_5226mWeb_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3568805.html","width":130,"caption":"Carp","height":95});
															thumbnails[3602601] = clik.newPhoto({"id":3602601,"src":"BSoUP_theme09web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_3602601.html","width":130,"caption":"Theme Portfolio 2009","height":97});
															thumbnails[3914056] = clik.newPhoto({"id":3914056,"src":"DSC_2263web_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_3914056.html","width":130,"caption":"Barnacles","height":97});
															thumbnails[4937705] = clik.newPhoto({"id":4937705,"src":"DSC_5489web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937705.html","width":130,"caption":"Kelp Greenling","height":94});
															thumbnails[1779026] = clik.newPhoto({"id":1779026,"src":"DSC_5501mweb_thumb.jpg","galleries_id":119322,"server_id":1,"link":"photo_1779026.html","width":130,"caption":"Diver & Carp","height":92});
															thumbnails[1788781] = clik.newPhoto({"id":1788781,"src":"DSC_2208web_thumb.jpg","galleries_id":119300,"server_id":1,"link":"photo_1788781.html","width":130,"caption":"Snake pipefish","height":92});
															thumbnails[1827267] = clik.newPhoto({"id":1827267,"src":"DSC_5804bwWeb_thumb.jpg","galleries_id":206104,"server_id":1,"link":"photo_1827267.html","width":130,"caption":"Teckie","height":91});
															thumbnails[2272282] = clik.newPhoto({"id":2272282,"src":"DSC_4612web_thumb.jpg","galleries_id":119321,"server_id":1,"link":"photo_2272282.html","width":130,"caption":"Crawfish","height":95});
															thumbnails[3216650] = clik.newPhoto({"id":3216650,"src":"DSC_1496mweb_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_3216650.html","width":130,"caption":"Two Pike","height":91});
															thumbnails[3568544] = clik.newPhoto({"id":3568544,"src":"DSC_4168zbWeb_thumb.jpg","galleries_id":218175,"server_id":1,"link":"photo_3568544.html","width":130,"caption":"Roach","height":83});
															thumbnails[5093374] = clik.newPhoto({"id":5093374,"src":"DSC_0527cweb_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_5093374.html","width":130,"caption":"Bib shoal","height":87});
															thumbnails[5552443] = clik.newPhoto({"id":5552443,"src":"DSC_1214mwebart_E2003E0E-24E8-5EC4-4F2D1C63894C2A2C_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_5552443.html","width":130,"caption":"Glass fish","height":108});
															thumbnails[2945387] = clik.newPhoto({"id":2945387,"src":"UK portfolio_08web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_2945387.html","width":130,"caption":"UK portfolio 2008","height":97});
															thumbnails[3218985] = clik.newPhoto({"id":3218985,"src":"IMG_2302cweb_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_3218985.html","width":130,"caption":"Canyon","height":184});
															thumbnails[4937694] = clik.newPhoto({"id":4937694,"src":"DSC_4658web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937694.html","width":130,"caption":"Wall & Diver","height":187});
															thumbnails[1783010] = clik.newPhoto({"id":1783010,"src":"T_Rees_Brit07web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_1783010.html","width":130,"caption":"UK portfolio 2007","height":97});
															thumbnails[1798100] = clik.newPhoto({"id":1798100,"src":"DSC_0897web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1798100.html","width":130,"caption":"Frogfish","height":184});
															thumbnails[5094564] = clik.newPhoto({"id":5094564,"src":"DSC_3213web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_5094564.html","width":130,"caption":"Hydroid","height":190});
															thumbnails[1780123] = clik.newPhoto({"id":1780123,"src":"IMG_2331web1_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1780123.html","width":130,"caption":"Jellyfish\/Diver","height":184});
															thumbnails[1783029] = clik.newPhoto({"id":1783029,"src":"DSC_0875web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_1783029.html","width":130,"caption":"Rockpool","height":92});
															thumbnails[4937692] = clik.newPhoto({"id":4937692,"src":"DSC_4784web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937692.html","width":130,"caption":"Telia & Kelp","height":189});
															thumbnails[1785273] = clik.newPhoto({"id":1785273,"src":"DSC_1156web_thumb.jpg","galleries_id":119325,"server_id":1,"link":"photo_1785273.html","width":130,"caption":"Diver & Fish","height":184});
															thumbnails[2468553] = clik.newPhoto({"id":2468553,"src":"DSC_4040web_thumb.jpg","galleries_id":119324,"server_id":1,"link":"photo_2468553.html","width":130,"caption":"Diver & Dome","height":92});
															thumbnails[4937531] = clik.newPhoto({"id":4937531,"src":"DSC_5157web_thumb.jpg","galleries_id":280963,"server_id":1,"link":"photo_4937531.html","width":130,"caption":"Diver & Kelp","height":190});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[119300] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Macro ","link":"gallery_119300.html","maxRecords":0.0,"photoIDs":[4066377.0,3373788.0,4085940.0,3373827.0,1783143.0,2211283.0,3914056.0,1788781.0],"skipIndex":0,"section_code":"gallery","featured_images":"4085940,4066377,3914056,3373827,3373788,2211283,1788781,1783143","id":119300,"singleSection":false});				  						galleries[119321] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Medium size","link":"gallery_119321.html","maxRecords":0.0,"photoIDs":[3219567.0,1787891.0,5934449.0,2468776.0,3220901.0,1784882.0,2257861.0,2272282.0],"skipIndex":0,"section_code":"gallery","featured_images":"5934449,3220901,3219567,2468776,2272282,2257861,1787891,1784882","id":119321,"singleSection":false});				  						galleries[119322] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wide angle","link":"gallery_119322.html","maxRecords":0.0,"photoIDs":[3612167.0,1783216.0,3244499.0,3216575.0,5956551.0,1784917.0,1779594.0,1779026.0],"skipIndex":0,"section_code":"gallery","featured_images":"5956551,3612167,3244499,3216575,1784917,1783216,1779594,1779026","id":119322,"singleSection":false});				  						galleries[218175] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Freshwater","link":"gallery_218175.html","maxRecords":0.0,"photoIDs":[3568365.0,3837147.0,3123281.0,3836350.0,3122219.0,3568677.0,3568805.0,3568544.0],"skipIndex":0,"section_code":"gallery","featured_images":"3837147,3836350,3568805,3568677,3568544,3568365,3123281,3122219","id":218175,"singleSection":false});				  						galleries[206104] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Monochrome","link":"gallery_206104.html","maxRecords":0.0,"photoIDs":[3446207.0,3374423.0,3375121.0,3375054.0,1827306.0,3375072.0,2468908.0,1827267.0],"skipIndex":0,"section_code":"gallery","featured_images":"3446207,3375121,3375072,3375054,3374423,2468908,1827306,1827267","id":206104,"singleSection":false});				  						galleries[280963] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Overseas\/Cold","link":"gallery_280963.html","maxRecords":0.0,"photoIDs":[5093370.0,4937716.0,4937699.0,5093266.0,1791119.0,5095674.0,4937705.0,5093374.0,4937694.0,5094564.0,4937692.0,4937531.0],"skipIndex":0,"section_code":"gallery","featured_images":"5095674,5094564,5093374,5093370,5093266,4937716,4937705,4937699,4937694,4937692","id":280963,"singleSection":false});				  						galleries[119325] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Overseas\/Warm","link":"gallery_119325.html","maxRecords":0.0,"photoIDs":[2957672.0,5816931.0,5552439.0,1780121.0,3097925.0,1784891.0,1783078.0,5552443.0,3218985.0,1798100.0,1780123.0,1785273.0],"skipIndex":0,"section_code":"gallery","featured_images":"5816931,5552443,5552439,3218985,3097925,2957672,1798100,1785273,1784891,1783078","id":119325,"singleSection":false});				  						galleries[119324] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Awards","link":"gallery_119324.html","maxRecords":0.0,"photoIDs":[8662951.0,7538737.0,8662987.0,5816967.0,5263406.0,4954237.0,3602601.0,3216650.0,2945387.0,1783010.0,1783029.0,2468553.0],"skipIndex":0,"section_code":"gallery","featured_images":"8662987,8662951,7538737,5816967,5263406,4954237,3602601,3216650,2945387,2468553","id":119324,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3622307,3581088,1827284,5093370,4066377,3612167,3568365,3446207,3219567,3374423,3373788,1787891,8662987,5934449,4937699,4085940,3244499,3123281,5816967,5093266,3836350,3641548,3375054,3373827,2468776,3220901,3122219,1827306,1791119,1783143,5299216,5095674,3568677,3375072,3220899,2211283,1784917,1784882,3914056,3568805,2468908,2257861,1779594,5093374,3568544,3216650,1788781,1783029,2468553';
imageSets[3] = '9056645,8662987,8662951,8468197,7602081,7538737,6180965,5956551,5934449,5816967,5816931,5681244,5552443,5552439,5299216,5280648,5263406,5095674,5095666,5094564,5093374,5093370,5093266,4954237,4937716,4937710,4937705,4937699,4937694,4937693,4937692,4937531,4085940,4066377,3914056,3837147,3836350,3765228,3641548,3622307,3612167,3602601,3597945,3581088,3568805,3568677,3568544,3568365,3446207,3413746';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/trevorrees/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/trevorrees/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 = 'Trevor Rees Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Camera </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;
	}
}

			

