window.thumbnails = {};
															thumbnails[447373] = clik.newPhoto({"id":447373,"src":"wedding_photo123_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":146});
															thumbnails[7398371] = clik.newPhoto({"id":7398371,"src":"Valentine_special_clkpx_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Special offer","height":195});
															thumbnails[8509435] = clik.newPhoto({"id":8509435,"src":"PFP-106_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"business","height":186});
															thumbnails[1556732] = clik.newPhoto({"id":1556732,"src":"flowers_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556732.html","width":130,"caption":"","height":130});
															thumbnails[750742] = clik.newPhoto({"id":750742,"src":"bride-walking_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750742.html","width":130,"caption":"","height":130});
															thumbnails[1556691] = clik.newPhoto({"id":1556691,"src":"flowergirl-BW_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556691.html","width":130,"caption":"","height":130});
															thumbnails[1556699] = clik.newPhoto({"id":1556699,"src":"fairy_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556699.html","width":130,"caption":"","height":130});
															thumbnails[750749] = clik.newPhoto({"id":750749,"src":"hands-on-back_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750749.html","width":130,"caption":"","height":130});
															thumbnails[1556693] = clik.newPhoto({"id":1556693,"src":"hat-BW_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556693.html","width":130,"caption":"","height":130});
															thumbnails[750782] = clik.newPhoto({"id":750782,"src":"candle-and-rings_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750782.html","width":130,"caption":"","height":130});
															thumbnails[750384] = clik.newPhoto({"id":750384,"src":"blessing-ring_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750384.html","width":130,"caption":"","height":130});
															thumbnails[750365] = clik.newPhoto({"id":750365,"src":"blessing-stone_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750365.html","width":130,"caption":"","height":130});
															thumbnails[750784] = clik.newPhoto({"id":750784,"src":"exchange-ring_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750784.html","width":130,"caption":"","height":130});
															thumbnails[750387] = clik.newPhoto({"id":750387,"src":"hug_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750387.html","width":130,"caption":"","height":130});
															thumbnails[1556685] = clik.newPhoto({"id":1556685,"src":"eyes-BW_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556685.html","width":130,"caption":"","height":130});
															thumbnails[1556700] = clik.newPhoto({"id":1556700,"src":"rings_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556700.html","width":130,"caption":"","height":130});
															thumbnails[1556689] = clik.newPhoto({"id":1556689,"src":"family-BW_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556689.html","width":130,"caption":"","height":130});
															thumbnails[1556730] = clik.newPhoto({"id":1556730,"src":"group_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556730.html","width":130,"caption":"","height":130});
															thumbnails[1556697] = clik.newPhoto({"id":1556697,"src":"bride_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556697.html","width":130,"caption":"","height":130});
															thumbnails[1556735] = clik.newPhoto({"id":1556735,"src":"horses-on-pier_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556735.html","width":130,"caption":"","height":130});
															thumbnails[1556629] = clik.newPhoto({"id":1556629,"src":"Connemara-BW_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556629.html","width":130,"caption":"","height":130});
															thumbnails[1556696] = clik.newPhoto({"id":1556696,"src":"kiss_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556696.html","width":130,"caption":"","height":130});
															thumbnails[1556725] = clik.newPhoto({"id":1556725,"src":"woods_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556725.html","width":130,"caption":"","height":130});
															thumbnails[1581108] = clik.newPhoto({"id":1581108,"src":"chilled_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1581108.html","width":130,"caption":"","height":130});
															thumbnails[1556723] = clik.newPhoto({"id":1556723,"src":"cake_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556723.html","width":130,"caption":"","height":130});
															thumbnails[750780] = clik.newPhoto({"id":750780,"src":"flowers-on-table_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_750780.html","width":130,"caption":"","height":130});
															thumbnails[1556727] = clik.newPhoto({"id":1556727,"src":"dance_thumb.jpg","galleries_id":57908,"server_id":18,"link":"photo_1556727.html","width":130,"caption":"","height":130});
															thumbnails[8509412] = clik.newPhoto({"id":8509412,"src":"PFP-104_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_8509412.html","width":130,"caption":"mum & baby","height":95});
															thumbnails[8509414] = clik.newPhoto({"id":8509414,"src":"PFP-107_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_8509414.html","width":130,"caption":"baby face","height":96});
															thumbnails[8509418] = clik.newPhoto({"id":8509418,"src":"PFP-1141_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509418.html","width":130,"caption":"so cute","height":96});
															thumbnails[8509420] = clik.newPhoto({"id":8509420,"src":"PFP-105_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509420.html","width":130,"caption":"engrossed","height":93});
															thumbnails[8509427] = clik.newPhoto({"id":8509427,"src":"PFP-109_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_8509427.html","width":130,"caption":"baby foot","height":95});
															thumbnails[8509429] = clik.newPhoto({"id":8509429,"src":"PFP-112_thumb.jpg","galleries_id":365385,"server_id":18,"link":"photo_8509429.html","width":130,"caption":"love","height":93});
															thumbnails[8509432] = clik.newPhoto({"id":8509432,"src":"PFP-108_thumb.jpg","galleries_id":365385,"server_id":18,"link":"photo_8509432.html","width":130,"caption":"graduation","height":181});
															thumbnails[8509434] = clik.newPhoto({"id":8509434,"src":"PFP-118_thumb.jpg","galleries_id":365385,"server_id":18,"link":"photo_8509434.html","width":130,"caption":"siblings","height":92});
															thumbnails[8509437] = clik.newPhoto({"id":8509437,"src":"PFP-102_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509437.html","width":130,"caption":"communion boy","height":178});
															thumbnails[8509438] = clik.newPhoto({"id":8509438,"src":"PFP-110_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509438.html","width":130,"caption":"communion girl","height":184});
															thumbnails[8509440] = clik.newPhoto({"id":8509440,"src":"PFP-103_thumb.jpg","galleries_id":365384,"server_id":18,"link":"photo_8509440.html","width":130,"caption":"music","height":193});
															thumbnails[8509442] = clik.newPhoto({"id":8509442,"src":"PFP-115_thumb.jpg","galleries_id":365384,"server_id":18,"link":"photo_8509442.html","width":130,"caption":"siblings","height":185});
															thumbnails[8509444] = clik.newPhoto({"id":8509444,"src":"PFP-101_thumb.jpg","galleries_id":365384,"server_id":18,"link":"photo_8509444.html","width":130,"caption":"relaxed","height":91});
															thumbnails[8509446] = clik.newPhoto({"id":8509446,"src":"PFP-111_thumb.jpg","galleries_id":365385,"server_id":18,"link":"photo_8509446.html","width":130,"caption":"pets","height":181});
															thumbnails[8509447] = clik.newPhoto({"id":8509447,"src":"PFP-113_thumb.jpg","galleries_id":365385,"server_id":18,"link":"photo_8509447.html","width":130,"caption":"helping hands","height":179});
															thumbnails[8509449] = clik.newPhoto({"id":8509449,"src":"PFP-116_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509449.html","width":130,"caption":"jump","height":96});
															thumbnails[8509450] = clik.newPhoto({"id":8509450,"src":"PFP-117_thumb.jpg","galleries_id":365382,"server_id":18,"link":"photo_8509450.html","width":130,"caption":"chairman","height":96});
															thumbnails[1660814] = clik.newPhoto({"id":1660814,"src":"Web--Baby-4_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_1660814.html","width":130,"caption":"","height":195});
															thumbnails[1660811] = clik.newPhoto({"id":1660811,"src":"Web-Baby-2_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_1660811.html","width":130,"caption":"","height":130});
															thumbnails[1660818] = clik.newPhoto({"id":1660818,"src":"Web-Family-2_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_1660818.html","width":130,"caption":"","height":87});
															thumbnails[1660813] = clik.newPhoto({"id":1660813,"src":"Web--Baby-3_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_1660813.html","width":130,"caption":"","height":130});
															thumbnails[1660816] = clik.newPhoto({"id":1660816,"src":"Web-Family-1_thumb.jpg","galleries_id":112078,"server_id":18,"link":"photo_1660816.html","width":130,"caption":"","height":195});
															thumbnails[5491304] = clik.newPhoto({"id":5491304,"src":"IMG_4821web_thumb.jpg","galleries_id":91449,"server_id":18,"link":"photo_5491304.html","width":130,"caption":"","height":197});
															thumbnails[5491305] = clik.newPhoto({"id":5491305,"src":"IMG_4822web_thumb.jpg","galleries_id":91449,"server_id":18,"link":"photo_5491305.html","width":130,"caption":"","height":87});
															thumbnails[5491251] = clik.newPhoto({"id":5491251,"src":"IMG_4859web_thumb.jpg","galleries_id":91449,"server_id":18,"link":"photo_5491251.html","width":130,"caption":"","height":103});
															thumbnails[1289032] = clik.newPhoto({"id":1289032,"src":"Mozarina2_thumb.jpg","galleries_id":91449,"server_id":18,"link":"photo_1289032.html","width":130,"caption":"","height":195});
															thumbnails[1288999] = clik.newPhoto({"id":1288999,"src":"Mozarina_thumb.jpg","galleries_id":91449,"server_id":18,"link":"photo_1288999.html","width":130,"caption":"","height":195});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[57908] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lá Pósta - Wedding","link":"gallery.html","maxRecords":0.0,"photoIDs":[1556732.0,750742.0,1556691.0,1556699.0,750749.0,1556693.0,750782.0,750384.0,750365.0,750784.0,750387.0,1556685.0,1556700.0,1556689.0,1556730.0,1556697.0,1556735.0,1556629.0,1556696.0,1556725.0,1581108.0,1556723.0,750780.0,1556727.0],"skipIndex":0,"section_code":"gallery","featured_images":"1581108,1556735,1556732,1556730,1556727,1556725,1556723,1556700,1556699,1556697","id":57908,"singleSection":true});				  						galleries[112078] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Babaí - Baby","link":"section147284_112078.html","maxRecords":0.0,"photoIDs":[8509412.0,8509414.0,8509427.0,1660814.0,1660811.0,1660818.0,1660813.0,1660816.0],"skipIndex":0,"section_code":"section147284","featured_images":"8509427,8509414,8509412,1660818,1660816,1660814,1660813,1660811","id":112078,"singleSection":false});				  						galleries[365382] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Páistí - Children","link":"section147284_365382.html","maxRecords":0.0,"photoIDs":[8509418.0,8509420.0,8509437.0,8509438.0,8509449.0,8509450.0],"skipIndex":0,"section_code":"section147284","featured_images":"8509450,8509449,8509438,8509437,8509420,8509418","id":365382,"singleSection":false});				  						galleries[365384] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Déaga - Teens","link":"section147284_365384.html","maxRecords":0.0,"photoIDs":[8509440.0,8509442.0,8509444.0],"skipIndex":0,"section_code":"section147284","featured_images":"8509444,8509442,8509440","id":365384,"singleSection":false});				  						galleries[365385] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Clann - Family","link":"section147284_365385.html","maxRecords":0.0,"photoIDs":[8509429.0,8509432.0,8509434.0,8509446.0,8509447.0],"skipIndex":0,"section_code":"section147284","featured_images":"8509447,8509446,8509434,8509432,8509429","id":365385,"singleSection":false});				  						galleries[91449] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mozarina Bridal","link":"section124218.html","maxRecords":0.0,"photoIDs":[5491304.0,5491305.0,5491251.0,1289032.0,1288999.0],"skipIndex":0,"section_code":"section124218","featured_images":"5491305,5491304,5491251,1289032,1288999","id":91449,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '447373';
imageSets[3] = '8509450,8509449,8509447,8509446,8509444,8509442,8509440,8509438,8509437,8509435,8509434,8509432,8509429,8509427,8509420,8509418,8509414,8509412,7398371,5491305,5491304,5491251,1660818,1660816,1660814,1660813,1660811,1581108,1556735,1556732,1556730,1556727,1556725,1556723,1556700,1556699,1556697,1556696,1556693,1556691,1556689,1556685,1556629,1289032,1288999,750784,750782,750780,750749,750742';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/paulfennellphoto/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/paulfennellphoto/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 = ' Galway Photographer, Claregalway: Paul Fennell: ' + 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;
	}
}

			

