window.thumbnails = {};
															thumbnails[6616123] = clik.newPhoto({"id":6616123,"src":"COMING_SOON_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"COMING SOON","height":87});
															thumbnails[8744385] = clik.newPhoto({"id":8744385,"src":"portada_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":87});
															thumbnails[8997956] = clik.newPhoto({"id":8997956,"src":"20120109_vincennes_009_copia_2_FA5171E1-1EC9-D45B-1C7D0EE4F6B9F31E_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8997956.html","width":130,"caption":"","height":92});
															thumbnails[8839770] = clik.newPhoto({"id":8839770,"src":"20110723_festivalfnaclive_10_C572C086-24E8-5EC4-4FFA812A80459E77_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839770.html","width":130,"caption":"","height":171});
															thumbnails[8896807] = clik.newPhoto({"id":8896807,"src":"20111207_zoo_019_copia_2_2FEE5AFF-1EC9-DFB6-09A7B5B14E073219_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8896807.html","width":130,"caption":"","height":90});
															thumbnails[8839771] = clik.newPhoto({"id":8839771,"src":"20110916_paris_bayonne_201_copia_C572FD08-24E8-5EC4-4FB556A0AEC3911F_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839771.html","width":130,"caption":"","height":100});
															thumbnails[8839765] = clik.newPhoto({"id":8839765,"src":"20111129_kaiser_chiefs_002_C52D0294-24E8-5EC4-4F1C7C926DB3886F_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839765.html","width":130,"caption":"","height":180});
															thumbnails[8839763] = clik.newPhoto({"id":8839763,"src":"20111018_front_de_gauche_041_copia_C52CAAE9-24E8-5EC4-4F73156C6D39ED3F_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839763.html","width":130,"caption":"","height":94});
															thumbnails[8839762] = clik.newPhoto({"id":8839762,"src":"20100731_NETHERLANDS-ENGLAND_33_C52C5DB2-24E8-5EC4-4FCCB6EF9537C1AB_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839762.html","width":130,"caption":"","height":159});
															thumbnails[8839764] = clik.newPhoto({"id":8839764,"src":"20111120_lechatpotte_023_C52CD3D0-24E8-5EC4-4F04EA10E5839099_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839764.html","width":130,"caption":"","height":177});
															thumbnails[7713827] = clik.newPhoto({"id":7713827,"src":"20110423_marseille_montpellier_76 copia_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_7713827.html","width":130,"caption":"","height":89});
															thumbnails[6501067] = clik.newPhoto({"id":6501067,"src":"20100806_EIFFEL_01_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6501067.html","width":130,"caption":"","height":96});
															thumbnails[6988209] = clik.newPhoto({"id":6988209,"src":"20101008_VINDAGE_01_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6988209.html","width":130,"caption":"","height":87});
															thumbnails[6940254] = clik.newPhoto({"id":6940254,"src":"20100626_ARGENTINE_FRANCE_01_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6940254.html","width":130,"caption":"","height":89});
															thumbnails[8508911] = clik.newPhoto({"id":8508911,"src":"20100831_Conférence_pres_RMC_et_BFMTV_03_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508911.html","width":130,"caption":"","height":101});
															thumbnails[3204989] = clik.newPhoto({"id":3204989,"src":"070204 salon lengerie03_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_3204989.html","width":130,"caption":"","height":195});
															thumbnails[4434204] = clik.newPhoto({"id":4434204,"src":"20090801_ELLERSTINA-LA_DOLFINA_004_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_4434204.html","width":130,"caption":"","height":86});
															thumbnails[7704875] = clik.newPhoto({"id":7704875,"src":"20110423_racing_clermont_01_copia_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_7704875.html","width":130,"caption":"","height":95});
															thumbnails[8213940] = clik.newPhoto({"id":8213940,"src":"20110721_FESTIVALFNACLIVE_06_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8213940.html","width":130,"caption":"","height":186});
															thumbnails[8839759] = clik.newPhoto({"id":8839759,"src":"20091202_BRASIL-ARGENTINA_414_C52BAC5D-24E8-5EC4-4F6A68A605AC7967_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839759.html","width":130,"caption":"","height":45});
															thumbnails[7426290] = clik.newPhoto({"id":7426290,"src":"20110212 LONG ISLAND BAR 17_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_7426290.html","width":130,"caption":"","height":97});
															thumbnails[6850330] = clik.newPhoto({"id":6850330,"src":"20101004_FICTION_PLANE_CONCERT_06_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6850330.html","width":130,"caption":"","height":91});
															thumbnails[8508909] = clik.newPhoto({"id":8508909,"src":"20090130_pretaporter_02_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508909.html","width":130,"caption":"","height":182});
															thumbnails[4249351] = clik.newPhoto({"id":4249351,"src":"open_france_golf_0239_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_4249351.html","width":130,"caption":"","height":86});
															thumbnails[8508913] = clik.newPhoto({"id":8508913,"src":"20100831_Conférence_pres_RMC_et_BFMTV_15_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508913.html","width":130,"caption":"","height":183});
															thumbnails[8839761] = clik.newPhoto({"id":8839761,"src":"20100725_LILLE_01_C52C264D-24E8-5EC4-4FF7741FA933A9FD_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839761.html","width":130,"caption":"","height":72});
															thumbnails[8508915] = clik.newPhoto({"id":8508915,"src":"20100915_Congres_Victimes_Terrorisme_07_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508915.html","width":130,"caption":"","height":172});
															thumbnails[6503168] = clik.newPhoto({"id":6503168,"src":"_DSC3359_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6503168.html","width":130,"caption":"","height":91});
															thumbnails[8508919] = clik.newPhoto({"id":8508919,"src":"20100916_JEROME_SAVARY_80_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508919.html","width":130,"caption":"","height":91});
															thumbnails[8508923] = clik.newPhoto({"id":8508923,"src":"20100917_CONCERT_PEACE_ONE_DAY_99_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508923.html","width":130,"caption":"","height":167});
															thumbnails[6617788] = clik.newPhoto({"id":6617788,"src":"20100827_POLAND-SCOTLAND_02_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6617788.html","width":130,"caption":"","height":85});
															thumbnails[6614311] = clik.newPhoto({"id":6614311,"src":"20100826_FRANCE-IRELAND_01_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6614311.html","width":130,"caption":"","height":180});
															thumbnails[8508935] = clik.newPhoto({"id":8508935,"src":"_DSC0766_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508935.html","width":130,"caption":"","height":100});
															thumbnails[8508939] = clik.newPhoto({"id":8508939,"src":"_DSC8557_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508939.html","width":130,"caption":"","height":186});
															thumbnails[6536581] = clik.newPhoto({"id":6536581,"src":"20091202_BRASIL-ARGENTINA_4181_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6536581.html","width":130,"caption":"","height":65});
															thumbnails[7713824] = clik.newPhoto({"id":7713824,"src":"20110423_marseille_montpellier_40 copia_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_7713824.html","width":130,"caption":"","height":92});
															thumbnails[8508906] = clik.newPhoto({"id":8508906,"src":"080603_debate_c_ricardo_piglia2_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508906.html","width":130,"caption":"","height":95});
															thumbnails[8839760] = clik.newPhoto({"id":8839760,"src":"20100308_GROOVE_ARMADA_CONCERT_452_C52BE560-24E8-5EC4-4FC41921D939674E_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8839760.html","width":130,"caption":"","height":200});
															thumbnails[3439945] = clik.newPhoto({"id":3439945,"src":"090211 Francia0-Argentina2 21_thumb.JPG","galleries_id":449670,"server_id":32,"link":"photo_3439945.html","width":130,"caption":"","height":86});
															thumbnails[8213942] = clik.newPhoto({"id":8213942,"src":"20110721_FESTIVALFNACLIVE_10_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8213942.html","width":130,"caption":"","height":98});
															thumbnails[4434206] = clik.newPhoto({"id":4434206,"src":"20090801_ELLERSTINA-LA_DOLFINA_006_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_4434206.html","width":130,"caption":"","height":195});
															thumbnails[3388739] = clik.newPhoto({"id":3388739,"src":"090130 pret aporter025_thumb.JPG","galleries_id":449670,"server_id":32,"link":"photo_3388739.html","width":130,"caption":"","height":195});
															thumbnails[6961449] = clik.newPhoto({"id":6961449,"src":"20100211_LUCIE_SAFAROVACZE-FRANCESCA_SCHIAVONEITA_164_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6961449.html","width":130,"caption":"","height":87});
															thumbnails[6899806] = clik.newPhoto({"id":6899806,"src":"2010_PAUL_02_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6899806.html","width":130,"caption":"","height":81});
															thumbnails[4249350] = clik.newPhoto({"id":4249350,"src":"open_france_golf_0141_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_4249350.html","width":130,"caption":"","height":87});
															thumbnails[6503167] = clik.newPhoto({"id":6503167,"src":"_DSC0558_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6503167.html","width":130,"caption":"","height":95});
															thumbnails[6699815] = clik.newPhoto({"id":6699815,"src":"20100908_CONCERT_LIMP_BIZKIT_08_F696A123-24E8-5EC4-4F26DB80615BEE1E_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6699815.html","width":130,"caption":"","height":94});
															thumbnails[3167394] = clik.newPhoto({"id":3167394,"src":"080406 toulouse-cardiff h-cup10_thumb.JPG","galleries_id":449670,"server_id":32,"link":"photo_3167394.html","width":130,"caption":"","height":84});
															thumbnails[3373976] = clik.newPhoto({"id":3373976,"src":"090119 SALON LENGERIE1442_thumb.JPG","galleries_id":449670,"server_id":32,"link":"photo_3373976.html","width":130,"caption":"","height":195});
															thumbnails[6505722] = clik.newPhoto({"id":6505722,"src":"_DSC1043_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_6505722.html","width":130,"caption":"","height":93});
															thumbnails[8508925] = clik.newPhoto({"id":8508925,"src":"20101108_CONCERT_LCD_SOUNDSYSTEM_12_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508925.html","width":130,"caption":"","height":177});
															thumbnails[8508928] = clik.newPhoto({"id":8508928,"src":"20110906_conference_presse_044_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508928.html","width":130,"caption":"","height":91});
															thumbnails[8508933] = clik.newPhoto({"id":8508933,"src":"20110919_FNAC_MIX_012_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508933.html","width":130,"caption":"","height":92});
															thumbnails[8508930] = clik.newPhoto({"id":8508930,"src":"20110911_psg_brest_002_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508930.html","width":130,"caption":"","height":91});
															thumbnails[8508937] = clik.newPhoto({"id":8508937,"src":"_DSC0799_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8508937.html","width":130,"caption":"","height":183});
															thumbnails[8509141] = clik.newPhoto({"id":8509141,"src":"20100917_CONCERT_PEACE_ONE_DAY_135_92FB9676-24E8-5EC4-4F69E630A53EF3B2_thumb.jpg","galleries_id":449670,"server_id":32,"link":"photo_8509141.html","width":130,"caption":"","height":182});
															thumbnails[3167352] = clik.newPhoto({"id":3167352,"src":"070520wasps-leicester h cup 4_thumb.JPG","galleries_id":449670,"server_id":32,"link":"photo_3167352.html","width":130,"caption":"","height":86});
															thumbnails[3140292] = clik.newPhoto({"id":3140292,"src":"05OCT200631_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_3140292.html","width":130,"caption":"CLARIN","height":177});
															thumbnails[4097293] = clik.newPhoto({"id":4097293,"src":"20090616_RUGBYFUN_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_4097293.html","width":130,"caption":"RUGBYFUN","height":104});
															thumbnails[4097294] = clik.newPhoto({"id":4097294,"src":"20090616_THE_GUARDIAN_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_4097294.html","width":130,"caption":"THE GUARDIAN","height":116});
															thumbnails[4434353] = clik.newPhoto({"id":4434353,"src":"20090725THE_SUN_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_4434353.html","width":130,"caption":"THE SUN","height":95});
															thumbnails[6436122] = clik.newPhoto({"id":6436122,"src":"20100729_CUGATCAT_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6436122.html","width":130,"caption":"CUGAT.CAT","height":92});
															thumbnails[6499301] = clik.newPhoto({"id":6499301,"src":"20100727_THE_SUN_542F6D05-24E8-5EC4-4FC8B804682191DE_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6499301.html","width":130,"caption":" THE SUN","height":98});
															thumbnails[6509481] = clik.newPhoto({"id":6509481,"src":"20090903_LE10SPORT_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6509481.html","width":130,"caption":" LE 10 SPORT","height":84});
															thumbnails[6515458] = clik.newPhoto({"id":6515458,"src":"20100316_ESPN_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6515458.html","width":130,"caption":"ESPN","height":83});
															thumbnails[6425205] = clik.newPhoto({"id":6425205,"src":"20100609_ENGLAND-IRELAND_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6425205.html","width":130,"caption":"IRISH TIMES","height":100});
															thumbnails[6431609] = clik.newPhoto({"id":6431609,"src":"20100727_LEINSTER_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6431609.html","width":130,"caption":"LEINSTER RUGBY","height":81});
															thumbnails[6436123] = clik.newPhoto({"id":6436123,"src":"20100729_DIARI_DE_TERRASA_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6436123.html","width":130,"caption":"DIARI DE TERRASA","height":179});
															thumbnails[6499302] = clik.newPhoto({"id":6499302,"src":"20100730_ENGLANDHOCKEYORG_542F6E7C-24E8-5EC4-4F6B4A13561C7014_thumb.jpg","galleries_id":208287,"server_id":32,"link":"photo_6499302.html","width":130,"caption":"ENGLAND HOCKEY","height":75});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[449670] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PORTFOLIO","link":"section541271.html","maxRecords":0.0,"photoIDs":[8997956.0,8839770.0,8896807.0,8839771.0,8839765.0,8839763.0,8839762.0,8839764.0,7713827.0,6501067.0,6988209.0,6940254.0,8508911.0,3204989.0,4434204.0,7704875.0,8213940.0,8839759.0,7426290.0,6850330.0,8508909.0,4249351.0,8508913.0,8839761.0,8508915.0,6503168.0,8508919.0,8508923.0,6617788.0,6614311.0,8508935.0,8508939.0,6536581.0,7713824.0,8508906.0,8839760.0,3439945.0,8213942.0,4434206.0,3388739.0,6961449.0,6899806.0,4249350.0,6503167.0,6699815.0,3167394.0,3373976.0,6505722.0,8508925.0,8508928.0,8508933.0,8508930.0,8508937.0,8509141.0,3167352.0],"skipIndex":0,"section_code":"section541271","featured_images":"8997956,8896807,8839771,8839770,8839765,8839764,8839763,8839762,8839761,8839760","id":449670,"singleSection":true});				  						galleries[208287] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Printed ","link":"section242811.html","maxRecords":0.0,"photoIDs":[3140292.0,4097293.0,4097294.0,4434353.0,6436122.0,6499301.0,6509481.0,6515458.0,6425205.0,6431609.0,6436123.0,6499302.0],"skipIndex":0,"section_code":"section242811","featured_images":"6431609,3140292","id":208287,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8744385';
imageSets[2] = '3140292,6431609';
imageSets[3] = '6515458,6509481,6499301,6499302';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/flordeloto3012/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/flordeloto3012/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 += 'section541271.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 && 'section541271' != '') {
					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 = 'INFOKO.net: ' + 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;
	}
}

			

