window.thumbnails = {};
															thumbnails[7494761] = clik.newPhoto({"id":7494761,"src":"largedogpuppet1_thumb.jpg","galleries_id":406353,"server_id":15,"link":"photo_7494761.html","width":130,"caption":"Golden Retriever - sorry, sold out until further notice.","height":173});
															thumbnails[7494779] = clik.newPhoto({"id":7494779,"src":"largedogpuppet2_thumb.jpg","galleries_id":406353,"server_id":15,"link":"photo_7494779.html","width":130,"caption":"Italian Wolf - sorry, sold out until further notice.","height":173});
															thumbnails[7494803] = clik.newPhoto({"id":7494803,"src":"largedogpuppet3_thumb.jpg","galleries_id":406353,"server_id":15,"link":"photo_7494803.html","width":130,"caption":"Canadian Fox","height":173});
															thumbnails[7494852] = clik.newPhoto({"id":7494852,"src":"superfluffylargedogpuppet1_thumb.jpg","galleries_id":406357,"server_id":15,"link":"photo_7494852.html","width":130,"caption":"Collie","height":173});
															thumbnails[7494855] = clik.newPhoto({"id":7494855,"src":"superfluffylargedogpuppet2_thumb.jpg","galleries_id":406357,"server_id":15,"link":"photo_7494855.html","width":130,"caption":"Labradoodle","height":173});
															thumbnails[7494858] = clik.newPhoto({"id":7494858,"src":"smalldogpuppet1_thumb.jpg","galleries_id":406358,"server_id":15,"link":"photo_7494858.html","width":130,"caption":"Foxhound","height":173});
															thumbnails[7494861] = clik.newPhoto({"id":7494861,"src":"smalldogpuppet2_thumb.jpg","galleries_id":406358,"server_id":15,"link":"photo_7494861.html","width":130,"caption":"Grey Mastive","height":173});
															thumbnails[7494866] = clik.newPhoto({"id":7494866,"src":"superfluffysmalldogpuppet1_thumb.jpg","galleries_id":406359,"server_id":15,"link":"photo_7494866.html","width":130,"caption":"Fluffy Purple - sorry, sold out until further notice.","height":173});
															thumbnails[7494869] = clik.newPhoto({"id":7494869,"src":"superfluffysmalldogpuppet2_thumb.jpg","galleries_id":406359,"server_id":15,"link":"photo_7494869.html","width":130,"caption":"Spaniel - sorry, sold out until further notice.","height":173});
															thumbnails[7494871] = clik.newPhoto({"id":7494871,"src":"puppyhandpuppets_thumb.jpg","galleries_id":406361,"server_id":15,"link":"photo_7494871.html","width":130,"caption":"Puppy Hand Puppets","height":98});
															thumbnails[7494875] = clik.newPhoto({"id":7494875,"src":"superfluffypuppyhandpuppets_thumb.jpg","galleries_id":406362,"server_id":15,"link":"photo_7494875.html","width":130,"caption":"Super Furry Puppy Hand Puppets - sorry, sold out until further notice.","height":97});
															thumbnails[7494882] = clik.newPhoto({"id":7494882,"src":"Pottytree_Puppets_Sales_033_thumb.jpg","galleries_id":406363,"server_id":15,"link":"photo_7494882.html","width":130,"caption":"Squirrel Hand Puppets","height":96});
															thumbnails[7264510] = clik.newPhoto({"id":7264510,"src":"DSC00155_thumb.JPG","galleries_id":51431,"server_id":15,"link":"photo_7264510.html","width":130,"caption":"Gill Whitten made this amazing circletime mat for me","height":98});
															thumbnails[676560] = clik.newPhoto({"id":676560,"src":"IMG_0127mrspottytree12_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_676560.html","width":130,"caption":"Me with three of my characters","height":98});
															thumbnails[673742] = clik.newPhoto({"id":673742,"src":"IMG_0666pottytree1_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_673742.html","width":130,"caption":"Charlie getting a hug","height":173});
															thumbnails[673811] = clik.newPhoto({"id":673811,"src":"IMG_0887pottytree2_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_673811.html","width":130,"caption":"Hugo doing his thing","height":98});
															thumbnails[717081] = clik.newPhoto({"id":717081,"src":"Pottytreepuppets15_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_717081.html","width":130,"caption":"Hazel Keelan who painted my puppet theatre","height":98});
															thumbnails[675434] = clik.newPhoto({"id":675434,"src":"IMG_1299pottytree5_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_675434.html","width":130,"caption":"Hugo and I in a local school","height":98});
															thumbnails[692937] = clik.newPhoto({"id":692937,"src":"Pottytreepics12_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_692937.html","width":130,"caption":"Charlie the entertainer","height":98});
															thumbnails[676435] = clik.newPhoto({"id":676435,"src":"IMG_0110mrspottytree8_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_676435.html","width":130,"caption":"Meatballs meets a fan","height":98});
															thumbnails[681518] = clik.newPhoto({"id":681518,"src":"IMG_0486mrspottytree10_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_681518.html","width":130,"caption":"At work in a local infant school","height":98});
															thumbnails[681520] = clik.newPhoto({"id":681520,"src":"IMG_0496mrspottytree11_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_681520.html","width":130,"caption":"The flying carpet in trouble","height":98});
															thumbnails[1987765] = clik.newPhoto({"id":1987765,"src":"009_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987765.html","width":130,"caption":"A puppet workshop captured by Paul Upward","height":87});
															thumbnails[1987773] = clik.newPhoto({"id":1987773,"src":"054_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987773.html","width":130,"caption":"Paul Upward's website can be found in links","height":87});
															thumbnails[1987777] = clik.newPhoto({"id":1987777,"src":"IMG_0587_2_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987777.html","width":130,"caption":"Puppets created at a teacher's workshop","height":87});
															thumbnails[1987782] = clik.newPhoto({"id":1987782,"src":"IMG_0590_2_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987782.html","width":130,"caption":"Demonstration of puppet skills","height":87});
															thumbnails[1987787] = clik.newPhoto({"id":1987787,"src":"PICT0093_thumb.JPG","galleries_id":51431,"server_id":15,"link":"photo_1987787.html","width":130,"caption":"Sock puppets at Royal Berkshire Hospital","height":173});
															thumbnails[1987874] = clik.newPhoto({"id":1987874,"src":"PICT0133_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987874.html","width":130,"caption":"Teachers join in at the Royal Berks","height":98});
															thumbnails[1987884] = clik.newPhoto({"id":1987884,"src":"PICT0122_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1987884.html","width":130,"caption":"Diwali with sock puppets","height":98});
															thumbnails[2261851] = clik.newPhoto({"id":2261851,"src":"Puppets 001_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_2261851.html","width":130,"caption":"A puppet training session at The Cresent Centre","height":98});
															thumbnails[2261860] = clik.newPhoto({"id":2261860,"src":"Puppets 003_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_2261860.html","width":130,"caption":"Teachers make puppets and perform with them","height":98});
															thumbnails[2261866] = clik.newPhoto({"id":2261866,"src":"Puppets 006_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_2261866.html","width":130,"caption":"Simple sock puppets are also effective","height":98});
															thumbnails[675435] = clik.newPhoto({"id":675435,"src":"Jo'sPuppetspottytree6_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_675435.html","width":130,"caption":"Twyford Advertiser 2nd June 2006","height":161});
															thumbnails[692951] = clik.newPhoto({"id":692951,"src":"PPTarticle21_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_692951.html","width":130,"caption":"Wokingham Times 5th July 2007","height":125});
															thumbnails[692940] = clik.newPhoto({"id":692940,"src":"PPTarticle3_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_692940.html","width":130,"caption":"Wokingham Times 12th July 2006","height":93});
															thumbnails[692954] = clik.newPhoto({"id":692954,"src":"PPTarticle4_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_692954.html","width":130,"caption":"Twyford Advertiser 21st September 2006","height":156});
															thumbnails[1882622] = clik.newPhoto({"id":1882622,"src":"Pottytree1_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882622.html","width":130,"caption":"Twyford Advertiser 29th November 2007","height":98});
															thumbnails[1882707] = clik.newPhoto({"id":1882707,"src":"Pottytree2_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882707.html","width":130,"caption":"Reading Chronicle 6th December 2007","height":187});
															thumbnails[1882709] = clik.newPhoto({"id":1882709,"src":"Pottytree4_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882709.html","width":130,"caption":"Enterprise Link Brochure Introduction","height":92});
															thumbnails[1882711] = clik.newPhoto({"id":1882711,"src":"Pottytree5_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882711.html","width":130,"caption":"Enterprise Link Brochure Feature","height":92});
															thumbnails[1882713] = clik.newPhoto({"id":1882713,"src":"Pottytree6_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882713.html","width":130,"caption":"University of Reading Bulletin 6th December 2007","height":103});
															thumbnails[1882716] = clik.newPhoto({"id":1882716,"src":"Pottytree8_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882716.html","width":130,"caption":"Women in Business Insert Side A","height":183});
															thumbnails[1882720] = clik.newPhoto({"id":1882720,"src":"Pottytree9_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_1882720.html","width":130,"caption":"Women in Business Insert Side B","height":183});
															thumbnails[4754509] = clik.newPhoto({"id":4754509,"src":"Pottytree_Puppet_Theft_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_4754509.html","width":130,"caption":"Wokingham Times 17th June 2009","height":251});
															thumbnails[7495792] = clik.newPhoto({"id":7495792,"src":"paperarticleforwebsite_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_7495792.html","width":130,"caption":"Maidenhead Advertiser. August 2010","height":64});
															thumbnails[7495797] = clik.newPhoto({"id":7495797,"src":"peterfieldforwebsite_thumb.jpg","galleries_id":51431,"server_id":15,"link":"photo_7495797.html","width":130,"caption":"Petersfield Post. February 2010","height":84});
															thumbnails[8759971] = clik.newPhoto({"id":8759971,"src":"Jo_workshops_for_schools_thumb.jpg","galleries_id":461325,"server_id":15,"link":"photo_8759971.html","width":130,"caption":"School Workshops 2011\/12","height":183});
															thumbnails[1916697] = clik.newPhoto({"id":1916697,"src":"Pottytree Book Order_thumb.jpg","galleries_id":128497,"server_id":15,"link":"photo_1916697.html","width":130,"caption":"Click on the image, then right click on the larger picture. Select 'save picture as', save to your desktop and print off.","height":184});
															thumbnails[2261962] = clik.newPhoto({"id":2261962,"src":"Magic Carpet Main Picture_thumb.jpg","galleries_id":148695,"server_id":15,"link":"photo_2261962.html","width":130,"caption":"Click on the image, then right click on the larger picture. Select 'save picture as' then save to your desktop.","height":80});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[51431] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Images","link":"gallery.html","maxRecords":0.0,"photoIDs":[7264510.0,676560.0,673742.0,673811.0,717081.0,675434.0,692937.0,676435.0,681518.0,681520.0,1987765.0,1987773.0,1987777.0,1987782.0,1987787.0,1987874.0,1987884.0,2261851.0,2261860.0,2261866.0,675435.0,692951.0,692940.0,692954.0,1882622.0,1882707.0,1882709.0,1882711.0,1882713.0,1882716.0,1882720.0,4754509.0,7495792.0,7495797.0],"skipIndex":0,"section_code":"gallery","featured_images":"675435,675434,673811,673742","id":51431,"singleSection":true});				  						galleries[128497] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Order Form","link":"section167583.html","maxRecords":0.0,"photoIDs":[1916697.0],"skipIndex":0,"section_code":"section167583","featured_images":1916697.0,"id":128497,"singleSection":true});				  						galleries[148695] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Book Illustration","link":"section190533.html","maxRecords":0.0,"photoIDs":[2261962.0],"skipIndex":0,"section_code":"section190533","featured_images":2261962.0,"id":148695,"singleSection":true});				  						galleries[406353] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Large Dog Puppets","link":"section485981_406353.html","maxRecords":0.0,"photoIDs":[7494761.0,7494779.0,7494803.0],"skipIndex":0,"section_code":"section485981","featured_images":"7494803,7494779,7494761","id":406353,"singleSection":false});				  						galleries[406357] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Super Furry Large Dog Puppets","link":"section485981_406357.html","maxRecords":0.0,"photoIDs":[7494852.0,7494855.0],"skipIndex":0,"section_code":"section485981","featured_images":"7494855,7494852","id":406357,"singleSection":false});				  						galleries[406358] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Small Dog Puppets","link":"section485981_406358.html","maxRecords":0.0,"photoIDs":[7494858.0,7494861.0],"skipIndex":0,"section_code":"section485981","featured_images":"7494861,7494858","id":406358,"singleSection":false});				  						galleries[406359] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Super Furry Small Dog Puppets","link":"section485981_406359.html","maxRecords":0.0,"photoIDs":[7494866.0,7494869.0],"skipIndex":0,"section_code":"section485981","featured_images":"7494869,7494866","id":406359,"singleSection":false});				  						galleries[406361] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Puppy Hand Puppets","link":"section485981_406361.html","maxRecords":0.0,"photoIDs":[7494871.0],"skipIndex":0,"section_code":"section485981","featured_images":7494871.0,"id":406361,"singleSection":false});				  						galleries[406362] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Super Furry Puppy Hand Puppets","link":"section485981_406362.html","maxRecords":0.0,"photoIDs":[7494875.0],"skipIndex":0,"section_code":"section485981","featured_images":7494875.0,"id":406362,"singleSection":false});				  						galleries[406363] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Squirrel Hand Puppets","link":"section485981_406363.html","maxRecords":0.0,"photoIDs":[7494882.0],"skipIndex":0,"section_code":"section485981","featured_images":7494882.0,"id":406363,"singleSection":false});				  						galleries[461325] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"School Workshops 2011\/12","link":"section558541.html","maxRecords":0.0,"photoIDs":[8759971.0],"skipIndex":0,"section_code":"section558541","featured_images":8759971.0,"id":461325,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '676560';
imageSets[2] = '673742,673811,675434,2261962,675435';
imageSets[3] = '8759971,7495797,7495792,7494882,7494875,7494871,7494869,7494866,7494861,7494858,7494855,7494852,7494803,7494779,7494761,7264510,4754509,2261962,2261866,2261860,2261851,1987884,1987874,1987787,1987782,1987777,1987773,1987765,1916697,1882720,1882716,1882713,1882711,1882709,1882707,1882622,717081,692954,692951,692940,692937,681520,681518,676560,676435,675435,675434,673811,673742';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jobryant/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jobryant/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jobryant/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jobryant/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jobryant/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jobryant/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jobryant/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 && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'section485981.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 && 'section485981' != '') {
					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 = 'pottytreepuppets: ' + 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 puppet online</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="JOBRYANT">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

