window.thumbnails = {};
															thumbnails[7026135] = clik.newPhoto({"id":7026135,"src":"Snapshot_2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":72});
															thumbnails[7556988] = clik.newPhoto({"id":7556988,"src":"MSM-name250_thumb.png","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":42});
															thumbnails[7566802] = clik.newPhoto({"id":7566802,"src":"Adraga_triangle_9809_molduras_srgb_600_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":94});
															thumbnails[7566804] = clik.newPhoto({"id":7566804,"src":"logo-transparent-80-face_thumb.png","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[7887338] = clik.newPhoto({"id":7887338,"src":"Stars_Background_IMG_6888_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":86});
															thumbnails[8487712] = clik.newPhoto({"id":8487712,"src":"Anucio_Ebook_PDL_750_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":148});
															thumbnails[8497406] = clik.newPhoto({"id":8497406,"src":"The_cloud_and_the_tree_MG_0874_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":87});
															thumbnails[5625195] = clik.newPhoto({"id":5625195,"src":"Pure-Drama-II-IMG_1414-22-copy_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_5625195.html","width":130,"caption":"","height":86});
															thumbnails[6235011] = clik.newPhoto({"id":6235011,"src":"Trough-the-trees_MG_0379_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_6235011.html","width":130,"caption":"","height":87});
															thumbnails[7300026] = clik.newPhoto({"id":7300026,"src":"Ponte_25_Abril_red_750_thumb.jpg","galleries_id":394925,"server_id":5,"link":"photo_7300026.html","width":130,"caption":"","height":46});
															thumbnails[7488771] = clik.newPhoto({"id":7488771,"src":"Crown_4005_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_7488771.html","width":130,"caption":"","height":99});
															thumbnails[7684677] = clik.newPhoto({"id":7684677,"src":"Adraga_color_delight_2_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_7684677.html","width":130,"caption":"","height":195});
															thumbnails[7987162] = clik.newPhoto({"id":7987162,"src":"Perserverance_MG_7967_212345_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_7987162.html","width":130,"caption":"","height":182});
															thumbnails[5647013] = clik.newPhoto({"id":5647013,"src":"Blue_Powder-sharp3_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_5647013.html","width":130,"caption":"","height":86});
															thumbnails[5657696] = clik.newPhoto({"id":5657696,"src":"Moisture-0428_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_5657696.html","width":130,"caption":"","height":87});
															thumbnails[5722458] = clik.newPhoto({"id":5722458,"src":"Rainbow-naked-trees7_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_5722458.html","width":130,"caption":"","height":87});
															thumbnails[6141719] = clik.newPhoto({"id":6141719,"src":"Gadering-_MG_0084-2_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_6141719.html","width":130,"caption":"","height":186});
															thumbnails[7300139] = clik.newPhoto({"id":7300139,"src":"Ponte_25_Abril_Blue_750_thumb.jpg","galleries_id":394925,"server_id":5,"link":"photo_7300139.html","width":130,"caption":"","height":46});
															thumbnails[7774923] = clik.newPhoto({"id":7774923,"src":"Urze_fest-6677_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_7774923.html","width":130,"caption":"","height":195});
															thumbnails[7906655] = clik.newPhoto({"id":7906655,"src":"Star_Trails_Diabo_Master_II_8bits__MG_7386_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_7906655.html","width":130,"caption":"","height":200});
															thumbnails[5649942] = clik.newPhoto({"id":5649942,"src":"Memory_of_a_dream_635D1C42-1D09-001F-990CD2609F470AB8_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5649942.html","width":130,"caption":"","height":195});
															thumbnails[5661559] = clik.newPhoto({"id":5661559,"src":"Iluminated-Splash_2_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_5661559.html","width":130,"caption":"","height":98});
															thumbnails[5670543] = clik.newPhoto({"id":5670543,"src":"Rainbow-with-moonrise3_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_5670543.html","width":130,"caption":"","height":80});
															thumbnails[5672682] = clik.newPhoto({"id":5672682,"src":"Moonset-over-Cresmina-Beach-222_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_5672682.html","width":130,"caption":"","height":86});
															thumbnails[6080701] = clik.newPhoto({"id":6080701,"src":"Artificial_approach_IMG_5546_II_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_6080701.html","width":130,"caption":"","height":195});
															thumbnails[7300397] = clik.newPhoto({"id":7300397,"src":"Ponte_Vasco_da_Gama_Panorama_4_thumb.jpg","galleries_id":394925,"server_id":5,"link":"photo_7300397.html","width":130,"caption":"","height":43});
															thumbnails[7370460] = clik.newPhoto({"id":7370460,"src":"Short_Encounter_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_7370460.html","width":130,"caption":"","height":195});
															thumbnails[7718064] = clik.newPhoto({"id":7718064,"src":"O_ciclista_2_v421_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_7718064.html","width":130,"caption":"","height":203});
															thumbnails[9069287] = clik.newPhoto({"id":9069287,"src":"moon_and_star_MG_9639-2_thumb.jpg","galleries_id":384757,"server_id":5,"link":"photo_9069287.html","width":130,"caption":"","height":87});
															thumbnails[5651686] = clik.newPhoto({"id":5651686,"src":"Abano_rainbow_sunrise-2_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_5651686.html","width":130,"caption":"","height":66});
															thumbnails[5655986] = clik.newPhoto({"id":5655986,"src":"Autumn-insight_687DE289-1D09-001F-99F36DBCB0FEA224_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_5655986.html","width":130,"caption":"","height":87});
															thumbnails[5671515] = clik.newPhoto({"id":5671515,"src":"Above-the-treetops-IMG_38141_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_5671515.html","width":130,"caption":"","height":87});
															thumbnails[6763896] = clik.newPhoto({"id":6763896,"src":"Be_my_guide_MG_1605_2_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_6763896.html","width":130,"caption":"","height":196});
															thumbnails[7216706] = clik.newPhoto({"id":7216706,"src":"Creativity_genarator_4_Flatten_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_7216706.html","width":130,"caption":"","height":196});
															thumbnails[7370578] = clik.newPhoto({"id":7370578,"src":"Thin_line_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_7370578.html","width":130,"caption":"","height":195});
															thumbnails[9040935] = clik.newPhoto({"id":9040935,"src":"After_the_rain_thumb.jpg","galleries_id":384757,"server_id":5,"link":"photo_9040935.html","width":130,"caption":"","height":87});
															thumbnails[5604695] = clik.newPhoto({"id":5604695,"src":"mist_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_5604695.html","width":130,"caption":"","height":87});
															thumbnails[5647360] = clik.newPhoto({"id":5647360,"src":"Ghost_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5647360.html","width":130,"caption":"","height":195});
															thumbnails[5684596] = clik.newPhoto({"id":5684596,"src":"Inselberg_thumb.jpeg","galleries_id":384756,"server_id":5,"link":"photo_5684596.html","width":130,"caption":"","height":86});
															thumbnails[7111816] = clik.newPhoto({"id":7111816,"src":"Beyondthelight_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_7111816.html","width":130,"caption":"","height":192});
															thumbnails[7153830] = clik.newPhoto({"id":7153830,"src":"Full_moon_set_at_Cresmina_Beach_2559_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_7153830.html","width":130,"caption":"","height":87});
															thumbnails[8917886] = clik.newPhoto({"id":8917886,"src":"Wind_playground_II_MG_0168_Master_flatten_thumb.jpg","galleries_id":384757,"server_id":5,"link":"photo_8917886.html","width":130,"caption":"","height":82});
															thumbnails[5649641] = clik.newPhoto({"id":5649641,"src":"Giant-Rabbit_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5649641.html","width":130,"caption":"","height":195});
															thumbnails[5651881] = clik.newPhoto({"id":5651881,"src":"Pastel_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_5651881.html","width":130,"caption":"","height":87});
															thumbnails[5723081] = clik.newPhoto({"id":5723081,"src":"Embraced-by-the-night_thumb.jpg","galleries_id":419409,"server_id":5,"link":"photo_5723081.html","width":130,"caption":"","height":86});
															thumbnails[6082676] = clik.newPhoto({"id":6082676,"src":"Late-point-IMG_48893-no-rgb_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_6082676.html","width":130,"caption":"","height":86});
															thumbnails[6386007] = clik.newPhoto({"id":6386007,"src":"Evanescent-gate_MG_0637-3_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_6386007.html","width":130,"caption":"","height":170});
															thumbnails[8792296] = clik.newPhoto({"id":8792296,"src":"Sanctuary_MG_9012_II_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_8792296.html","width":130,"caption":"","height":87});
															thumbnails[8860190] = clik.newPhoto({"id":8860190,"src":"Change_of_seasons_MG_9944_v2_thumb.jpg","galleries_id":384757,"server_id":5,"link":"photo_8860190.html","width":130,"caption":"","height":195});
															thumbnails[5647254] = clik.newPhoto({"id":5647254,"src":"Unsustained_forms_61C821D7-1D09-001F-9971D5F7C9A495C1_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5647254.html","width":130,"caption":"","height":195});
															thumbnails[5693706] = clik.newPhoto({"id":5693706,"src":"Stone-Path2_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_5693706.html","width":130,"caption":"","height":182});
															thumbnails[6083206] = clik.newPhoto({"id":6083206,"src":"Tintin-Cousin-IMG_5269-2_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_6083206.html","width":130,"caption":"","height":88});
															thumbnails[8805169] = clik.newPhoto({"id":8805169,"src":"Impass_MG_9031_flatten12_thumb.jpg","galleries_id":321536,"server_id":5,"link":"photo_8805169.html","width":130,"caption":"","height":181});
															thumbnails[8805225] = clik.newPhoto({"id":8805225,"src":"Sanctuary_resune_thumb.jpg","galleries_id":384756,"server_id":5,"link":"photo_8805225.html","width":130,"caption":"","height":87});
															thumbnails[5649504] = clik.newPhoto({"id":5649504,"src":"Devils-Tower_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5649504.html","width":130,"caption":"","height":195});
															thumbnails[6080708] = clik.newPhoto({"id":6080708,"src":"Bolivar-IMG_5534_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_6080708.html","width":130,"caption":"","height":87});
															thumbnails[7112971] = clik.newPhoto({"id":7112971,"src":"Enchantment_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_7112971.html","width":130,"caption":"","height":195});
															thumbnails[6080703] = clik.newPhoto({"id":6080703,"src":"Timeless-IMG_5560_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_6080703.html","width":130,"caption":"","height":195});
															thumbnails[6497448] = clik.newPhoto({"id":6497448,"src":"Meet-me-under-moon_MG_0939_thumb.jpg","galleries_id":314558,"server_id":5,"link":"photo_6497448.html","width":130,"caption":"","height":195});
															thumbnails[6553833] = clik.newPhoto({"id":6553833,"src":"Dramatic_stone_IMG_5152_221_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_6553833.html","width":130,"caption":"","height":87});
															thumbnails[5649434] = clik.newPhoto({"id":5649434,"src":"Bare_62F8137C-1D09-001F-99D210031F8EE1AF_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5649434.html","width":130,"caption":"","height":195});
															thumbnails[7968230] = clik.newPhoto({"id":7968230,"src":"swolowed_MG_7456_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_7968230.html","width":130,"caption":"","height":85});
															thumbnails[5647604] = clik.newPhoto({"id":5647604,"src":"The_bust3_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5647604.html","width":130,"caption":"","height":195});
															thumbnails[7989454] = clik.newPhoto({"id":7989454,"src":"Waterfall_Cave_Master_flatten_MG_7679_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_7989454.html","width":130,"caption":"","height":87});
															thumbnails[5650114] = clik.newPhoto({"id":5650114,"src":"Three-stones-to-eternity_63693E81-1D09-001F-99D3F7AB1BF4D0A1_thumb.jpg","galleries_id":314557,"server_id":5,"link":"photo_5650114.html","width":130,"caption":"","height":195});
															thumbnails[8251700] = clik.newPhoto({"id":8251700,"src":"Robins_shoe_flatten_2_v2_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_8251700.html","width":130,"caption":"","height":85});
															thumbnails[8460155] = clik.newPhoto({"id":8460155,"src":"Fog_in_light_v2_MG_1160_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_8460155.html","width":130,"caption":"","height":87});
															thumbnails[9140318] = clik.newPhoto({"id":9140318,"src":"Red_Peaks_v4_1_thumb.jpg","galleries_id":341357,"server_id":5,"link":"photo_9140318.html","width":130,"caption":"","height":88});
															thumbnails[8762339] = clik.newPhoto({"id":8762339,"src":"Anuncio_18FEV2011_A_praia_e_o_Inverno_flatten_IMG_3037_thumb.jpg","galleries_id":461318,"server_id":5,"link":"photo_8762339.html","width":130,"caption":"","height":87});
															thumbnails[8762340] = clik.newPhoto({"id":8762340,"src":"Trio_da_Adraga_nocturno_MG_4493_thumb.jpg","galleries_id":461319,"server_id":5,"link":"photo_8762340.html","width":130,"caption":"","height":87});
															thumbnails[8762343] = clik.newPhoto({"id":8762343,"src":"Colourfull_sentinel_thumb.jpg","galleries_id":461320,"server_id":5,"link":"photo_8762343.html","width":130,"caption":"","height":87});
															thumbnails[8807776] = clik.newPhoto({"id":8807776,"src":"In_the_begining_of_the_night_MG_0502_thumb.jpg","galleries_id":461321,"server_id":5,"link":"photo_8807776.html","width":130,"caption":"","height":87});
															thumbnails[8762342] = clik.newPhoto({"id":8762342,"src":"Encosta_iluminada_thumb.jpg","galleries_id":461322,"server_id":5,"link":"photo_8762342.html","width":130,"caption":"","height":81});
															thumbnails[8808370] = clik.newPhoto({"id":8808370,"src":"Wave_compliment_MG_7085_Final_Master_flatten_thumb.jpg","galleries_id":461323,"server_id":5,"link":"photo_8808370.html","width":130,"caption":"","height":85});
															thumbnails[7219966] = clik.newPhoto({"id":7219966,"src":"Voucher_Ingles_thumb.jpg","galleries_id":369106,"server_id":5,"link":"photo_7219966.html","width":130,"caption":"","height":55});
															thumbnails[8519328] = clik.newPhoto({"id":8519328,"src":"1_-_After_the_rain_750_thumb.jpg","galleries_id":451773,"server_id":5,"link":"photo_8519328.html","width":130,"caption":"","height":131});
															thumbnails[6256987] = clik.newPhoto({"id":6256987,"src":"Dawn_and_Dusk-collectionBCKBK12_thumb.jpg","galleries_id":379767,"server_id":5,"link":"photo_6256987.html","width":130,"caption":"\"Aurora e Crepúsculo\"","height":43});
															thumbnails[6256233] = clik.newPhoto({"id":6256233,"src":"Special-moments-collectionBCKBK_thumb.jpg","galleries_id":379767,"server_id":5,"link":"photo_6256233.html","width":130,"caption":"\"Eventos da natureza\"","height":43});
															thumbnails[7008914] = clik.newPhoto({"id":7008914,"src":"Pontes_de_Lisboa__thumb.jpg","galleries_id":379767,"server_id":5,"link":"photo_7008914.html","width":130,"caption":"\"Pontes de Lisboa\"","height":149});
															thumbnails[7628881] = clik.newPhoto({"id":7628881,"src":"Moon_set_over_giants_thumb.jpg","galleries_id":413742,"server_id":5,"link":"photo_7628881.html","width":130,"caption":"April Wallpaper","height":87});
															thumbnails[7256098] = clik.newPhoto({"id":7256098,"src":"Damage_thumb.jpg","galleries_id":413742,"server_id":5,"link":"photo_7256098.html","width":130,"caption":"January Wallpaper","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[413742] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wallpaper","link":"section466021.html","maxRecords":0.0,"photoIDs":[7628881.0,7256098.0],"skipIndex":0,"section_code":"section466021","featured_images":"7628881,7256098","id":413742,"singleSection":true});				  						galleries[384757] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Latest work","link":"gallery_384757.html","maxRecords":0.0,"photoIDs":[9069287.0,9040935.0,8917886.0,8860190.0],"skipIndex":0,"section_code":"gallery","featured_images":8860190.0,"id":384757,"singleSection":false});				  						galleries[379767] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"postais","link":"section451949.html","maxRecords":0.0,"photoIDs":[6256987.0,6256233.0,7008914.0],"skipIndex":0,"section_code":"section451949","featured_images":"7008914,6256987,6256233","id":379767,"singleSection":true});				  							galleries[369106] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Workshops Voucher","link":"photo_7219966.html","maxRecords":0.0,"photoIDs":[7219966.0],"skipIndex":true,"section_code":"section463874","featured_images":7219966.0,"id":369106,"singleSection":true});				  						galleries[314558] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landforms V","link":"gallery_314558.html","maxRecords":0.0,"photoIDs":[7774923.0,7370460.0,7370578.0,7111816.0,6386007.0,5693706.0,7112971.0,6497448.0],"skipIndex":0,"section_code":"gallery","featured_images":7370460.0,"id":314558,"singleSection":false});				  						galleries[314557] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Ocean Boundaries V","link":"gallery_314557.html","maxRecords":0.0,"photoIDs":[7684677.0,6141719.0,5649942.0,6763896.0,5647360.0,5649641.0,5647254.0,5649504.0,6080703.0,5649434.0,5647604.0,5650114.0],"skipIndex":0,"section_code":"gallery","featured_images":5649942.0,"id":314557,"singleSection":false});				  							galleries[461318] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 18 Fevereiro 2012 - Inverno","link":"photo_8762339.html","maxRecords":0.0,"photoIDs":[8762339.0],"skipIndex":true,"section_code":"section439641","featured_images":8762339.0,"id":461318,"singleSection":false});				  						galleries[321536] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Insight Frames","link":"gallery_321536.html","maxRecords":0.0,"photoIDs":[7488771.0,5657696.0,5661559.0,5655986.0,5604695.0,5651881.0,8805169.0],"skipIndex":0,"section_code":"gallery","featured_images":7488771.0,"id":321536,"singleSection":false});				  							galleries[461319] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 28 Abril 2012 - Nocturna","link":"photo_8762340.html","maxRecords":0.0,"photoIDs":[8762340.0],"skipIndex":true,"section_code":"section439641","featured_images":8762340.0,"id":461319,"singleSection":false});				  						galleries[384756] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landforms H","link":"gallery_384756.html","maxRecords":0.0,"photoIDs":[6235011.0,5722458.0,5670543.0,5671515.0,5684596.0,8792296.0,8805225.0],"skipIndex":0,"section_code":"gallery","featured_images":5722458.0,"id":384756,"singleSection":false});				  							galleries[461320] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 23 Junho 2012 - Noturna","link":"photo_8762343.html","maxRecords":0.0,"photoIDs":[8762343.0],"skipIndex":true,"section_code":"section439641","featured_images":8762343.0,"id":461320,"singleSection":false});				  						galleries[341357] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Ocean Boundaries H","link":"gallery_341357.html","maxRecords":0.0,"photoIDs":[5625195.0,5647013.0,5672682.0,5651686.0,6082676.0,6083206.0,6080708.0,6553833.0,7968230.0,7989454.0,8251700.0,8460155.0,9140318.0],"skipIndex":0,"section_code":"gallery","featured_images":"9140318,6080708","id":341357,"singleSection":false});				  							galleries[461321] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 22 Setembro 2012 - Noturna","link":"photo_8807776.html","maxRecords":0.0,"photoIDs":[8807776.0],"skipIndex":true,"section_code":"section439641","featured_images":8807776.0,"id":461321,"singleSection":false});				  						galleries[419409] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Noctivagus","link":"gallery_419409.html","maxRecords":0.0,"photoIDs":[7987162.0,7906655.0,6080701.0,7718064.0,7216706.0,7153830.0,5723081.0],"skipIndex":0,"section_code":"gallery","featured_images":"7987162,6080701","id":419409,"singleSection":false});				  							galleries[461322] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 13 Outubro 2012 - Outono","link":"photo_8762342.html","maxRecords":0.0,"photoIDs":[8762342.0],"skipIndex":true,"section_code":"section439641","featured_images":8762342.0,"id":461322,"singleSection":false});				  						galleries[394925] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Humans in Nature","link":"gallery_394925.html","maxRecords":0.0,"photoIDs":[7300026.0,7300139.0,7300397.0],"skipIndex":0,"section_code":"gallery","featured_images":7300026.0,"id":394925,"singleSection":false});				  							galleries[451773] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Livro  - Os direitos da Terra ","link":"photo_8519328.html","maxRecords":0.0,"photoIDs":[8519328.0],"skipIndex":true,"section_code":"section544650","featured_images":8519328.0,"id":451773,"singleSection":true});				  							galleries[461323] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"P N Sintra Cascais - 8 Dezembro 2012 - Inverno","link":"photo_8808370.html","maxRecords":0.0,"photoIDs":[8808370.0],"skipIndex":true,"section_code":"section439641","featured_images":8808370.0,"id":461323,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6553833,7968230';
imageSets[2] = '7987162,7488771,7300026,5722458,7370460,6080701,5649942,8860190,6080708,9140318';
imageSets[3] = '7887338';
imageSets[237814] = '9040935';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/marcosantosmarques/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/marcosantosmarques/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 = 'Marco Santos Marques - Lightscapes in Nature: ' + 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>  </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Artist </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (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.payment_groups_id !== '') {
		temp += '<p>Paypal</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="MARCOSANTOSMARQUES">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							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 += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

