window.thumbnails = {};
															thumbnails[3583134] = clik.newPhoto({"id":3583134,"src":"veronicap1_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3583134.html","width":130,"caption":"Veronica","height":173});
															thumbnails[5884201] = clik.newPhoto({"id":5884201,"src":"mr_jacobs_progress_013_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_5884201.html","width":130,"caption":"The Sleeping Lady","height":98});
															thumbnails[6029873] = clik.newPhoto({"id":6029873,"src":"mobilepics_013_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_6029873.html","width":130,"caption":"The Conversation","height":86});
															thumbnails[7471271] = clik.newPhoto({"id":7471271,"src":"Baby_A3_thumb.jpg","galleries_id":210854,"server_id":15,"link":"photo_7471271.html","width":130,"caption":"Baby A","height":109});
															thumbnails[7485488] = clik.newPhoto({"id":7485488,"src":"guidinglightjpgm_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_7485488.html","width":130,"caption":"Guiding Light","height":106});
															thumbnails[7485491] = clik.newPhoto({"id":7485491,"src":"mourning_georgecopyc_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_7485491.html","width":130,"caption":"Mourning George","height":177});
															thumbnails[7530659] = clik.newPhoto({"id":7530659,"src":"goodposs2_thumb.jpg","galleries_id":298175,"server_id":15,"link":"photo_7530659.html","width":130,"caption":"Zansker Valley, India","height":351});
															thumbnails[7813254] = clik.newPhoto({"id":7813254,"src":"brionybramble1_thumb.jpg","galleries_id":298174,"server_id":15,"link":"photo_7813254.html","width":130,"caption":"Cavalier King Charles Spaniels","height":159});
															thumbnails[7821579] = clik.newPhoto({"id":7821579,"src":"miller_00112_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_7821579.html","width":130,"caption":"Mrs H Miller","height":172});
															thumbnails[8704179] = clik.newPhoto({"id":8704179,"src":"023_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_8704179.html","width":130,"caption":"The Love of Polly","height":187});
															thumbnails[8704308] = clik.newPhoto({"id":8704308,"src":"018_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8704308.html","width":130,"caption":"Female Nude Study","height":84});
															thumbnails[8704314] = clik.newPhoto({"id":8704314,"src":"013_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8704314.html","width":130,"caption":"The Ballerina","height":86});
															thumbnails[8704364] = clik.newPhoto({"id":8704364,"src":"011_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8704364.html","width":130,"caption":"'Breathe'","height":95});
															thumbnails[8704589] = clik.newPhoto({"id":8704589,"src":"019_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8704589.html","width":130,"caption":"Ballerina","height":196});
															thumbnails[8705278] = clik.newPhoto({"id":8705278,"src":"otter_thumb.jpg","galleries_id":298174,"server_id":15,"link":"photo_8705278.html","width":130,"caption":"The Otter (detail)","height":157});
															thumbnails[8705279] = clik.newPhoto({"id":8705279,"src":"036_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8705279.html","width":130,"caption":"The Family","height":88});
															thumbnails[8916441] = clik.newPhoto({"id":8916441,"src":"0bi1_thumb.jpg","galleries_id":298174,"server_id":15,"link":"photo_8916441.html","width":130,"caption":"Obi","height":173});
															thumbnails[8916447] = clik.newPhoto({"id":8916447,"src":"jbw_004_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_8916447.html","width":130,"caption":"Jasmine","height":96});
															thumbnails[8916453] = clik.newPhoto({"id":8916453,"src":"artwork_002_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_8916453.html","width":130,"caption":"Cavalier King Charles Puppy","height":173});
															thumbnails[8916461] = clik.newPhoto({"id":8916461,"src":"nebula_005_thumb.JPG","galleries_id":298175,"server_id":15,"link":"photo_8916461.html","width":130,"caption":"Nebula 1","height":169});
															thumbnails[8927391] = clik.newPhoto({"id":8927391,"src":"wed_013_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_8927391.html","width":130,"caption":"Free Spirit","height":168});
															thumbnails[8927394] = clik.newPhoto({"id":8927394,"src":"wed_001_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8927394.html","width":130,"caption":"Contemplation","height":198});
															thumbnails[8927468] = clik.newPhoto({"id":8927468,"src":"other_001_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_8927468.html","width":130,"caption":"","height":176});
															thumbnails[8936014] = clik.newPhoto({"id":8936014,"src":"seascapes_012_thumb.JPG","galleries_id":470275,"server_id":15,"link":"photo_8936014.html","width":130,"caption":"Heading Home","height":173});
															thumbnails[8944773] = clik.newPhoto({"id":8944773,"src":"seascape2_022_thumb.JPG","galleries_id":470275,"server_id":15,"link":"photo_8944773.html","width":130,"caption":"After the Rain","height":97});
															thumbnails[3448311] = clik.newPhoto({"id":3448311,"src":"022_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_3448311.html","width":130,"caption":"Treasured Memories of Polly.","height":183});
															thumbnails[3448421] = clik.newPhoto({"id":3448421,"src":"thehorse_thumb.jpg","galleries_id":298174,"server_id":15,"link":"photo_3448421.html","width":130,"caption":"'Free Spirit' ","height":92});
															thumbnails[3448489] = clik.newPhoto({"id":3448489,"src":"014_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_3448489.html","width":130,"caption":"'Keep still, We're being watched'","height":99});
															thumbnails[3448801] = clik.newPhoto({"id":3448801,"src":"rabbit_thumb.jpg","galleries_id":298174,"server_id":15,"link":"photo_3448801.html","width":130,"caption":"Rabbit Study","height":98});
															thumbnails[3448512] = clik.newPhoto({"id":3448512,"src":"012_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_3448512.html","width":130,"caption":"'Brooke' ","height":113});
															thumbnails[4235597] = clik.newPhoto({"id":4235597,"src":"033_thumb.JPG","galleries_id":298174,"server_id":15,"link":"photo_4235597.html","width":130,"caption":"Bluebell","height":99});
															thumbnails[3469582] = clik.newPhoto({"id":3469582,"src":"DSC00458_thumb.jpg","galleries_id":210854,"server_id":15,"link":"photo_3469582.html","width":130,"caption":"Mabel","height":186});
															thumbnails[3469583] = clik.newPhoto({"id":3469583,"src":"DSC00459_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_3469583.html","width":130,"caption":"Stanley ","height":173});
															thumbnails[3452951] = clik.newPhoto({"id":3452951,"src":"Rhiannon2_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_3452951.html","width":130,"caption":"Rhiannon","height":173});
															thumbnails[3773078] = clik.newPhoto({"id":3773078,"src":"der_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3773078.html","width":130,"caption":"Derek (detail)","height":150});
															thumbnails[4283678] = clik.newPhoto({"id":4283678,"src":"mt2_thumb.jpg","galleries_id":210854,"server_id":15,"link":"photo_4283678.html","width":130,"caption":"Mrs Tidmas","height":181});
															thumbnails[3448477] = clik.newPhoto({"id":3448477,"src":"017_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_3448477.html","width":130,"caption":"'Cyril: Held in the arms whilst he sleeps;Held in the heart forever' ","height":89});
															thumbnails[3449233] = clik.newPhoto({"id":3449233,"src":"l1_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3449233.html","width":130,"caption":"Mr Lloyd","height":173});
															thumbnails[3452958] = clik.newPhoto({"id":3452958,"src":"cpjk_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3452958.html","width":130,"caption":"Mr Peter Jinks","height":173});
															thumbnails[3449312] = clik.newPhoto({"id":3449312,"src":"ali_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3449312.html","width":130,"caption":"Ali","height":173});
															thumbnails[3449227] = clik.newPhoto({"id":3449227,"src":"cj_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3449227.html","width":130,"caption":"The Young Reader","height":173});
															thumbnails[3449278] = clik.newPhoto({"id":3449278,"src":"cp_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_3449278.html","width":130,"caption":"Chrissie Amongst The Bluebells","height":163});
															thumbnails[3452947] = clik.newPhoto({"id":3452947,"src":"alison_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_3452947.html","width":130,"caption":"Alison","height":173});
															thumbnails[4135706] = clik.newPhoto({"id":4135706,"src":"clikpicoption2_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_4135706.html","width":130,"caption":"Never Ending Love","height":213});
															thumbnails[3448370] = clik.newPhoto({"id":3448370,"src":"DSC00759_thumb.JPG","galleries_id":210854,"server_id":15,"link":"photo_3448370.html","width":130,"caption":"Study of Female Nude.","height":173});
															thumbnails[3448517] = clik.newPhoto({"id":3448517,"src":"Bluebell 026_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_3448517.html","width":130,"caption":"Sunday Morning","height":99});
															thumbnails[4135709] = clik.newPhoto({"id":4135709,"src":"DSC01088_thumb.JPG","galleries_id":210853,"server_id":15,"link":"photo_4135709.html","width":130,"caption":"Best Friends","height":98});
															thumbnails[8706670] = clik.newPhoto({"id":8706670,"src":"barbara_thumb.jpg","galleries_id":210853,"server_id":15,"link":"photo_8706670.html","width":130,"caption":"Barbara","height":81});
															thumbnails[8704804] = clik.newPhoto({"id":8704804,"src":"brps_thumb.jpg","galleries_id":459124,"server_id":15,"link":"photo_8704804.html","width":130,"caption":"","height":153});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[298175] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landscapes","link":"gallery_298175.html","maxRecords":0.0,"photoIDs":[7530659.0,8916461.0],"skipIndex":0,"section_code":"gallery","featured_images":7530659.0,"id":298175,"singleSection":false});				  						galleries[298174] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Animals","link":"gallery_298174.html","maxRecords":0.0,"photoIDs":[7813254.0,8704179.0,8705278.0,8916441.0,8916453.0,8927391.0,3448311.0,3448421.0,3448489.0,3448801.0,3448512.0,4235597.0],"skipIndex":0,"section_code":"gallery","featured_images":3448801.0,"id":298174,"singleSection":false});				  						galleries[210853] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Painted Portraits","link":"gallery_210853.html","maxRecords":0.0,"photoIDs":[3583134.0,5884201.0,6029873.0,7485488.0,7485491.0,7821579.0,8916447.0,3452951.0,3773078.0,3449233.0,3452958.0,3449312.0,3449227.0,3449278.0,3452947.0,4135706.0,3448517.0,4135709.0,8706670.0],"skipIndex":0,"section_code":"gallery","featured_images":7485488.0,"id":210853,"singleSection":false});				  						galleries[210854] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Drawn Portraits","link":"gallery_210854.html","maxRecords":0.0,"photoIDs":[7471271.0,8704308.0,8704314.0,8704364.0,8704589.0,8705279.0,8927394.0,8927468.0,3469582.0,3469583.0,4283678.0,3448477.0,3448370.0],"skipIndex":0,"section_code":"gallery","featured_images":3448477.0,"id":210854,"singleSection":false});				  						galleries[470275] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Seascapes","link":"gallery_470275.html","maxRecords":0.0,"photoIDs":[8936014.0,8944773.0],"skipIndex":0,"section_code":"gallery","featured_images":"8944773,8936014","id":470275,"singleSection":false});				  						galleries[459124] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Caroline","link":"section555766.html","maxRecords":0.0,"photoIDs":[8704804.0],"skipIndex":0,"section_code":"section555766","featured_images":8704804.0,"id":459124,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3583134';
imageSets[2] = '7530659,7485488,3448801,3448477';
imageSets[3] = '8944773,8936014,8927468,8927394,8927391,8916461,8916453,8916447,8916441,8706670,8705279,8705278,8704804,8704589,8704364,8704314,8704308,8704179,7821579,7813254,7530659,7485491,7485488,7471271,6029873,5884201,4283678,4235597,4135709,4135706,3773078,3583134,3469583,3469582,3452958,3452951,3452947,3449312,3449278,3449233,3449227,3448801,3448517,3448512,3448489,3448477,3448421,3448370,3448311';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/carolineneill/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/carolineneill/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 = 'Caroline Neill Artworks: ' + 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> &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="carolineneill2@yahoo.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="carolineneill2@yahoo.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;
	}
}

			

