window.thumbnails = {};
															thumbnails[3732873] = clik.newPhoto({"id":3732873,"src":"Bólus_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"View from Bolus Head","height":43});
															thumbnails[3732811] = clik.newPhoto({"id":3732811,"src":"duIMG_6193innen_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732811.html","width":130,"caption":"Double Bedroom","height":87});
															thumbnails[3732814] = clik.newPhoto({"id":3732814,"src":"duIMG_6285innen_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732814.html","width":130,"caption":"Sitting Room","height":87});
															thumbnails[3732817] = clik.newPhoto({"id":3732817,"src":"duIMG_6287hausaussen2_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732817.html","width":130,"caption":"View towards Puffin Island","height":87});
															thumbnails[3732824] = clik.newPhoto({"id":3732824,"src":"duIMG_6429_Kopiehausaussen_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732824.html","width":130,"caption":"Duchealla in Summer","height":87});
															thumbnails[3732830] = clik.newPhoto({"id":3732830,"src":"_MGReenroeRiders_8498_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732830.html","width":130,"caption":"Riders at Reenroe Beach","height":87});
															thumbnails[3732838] = clik.newPhoto({"id":3732838,"src":"BallinskelligsBaycopy_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732838.html","width":130,"caption":"Ballinskelligs Bay from Old Priory","height":195});
															thumbnails[3732877] = clik.newPhoto({"id":3732877,"src":"IMG_0001Kilrealigsheep_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732877.html","width":130,"caption":"Sheep Kilrealig","height":195});
															thumbnails[3732882] = clik.newPhoto({"id":3732882,"src":"IMG_3141Skelligsunset_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732882.html","width":130,"caption":"Skellig Sunset","height":85});
															thumbnails[3732885] = clik.newPhoto({"id":3732885,"src":"IMG_6273HorseIsland_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732885.html","width":130,"caption":"Horse Island in Ballinskelligs Bay","height":87});
															thumbnails[3732892] = clik.newPhoto({"id":3732892,"src":"IMG_9667Glensheep2_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732892.html","width":130,"caption":"St Finian´s Bay","height":87});
															thumbnails[3732896] = clik.newPhoto({"id":3732896,"src":"IMG_9951Kilrealig_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732896.html","width":130,"caption":"Kilrealig","height":87});
															thumbnails[3732899] = clik.newPhoto({"id":3732899,"src":"kilreelig_Kopie_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732899.html","width":130,"caption":"Kilrealig","height":88});
															thumbnails[3732905] = clik.newPhoto({"id":3732905,"src":"IMGMusicRosies_3723_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_3732905.html","width":130,"caption":"","height":87});
															thumbnails[3732906] = clik.newPhoto({"id":3732906,"src":"IMGMusicRosies_3725_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_3732906.html","width":130,"caption":"","height":87});
															thumbnails[3732907] = clik.newPhoto({"id":3732907,"src":"IMGMusicRosies_3729_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_3732907.html","width":130,"caption":"","height":87});
															thumbnails[3732912] = clik.newPhoto({"id":3732912,"src":"Regatta1_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732912.html","width":130,"caption":"Regatta in Ballinskelligs","height":87});
															thumbnails[3732924] = clik.newPhoto({"id":3732924,"src":"StMichaelsWell_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732924.html","width":130,"caption":"St Michael´s Well in Dun Geagan","height":87});
															thumbnails[3732945] = clik.newPhoto({"id":3732945,"src":"Surf_Skellig_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3732945.html","width":130,"caption":"Surf in St. Finian´s Bay","height":87});
															thumbnails[3742710] = clik.newPhoto({"id":3742710,"src":"duIMG_6077fenster_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742710.html","width":130,"caption":"","height":87});
															thumbnails[3742715] = clik.newPhoto({"id":3742715,"src":"duIMG_6280kitchenKopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742715.html","width":130,"caption":"","height":87});
															thumbnails[3742726] = clik.newPhoto({"id":3742726,"src":"duIMG_6081insideKopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742726.html","width":130,"caption":"","height":87});
															thumbnails[3742734] = clik.newPhoto({"id":3742734,"src":"duIMG_6195insideKopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742734.html","width":130,"caption":"","height":87});
															thumbnails[3742857] = clik.newPhoto({"id":3742857,"src":"_MG_8280_draghunt1Kopie_thumb.jpg","galleries_id":227891,"server_id":15,"link":"photo_3742857.html","width":130,"caption":"Drag Hunting is a local sport","height":87});
															thumbnails[3744641] = clik.newPhoto({"id":3744641,"src":"IMG_1309weddinginside_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_3744641.html","width":130,"caption":"","height":87});
															thumbnails[3744645] = clik.newPhoto({"id":3744645,"src":"IMG_1321wedding_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_3744645.html","width":130,"caption":"","height":87});
															thumbnails[4554834] = clik.newPhoto({"id":4554834,"src":"IMG_0653web_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4554834.html","width":130,"caption":"","height":87});
															thumbnails[4554837] = clik.newPhoto({"id":4554837,"src":"IMG_0655web_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4554837.html","width":130,"caption":"","height":87});
															thumbnails[4554841] = clik.newPhoto({"id":4554841,"src":"IMG_0663web_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4554841.html","width":130,"caption":"","height":87});
															thumbnails[4554846] = clik.newPhoto({"id":4554846,"src":"IMG_0667web_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4554846.html","width":130,"caption":"","height":87});
															thumbnails[8831480] = clik.newPhoto({"id":8831480,"src":"bolus_head-0868_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831480.html","width":87,"caption":"","height":130});
															thumbnails[8831482] = clik.newPhoto({"id":8831482,"src":"bolus_head-0871_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831482.html","width":130,"caption":"","height":87});
															thumbnails[8831484] = clik.newPhoto({"id":8831484,"src":"bolus_head-0874_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831484.html","width":130,"caption":"","height":87});
															thumbnails[8831486] = clik.newPhoto({"id":8831486,"src":"bolus_head-0881_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831486.html","width":130,"caption":"","height":87});
															thumbnails[8831488] = clik.newPhoto({"id":8831488,"src":"bolus_head-0903_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831488.html","width":130,"caption":"","height":87});
															thumbnails[8831489] = clik.newPhoto({"id":8831489,"src":"bolus_head-0906_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831489.html","width":87,"caption":"","height":130});
															thumbnails[8831490] = clik.newPhoto({"id":8831490,"src":"bolus_head-0922_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831490.html","width":130,"caption":"","height":87});
															thumbnails[8831494] = clik.newPhoto({"id":8831494,"src":"bolus_head-0926_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831494.html","width":130,"caption":"","height":87});
															thumbnails[8831499] = clik.newPhoto({"id":8831499,"src":"bolus_head-0969_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831499.html","width":130,"caption":"","height":87});
															thumbnails[8831501] = clik.newPhoto({"id":8831501,"src":"bolus_head-0988_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831501.html","width":130,"caption":"","height":87});
															thumbnails[8831502] = clik.newPhoto({"id":8831502,"src":"bolus_head-0997_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831502.html","width":130,"caption":"","height":87});
															thumbnails[8831511] = clik.newPhoto({"id":8831511,"src":"bolus_head-0886_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831511.html","width":130,"caption":"","height":87});
															thumbnails[8831749] = clik.newPhoto({"id":8831749,"src":"bolus_head-0888_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831749.html","width":130,"caption":"","height":87});
															thumbnails[8831862] = clik.newPhoto({"id":8831862,"src":"bolus_head-08881_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831862.html","width":130,"caption":"","height":87});
															thumbnails[8831865] = clik.newPhoto({"id":8831865,"src":"bolus_head-09331_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831865.html","width":130,"caption":"","height":87});
															thumbnails[8831867] = clik.newPhoto({"id":8831867,"src":"bolus_head-10131_thumb.jpg","galleries_id":464645,"server_id":15,"link":"photo_8831867.html","width":130,"caption":"","height":87});
															thumbnails[4392491] = clik.newPhoto({"id":4392491,"src":"rosies1_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4392491.html","width":130,"caption":"","height":87});
															thumbnails[4392494] = clik.newPhoto({"id":4392494,"src":"rosies2_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4392494.html","width":130,"caption":"","height":87});
															thumbnails[4392496] = clik.newPhoto({"id":4392496,"src":"rosies3_thumb.jpg","galleries_id":227428,"server_id":15,"link":"photo_4392496.html","width":130,"caption":"","height":87});
															thumbnails[3742714] = clik.newPhoto({"id":3742714,"src":"duIMG_6192fenster2_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742714.html","width":130,"caption":"","height":166});
															thumbnails[3742719] = clik.newPhoto({"id":3742719,"src":"duIMG_6178bedroomlamp_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3742719.html","width":130,"caption":"","height":195});
															thumbnails[3732820] = clik.newPhoto({"id":3732820,"src":"duIMG_6382hausaussen3_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732820.html","width":130,"caption":"Duchealla House","height":195});
															thumbnails[3732825] = clik.newPhoto({"id":3732825,"src":"duIMG_6430skelligs_Kopie_thumb.jpg","galleries_id":227427,"server_id":15,"link":"photo_3732825.html","width":130,"caption":"View from House towards Skelligs","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[464645] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Bolus Head Loop Walk","link":"gallery_464645.html","maxRecords":0.0,"photoIDs":[8831480.0,8831482.0,8831484.0,8831486.0,8831488.0,8831489.0,8831490.0,8831494.0,8831499.0,8831501.0,8831502.0,8831511.0,8831749.0,8831862.0,8831865.0,8831867.0],"skipIndex":0,"section_code":"gallery","featured_images":"8831867,8831865,8831862,8831749,8831511,8831502,8831501,8831499,8831494,8831490","id":464645,"singleSection":false});				  						galleries[227427] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Duchealla House","link":"gallery_227427.html","maxRecords":0.0,"photoIDs":[3732811.0,3732814.0,3732817.0,3732824.0,3742710.0,3742715.0,3742726.0,3742734.0,3742714.0,3742719.0,3732820.0,3732825.0],"skipIndex":0,"section_code":"gallery","featured_images":3732824.0,"id":227427,"singleSection":false});				  						galleries[227428] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Tig Rosie","link":"gallery_227428.html","maxRecords":0.0,"photoIDs":[3732905.0,3732906.0,3732907.0,3744641.0,3744645.0,4554834.0,4554837.0,4554841.0,4554846.0,4392491.0,4392494.0,4392496.0],"skipIndex":0,"section_code":"gallery","featured_images":"4554846,4554841,4554837,4554834,4392496,4392494,4392491,3744645,3744641,3732907","id":227428,"singleSection":false});				  						galleries[227891] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Local Scenes ","link":"gallery_227891.html","maxRecords":0.0,"photoIDs":[3732830.0,3732838.0,3732877.0,3732882.0,3732885.0,3732892.0,3732896.0,3732899.0,3732912.0,3732924.0,3732945.0,3742857.0],"skipIndex":0,"section_code":"gallery","featured_images":3732896.0,"id":227891,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8831490,8831482,3732945,3732905,3732892,3732885,3732824,4392494';
imageSets[2] = '3732896,3732824';
imageSets[3] = '8831867,8831865,8831862,8831749,8831511,8831502,8831501,8831499,8831494,8831490,8831489,8831488,8831486,8831484,8831482,8831480,4554846,4554841,4554837,4554834,4392496,4392494,4392491,3744645,3744641,3742857,3742734,3742726,3742719,3742715,3742714,3742710,3732945,3732924,3732912,3732907,3732906,3732905,3732899,3732896,3732892,3732885,3732882,3732877,3732873,3732838,3732830,3732825,3732824,3732820';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/tigrosie/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/tigrosie/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 = 'tigrosie and duchealla house: ' + 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;
	}
}

			

