window.thumbnails = {};
															thumbnails[3318858] = clik.newPhoto({"id":3318858,"src":"zenit-e_thumb.JPG","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":98});
															thumbnails[3331650] = clik.newPhoto({"id":3331650,"src":"logo_450x80_thumb.JPG","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":23});
															thumbnails[3463656] = clik.newPhoto({"id":3463656,"src":"Banner550x100_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":26});
															thumbnails[3790079] = clik.newPhoto({"id":3790079,"src":"FullCircle_sml1_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790079.html","width":130,"caption":"","height":156});
															thumbnails[4703054] = clik.newPhoto({"id":4703054,"src":"Ally_window_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703054.html","width":130,"caption":"","height":196});
															thumbnails[8999314] = clik.newPhoto({"id":8999314,"src":"Caves2_thumb_04552DB1-1EC9-DFB6-096851FEB450862A.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999314.html","width":130,"caption":"","height":145});
															thumbnails[4703055] = clik.newPhoto({"id":4703055,"src":"Ally_window2_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703055.html","width":130,"caption":"","height":207});
															thumbnails[3790077] = clik.newPhoto({"id":3790077,"src":"FullCircle_sml_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790077.html","width":130,"caption":"","height":197});
															thumbnails[3971271] = clik.newPhoto({"id":3971271,"src":"DSC_0137_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971271.html","width":130,"caption":"","height":195});
															thumbnails[4208761] = clik.newPhoto({"id":4208761,"src":"DR_sml_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_4208761.html","width":130,"caption":"","height":156});
															thumbnails[4703053] = clik.newPhoto({"id":4703053,"src":"Ally-Arrive_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703053.html","width":130,"caption":"","height":195});
															thumbnails[4724368] = clik.newPhoto({"id":4724368,"src":"D30_0040_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724368.html","width":130,"caption":"","height":196});
															thumbnails[5355680] = clik.newPhoto({"id":5355680,"src":"JM_Hazlewood6_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355680.html","width":130,"caption":"","height":196});
															thumbnails[7288458] = clik.newPhoto({"id":7288458,"src":"NA11_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288458.html","width":130,"caption":"","height":195});
															thumbnails[8249853] = clik.newPhoto({"id":8249853,"src":"Inchcolm_001_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249853.html","width":130,"caption":"","height":195});
															thumbnails[8999016] = clik.newPhoto({"id":8999016,"src":"Caves1_thumb_00FC7CED-1EC9-D45B-1C1DFB758E161361.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999016.html","width":130,"caption":"","height":103});
															thumbnails[9044494] = clik.newPhoto({"id":9044494,"src":"012-013_thumb.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044494.html","width":130,"caption":"","height":89});
															thumbnails[4703056] = clik.newPhoto({"id":4703056,"src":"AB1_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703056.html","width":130,"caption":"","height":195});
															thumbnails[8999319] = clik.newPhoto({"id":8999319,"src":"Caves3_thumb.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999319.html","width":130,"caption":"","height":95});
															thumbnails[3674371] = clik.newPhoto({"id":3674371,"src":"DSC_0008_sml_thumb.JPG","galleries_id":224446,"server_id":15,"link":"photo_3674371.html","width":130,"caption":"","height":194});
															thumbnails[3790082] = clik.newPhoto({"id":3790082,"src":"FullCircle_sml2_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790082.html","width":130,"caption":"","height":128});
															thumbnails[4703057] = clik.newPhoto({"id":4703057,"src":"AB2_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703057.html","width":130,"caption":"","height":87});
															thumbnails[4724369] = clik.newPhoto({"id":4724369,"src":"D30_0138_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724369.html","width":130,"caption":"","height":86});
															thumbnails[5355678] = clik.newPhoto({"id":5355678,"src":"JM_Hazlewood4_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355678.html","width":130,"caption":"","height":86});
															thumbnails[7288504] = clik.newPhoto({"id":7288504,"src":"NA21_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288504.html","width":130,"caption":"","height":185});
															thumbnails[8249866] = clik.newPhoto({"id":8249866,"src":"Inchcolm_002_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249866.html","width":130,"caption":"","height":86});
															thumbnails[8999322] = clik.newPhoto({"id":8999322,"src":"Caves4_thumb.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999322.html","width":130,"caption":"","height":196});
															thumbnails[9044510] = clik.newPhoto({"id":9044510,"src":"Greenock_Wedding_2_thumb_40ACCDCA-1EC9-D45B-1C4E46EE3E1DBAD7.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044510.html","width":130,"caption":"","height":89});
															thumbnails[4703059] = clik.newPhoto({"id":4703059,"src":"AB6_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703059.html","width":130,"caption":"","height":163});
															thumbnails[4703060] = clik.newPhoto({"id":4703060,"src":"AB5_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703060.html","width":130,"caption":"","height":195});
															thumbnails[8999328] = clik.newPhoto({"id":8999328,"src":"Caves5_thumb.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999328.html","width":130,"caption":"","height":205});
															thumbnails[3674374] = clik.newPhoto({"id":3674374,"src":"DSC_0029_sml_thumb.JPG","galleries_id":224446,"server_id":15,"link":"photo_3674374.html","width":130,"caption":"","height":188});
															thumbnails[3790083] = clik.newPhoto({"id":3790083,"src":"FullCircle_sml3_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790083.html","width":130,"caption":"","height":151});
															thumbnails[3971269] = clik.newPhoto({"id":3971269,"src":"DSC_0115_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971269.html","width":130,"caption":"","height":195});
															thumbnails[4703058] = clik.newPhoto({"id":4703058,"src":"AB3_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703058.html","width":130,"caption":"","height":86});
															thumbnails[4724370] = clik.newPhoto({"id":4724370,"src":"D30_0081_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724370.html","width":130,"caption":"","height":156});
															thumbnails[5355676] = clik.newPhoto({"id":5355676,"src":"JM_Hazlewood1_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355676.html","width":130,"caption":"","height":196});
															thumbnails[7288483] = clik.newPhoto({"id":7288483,"src":"NA3_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288483.html","width":130,"caption":"","height":182});
															thumbnails[8249871] = clik.newPhoto({"id":8249871,"src":"Inchcolm_003_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249871.html","width":130,"caption":"","height":86});
															thumbnails[8999336] = clik.newPhoto({"id":8999336,"src":"Caves6_thumb.jpg","galleries_id":473955,"server_id":15,"link":"photo_8999336.html","width":130,"caption":"","height":87});
															thumbnails[9044514] = clik.newPhoto({"id":9044514,"src":"Greenock_Wedding_3_thumb_409E8C0A-1EC9-D45B-1C737B006E1B1FC7.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044514.html","width":130,"caption":"","height":96});
															thumbnails[3971270] = clik.newPhoto({"id":3971270,"src":"DSC_0059_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971270.html","width":130,"caption":"","height":87});
															thumbnails[4703061] = clik.newPhoto({"id":4703061,"src":"AB4_thumb.jpg","galleries_id":270468,"server_id":15,"link":"photo_4703061.html","width":130,"caption":"","height":183});
															thumbnails[3790084] = clik.newPhoto({"id":3790084,"src":"FullCircle_sml4_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790084.html","width":130,"caption":"","height":87});
															thumbnails[3971256] = clik.newPhoto({"id":3971256,"src":"DSC_0058_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971256.html","width":130,"caption":"","height":114});
															thumbnails[4724372] = clik.newPhoto({"id":4724372,"src":"D30_0172_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724372.html","width":130,"caption":"","height":196});
															thumbnails[5193807] = clik.newPhoto({"id":5193807,"src":"Portrait2_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_5193807.html","width":130,"caption":"","height":87});
															thumbnails[5355681] = clik.newPhoto({"id":5355681,"src":"JM_Hazlewood2_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355681.html","width":130,"caption":"","height":195});
															thumbnails[7288683] = clik.newPhoto({"id":7288683,"src":"NA4123_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288683.html","width":130,"caption":"","height":86});
															thumbnails[8249929] = clik.newPhoto({"id":8249929,"src":"Inchcolm_008_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249929.html","width":130,"caption":"","height":195});
															thumbnails[9044526] = clik.newPhoto({"id":9044526,"src":"Greenock_Wedding_4_thumb_4092FF01-1EC9-D45B-1C53F3571E4ECF8A.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044526.html","width":130,"caption":"","height":100});
															thumbnails[3790086] = clik.newPhoto({"id":3790086,"src":"FullCircle_sml5_thumb.JPG","galleries_id":231030,"server_id":15,"link":"photo_3790086.html","width":130,"caption":"","height":101});
															thumbnails[3971273] = clik.newPhoto({"id":3971273,"src":"DSC_0199_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971273.html","width":130,"caption":"","height":122});
															thumbnails[4724373] = clik.newPhoto({"id":4724373,"src":"DSC_0043_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724373.html","width":130,"caption":"","height":87});
															thumbnails[5355683] = clik.newPhoto({"id":5355683,"src":"JM_Hazlewood3_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355683.html","width":130,"caption":"","height":86});
															thumbnails[7288667] = clik.newPhoto({"id":7288667,"src":"NA51_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288667.html","width":130,"caption":"","height":86});
															thumbnails[8999851] = clik.newPhoto({"id":8999851,"src":"DSC_0159S_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8999851.html","width":130,"caption":"","height":194});
															thumbnails[9044562] = clik.newPhoto({"id":9044562,"src":"Greenock_Wedding_5_thumb.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044562.html","width":130,"caption":"","height":86});
															thumbnails[4537724] = clik.newPhoto({"id":4537724,"src":"D80_0089_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_4537724.html","width":130,"caption":"","height":163});
															thumbnails[4724374] = clik.newPhoto({"id":4724374,"src":"D30_0351_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724374.html","width":130,"caption":"","height":196});
															thumbnails[5193474] = clik.newPhoto({"id":5193474,"src":"D30_0069s_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_5193474.html","width":130,"caption":"","height":114});
															thumbnails[5355686] = clik.newPhoto({"id":5355686,"src":"JM_Hazlewood5_thumb.jpg","galleries_id":301639,"server_id":15,"link":"photo_5355686.html","width":130,"caption":"","height":196});
															thumbnails[7288656] = clik.newPhoto({"id":7288656,"src":"NA6_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288656.html","width":130,"caption":"","height":86});
															thumbnails[8249932] = clik.newPhoto({"id":8249932,"src":"Inchcolm_010_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249932.html","width":130,"caption":"","height":206});
															thumbnails[9044601] = clik.newPhoto({"id":9044601,"src":"Greenock_Wedding_6_thumb_420B2CD3-1EC9-D45B-1C0972DBD98F773B.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044601.html","width":130,"caption":"","height":99});
															thumbnails[3971274] = clik.newPhoto({"id":3971274,"src":"DSC_0190_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971274.html","width":130,"caption":"","height":183});
															thumbnails[4659687] = clik.newPhoto({"id":4659687,"src":"Full_Circle_1_thumb.jpg","galleries_id":231030,"server_id":15,"link":"photo_4659687.html","width":130,"caption":"","height":85});
															thumbnails[4724376] = clik.newPhoto({"id":4724376,"src":"D30_0367_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724376.html","width":130,"caption":"","height":109});
															thumbnails[5193541] = clik.newPhoto({"id":5193541,"src":"D30_0178s_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_5193541.html","width":130,"caption":"","height":113});
															thumbnails[5193590] = clik.newPhoto({"id":5193590,"src":"D30_0082s_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_5193590.html","width":130,"caption":"","height":100});
															thumbnails[7288671] = clik.newPhoto({"id":7288671,"src":"NA7_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288671.html","width":130,"caption":"","height":86});
															thumbnails[8249908] = clik.newPhoto({"id":8249908,"src":"Inchcolm_004_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249908.html","width":130,"caption":"","height":86});
															thumbnails[9044662] = clik.newPhoto({"id":9044662,"src":"Greenock_Wedding_7_thumb_417C7800-1EC9-D45B-1CCD18304499B5A7.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044662.html","width":130,"caption":"","height":94});
															thumbnails[3971290] = clik.newPhoto({"id":3971290,"src":"DSC_0234_thumb.jpg","galleries_id":263433,"server_id":15,"link":"photo_3971290.html","width":130,"caption":"","height":86});
															thumbnails[4659693] = clik.newPhoto({"id":4659693,"src":"Full_Circle_2_thumb.jpg","galleries_id":231030,"server_id":15,"link":"photo_4659693.html","width":130,"caption":"","height":196});
															thumbnails[4724377] = clik.newPhoto({"id":4724377,"src":"D30_0299_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724377.html","width":130,"caption":"","height":108});
															thumbnails[7288685] = clik.newPhoto({"id":7288685,"src":"NA8_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288685.html","width":130,"caption":"","height":86});
															thumbnails[7289519] = clik.newPhoto({"id":7289519,"src":"Watson3_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_7289519.html","width":130,"caption":"","height":160});
															thumbnails[8249950] = clik.newPhoto({"id":8249950,"src":"Inchcolm_005_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249950.html","width":130,"caption":"","height":57});
															thumbnails[9044667] = clik.newPhoto({"id":9044667,"src":"Greenock_Wedding_8_thumb_41ABE73D-1EC9-D45B-1CEF7B53C18C7624.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044667.html","width":130,"caption":"","height":91});
															thumbnails[4659699] = clik.newPhoto({"id":4659699,"src":"Full_Circle_3_thumb.jpg","galleries_id":231030,"server_id":15,"link":"photo_4659699.html","width":130,"caption":"","height":86});
															thumbnails[4724378] = clik.newPhoto({"id":4724378,"src":"DSC_0085_thumb.jpg","galleries_id":271274,"server_id":15,"link":"photo_4724378.html","width":130,"caption":"","height":109});
															thumbnails[7288687] = clik.newPhoto({"id":7288687,"src":"NA9_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288687.html","width":130,"caption":"","height":86});
															thumbnails[7289523] = clik.newPhoto({"id":7289523,"src":"Watson2_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_7289523.html","width":130,"caption":"","height":147});
															thumbnails[9044713] = clik.newPhoto({"id":9044713,"src":"Greenock_Wedding_9_thumb_423AF729-1EC9-D45B-1CCD32211A77F126.jpg","galleries_id":476663,"server_id":15,"link":"photo_9044713.html","width":130,"caption":"","height":89});
															thumbnails[3301025] = clik.newPhoto({"id":3301025,"src":"TD_Group1_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301025.html","width":130,"caption":"","height":93});
															thumbnails[7288691] = clik.newPhoto({"id":7288691,"src":"NA12_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288691.html","width":130,"caption":"","height":86});
															thumbnails[7289524] = clik.newPhoto({"id":7289524,"src":"Watson_-_Montage_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_7289524.html","width":130,"caption":"","height":52});
															thumbnails[8249940] = clik.newPhoto({"id":8249940,"src":"Inchcolm_007_thumb.jpg","galleries_id":439351,"server_id":15,"link":"photo_8249940.html","width":130,"caption":"","height":86});
															thumbnails[3301026] = clik.newPhoto({"id":3301026,"src":"SM1_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301026.html","width":130,"caption":"","height":184});
															thumbnails[7288694] = clik.newPhoto({"id":7288694,"src":"NA10_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288694.html","width":130,"caption":"","height":194});
															thumbnails[8999435] = clik.newPhoto({"id":8999435,"src":"KB11_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_8999435.html","width":130,"caption":"","height":94});
															thumbnails[3301031] = clik.newPhoto({"id":3301031,"src":"Kids_Settee_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301031.html","width":130,"caption":"","height":94});
															thumbnails[7288695] = clik.newPhoto({"id":7288695,"src":"NA111_thumb.jpg","galleries_id":394198,"server_id":15,"link":"photo_7288695.html","width":130,"caption":"","height":86});
															thumbnails[8999465] = clik.newPhoto({"id":8999465,"src":"KB2_thumb.jpg","galleries_id":224446,"server_id":15,"link":"photo_8999465.html","width":130,"caption":"","height":93});
															thumbnails[3301034] = clik.newPhoto({"id":3301034,"src":"SM_Church1_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301034.html","width":130,"caption":"","height":194});
															thumbnails[3301047] = clik.newPhoto({"id":3301047,"src":"Rings_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301047.html","width":130,"caption":"","height":86});
															thumbnails[3301069] = clik.newPhoto({"id":3301069,"src":"SM_Church2_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301069.html","width":130,"caption":"","height":195});
															thumbnails[3301040] = clik.newPhoto({"id":3301040,"src":"SM_Church4_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301040.html","width":130,"caption":"","height":87});
															thumbnails[3301340] = clik.newPhoto({"id":3301340,"src":"Orchid_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301340.html","width":130,"caption":"","height":87});
															thumbnails[3306557] = clik.newPhoto({"id":3306557,"src":"Ring2_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3306557.html","width":130,"caption":"","height":86});
															thumbnails[3301058] = clik.newPhoto({"id":3301058,"src":"SM_Rec2_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301058.html","width":130,"caption":"","height":165});
															thumbnails[3301060] = clik.newPhoto({"id":3301060,"src":"TD_Statue1_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301060.html","width":130,"caption":"","height":194});
															thumbnails[3301018] = clik.newPhoto({"id":3301018,"src":"SM_Rec3_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3301018.html","width":130,"caption":"","height":195});
															thumbnails[3332745] = clik.newPhoto({"id":3332745,"src":"TD_Cake_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3332745.html","width":130,"caption":"","height":194});
															thumbnails[3332742] = clik.newPhoto({"id":3332742,"src":"T+D_Humanist_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3332742.html","width":130,"caption":"","height":89});
															thumbnails[3332748] = clik.newPhoto({"id":3332748,"src":"SM_Rec1_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3332748.html","width":130,"caption":"","height":195});
															thumbnails[3332749] = clik.newPhoto({"id":3332749,"src":"TD_Flower_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3332749.html","width":130,"caption":"","height":194});
															thumbnails[3332750] = clik.newPhoto({"id":3332750,"src":"T+D_Mirror_thumb.JPG","galleries_id":201269,"server_id":15,"link":"photo_3332750.html","width":130,"caption":"","height":194});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[263431] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Wedding","link":"gallery_263431.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":3301069.0,"id":263431,"singleSection":false});				  						galleries[201269] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Portfolio","link":"gallery_201269.html","maxRecords":0.0,"photoIDs":[3301025.0,3301026.0,3301031.0,3301034.0,3301047.0,3301069.0,3301040.0,3301340.0,3306557.0,3301058.0,3301060.0,3301018.0,3332745.0,3332742.0,3332748.0,3332749.0,3332750.0],"skipIndex":0,"section_code":"gallery","featured_images":3301069.0,"id":201269,"singleSection":false});				  						galleries[263433] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Gina and Greig","link":"gallery_263433.html","maxRecords":0.0,"photoIDs":[3971271.0,3971269.0,3971270.0,3971256.0,3971273.0,4537724.0,3971274.0,3971290.0],"skipIndex":0,"section_code":"gallery","featured_images":"4537724,3971290,3971274,3971273,3971271,3971270,3971269,3971256","id":263433,"singleSection":false});				  						galleries[224446] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Portrait","link":"gallery_224446.html","maxRecords":0.0,"photoIDs":[4208761.0,3674371.0,3674374.0,5193807.0,5193474.0,5193541.0,5193590.0,7289519.0,7289523.0,7289524.0,8999435.0,8999465.0],"skipIndex":0,"section_code":"gallery","featured_images":"8999465,8999435,7289524,7289523,7289519,5193807,5193590,5193541,5193474,4208761","id":224446,"singleSection":false});				  						galleries[270468] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Allison and Barry","link":"gallery_270468.html","maxRecords":0.0,"photoIDs":[4703054.0,4703055.0,4703053.0,4703056.0,4703057.0,4703059.0,4703060.0,4703058.0,4703061.0],"skipIndex":0,"section_code":"gallery","featured_images":"4703061,4703060,4703059,4703058,4703057,4703056,4703055,4703054,4703053","id":270468,"singleSection":false});				  						galleries[231030] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Promotional","link":"gallery_231030.html","maxRecords":0.0,"photoIDs":[3790079.0,3790077.0,3790082.0,3790083.0,3790084.0,3790086.0,4659687.0,4659693.0,4659699.0],"skipIndex":0,"section_code":"gallery","featured_images":3790079.0,"id":231030,"singleSection":false});				  						galleries[271274] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Paula and Tim","link":"gallery_271274.html","maxRecords":0.0,"photoIDs":[4724368.0,4724369.0,4724370.0,4724372.0,4724373.0,4724374.0,4724376.0,4724377.0,4724378.0],"skipIndex":0,"section_code":"gallery","featured_images":"4724378,4724377,4724376,4724374,4724373,4724372,4724370,4724369,4724368","id":271274,"singleSection":false});				  						galleries[301639] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Joanne and Matt","link":"gallery_301639.html","maxRecords":0.0,"photoIDs":[5355680.0,5355678.0,5355676.0,5355681.0,5355683.0,5355686.0],"skipIndex":0,"section_code":"gallery","featured_images":"5355686,5355683,5355681,5355680,5355678,5355676","id":301639,"singleSection":false});				  						galleries[394198] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Natalie and Andrew","link":"gallery_394198.html","maxRecords":0.0,"photoIDs":[7288458.0,7288504.0,7288483.0,7288683.0,7288667.0,7288656.0,7288671.0,7288685.0,7288687.0,7288691.0,7288694.0,7288695.0],"skipIndex":0,"section_code":"gallery","featured_images":"7288695,7288694,7288691,7288687,7288685,7288683,7288671,7288667,7288656,7288504","id":394198,"singleSection":false});				  						galleries[476663] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Heather and Kenneth","link":"gallery_476663.html","maxRecords":0.0,"photoIDs":[9044494.0,9044510.0,9044514.0,9044526.0,9044562.0,9044601.0,9044662.0,9044667.0,9044713.0],"skipIndex":0,"section_code":"gallery","featured_images":"9044713,9044667,9044662,9044601,9044562,9044526,9044514,9044510,9044494","id":476663,"singleSection":false});				  						galleries[439351] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Ish and Kev","link":"gallery_439351.html","maxRecords":0.0,"photoIDs":[8249853.0,8249866.0,8249871.0,8249929.0,8999851.0,8249932.0,8249908.0,8249950.0,8249940.0],"skipIndex":0,"section_code":"gallery","featured_images":"8999851,8249950,8249940,8249932,8249929,8249908,8249871,8249866,8249853","id":439351,"singleSection":false});				  						galleries[473955] = clik.newGallery({"parentGallery":263431,"usePopups":true,"title":"Katrina and Tom","link":"gallery_473955.html","maxRecords":0.0,"photoIDs":[8999314.0,8999016.0,8999319.0,8999322.0,8999328.0,8999336.0],"skipIndex":0,"section_code":"gallery","featured_images":"8999336,8999328,8999322,8999319,8999314,8999016","id":473955,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[238740] = '7288458,7288504,7288483,7288683,7288667,7288656,7288671,7288685,7288687,7288691,7288694,7288695';
imageSets[247377] = '9044494,9044510,9044514,9044526,9044562,9044601,9044662,9044667,9044713';
imageSets[1] = '3971273,7288694,3301069';
imageSets[2] = '3790079,3301069';
imageSets[3] = '3971274,3971290';
imageSets[232079] = '3971271,3971269,3971270,3971256,3971273,4537724,3971274';
imageSets[232421] = '4703054,4703055,4703053,4703056,4703057,4703059,4703060,4703058,4703061';
imageSets[232479] = '4724368,4724369,4724370,4724372,4724373,4724374,4724376,4724377,4724378';
imageSets[234125] = '5355680,5355678,5355676,5355681,5355683,5355686';
imageSets[247111] = '8999314,8999016,8999319,8999322,8999328,8999336';
imageSets[244018] = '8249853,8249866,8249871,8249929,8999851,8249932,8249908,8249940';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Ewan0602/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Ewan0602/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 = 'Ewan F Ramage | Photographer | Wedding | Fife: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

