window.thumbnails = {};
															thumbnails[3753669] = clik.newPhoto({"id":3753669,"src":"catidLogo3_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Cat Interior Design Acrylics and Framing","height":73});
															thumbnails[5453552] = clik.newPhoto({"id":5453552,"src":"blackcat_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":37});
															thumbnails[7217501] = clik.newPhoto({"id":7217501,"src":"merryxmas_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"Merry Christmas","height":261});
															thumbnails[3747404] = clik.newPhoto({"id":3747404,"src":"image03_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747404.html","width":130,"caption":"","height":195});
															thumbnails[3747408] = clik.newPhoto({"id":3747408,"src":"image05_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747408.html","width":130,"caption":"","height":195});
															thumbnails[3747415] = clik.newPhoto({"id":3747415,"src":"image09_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747415.html","width":130,"caption":"","height":195});
															thumbnails[3747424] = clik.newPhoto({"id":3747424,"src":"image11_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747424.html","width":130,"caption":"","height":195});
															thumbnails[3747427] = clik.newPhoto({"id":3747427,"src":"image12_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747427.html","width":130,"caption":"","height":195});
															thumbnails[3747430] = clik.newPhoto({"id":3747430,"src":"image13_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3747430.html","width":130,"caption":"","height":195});
															thumbnails[3761176] = clik.newPhoto({"id":3761176,"src":"_MG_6408_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761176.html","width":130,"caption":"","height":173});
															thumbnails[3761177] = clik.newPhoto({"id":3761177,"src":"wAD596_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761177.html","width":130,"caption":"","height":184});
															thumbnails[3761179] = clik.newPhoto({"id":3761179,"src":"wAJ114_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761179.html","width":130,"caption":"","height":173});
															thumbnails[3761180] = clik.newPhoto({"id":3761180,"src":"wBR426_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761180.html","width":130,"caption":"","height":184});
															thumbnails[3761181] = clik.newPhoto({"id":3761181,"src":"wCC0417_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761181.html","width":130,"caption":"","height":184});
															thumbnails[3761182] = clik.newPhoto({"id":3761182,"src":"wCC0905_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761182.html","width":130,"caption":"","height":184});
															thumbnails[3761185] = clik.newPhoto({"id":3761185,"src":"wCG749_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761185.html","width":130,"caption":"","height":184});
															thumbnails[3761186] = clik.newPhoto({"id":3761186,"src":"wCP0459_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761186.html","width":130,"caption":"","height":184});
															thumbnails[3761187] = clik.newPhoto({"id":3761187,"src":"wCR466_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761187.html","width":130,"caption":"","height":184});
															thumbnails[3761188] = clik.newPhoto({"id":3761188,"src":"wCR583_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761188.html","width":130,"caption":"","height":184});
															thumbnails[3761210] = clik.newPhoto({"id":3761210,"src":"wEB509_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761210.html","width":130,"caption":"","height":184});
															thumbnails[3761211] = clik.newPhoto({"id":3761211,"src":"wEN595_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761211.html","width":130,"caption":"","height":173});
															thumbnails[3761212] = clik.newPhoto({"id":3761212,"src":"wHN455_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761212.html","width":130,"caption":"","height":173});
															thumbnails[3761214] = clik.newPhoto({"id":3761214,"src":"wHS382_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761214.html","width":130,"caption":"","height":184});
															thumbnails[3761215] = clik.newPhoto({"id":3761215,"src":"wHS629_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761215.html","width":130,"caption":"","height":184});
															thumbnails[3761217] = clik.newPhoto({"id":3761217,"src":"wJJ412_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761217.html","width":130,"caption":"","height":184});
															thumbnails[3761218] = clik.newPhoto({"id":3761218,"src":"wJJ452_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761218.html","width":130,"caption":"","height":184});
															thumbnails[3761219] = clik.newPhoto({"id":3761219,"src":"wLT536_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761219.html","width":130,"caption":"","height":184});
															thumbnails[3761251] = clik.newPhoto({"id":3761251,"src":"wLT556_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761251.html","width":130,"caption":"","height":184});
															thumbnails[3761253] = clik.newPhoto({"id":3761253,"src":"wSR009_thumb.jpg","galleries_id":228427,"server_id":15,"link":"photo_3761253.html","width":130,"caption":"","height":173});
															thumbnails[3761259] = clik.newPhoto({"id":3761259,"src":"pAH104_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761259.html","width":130,"caption":"","height":183});
															thumbnails[3761261] = clik.newPhoto({"id":3761261,"src":"pAH147_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761261.html","width":130,"caption":"","height":195});
															thumbnails[3761263] = clik.newPhoto({"id":3761263,"src":"pAH174_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761263.html","width":130,"caption":"","height":195});
															thumbnails[3761356] = clik.newPhoto({"id":3761356,"src":"pNW016_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761356.html","width":130,"caption":"","height":156});
															thumbnails[3761357] = clik.newPhoto({"id":3761357,"src":"pNW021_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761357.html","width":130,"caption":"","height":156});
															thumbnails[3761359] = clik.newPhoto({"id":3761359,"src":"pNW025_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761359.html","width":130,"caption":"","height":108});
															thumbnails[3761361] = clik.newPhoto({"id":3761361,"src":"pNW084_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761361.html","width":130,"caption":"","height":108});
															thumbnails[3761364] = clik.newPhoto({"id":3761364,"src":"pNW1052_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761364.html","width":130,"caption":"","height":108});
															thumbnails[3761366] = clik.newPhoto({"id":3761366,"src":"pNW118_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761366.html","width":130,"caption":"","height":156});
															thumbnails[3761367] = clik.newPhoto({"id":3761367,"src":"pNW221_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761367.html","width":130,"caption":"","height":156});
															thumbnails[3761369] = clik.newPhoto({"id":3761369,"src":"pNW295_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761369.html","width":130,"caption":"","height":108});
															thumbnails[3761370] = clik.newPhoto({"id":3761370,"src":"pNW365_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761370.html","width":130,"caption":"","height":108});
															thumbnails[3761372] = clik.newPhoto({"id":3761372,"src":"pNW584_thumb.jpg","galleries_id":228437,"server_id":15,"link":"photo_3761372.html","width":130,"caption":"","height":108});
															thumbnails[3761378] = clik.newPhoto({"id":3761378,"src":"pCD61_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761378.html","width":130,"caption":"","height":163});
															thumbnails[3761381] = clik.newPhoto({"id":3761381,"src":"pEC81_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761381.html","width":130,"caption":"","height":163});
															thumbnails[3761382] = clik.newPhoto({"id":3761382,"src":"pFF157_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761382.html","width":130,"caption":"","height":173});
															thumbnails[3761384] = clik.newPhoto({"id":3761384,"src":"pGP99_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761384.html","width":130,"caption":"","height":163});
															thumbnails[3761385] = clik.newPhoto({"id":3761385,"src":"pIF077a_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761385.html","width":130,"caption":"","height":163});
															thumbnails[3761388] = clik.newPhoto({"id":3761388,"src":"pKH128a_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761388.html","width":130,"caption":"","height":104});
															thumbnails[3761389] = clik.newPhoto({"id":3761389,"src":"pMP085_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761389.html","width":130,"caption":"","height":163});
															thumbnails[3761392] = clik.newPhoto({"id":3761392,"src":"pSR132_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761392.html","width":130,"caption":"","height":163});
															thumbnails[3761393] = clik.newPhoto({"id":3761393,"src":"pEW096_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761393.html","width":130,"caption":"","height":163});
															thumbnails[3761397] = clik.newPhoto({"id":3761397,"src":"pNW429_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761397.html","width":130,"caption":"","height":108});
															thumbnails[3761399] = clik.newPhoto({"id":3761399,"src":"pSE087_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761399.html","width":130,"caption":"","height":163});
															thumbnails[3761401] = clik.newPhoto({"id":3761401,"src":"pNW146_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761401.html","width":130,"caption":"","height":156});
															thumbnails[3761404] = clik.newPhoto({"id":3761404,"src":"pNW305_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761404.html","width":130,"caption":"","height":156});
															thumbnails[3761408] = clik.newPhoto({"id":3761408,"src":"pNW200_thumb.jpg","galleries_id":228428,"server_id":15,"link":"photo_3761408.html","width":130,"caption":"","height":156});
															thumbnails[6229762] = clik.newPhoto({"id":6229762,"src":"cGG132270610_thumb.jpg","galleries_id":346996,"server_id":15,"link":"photo_6229762.html","width":130,"caption":"","height":87});
															thumbnails[8375701] = clik.newPhoto({"id":8375701,"src":"IMG_4560_thumb.jpg","galleries_id":346996,"server_id":15,"link":"photo_8375701.html","width":130,"caption":"","height":100});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[346996] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Events","link":"gallery_346996.html","maxRecords":0.0,"photoIDs":[6229762.0,8375701.0],"skipIndex":0,"section_code":"gallery","featured_images":"8375701,6229762","id":346996,"singleSection":false});				  						galleries[228427] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_228427.html","maxRecords":0.0,"photoIDs":[3747404.0,3747408.0,3747415.0,3747424.0,3747427.0,3747430.0,3761176.0,3761177.0,3761179.0,3761180.0,3761181.0,3761182.0,3761185.0,3761186.0,3761187.0,3761188.0,3761210.0,3761211.0,3761212.0,3761214.0,3761215.0,3761217.0,3761218.0,3761219.0,3761251.0,3761253.0],"skipIndex":0,"section_code":"gallery","featured_images":"3747430,3747404","id":228427,"singleSection":false});				  						galleries[228428] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_228428.html","maxRecords":0.0,"photoIDs":[3761366.0,3761378.0,3761381.0,3761382.0,3761384.0,3761385.0,3761388.0,3761389.0,3761392.0,3761393.0,3761397.0,3761399.0,3761401.0,3761404.0,3761408.0],"skipIndex":0,"section_code":"gallery","featured_images":"3761408,3761404,3761401,3761399,3761397,3761393,3761392,3761389,3761388,3761385","id":228428,"singleSection":false});				  						galleries[228437] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portfolio & Head Shots","link":"gallery_228437.html","maxRecords":0.0,"photoIDs":[3761259.0,3761261.0,3761263.0,3761356.0,3761357.0,3761359.0,3761361.0,3761364.0,3761367.0,3761369.0,3761370.0,3761372.0],"skipIndex":0,"section_code":"gallery","featured_images":3761259.0,"id":228437,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3761253,3761219,3761218,3761214,3761187,3761177';
imageSets[2] = '3761259,3747430,3747404';
imageSets[3] = '8375701,7217501,6229762,5453552,3761408,3761404,3761401,3761399,3761397,3761393,3761392,3761389,3761388,3761385,3761384,3761382,3761381,3761378,3761372,3761370,3761369,3761367,3761366,3761364,3761361,3761359,3761357,3761356,3761263,3761261,3761259,3761253,3761251,3761219,3761218,3761217,3761215,3761214,3761212,3761211,3761210,3761188,3761187,3761186,3761185,3761182,3761181,3761180,3761179,3761177';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/CameraCat/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/CameraCat/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 = 'Northop Wedding & Portrait Photographer Flintshire: ' + 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> &pound;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
																		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="nigel@cameracat.co.uk">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					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="nigel@cameracat.co.uk">';
				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;
	}
}

			

