window.thumbnails = {};
															thumbnails[8589341] = clik.newPhoto({"id":8589341,"src":"CS10_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589341.html","width":130,"caption":"","height":86});
															thumbnails[8597342] = clik.newPhoto({"id":8597342,"src":"N10_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597342.html","width":130,"caption":"","height":86});
															thumbnails[8608687] = clik.newPhoto({"id":8608687,"src":"D10_thumb.JPG","galleries_id":454214,"server_id":18,"link":"photo_8608687.html","width":130,"caption":"","height":86});
															thumbnails[8608754] = clik.newPhoto({"id":8608754,"src":"I10_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608754.html","width":130,"caption":"","height":86});
															thumbnails[8649356] = clik.newPhoto({"id":8649356,"src":"P10_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649356.html","width":130,"caption":"","height":86});
															thumbnails[8649857] = clik.newPhoto({"id":8649857,"src":"ST10_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649857.html","width":130,"caption":"","height":86});
															thumbnails[8589347] = clik.newPhoto({"id":8589347,"src":"CS20_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589347.html","width":130,"caption":"","height":86});
															thumbnails[8597344] = clik.newPhoto({"id":8597344,"src":"N20_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597344.html","width":130,"caption":"","height":86});
															thumbnails[8608689] = clik.newPhoto({"id":8608689,"src":"D20_thumb.JPG","galleries_id":454214,"server_id":18,"link":"photo_8608689.html","width":130,"caption":"","height":86});
															thumbnails[8608755] = clik.newPhoto({"id":8608755,"src":"I20_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608755.html","width":130,"caption":"","height":86});
															thumbnails[8649357] = clik.newPhoto({"id":8649357,"src":"P20_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649357.html","width":130,"caption":"","height":86});
															thumbnails[8649863] = clik.newPhoto({"id":8649863,"src":"ST20_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649863.html","width":130,"caption":"","height":86});
															thumbnails[8589348] = clik.newPhoto({"id":8589348,"src":"CS30_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589348.html","width":130,"caption":"","height":86});
															thumbnails[8597345] = clik.newPhoto({"id":8597345,"src":"N30_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8597345.html","width":130,"caption":"","height":86});
															thumbnails[8608697] = clik.newPhoto({"id":8608697,"src":"D50_thumb.JPG","galleries_id":454214,"server_id":18,"link":"photo_8608697.html","width":130,"caption":"","height":86});
															thumbnails[8608757] = clik.newPhoto({"id":8608757,"src":"I30_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608757.html","width":130,"caption":"","height":86});
															thumbnails[8649364] = clik.newPhoto({"id":8649364,"src":"P30_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649364.html","width":130,"caption":"","height":86});
															thumbnails[8649856] = clik.newPhoto({"id":8649856,"src":"ST30_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649856.html","width":130,"caption":"","height":86});
															thumbnails[8589353] = clik.newPhoto({"id":8589353,"src":"CS40_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589353.html","width":130,"caption":"","height":86});
															thumbnails[8597346] = clik.newPhoto({"id":8597346,"src":"N40_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597346.html","width":130,"caption":"","height":86});
															thumbnails[8608758] = clik.newPhoto({"id":8608758,"src":"I40_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608758.html","width":130,"caption":"","height":86});
															thumbnails[8649352] = clik.newPhoto({"id":8649352,"src":"P40_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649352.html","width":130,"caption":"","height":86});
															thumbnails[8649489] = clik.newPhoto({"id":8649489,"src":"D100_thumb.JPG","galleries_id":454214,"server_id":18,"link":"photo_8649489.html","width":130,"caption":"","height":86});
															thumbnails[8649882] = clik.newPhoto({"id":8649882,"src":"ST40_thumb.jpg","galleries_id":454209,"server_id":18,"link":"photo_8649882.html","width":130,"caption":"","height":86});
															thumbnails[8597348] = clik.newPhoto({"id":8597348,"src":"N50_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597348.html","width":130,"caption":"","height":86});
															thumbnails[8608703] = clik.newPhoto({"id":8608703,"src":"D90_thumb.JPG","galleries_id":454214,"server_id":18,"link":"photo_8608703.html","width":120,"caption":"","height":90});
															thumbnails[8608759] = clik.newPhoto({"id":8608759,"src":"I50_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608759.html","width":130,"caption":"","height":86});
															thumbnails[8638133] = clik.newPhoto({"id":8638133,"src":"CS101_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8638133.html","width":130,"caption":"","height":86});
															thumbnails[8649358] = clik.newPhoto({"id":8649358,"src":"P50_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649358.html","width":130,"caption":"","height":86});
															thumbnails[8649887] = clik.newPhoto({"id":8649887,"src":"ST50_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649887.html","width":130,"caption":"","height":86});
															thumbnails[8608702] = clik.newPhoto({"id":8608702,"src":"D80_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8608702.html","width":130,"caption":"","height":86});
															thumbnails[8589360] = clik.newPhoto({"id":8589360,"src":"CS60_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589360.html","width":130,"caption":"","height":86});
															thumbnails[8597350] = clik.newPhoto({"id":8597350,"src":"N60_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597350.html","width":130,"caption":"","height":86});
															thumbnails[8608761] = clik.newPhoto({"id":8608761,"src":"I60_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608761.html","width":130,"caption":"","height":86});
															thumbnails[8649360] = clik.newPhoto({"id":8649360,"src":"P60_thumb.JPG","galleries_id":454213,"server_id":18,"link":"photo_8649360.html","width":130,"caption":"","height":86});
															thumbnails[8649498] = clik.newPhoto({"id":8649498,"src":"SL60_268554FD-1EC9-D45B-1C51C1A59ED2BEC8_thumb.jpg","galleries_id":454214,"server_id":18,"link":"photo_8649498.html","width":130,"caption":"","height":86});
															thumbnails[8649864] = clik.newPhoto({"id":8649864,"src":"ST60_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649864.html","width":130,"caption":"","height":86});
															thumbnails[8597352] = clik.newPhoto({"id":8597352,"src":"N70_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597352.html","width":130,"caption":"","height":86});
															thumbnails[8608763] = clik.newPhoto({"id":8608763,"src":"I70_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608763.html","width":130,"caption":"","height":86});
															thumbnails[8649368] = clik.newPhoto({"id":8649368,"src":"P70_thumb.JPG","galleries_id":454213,"server_id":18,"link":"photo_8649368.html","width":130,"caption":"","height":86});
															thumbnails[8649493] = clik.newPhoto({"id":8649493,"src":"SL70_thumb.jpg","galleries_id":454214,"server_id":18,"link":"photo_8649493.html","width":130,"caption":"","height":86});
															thumbnails[8649855] = clik.newPhoto({"id":8649855,"src":"ST70_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649855.html","width":130,"caption":"","height":86});
															thumbnails[8589365] = clik.newPhoto({"id":8589365,"src":"CS80_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589365.html","width":130,"caption":"","height":86});
															thumbnails[8597376] = clik.newPhoto({"id":8597376,"src":"N80_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597376.html","width":130,"caption":"","height":86});
															thumbnails[8608764] = clik.newPhoto({"id":8608764,"src":"I80_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608764.html","width":120,"caption":"","height":90});
															thumbnails[8649355] = clik.newPhoto({"id":8649355,"src":"P80_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649355.html","width":130,"caption":"","height":86});
															thumbnails[8649497] = clik.newPhoto({"id":8649497,"src":"SL80_thumb.jpg","galleries_id":454214,"server_id":18,"link":"photo_8649497.html","width":130,"caption":"","height":86});
															thumbnails[8649865] = clik.newPhoto({"id":8649865,"src":"ST80_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649865.html","width":130,"caption":"","height":86});
															thumbnails[8589477] = clik.newPhoto({"id":8589477,"src":"CS81_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589477.html","width":130,"caption":"","height":86});
															thumbnails[8597377] = clik.newPhoto({"id":8597377,"src":"N90_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597377.html","width":130,"caption":"","height":86});
															thumbnails[8608765] = clik.newPhoto({"id":8608765,"src":"I90_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608765.html","width":130,"caption":"","height":65});
															thumbnails[8649353] = clik.newPhoto({"id":8649353,"src":"P90_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649353.html","width":130,"caption":"","height":86});
															thumbnails[8649495] = clik.newPhoto({"id":8649495,"src":"SL90_26847E35-1EC9-D45B-1CF1AB64213C95F4_thumb.jpg","galleries_id":454214,"server_id":18,"link":"photo_8649495.html","width":130,"caption":"","height":86});
															thumbnails[8649873] = clik.newPhoto({"id":8649873,"src":"ST90_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649873.html","width":130,"caption":"","height":86});
															thumbnails[8597393] = clik.newPhoto({"id":8597393,"src":"N100_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8597393.html","width":130,"caption":"","height":86});
															thumbnails[8608767] = clik.newPhoto({"id":8608767,"src":"I100_thumb.JPG","galleries_id":454210,"server_id":18,"link":"photo_8608767.html","width":130,"caption":"","height":86});
															thumbnails[8638151] = clik.newPhoto({"id":8638151,"src":"CS100_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8638151.html","width":130,"caption":"","height":86});
															thumbnails[8649366] = clik.newPhoto({"id":8649366,"src":"P100_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649366.html","width":130,"caption":"","height":86});
															thumbnails[8649494] = clik.newPhoto({"id":8649494,"src":"SL100_thumb.jpg","galleries_id":454214,"server_id":18,"link":"photo_8649494.html","width":130,"caption":"","height":86});
															thumbnails[8649878] = clik.newPhoto({"id":8649878,"src":"ST100_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649878.html","width":130,"caption":"","height":69});
															thumbnails[8589358] = clik.newPhoto({"id":8589358,"src":"CS50_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589358.html","width":130,"caption":"","height":86});
															thumbnails[8597442] = clik.newPhoto({"id":8597442,"src":"N110_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597442.html","width":130,"caption":"","height":86});
															thumbnails[8649363] = clik.newPhoto({"id":8649363,"src":"P110_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649363.html","width":130,"caption":"","height":86});
															thumbnails[8649860] = clik.newPhoto({"id":8649860,"src":"ST110_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649860.html","width":130,"caption":"","height":86});
															thumbnails[8597462] = clik.newPhoto({"id":8597462,"src":"N120_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597462.html","width":130,"caption":"","height":86});
															thumbnails[8649359] = clik.newPhoto({"id":8649359,"src":"P120_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649359.html","width":130,"caption":"","height":86});
															thumbnails[8649853] = clik.newPhoto({"id":8649853,"src":"ST120_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649853.html","width":130,"caption":"","height":87});
															thumbnails[8589985] = clik.newPhoto({"id":8589985,"src":"CS130_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589985.html","width":130,"caption":"","height":86});
															thumbnails[8597491] = clik.newPhoto({"id":8597491,"src":"N130_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8597491.html","width":120,"caption":"","height":90});
															thumbnails[8649333] = clik.newPhoto({"id":8649333,"src":"P130_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649333.html","width":130,"caption":"","height":86});
															thumbnails[8649854] = clik.newPhoto({"id":8649854,"src":"ST130_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649854.html","width":130,"caption":"","height":86});
															thumbnails[8597508] = clik.newPhoto({"id":8597508,"src":"palms2_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8597508.html","width":130,"caption":"","height":86});
															thumbnails[8649354] = clik.newPhoto({"id":8649354,"src":"P140_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649354.html","width":130,"caption":"","height":86});
															thumbnails[8649876] = clik.newPhoto({"id":8649876,"src":"ST140_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649876.html","width":130,"caption":"","height":86});
															thumbnails[8589991] = clik.newPhoto({"id":8589991,"src":"CS150_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589991.html","width":130,"caption":"","height":86});
															thumbnails[8597515] = clik.newPhoto({"id":8597515,"src":"mDSC_0100_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8597515.html","width":130,"caption":"","height":86});
															thumbnails[8649361] = clik.newPhoto({"id":8649361,"src":"P150_thumb.jpg","galleries_id":454213,"server_id":18,"link":"photo_8649361.html","width":130,"caption":"","height":86});
															thumbnails[8649884] = clik.newPhoto({"id":8649884,"src":"ST150_thumb.jpg","galleries_id":454209,"server_id":18,"link":"photo_8649884.html","width":130,"caption":"","height":65});
															thumbnails[8638137] = clik.newPhoto({"id":8638137,"src":"CS105_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8638137.html","width":130,"caption":"","height":86});
															thumbnails[8589996] = clik.newPhoto({"id":8589996,"src":"CS160_thumb.JPG","galleries_id":454208,"server_id":18,"link":"photo_8589996.html","width":130,"caption":"","height":86});
															thumbnails[8608779] = clik.newPhoto({"id":8608779,"src":"I160_thumb.jpg","galleries_id":454210,"server_id":18,"link":"photo_8608779.html","width":130,"caption":"","height":86});
															thumbnails[8649466] = clik.newPhoto({"id":8649466,"src":"N1601_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8649466.html","width":130,"caption":"","height":86});
															thumbnails[8649859] = clik.newPhoto({"id":8649859,"src":"ST160_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649859.html","width":130,"caption":"","height":86});
															thumbnails[8649968] = clik.newPhoto({"id":8649968,"src":"CS165_thumb.jpg","galleries_id":454208,"server_id":18,"link":"photo_8649968.html","width":130,"caption":"","height":86});
															thumbnails[8608780] = clik.newPhoto({"id":8608780,"src":"I170_thumb.jpg","galleries_id":454210,"server_id":18,"link":"photo_8608780.html","width":130,"caption":"","height":86});
															thumbnails[8649463] = clik.newPhoto({"id":8649463,"src":"N1701_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8649463.html","width":130,"caption":"","height":86});
															thumbnails[8649868] = clik.newPhoto({"id":8649868,"src":"ST170_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649868.html","width":130,"caption":"","height":86});
															thumbnails[8649972] = clik.newPhoto({"id":8649972,"src":"CS170_thumb.jpg","galleries_id":454208,"server_id":18,"link":"photo_8649972.html","width":130,"caption":"","height":86});
															thumbnails[8608782] = clik.newPhoto({"id":8608782,"src":"I180_thumb.jpg","galleries_id":454210,"server_id":18,"link":"photo_8608782.html","width":130,"caption":"","height":86});
															thumbnails[8649468] = clik.newPhoto({"id":8649468,"src":"N1801_thumb.jpg","galleries_id":454211,"server_id":18,"link":"photo_8649468.html","width":130,"caption":"","height":86});
															thumbnails[8649866] = clik.newPhoto({"id":8649866,"src":"ST180_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649866.html","width":130,"caption":"","height":86});
															thumbnails[8649976] = clik.newPhoto({"id":8649976,"src":"CS180_thumb.jpg","galleries_id":454208,"server_id":18,"link":"photo_8649976.html","width":130,"caption":"","height":86});
															thumbnails[8608783] = clik.newPhoto({"id":8608783,"src":"I190_thumb.jpg","galleries_id":454210,"server_id":18,"link":"photo_8608783.html","width":130,"caption":"","height":86});
															thumbnails[8649461] = clik.newPhoto({"id":8649461,"src":"N1901_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8649461.html","width":130,"caption":"","height":86});
															thumbnails[8649867] = clik.newPhoto({"id":8649867,"src":"ST190_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649867.html","width":130,"caption":"","height":86});
															thumbnails[8649979] = clik.newPhoto({"id":8649979,"src":"CS190_thumb.jpg","galleries_id":454208,"server_id":18,"link":"photo_8649979.html","width":130,"caption":"","height":86});
															thumbnails[8608785] = clik.newPhoto({"id":8608785,"src":"I200_thumb.jpg","galleries_id":454210,"server_id":18,"link":"photo_8608785.html","width":130,"caption":"","height":86});
															thumbnails[8649459] = clik.newPhoto({"id":8649459,"src":"N2001_thumb.JPG","galleries_id":454211,"server_id":18,"link":"photo_8649459.html","width":130,"caption":"","height":86});
															thumbnails[8649870] = clik.newPhoto({"id":8649870,"src":"ST200_thumb.JPG","galleries_id":454209,"server_id":18,"link":"photo_8649870.html","width":130,"caption":"","height":86});
															thumbnails[8649981] = clik.newPhoto({"id":8649981,"src":"CS200_thumb.jpg","galleries_id":454208,"server_id":18,"link":"photo_8649981.html","width":130,"caption":"","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[454208] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CITYSCAPES","link":"gallery_454208.html","maxRecords":0.0,"photoIDs":[8589341.0,8589347.0,8589348.0,8589353.0,8638133.0,8608702.0,8589360.0,8589365.0,8589477.0,8638151.0,8589358.0,8589985.0,8589991.0,8638137.0,8589996.0,8649968.0,8649972.0,8649976.0,8649979.0,8649981.0],"skipIndex":0,"section_code":"gallery","featured_images":"8649968,8608702,8589365,8589360,8589353,8589341","id":454208,"singleSection":false});				  						galleries[454209] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"STREET LIFE","link":"gallery_454209.html","maxRecords":0.0,"photoIDs":[8649857.0,8649863.0,8649856.0,8649882.0,8649887.0,8649864.0,8649855.0,8649865.0,8649873.0,8649878.0,8649860.0,8649853.0,8649854.0,8649876.0,8649884.0,8649859.0,8649868.0,8649866.0,8649867.0,8649870.0],"skipIndex":0,"section_code":"gallery","featured_images":"8649884,8649882,8649864,8649860","id":454209,"singleSection":false});				  						galleries[454210] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"INDUSTRIAL","link":"gallery_454210.html","maxRecords":0.0,"photoIDs":[8608754.0,8608755.0,8608757.0,8608758.0,8608759.0,8608761.0,8608763.0,8608764.0,8608765.0,8608767.0,8608779.0,8608780.0,8608782.0,8608783.0,8608785.0],"skipIndex":0,"section_code":"gallery","featured_images":"8608783,8608779,8608763,8608761","id":454210,"singleSection":false});				  						galleries[454211] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"NATURE","link":"gallery_454211.html","maxRecords":0.0,"photoIDs":[8597342.0,8597344.0,8597345.0,8597346.0,8597348.0,8597350.0,8597352.0,8597376.0,8597377.0,8597393.0,8597442.0,8597462.0,8597491.0,8597508.0,8597515.0,8649466.0,8649463.0,8649468.0,8649461.0,8649459.0],"skipIndex":0,"section_code":"gallery","featured_images":8649463.0,"id":454211,"singleSection":false});				  						galleries[454213] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTAITS","link":"gallery_454213.html","maxRecords":0.0,"photoIDs":[8649356.0,8649357.0,8649364.0,8649352.0,8649358.0,8649360.0,8649368.0,8649355.0,8649353.0,8649366.0,8649363.0,8649359.0,8649333.0,8649354.0,8649361.0],"skipIndex":0,"section_code":"gallery","featured_images":"8649361,8649354","id":454213,"singleSection":false});				  						galleries[454214] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"STILL LIFE","link":"gallery_454214.html","maxRecords":0.0,"photoIDs":[8608687.0,8608689.0,8608697.0,8649489.0,8608703.0,8649498.0,8649493.0,8649497.0,8649495.0,8649494.0],"skipIndex":0,"section_code":"gallery","featured_images":8649495.0,"id":454214,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8649857,8589341,8649863,8608757,8597345,8649882,8649498,8589365,8649495,8608765,8649853,8649876,8597508,8649361,8649968,8608783,8649870,8649459';
imageSets[2] = '8589341,8649882,8589353,8608702,8649864,8608761,8589360,8608763,8589365,8649495,8649860,8649354,8649884,8649361,8608779,8649968,8649463,8608783';
imageSets[3] = '8649981,8649979,8649976,8649972,8649968,8649887,8649884,8649882,8649878,8649876,8649873,8649870,8649868,8649867,8649866,8649865,8649864,8649863,8649860,8649859,8649857,8649856,8649855,8649854,8649853,8649498,8649497,8649495,8649494,8649493,8649489,8649468,8649466,8649463,8649461,8649459,8649368,8649366,8649364,8649363,8649361,8649360,8649359,8649358,8649357,8649356,8649355,8649354,8649353,8649352';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/barbafia/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/barbafia/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/barbafia/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 = 'Barbara Müller Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>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;
	}
}

			

