window.thumbnails = new Object();
												thumbnails[2163021] = new thumbnail(2163021,'','','BOS11_thumb.jpg',130, 76,1,'															#');
												thumbnails[2883882] = new thumbnail(2883882,'','','PayPal Logo 2_thumb.gif',129, 41,1,'															#');
												thumbnails[3709130] = new thumbnail(3709130,'','','False_Kiva_X1_thumb.jpg',130, 104,1,'															#');
												thumbnails[3714499] = new thumbnail(3714499,'','','Frames_thumb.jpg',130, 96,1,'															#');
												thumbnails[4502001] = new thumbnail(4502001,'','','George_Frandsen_1_thumb.jpg',130, 189,1,'															#');
												thumbnails[152196] = new thumbnail(152196,'27011','Mt. Everest','Everest2_thumb.jpg',130, 87,1,'																			photo_152196.html');
												thumbnails[788011] = new thumbnail(788011,'55971','False Kiva','False_Kiva_X_thumb.jpg',130, 87,1,'																			photo_788011.html');
												thumbnails[206165] = new thumbnail(206165,'115061','Her Majesty','Orangutan_thumb.Sumatra.jpg',130, 195,1,'																			photo_206165.html');
												thumbnails[1060831] = new thumbnail(1060831,'55971','Aztec Butte','Aztec Butte_thumb.jpg',130, 87,1,'																			photo_1060831.html');
												thumbnails[4908955] = new thumbnail(4908955,'14185','Colorado River Reflection','Colorado_Overlook_2_thumb.jpg',130, 102,1,'																			photo_4908955.html');
												thumbnails[152185] = new thumbnail(152185,'115061','Contemplation','003_thumb.GeorgeFrandsen.jpg',130, 178,1,'																			photo_152185.html');
												thumbnails[624714] = new thumbnail(624714,'55971','Hovenweep Castle','Hovenweep1_thumb.jpg',130, 47,1,'																			photo_624714.html');
												thumbnails[2884163] = new thumbnail(2884163,'27011','Gharial Crocodile','Gharial_thumb.Chitwan1.jpg',129, 86,1,'																			photo_2884163.html');
												thumbnails[4687869] = new thumbnail(4687869,'14185','Crystal Peak being illuminated by a full moon.','CP_Night_thumb.jpg',130, 86,1,'																			photo_4687869.html');
												thumbnails[4687873] = new thumbnail(4687873,'14185','Great Basin Rattlesnake ','Frandsen_031_thumb.jpg',130, 87,1,'																			photo_4687873.html');
												thumbnails[152188] = new thumbnail(152188,'115061','What\'s Up? ','004_thumb.GeorgeFrandsen.jpg',130, 87,1,'																			photo_152188.html');
												thumbnails[629757] = new thumbnail(629757,'27011','Greater One-horned Rhino','Rhino_thumb.jpg',130, 195,1,'																			photo_629757.html');
												thumbnails[157158] = new thumbnail(157158,'115061','Guarded Gaze  ','GuardedGaze_thumb.jpg',130, 73,1,'																			photo_157158.html');
												thumbnails[624700] = new thumbnail(624700,'55971','House on Fire','House_on_Fire1_thumb.jpg',130, 196,1,'																			photo_624700.html');
												thumbnails[624717] = new thumbnail(624717,'27011','Spring Flower','Spring Flower Incheon_thumb.jpg',130, 86,1,'																			photo_624717.html');
												thumbnails[2885354] = new thumbnail(2885354,'14185','Bonneville Salt Flats','Salt Flats1_thumb.jpg',129, 86,1,'																			photo_2885354.html');
												thumbnails[5817729] = new thumbnail(5817729,'329301','Rainforest','Arenal_National_Park_thumb.jpg',130, 86,1,'																			photo_5817729.html');
												thumbnails[876302] = new thumbnail(876302,'14185','Zebra Slot Canyon, Grand Staircase-Escalante National Monument, Utah','Zebra Slot_thumb.jpg',130, 195,1,'																			photo_876302.html');
												thumbnails[624699] = new thumbnail(624699,'14185','Sunrise at Dead Horse Point, Utah','DeadHorsePoint_thumb.jpg',130, 87,1,'																			photo_624699.html');
												thumbnails[629753] = new thumbnail(629753,'27011','Maple Leaves in Ice','Leaves in Ice_thumb.jpg',130, 195,1,'																			photo_629753.html');
												thumbnails[326131] = new thumbnail(326131,'115061','Bashful','007_thumb.GeorgeFrandsen.jpg',130, 195,1,'																			photo_326131.html');
												thumbnails[2884298] = new thumbnail(2884298,'27011','Bamboo Forest','Bamboo_thumb.jpg',129, 194,1,'																			photo_2884298.html');
												thumbnails[5828921] = new thumbnail(5828921,'329301','Postman Butterfly','Postman_Butterfly_thumb.jpg',130, 195,1,'																			photo_5828921.html');
												thumbnails[624679] = new thumbnail(624679,'115061','Tarzan','07_thumb.jpg',130, 87,1,'																			photo_624679.html');
												thumbnails[2884309] = new thumbnail(2884309,'27011','Autumn in Songnisan National Park','Songnisan 1_thumb.jpg',130, 195,1,'																			photo_2884309.html');
												thumbnails[5265546] = new thumbnail(5265546,'14185','Court of the Patriarchs','Court_of_the_Patriarchs_BW1b1_thumb.jpg',130, 86,1,'																			photo_5265546.html');
												thumbnails[624702] = new thumbnail(624702,'14185','The Virgin River at Temple of Sinawava, Zion National Park, Utah','ZionNarrows_thumb.jpg',130, 195,1,'																			photo_624702.html');
												thumbnails[2884317] = new thumbnail(2884317,'27011','Yellow Sea at Sunset','Yellow Sea_thumb.jpg',130, 194,1,'																			photo_2884317.html');
												thumbnails[5817731] = new thumbnail(5817731,'329301','Arenal Volcano','Arenal_Volcano_thumb.jpg',130, 86,1,'																			photo_5817731.html');
												thumbnails[629750] = new thumbnail(629750,'27011','Sunrise over a Rio Negro Tributary','Brazil_thumb.Amazonas.RioNegroSunrise.jpg',130, 190,1,'																			photo_629750.html');
												thumbnails[2885352] = new thumbnail(2885352,'14185','Big Springs in Narrows Canyon, Zion National Park','BigSprings1_thumb.jpg',130, 195,1,'																			photo_2885352.html');
												thumbnails[3324095] = new thumbnail(3324095,'27011','Sanctuary Falls','Sanctuary Falls_thumb.jpg',130, 195,1,'																			photo_3324095.html');
												thumbnails[2884325] = new thumbnail(2884325,'27011','Great Egret','Great Egret on log11_thumb.jpg',129, 194,1,'																			photo_2884325.html');
												thumbnails[3324094] = new thumbnail(3324094,'14185','Morning Storm in Zion Canyon, Zion National Park','Zion Storm_thumb.jpg',130, 195,1,'																			photo_3324094.html');
												thumbnails[2990356] = new thumbnail(2990356,'14185','A mallard duck on a pond that is reflecting the yellow leaves of cottonwood trees in the autumn; Wasatch Front.','Ducky_thumb.jpg',130, 87,1,'																			photo_2990356.html');
												thumbnails[152190] = new thumbnail(152190,'27011','Puma ','Puma_thumb.jpg',130, 98,1,'																			photo_152190.html');
												thumbnails[624704] = new thumbnail(624704,'14185','Eubrontes Dinosaur Footprint','Eubrontes_2_thumb.jpg',130, 196,1,'																			photo_624704.html');
												thumbnails[5817732] = new thumbnail(5817732,'329301','Coatimundi','Coatimundi1_thumb.jpg',130, 196,1,'																			photo_5817732.html');
												thumbnails[624687] = new thumbnail(624687,'115061','Good Night','SO1 copy_thumb.jpg',129, 86,1,'																			photo_624687.html');
												thumbnails[2885353] = new thumbnail(2885353,'14185','Crack Canyon, San Rafael Swell','Crack Canyon_thumb.jpg',129, 194,1,'																			photo_2885353.html');
												thumbnails[4627279] = new thumbnail(4627279,'27011','Red-bellied Piranha ','Red_Belly_Piranha_1_thumb.jpg',130, 104,1,'																			photo_4627279.html');
												thumbnails[2885378] = new thumbnail(2885378,'14185','San Rafael River, San Rafael Swell','SanRafaelRiver 2a_thumb.jpg',130, 194,1,'																			photo_2885378.html');
												thumbnails[624689] = new thumbnail(624689,'115061','The Hitch-hiker','SO2 copy_thumb.jpg',129, 86,1,'																			photo_624689.html');
												thumbnails[2890061] = new thumbnail(2890061,'14185','Lone Aspen, Big Cottonwood Canyon, Wasatch Range','BW Aspen BC Canyon_thumb.jpg',130, 194,1,'																			photo_2890061.html');
												thumbnails[2890062] = new thumbnail(2890062,'14185','Big Cottownwood Canyon, Wasatch Range','Big Cottonwood 1_thumb.jpg',130, 195,1,'																			photo_2890062.html');
												thumbnails[152194] = new thumbnail(152194,'27011','Reflection of the Rio Negro','Brazil_thumb.Amazonas.RiverReflection2.JPG',130, 85,1,'																			photo_152194.html');
												thumbnails[624706] = new thumbnail(624706,'14185','Wasatch Mountains, Utah','Wasatch_thumb.jpg',130, 163,1,'																			photo_624706.html');
												thumbnails[5100996] = new thumbnail(5100996,'115061','Upside Down Baby','SO_11a_thumb.jpg',130, 197,1,'																			photo_5100996.html');
												thumbnails[5817734] = new thumbnail(5817734,'329301','Blue Morpho Butterfly','Blue_Morpho_4_thumb.jpg',130, 87,1,'																			photo_5817734.html');
												thumbnails[5101008] = new thumbnail(5101008,'115061','Cautious Glare','S10a_thumb.jpg',130, 196,1,'																			photo_5101008.html');
												thumbnails[5943878] = new thumbnail(5943878,'115061','Curiosity','Butterfly_Orangutan_thumb.jpg',130, 195,1,'																			photo_5943878.html');
												thumbnails[5101032] = new thumbnail(5101032,'115061','Vine Walker','SO9a_thumb.jpg',130, 195,1,'																			photo_5101032.html');
												thumbnails[5817735] = new thumbnail(5817735,'329301','Poison Dart Frog','Poison_Dart_Frog_thumb.jpg',130, 87,1,'																			photo_5817735.html');
												thumbnails[629774] = new thumbnail(629774,'14185','Rocky Mouth Falls, Wasatch Mountains','Rocky Mouth Falls_thumb.jpg',130, 195,1,'																			photo_629774.html');
												thumbnails[5101060] = new thumbnail(5101060,'115061','The Butterfly Effect','SO6a_thumb.jpg',130, 87,1,'																			photo_5101060.html');
												thumbnails[631549] = new thumbnail(631549,'14185','Near Mill Hollow, Uinta National Forest','Uintas Mill Hollow 2_thumb.jpg',130, 87,1,'																			photo_631549.html');
												thumbnails[629775] = new thumbnail(629775,'14185','Skyline Arch & Mule Deer, Arches National Park','SkylineArch_thumb.jpg',130, 163,1,'																			photo_629775.html');
												thumbnails[629781] = new thumbnail(629781,'14185','Balanced Rock, Arches National Park','BalancedRock1_thumb.jpg',130, 87,1,'																			photo_629781.html');
												thumbnails[316415] = new thumbnail(316415,'27011','Indigo Flycatcher','Sungai Kinabatangan Flycatcher_thumb.jpg',130, 87,1,'																			photo_316415.html');
												thumbnails[624707] = new thumbnail(624707,'55971','Monarch Cave','Monarch Cave 1_thumb.jpg',130, 195,1,'																			photo_624707.html');
												thumbnails[5817736] = new thumbnail(5817736,'329301','Llano de Cortes Waterfall','1_Llano_de_Cortes_Waterfall_thumb.jpg',130, 86,1,'																			photo_5817736.html');
												thumbnails[3324093] = new thumbnail(3324093,'14185','Delicate Arch, Arches National Park','Delicate Arch 2_thumb.jpg',130, 195,1,'																			photo_3324093.html');
												thumbnails[1349538] = new thumbnail(1349538,'55971','Fallen Roof','Fallen_Roof_Ruin_BW3_thumb.jpg',130, 196,1,'																			photo_1349538.html');
												thumbnails[5817737] = new thumbnail(5817737,'329301','Bougainvilla','Bougainvilla_thumb.jpg',130, 84,1,'																			photo_5817737.html');
												thumbnails[1349539] = new thumbnail(1349539,'55971','Moon House','Moon_House_3_thumb.jpg',130, 87,1,'																			photo_1349539.html');
												thumbnails[3985073] = new thumbnail(3985073,'14185','Desert Tarantula, near Kanab','Desert_Tarantula_thumb.jpg',130, 87,1,'																			photo_3985073.html');
												thumbnails[1635106] = new thumbnail(1635106,'55971','3-Paw Ruin','3-Paw_Ruin_Fable_Valley1_thumb.jpg',130, 195,1,'																			photo_1635106.html');
												thumbnails[5817794] = new thumbnail(5817794,'329301','Basilisk Lizard','1Basilisk_thumb.jpg',130, 43,1,'																			photo_5817794.html');
												thumbnails[5817795] = new thumbnail(5817795,'329301','Long-Nosed Bat','Long-nosed_Bat_-_Cano_Negro_NWR_1_thumb.jpg',130, 86,1,'																			photo_5817795.html');
												thumbnails[634145] = new thumbnail(634145,'14185','Owachomo Bridge, Natural Bridges National Monument','Natural Bridges_thumb.jpg',130, 82,1,'																			photo_634145.html');
												thumbnails[3985078] = new thumbnail(3985078,'55971','Ancestral Puebloan Burial Cyst','Kane_Co_Cyst_1_thumb.jpg',130, 196,1,'																			photo_3985078.html');
												thumbnails[5817796] = new thumbnail(5817796,'329301','Spectacled Caiman ','1Spectacled_Caiman_-_Cano_Negro_NWR_thumb.jpg',130, 89,1,'																			photo_5817796.html');
												thumbnails[624681] = new thumbnail(624681,'115061','Eye Contact','011_thumb.GeorgeFrandsen.jpg',130, 196,1,'																			photo_624681.html');
												thumbnails[624682] = new thumbnail(624682,'115061','Dominance','Borangutan2a_thumb.jpg',130, 87,1,'																			photo_624682.html');
												thumbnails[5817802] = new thumbnail(5817802,'329301','Mantled Howler Monkey Eating Blooms','Mantled_Howler_Monkey_3_thumb.jpg',130, 86,1,'																			photo_5817802.html');
												thumbnails[5817797] = new thumbnail(5817797,'329301','Mantled Howler Monkey','Mantled_Howler_Monkey_4_thumb.jpg',130, 196,1,'																			photo_5817797.html');
												thumbnails[4559298] = new thumbnail(4559298,'115061','Home Sweet Home','Orang10_thumb.jpg',130, 87,1,'																			photo_4559298.html');
												thumbnails[4559299] = new thumbnail(4559299,'115061','The End','TheEnd_thumb.jpg',130, 87,1,'																			photo_4559299.html');
												thumbnails[726882] = new thumbnail(726882,'55971','Watchman Ruin Foundation','Watchman Tower Ruin 2_thumb.jpg',130, 195,1,'																			photo_726882.html');
												thumbnails[3324097] = new thumbnail(3324097,'14185','Minnie Maude Creek, Nine Mile Canyon','9 Mile Canyon Spring_thumb.jpg',130, 87,1,'																			photo_3324097.html');
												thumbnails[4559300] = new thumbnail(4559300,'115061','Sideshow ','Orang12_thumb.jpg',130, 87,1,'																			photo_4559300.html');
												thumbnails[5817798] = new thumbnail(5817798,'329301','Green Iguana','1_Green_Iguana_thumb.jpg',130, 87,1,'																			photo_5817798.html');
												thumbnails[3883170] = new thumbnail(3883170,'55971','Leaky Roof Ruin','Leaky_Roof_Ruin_thumb.jpg',130, 196,1,'																			photo_3883170.html');
												thumbnails[4559301] = new thumbnail(4559301,'115061','How Cold<br>\r\n','Orang13_thumb.jpg',130, 98,1,'																			photo_4559301.html');
												thumbnails[2711048] = new thumbnail(2711048,'55971','Perfect Kiva','Perfect Kiva 2_thumb.jpg',130, 87,1,'																			photo_2711048.html');
												thumbnails[5828916] = new thumbnail(5828916,'329301','Juvenile Spectacled Caimans','Spectacled_Caimans_-_Cano_Negro_NWR_thumb.jpg',130, 87,1,'																			photo_5828916.html');
												thumbnails[316446] = new thumbnail(316446,'27011','Macaque','Macaque_thumb.jpg',130, 195,1,'																			photo_316446.html');
												thumbnails[2711049] = new thumbnail(2711049,'55971','Inside Perfect Kiva','Perfect Kiva 1a_thumb.jpg',130, 195,1,'																			photo_2711049.html');
												thumbnails[4559302] = new thumbnail(4559302,'115061','The Cell<br>\r\n','Frandsen_010_thumb.jpg',130, 104,1,'																			photo_4559302.html');
												thumbnails[5817799] = new thumbnail(5817799,'329301','Anhinga or \"Snakebird\"','Anhinga_-_Cano_Negro_NWR_2_thumb.jpg',130, 43,1,'																			photo_5817799.html');
												thumbnails[3617782] = new thumbnail(3617782,'55971','Tower Ruin','Tower_Ruin_BW31_thumb.jpg',130, 196,1,'																			photo_3617782.html');
												thumbnails[4559303] = new thumbnail(4559303,'115061','Trapped<br>\r\n','Orang15_thumb.jpg',130, 87,1,'																			photo_4559303.html');
												thumbnails[624710] = new thumbnail(624710,'55971','Horse Collar Ruin','Horse Collar BW_thumb.jpg',130, 48,1,'																			photo_624710.html');
												thumbnails[2536958] = new thumbnail(2536958,'14185','Albion Basin Summer Storm, Little Cottonwood Canyon.','Albion Basin_thumb.jpg',130, 196,1,'																			photo_2536958.html');
												thumbnails[2494448] = new thumbnail(2494448,'14185','Autumn in Little Cottonwood Canyon, Utah','Little Cottonwood Fall_thumb.jpg',130, 86,1,'																			photo_2494448.html');
												thumbnails[2633397] = new thumbnail(2633397,'55971','Newspaper Rock Petroglyphs','Newspaper Rock_thumb.jpg',130, 194,1,'																			photo_2633397.html');
												thumbnails[3324091] = new thumbnail(3324091,'55971','Hunter Panel','9 Mile Petroglyphs_thumb.jpg',130, 87,1,'																			photo_3324091.html');
												thumbnails[4751733] = new thumbnail(4751733,'55971','Sunflower Shadow & Petroglyph','Stansbury_Animporph_thumb.jpg',130, 190,1,'																			photo_4751733.html');
												thumbnails[3324092] = new thumbnail(3324092,'55971','Potash Road Petroglyphs','Potash RD Petroglyphs_thumb.jpg',130, 87,1,'																			photo_3324092.html');
												thumbnails[2633398] = new thumbnail(2633398,'55971','Parowon Gap Petroglyphs','Parowan Gap Glyphs_thumb.jpg',130, 87,1,'																			photo_2633398.html');
												thumbnails[2883329] = new thumbnail(2883329,'27011','Lower Sungai Kinabatangan Floodplain','Sungai Kinabatangan 4_thumb.jpg',129, 86,1,'																			photo_2883329.html');
												thumbnails[5636710] = new thumbnail(5636710,'27011','Proboscis Monkey','ProboscisMonkey_thumb.jpg',130, 87,1,'																			photo_5636710.html');
												thumbnails[2633399] = new thumbnail(2633399,'55971','Angels','Buckhorn Wash_thumb.jpg',130, 195,1,'																			photo_2633399.html');
												thumbnails[2884436] = new thumbnail(2884436,'27011','Sibuan Island','Sibuan Island Boat1_thumb.jpg',129, 86,1,'																			photo_2884436.html');
												thumbnails[3215385] = new thumbnail(3215385,'14185','Lopsided Mule Deer, Deloris Triangle','Lopsided Buck1_thumb.jpg',130, 162,1,'																			photo_3215385.html');
												thumbnails[1349540] = new thumbnail(1349540,'14185','Rainbow over Cedar Mesa, Utah','Cedar Mesa1_thumb.jpg',130, 87,1,'																			photo_1349540.html');
												thumbnails[2633400] = new thumbnail(2633400,'55971','The Rochester Panel Petroglyphs','Rochester Panel_thumb.jpg',130, 87,1,'																			photo_2633400.html');
												thumbnails[3883169] = new thumbnail(3883169,'55971','Faces','10_Faces_A_thumb.jpg',130, 86,1,'																			photo_3883169.html');
												thumbnails[2633409] = new thumbnail(2633409,'55971','Sego Canyon Pictographs','Sego Canyon Glyphs_thumb.jpg',130, 195,1,'																			photo_2633409.html');
												thumbnails[4751706] = new thumbnail(4751706,'14185','Black-Tailed Jackrabbit, Lepus californicus, Stansbury Island','Stansbury_JackRabbit_thumb.jpg',130, 86,1,'																			photo_4751706.html');
												thumbnails[4908956] = new thumbnail(4908956,'55971','Moonflower Canyon Petroglyphs','Moonflower_Petroglyph_thumb.jpg',130, 196,1,'																			photo_4908956.html');
												thumbnails[4751713] = new thumbnail(4751713,'14185','Sunflower, Stansbury Island','Stansbury_Sunflower_thumb.jpg',130, 196,1,'																			photo_4751713.html');
												thumbnails[5476077] = new thumbnail(5476077,'14185','Buck Canyon Overlook','Buck_Canyon_Overlook_3_thumb.jpg',130, 163,1,'																			photo_5476077.html');
												thumbnails[2633401] = new thumbnail(2633401,'55971','The Great Gallery Pictographs','Great Gallery_thumb.jpg',130, 26,1,'																			photo_2633401.html');
												thumbnails[5943159] = new thumbnail(5943159,'14185','Hoodoo at Sunset','Goblin_2_thumb.jpg',130, 196,1,'																			photo_5943159.html');
												thumbnails[2885356] = new thumbnail(2885356,'14185','Mount Timpanogos, Wasatch Range','Timp_thumb.jpg',130, 47,1,'																			photo_2885356.html');
												thumbnails[3420587] = new thumbnail(3420587,'14185','Bald Eagles, Farmington Bay','Farmington Bay Eagles_thumb.jpg',130, 44,1,'																			photo_3420587.html');
												thumbnails[206173] = new thumbnail(206173,'27011','Wildflower','wildflower1_thumb.jpg',130, 111,1,'																			photo_206173.html');
												thumbnails[624708] = new thumbnail(624708,'14185','Phragmite Reeds','Farmington Bay_thumb.jpg',130, 43,1,'																			photo_624708.html');
												thumbnails[624709] = new thumbnail(624709,'14185','Narrows Canyon, Zion National Park, Utah','NarrowsCanyon3_thumb.jpg',130, 48,1,'																			photo_624709.html');
												thumbnails[5671049] = new thumbnail(5671049,'14185','Mystery Falls','1_Mystery_Falls_thumb.jpg',130, 46,1,'																			photo_5671049.html');
												thumbnails[624713] = new thumbnail(624713,'14185','Zion Canyon, Zion National Park, Utah<br>\r\n','Zion Canyon_thumb.jpg',130, 47,1,'																			photo_624713.html');
												thumbnails[624711] = new thumbnail(624711,'14185','Monument Valley, Utah-Arizona Border','MonumentValley_thumb.jpg',130, 46,1,'																			photo_624711.html');
												thumbnails[5902895] = new thumbnail(5902895,'14185','Grallator Dinosaur Footprints','Dino_Tracks_Pan_thumb.jpg',130, 39,1,'																			photo_5902895.html');
												thumbnails[624719] = new thumbnail(624719,'27011','Macaw Parrot','Macaw 1_thumb.jpg',130, 195,1,'																			photo_624719.html');
												thumbnails[629694] = new thumbnail(629694,'27011','Moose','Moose1_thumb.jpg',130, 88,1,'																			photo_629694.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[14185] = new gallery(14185,'4908955','Utah Gallery','gallery',[4908955,4687869,4687873,2885354,876302,624699,5265546,624702,2885352,3324094,2990356,624704,2885353,2885378,2890061,2890062,624706,629774,631549,629775,629781,3324093,3985073,634145,3324097,2536958,2494448,3215385,1349540,4751706,4751713,5476077,5943159,2885356,3420587,624708,624709,5671049,624713,624711,5902895],0, 0, '', '																																																																																																							gallery_14185.html',0,0);
				  					galleries[55971] = new gallery(55971,'788011','Ancient Utah Gallery','gallery',[788011,1060831,624714,624700,624707,1349538,1349539,1635106,3985078,726882,3883170,2711048,2711049,3617782,624710,2633397,3324091,4751733,3324092,2633398,2633399,2633400,3883169,2633409,4908956,2633401],0, 0, '', '																																																																																																							gallery_55971.html',0,0);
				  					galleries[115061] = new gallery(115061,'152188','Orangutan Gallery','gallery',[206165,152185,152188,157158,326131,624679,624687,624689,5100996,5101008,5943878,5101032,5101060,624681,624682,4559298,4559299,4559300,4559301,4559302,4559303],0, 0, '', '																																																																																																							gallery_115061.html',0,0);
				  					galleries[329301] = new gallery(329301,'5817735','Costa Rica','gallery',[5817729,5828921,5817731,5817732,5817734,5817735,5817736,5817737,5817794,5817795,5817796,5817802,5817797,5817798,5828916,5817799],0, 0, '', '																																																																																																							gallery_329301.html',0,0);
				  					galleries[27011] = new gallery(27011,'152196','International Gallery','gallery',[152196,2884163,629757,624717,629753,2884298,2884309,2884317,629750,3324095,2884325,152190,4627279,152194,316415,316446,2883329,5636710,2884436,206173,624719,629694],0, 0, '', '																																																																																																							gallery_27011.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '624699';
imageSets[2] = '5817735,4908955,788011,152196,152188';
imageSets[3] = '5943878,5943159,5902895,5828921,5828916,5817802,5817799,5817798,5817797,5817796,5817795,5817794,5817737,5817736,5817735,5817734,5817732,5817731,5817729,5671049,5636710,5476077,5265546,5101060,5101032,5101008,5100996,4908956,4908955,4751733,4751713,4751706,4687873,4687869,4627279,4559303,4559302,4559301,4559300,4559299,4559298,4502001,3985078,3985073,3883170,3883169,3714499,3709130,3617782,3420587';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gnfrandsen/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gnfrandsen/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 = 'George Frandsen Nature Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    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> 				$' + (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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="GNFRANDSEN">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

			

