window.thumbnails = {};
															thumbnails[8965188] = clik.newPhoto({"id":8965188,"src":"70_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965188.html","width":130,"caption":"Reception at Imperial Hotel","height":87});
															thumbnails[8965206] = clik.newPhoto({"id":8965206,"src":"68a_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965206.html","width":130,"caption":"Wedding at UCC Honan Chapel","height":106});
															thumbnails[8965211] = clik.newPhoto({"id":8965211,"src":"41_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965211.html","width":130,"caption":"Wedding at UCC Honan Chapel","height":87});
															thumbnails[8965215] = clik.newPhoto({"id":8965215,"src":"11_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965215.html","width":130,"caption":"Wedding at UCC Honan Chapel","height":87});
															thumbnails[8965221] = clik.newPhoto({"id":8965221,"src":"10_6C5015AF-1EC9-D45B-1CCAD303776811AD_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965221.html","width":130,"caption":"Wedding at UCC Honan Chapel","height":74});
															thumbnails[8965245] = clik.newPhoto({"id":8965245,"src":"91_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965245.html","width":104,"caption":"Wedding at UCC Honan Chapel","height":130});
															thumbnails[8965627] = clik.newPhoto({"id":8965627,"src":"_MG_6909-Edit1_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965627.html","width":130,"caption":"Wedding at St. Mary's Church Mallow","height":130});
															thumbnails[8965629] = clik.newPhoto({"id":8965629,"src":"_MG_6965-Edit_6CE54215-1EC9-D45B-1C9ECE6265AC60D6_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965629.html","width":130,"caption":"Wedding Reception Springfort Hall Mallow","height":87});
															thumbnails[8965630] = clik.newPhoto({"id":8965630,"src":"_MG_7001-2_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965630.html","width":130,"caption":"Wedding Reception Springfort Hall Mallow","height":86});
															thumbnails[8965631] = clik.newPhoto({"id":8965631,"src":"_MG_7020-Edit_cropped-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965631.html","width":75,"caption":"Wedding Reception Springfort Hall Mallow","height":130});
															thumbnails[8965633] = clik.newPhoto({"id":8965633,"src":"_MG_7028-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965633.html","width":98,"caption":"Wedding Reception Springfort Hall Mallow","height":130});
															thumbnails[8965634] = clik.newPhoto({"id":8965634,"src":"_MG_7029-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965634.html","width":92,"caption":"Wedding Reception Springfort Hall Mallow","height":130});
															thumbnails[8965636] = clik.newPhoto({"id":8965636,"src":"_MG_7038-Edit_copy_6_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965636.html","width":130,"caption":"Wedding Reception at Springfort Hall","height":67});
															thumbnails[8965637] = clik.newPhoto({"id":8965637,"src":"_MG_85211_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965637.html","width":130,"caption":"Getting Married","height":104});
															thumbnails[8965641] = clik.newPhoto({"id":8965641,"src":"_MG_85541_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965641.html","width":130,"caption":"Proud Mother of the Bride","height":104});
															thumbnails[8965642] = clik.newPhoto({"id":8965642,"src":"_MG_8555_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965642.html","width":130,"caption":"Proud Mother of the Groom","height":104});
															thumbnails[8965643] = clik.newPhoto({"id":8965643,"src":"_MG_86252_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965643.html","width":130,"caption":"Beautiful Bride","height":104});
															thumbnails[8965645] = clik.newPhoto({"id":8965645,"src":"_MG_91133_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965645.html","width":104,"caption":"Beautiful Bride","height":130});
															thumbnails[8965647] = clik.newPhoto({"id":8965647,"src":"_MG_91172_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965647.html","width":130,"caption":"Beautiful Bride","height":111});
															thumbnails[8965648] = clik.newPhoto({"id":8965648,"src":"_MG_9175_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965648.html","width":100,"caption":"Hand in Hand","height":130});
															thumbnails[8965652] = clik.newPhoto({"id":8965652,"src":"_MG_9269-Edit-Edit-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965652.html","width":104,"caption":"Romantic Wedding Couple","height":130});
															thumbnails[8965653] = clik.newPhoto({"id":8965653,"src":"_MG_92781_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965653.html","width":104,"caption":"Romantic Wedding Couple","height":130});
															thumbnails[8965659] = clik.newPhoto({"id":8965659,"src":"_MG_9382_7C3291C7-24E8-5EC4-4F88E592DCA3C28B_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965659.html","width":91,"caption":"Groom","height":130});
															thumbnails[8965676] = clik.newPhoto({"id":8965676,"src":"3_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965676.html","width":130,"caption":"Beautiful Bride","height":104});
															thumbnails[8965683] = clik.newPhoto({"id":8965683,"src":"123_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965683.html","width":130,"caption":"Happy Bride & her Sister","height":104});
															thumbnails[8965684] = clik.newPhoto({"id":8965684,"src":"18_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965684.html","width":130,"caption":"Attentive Couple","height":87});
															thumbnails[8965688] = clik.newPhoto({"id":8965688,"src":"38_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965688.html","width":130,"caption":"Groom congratulated by the groomsmen","height":93});
															thumbnails[8965689] = clik.newPhoto({"id":8965689,"src":"411_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965689.html","width":130,"caption":"Lighting the candles","height":87});
															thumbnails[8965690] = clik.newPhoto({"id":8965690,"src":"59_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965690.html","width":130,"caption":"Group Shot at Springfort Hall","height":87});
															thumbnails[8965714] = clik.newPhoto({"id":8965714,"src":"79_7C2D4D8B-24E8-5EC4-4FD854107D6C4E58_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965714.html","width":130,"caption":"First Dance","height":104});
															thumbnails[8965717] = clik.newPhoto({"id":8965717,"src":"Bride_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965717.html","width":130,"caption":"Wedding Reception Longueville House","height":130});
															thumbnails[8965718] = clik.newPhoto({"id":8965718,"src":"Happy_bride1_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965718.html","width":130,"caption":"Wedding Reception Longueville House","height":104});
															thumbnails[8965754] = clik.newPhoto({"id":8965754,"src":"_MG_9602-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965754.html","width":130,"caption":"Competition for the Wedding Photographer","height":87});
															thumbnails[8965768] = clik.newPhoto({"id":8965768,"src":"_MG_8861-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965768.html","width":130,"caption":"Bride & Groom having a laugh","height":104});
															thumbnails[8965775] = clik.newPhoto({"id":8965775,"src":"_MG_8857-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965775.html","width":130,"caption":"Bride & Groom having a laugh","height":97});
															thumbnails[8965792] = clik.newPhoto({"id":8965792,"src":"_MG_8836-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965792.html","width":103,"caption":"Beautiful Bride","height":130});
															thumbnails[8965797] = clik.newPhoto({"id":8965797,"src":"GB-1_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965797.html","width":130,"caption":"Gougane Barra Wedding","height":83});
															thumbnails[8965798] = clik.newPhoto({"id":8965798,"src":"gotcha_web1_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8965798.html","width":130,"caption":"Would the real photographer please stand up?","height":93});
															thumbnails[8966003] = clik.newPhoto({"id":8966003,"src":"Contemporary_Collection_thumb.jpg","galleries_id":349830,"server_id":15,"link":"photo_8966003.html","width":130,"caption":"Album Epoca - Contemporary","height":98});
															thumbnails[8966005] = clik.newPhoto({"id":8966005,"src":"Evolution_Collection_thumb.jpg","galleries_id":349830,"server_id":15,"link":"photo_8966005.html","width":130,"caption":"Album Epoca - Evolution","height":98});
															thumbnails[8966006] = clik.newPhoto({"id":8966006,"src":"Retro_Collection_thumb.jpg","galleries_id":349830,"server_id":15,"link":"photo_8966006.html","width":130,"caption":"Album Epoca - Retro","height":98});
															thumbnails[8966007] = clik.newPhoto({"id":8966007,"src":"Tradition_Collection_thumb.jpg","galleries_id":349830,"server_id":15,"link":"photo_8966007.html","width":130,"caption":"Album Epoca - Tradition","height":98});
															thumbnails[8966089] = clik.newPhoto({"id":8966089,"src":"Album_1_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966089.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966091] = clik.newPhoto({"id":8966091,"src":"Untitled-2_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966091.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966093] = clik.newPhoto({"id":8966093,"src":"Untitled-3_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966093.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966094] = clik.newPhoto({"id":8966094,"src":"Untitled-4_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966094.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966098] = clik.newPhoto({"id":8966098,"src":"Untitled-6_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966098.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966108] = clik.newPhoto({"id":8966108,"src":"Untitled-8_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966108.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966119] = clik.newPhoto({"id":8966119,"src":"Untitled-9_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8966119.html","width":130,"caption":"Wedding Album","height":47});
															thumbnails[8966220] = clik.newPhoto({"id":8966220,"src":"1_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966220.html","width":107,"caption":"Dunquin Pier","height":130});
															thumbnails[8966223] = clik.newPhoto({"id":8966223,"src":"2_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966223.html","width":107,"caption":"Brandon Creek","height":130});
															thumbnails[8966240] = clik.newPhoto({"id":8966240,"src":"3_729AE034-24E8-5EC4-4FC0E3EF54FFB2A0_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966240.html","width":130,"caption":"Banteer Park","height":96});
															thumbnails[8966241] = clik.newPhoto({"id":8966241,"src":"4_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966241.html","width":130,"caption":"Bantry House","height":97});
															thumbnails[8966245] = clik.newPhoto({"id":8966245,"src":"5_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966245.html","width":130,"caption":"Gougane Barra","height":88});
															thumbnails[8966248] = clik.newPhoto({"id":8966248,"src":"6_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966248.html","width":130,"caption":"View from St. John's Well","height":59});
															thumbnails[8966249] = clik.newPhoto({"id":8966249,"src":"7_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966249.html","width":130,"caption":"View from St. John's Well","height":49});
															thumbnails[8966252] = clik.newPhoto({"id":8966252,"src":"8_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966252.html","width":130,"caption":"Gougane Barra Fog","height":62});
															thumbnails[8966254] = clik.newPhoto({"id":8966254,"src":"9_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966254.html","width":130,"caption":"Gougane Barra","height":70});
															thumbnails[8966255] = clik.newPhoto({"id":8966255,"src":"10_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966255.html","width":130,"caption":"Gougane Barra","height":107});
															thumbnails[8966256] = clik.newPhoto({"id":8966256,"src":"11_72C7F94B-24E8-5EC4-4FD4343F90D81520_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966256.html","width":130,"caption":"Gougane Barra","height":71});
															thumbnails[8966257] = clik.newPhoto({"id":8966257,"src":"12_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966257.html","width":130,"caption":"Gougane Barra","height":84});
															thumbnails[8966259] = clik.newPhoto({"id":8966259,"src":"13_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966259.html","width":130,"caption":"Gougane Barra","height":93});
															thumbnails[8966262] = clik.newPhoto({"id":8966262,"src":"14_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966262.html","width":130,"caption":"Gougane Barra","height":112});
															thumbnails[8966267] = clik.newPhoto({"id":8966267,"src":"15_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966267.html","width":130,"caption":"Mizen Head","height":98});
															thumbnails[8966273] = clik.newPhoto({"id":8966273,"src":"16_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966273.html","width":130,"caption":"Mizen Head","height":130});
															thumbnails[8966278] = clik.newPhoto({"id":8966278,"src":"17_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966278.html","width":98,"caption":"Mizen Head","height":130});
															thumbnails[8966284] = clik.newPhoto({"id":8966284,"src":"18_72E67DE4-24E8-5EC4-4F8FD994BD807A72_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966284.html","width":130,"caption":"Ross Castle","height":96});
															thumbnails[8966290] = clik.newPhoto({"id":8966290,"src":"19_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966290.html","width":130,"caption":"Courtmacsherry","height":90});
															thumbnails[8966297] = clik.newPhoto({"id":8966297,"src":"20_thumb.jpg","galleries_id":283620,"server_id":15,"link":"photo_8966297.html","width":130,"caption":"Valentia Island","height":76});
															thumbnails[8967176] = clik.newPhoto({"id":8967176,"src":"_MG_5126-Edit_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8967176.html","width":87,"caption":"Gougane Barra Wedding","height":130});
															thumbnails[8967183] = clik.newPhoto({"id":8967183,"src":"_MG_5139-Paint-Web_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8967183.html","width":130,"caption":"Gougane Barra Wedding","height":79});
															thumbnails[8967190] = clik.newPhoto({"id":8967190,"src":"_MG_5159_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8967190.html","width":130,"caption":"Gougane Barra Wedding","height":66});
															thumbnails[8967193] = clik.newPhoto({"id":8967193,"src":"Album-3_thumb.jpg","galleries_id":342852,"server_id":15,"link":"photo_8967193.html","width":130,"caption":"Wedding Album","height":46});
															thumbnails[8967207] = clik.newPhoto({"id":8967207,"src":"Carroll-Photography-1_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8967207.html","width":130,"caption":"Wedding Reception Longueville House","height":43});
															thumbnails[8967209] = clik.newPhoto({"id":8967209,"src":"Carroll_photography_4_thumb.jpg","galleries_id":339759,"server_id":15,"link":"photo_8967209.html","width":130,"caption":"Wedding Reception Longueville House","height":43});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[339759] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Weddings","link":"gallery_339759.html","maxRecords":0.0,"photoIDs":[8965188.0,8965206.0,8965211.0,8965215.0,8965221.0,8965245.0,8965627.0,8965629.0,8965630.0,8965631.0,8965633.0,8965634.0,8965636.0,8965637.0,8965641.0,8965642.0,8965643.0,8965645.0,8965647.0,8965648.0,8965652.0,8965653.0,8965659.0,8965676.0,8965683.0,8965684.0,8965688.0,8965689.0,8965690.0,8965714.0,8965717.0,8965718.0,8965754.0,8965768.0,8965775.0,8965792.0,8965797.0,8965798.0,8967176.0,8967183.0,8967190.0,8967207.0,8967209.0],"skipIndex":0,"section_code":"gallery","featured_images":"8967209,8967207,8967190,8967183,8967176,8965797,8965792,8965768,8965718,8965717,8965714,8965690,8965689,8965688,8965684,8965683,8965676,8965659,8965653,8965652,8965648,8965647,8965645,8965643,8965642,8965641,8965637,8965636,8965634,8965633,8965631,8965630,8965629,8965627,8965245,8965221,8965215,8965211,8965206,8965188","id":339759,"singleSection":false});				  						galleries[342852] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Album Images","link":"gallery_342852.html","maxRecords":0.0,"photoIDs":[8966089.0,8966091.0,8966093.0,8966094.0,8966098.0,8966108.0,8966119.0,8967193.0],"skipIndex":0,"section_code":"gallery","featured_images":"8967193,8966119,8966108,8966098,8966094,8966093,8966091,8966089","id":342852,"singleSection":false});				  						galleries[349830] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Wedding Albums","link":"gallery_349830.html","maxRecords":0.0,"photoIDs":[8966003.0,8966005.0,8966006.0,8966007.0],"skipIndex":0,"section_code":"gallery","featured_images":"8966007,8966006,8966005,8966003","id":349830,"singleSection":false});				  						galleries[283620] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landscape","link":"gallery_283620.html","maxRecords":0.0,"photoIDs":[8966220.0,8966223.0,8966240.0,8966241.0,8966245.0,8966248.0,8966249.0,8966252.0,8966254.0,8966255.0,8966256.0,8966257.0,8966259.0,8966262.0,8966267.0,8966273.0,8966278.0,8966284.0,8966290.0,8966297.0],"skipIndex":0,"section_code":"gallery","featured_images":"8966297,8966290,8966284,8966278,8966273,8966262,8966259,8966257,8966256,8966255,8966254,8966252,8966249,8966248,8966245,8966241,8966240,8966223,8966220","id":283620,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8965647,8965643,8965636,8965630,8965629,8965627,8965211';
imageSets[2] = '8967209,8967207,8967193,8967190,8967183,8967176,8966297,8966290,8966284,8966278,8966273,8966262,8966259,8966257,8966256,8966255,8966254,8966252,8966249,8966248,8966245,8966241,8966240,8966223,8966220,8966119,8966108,8966098,8966094,8966093,8966091,8966089,8966007,8966006,8966005,8966003,8965797,8965792,8965768,8965718,8965717,8965714,8965690,8965689,8965688,8965684,8965683,8965676,8965659,8965653,8965652,8965648,8965647,8965645,8965643,8965642,8965641,8965637,8965636,8965634,8965633,8965631,8965630,8965629,8965627,8965245,8965221,8965215,8965211,8965206,8965188';
imageSets[3] = '8965754';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/clementcarroll/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/clementcarroll/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 = 'Welcome to Carroll Wedding 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>';
	}
				
	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.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="carrollphotography@ymail.com">';
					temp += '<input type="hidden" name="currency_code" value="EUR">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="carrollphotography@ymail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

