window.thumbnails = {};
															thumbnails[1355074] = clik.newPhoto({"id":1355074,"src":"andrewsphotos.co.uk (22)2.jpg","galleries_id":94911,"server_id":18,"link":"photo_1355074.html","width":130,"caption":"","height":103});
															thumbnails[1355110] = clik.newPhoto({"id":1355110,"src":"andrewsphotos.co.uk (3)2.jpg","galleries_id":94911,"server_id":18,"link":"photo_1355110.html","width":130,"caption":"","height":164});
															thumbnails[1356327] = clik.newPhoto({"id":1356327,"src":"andrewsphotos.co.uk (1)4.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356327.html","width":130,"caption":"","height":173});
															thumbnails[1356330] = clik.newPhoto({"id":1356330,"src":"andrewsphotos.co.uk (4)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356330.html","width":130,"caption":"","height":178});
															thumbnails[1356332] = clik.newPhoto({"id":1356332,"src":"andrewsphotos.co.uk (2)4.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356332.html","width":130,"caption":"","height":98});
															thumbnails[1356333] = clik.newPhoto({"id":1356333,"src":"andrewsphotos.co.uk (5)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356333.html","width":130,"caption":"","height":172});
															thumbnails[1356336] = clik.newPhoto({"id":1356336,"src":"andrewsphotos.co.uk (6)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356336.html","width":130,"caption":"","height":173});
															thumbnails[1356338] = clik.newPhoto({"id":1356338,"src":"andrewsphotos.co.uk (7)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356338.html","width":130,"caption":"","height":174});
															thumbnails[1356339] = clik.newPhoto({"id":1356339,"src":"andrewsphotos.co.uk (8)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356339.html","width":130,"caption":"","height":172});
															thumbnails[1356340] = clik.newPhoto({"id":1356340,"src":"andrewsphotos.co.uk (9)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356340.html","width":130,"caption":"","height":176});
															thumbnails[1356343] = clik.newPhoto({"id":1356343,"src":"andrewsphotos.co.uk (10)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356343.html","width":130,"caption":"","height":173});
															thumbnails[1356344] = clik.newPhoto({"id":1356344,"src":"andrewsphotos.co.uk (11)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356344.html","width":130,"caption":"","height":170});
															thumbnails[1356346] = clik.newPhoto({"id":1356346,"src":"andrewsphotos.co.uk (12)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356346.html","width":130,"caption":"","height":174});
															thumbnails[1356348] = clik.newPhoto({"id":1356348,"src":"andrewsphotos.co.uk (13)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1356348.html","width":130,"caption":"","height":176});
															thumbnails[1359286] = clik.newPhoto({"id":1359286,"src":"andrewsphotos.co.uk (20)4.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359286.html","width":130,"caption":"","height":111});
															thumbnails[1359296] = clik.newPhoto({"id":1359296,"src":"andrewsphotos.co.uk (26)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359296.html","width":130,"caption":"","height":163});
															thumbnails[1359300] = clik.newPhoto({"id":1359300,"src":"andrewsphotos.co.uk (15)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359300.html","width":130,"caption":"","height":100});
															thumbnails[1359308] = clik.newPhoto({"id":1359308,"src":"andrewsphotos.co.uk (28)1.JPG","galleries_id":94911,"server_id":18,"link":"photo_1359308.html","width":130,"caption":"","height":69});
															thumbnails[1359309] = clik.newPhoto({"id":1359309,"src":"andrewsphotos.co.uk (30)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359309.html","width":130,"caption":"","height":102});
															thumbnails[1359310] = clik.newPhoto({"id":1359310,"src":"andrewsphotos.co.uk (31)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359310.html","width":130,"caption":"","height":178});
															thumbnails[1359311] = clik.newPhoto({"id":1359311,"src":"andrewsphotos.co.uk (32)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359311.html","width":130,"caption":"","height":90});
															thumbnails[1359316] = clik.newPhoto({"id":1359316,"src":"andrewsphotos.co.uk (38)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359316.html","width":130,"caption":"","height":182});
															thumbnails[1359325] = clik.newPhoto({"id":1359325,"src":"andrewsphotos.co.uk (18)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359325.html","width":130,"caption":"","height":165});
															thumbnails[1359328] = clik.newPhoto({"id":1359328,"src":"andrewsphotos.co.uk (40)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1359328.html","width":130,"caption":"","height":170});
															thumbnails[1359370] = clik.newPhoto({"id":1359370,"src":"andrewsphotos.co.uk (24)1.JPG","galleries_id":94911,"server_id":18,"link":"photo_1359370.html","width":130,"caption":"","height":173});
															thumbnails[1361690] = clik.newPhoto({"id":1361690,"src":"ice copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1361690.html","width":130,"caption":"","height":158});
															thumbnails[1361691] = clik.newPhoto({"id":1361691,"src":"6 copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1361691.html","width":130,"caption":"","height":130});
															thumbnails[1362026] = clik.newPhoto({"id":1362026,"src":"andrewsphotos.co.uk (21)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362026.html","width":130,"caption":"","height":165});
															thumbnails[1362029] = clik.newPhoto({"id":1362029,"src":"L1220055 Double Bluff Theatre Company. 07.121.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362029.html","width":130,"caption":"","height":85});
															thumbnails[1362033] = clik.newPhoto({"id":1362033,"src":"photo examples (8) copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362033.html","width":130,"caption":"","height":140});
															thumbnails[1362036] = clik.newPhoto({"id":1362036,"src":"photo examples (18) copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362036.html","width":130,"caption":"","height":174});
															thumbnails[1362039] = clik.newPhoto({"id":1362039,"src":"andrewsphotos.co.uk (23)1.JPG","galleries_id":94911,"server_id":18,"link":"photo_1362039.html","width":130,"caption":"","height":173});
															thumbnails[1362042] = clik.newPhoto({"id":1362042,"src":"andrewsphotos.co.uk (35)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362042.html","width":130,"caption":"","height":167});
															thumbnails[1362046] = clik.newPhoto({"id":1362046,"src":"andrewsphotos.co.uk (37)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1362046.html","width":130,"caption":"","height":174});
															thumbnails[1365033] = clik.newPhoto({"id":1365033,"src":"andrewsphotos.co.uk (14)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365033.html","width":130,"caption":"","height":171});
															thumbnails[1365037] = clik.newPhoto({"id":1365037,"src":"photo examples (1) copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365037.html","width":130,"caption":"","height":102});
															thumbnails[1365041] = clik.newPhoto({"id":1365041,"src":"andrewsphotos.co.uk (39)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365041.html","width":130,"caption":"","height":176});
															thumbnails[1365043] = clik.newPhoto({"id":1365043,"src":"andrewsphotos.co.uk (36)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365043.html","width":130,"caption":"","height":179});
															thumbnails[1365449] = clik.newPhoto({"id":1365449,"src":"examples  57 (47) copy1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365449.html","width":130,"caption":"","height":94});
															thumbnails[1365459] = clik.newPhoto({"id":1365459,"src":"andrewsphotos.co.uk (34)1.jpg","galleries_id":94911,"server_id":18,"link":"photo_1365459.html","width":130,"caption":"","height":169});
															thumbnails[1365465] = clik.newPhoto({"id":1365465,"src":"andrewsphotos.co.uk (27)1.JPG","galleries_id":94911,"server_id":18,"link":"photo_1365465.html","width":130,"caption":"","height":171});
															thumbnails[1368596] = clik.newPhoto({"id":1368596,"src":"andrewsphotos.co.uk (29)3.JPG","galleries_id":94911,"server_id":18,"link":"photo_1368596.html","width":130,"caption":"","height":110});
															thumbnails[1730748] = clik.newPhoto({"id":1730748,"src":"Actors   260_thumb.jpg","galleries_id":94911,"server_id":18,"link":"photo_1730748.html","width":130,"caption":"","height":169});
															thumbnails[2117763] = clik.newPhoto({"id":2117763,"src":"Actors   388_thumb.jpg","galleries_id":94911,"server_id":18,"link":"photo_2117763.html","width":130,"caption":"","height":166});
															thumbnails[2117764] = clik.newPhoto({"id":2117764,"src":"Actors   394_thumb.JPG","galleries_id":94911,"server_id":18,"link":"photo_2117764.html","width":130,"caption":"","height":165});
															thumbnails[2117772] = clik.newPhoto({"id":2117772,"src":"Actors   389_thumb.JPG","galleries_id":94911,"server_id":18,"link":"photo_2117772.html","width":130,"caption":"","height":105});
															thumbnails[3127724] = clik.newPhoto({"id":3127724,"src":"DSC_2091_thumb.JPG","galleries_id":94911,"server_id":18,"link":"photo_3127724.html","width":130,"caption":"","height":173});
															thumbnails[3644726] = clik.newPhoto({"id":3644726,"src":"Example_425_thumb.JPG","galleries_id":94911,"server_id":18,"link":"photo_3644726.html","width":130,"caption":"","height":195});
															thumbnails[6027616] = clik.newPhoto({"id":6027616,"src":"654321_thumb.JPG","galleries_id":94911,"server_id":18,"link":"photo_6027616.html","width":130,"caption":"","height":180});
															thumbnails[6028035] = clik.newPhoto({"id":6028035,"src":"22222_thumb.jpg","galleries_id":94911,"server_id":18,"link":"photo_6028035.html","width":130,"caption":"","height":169});
															thumbnails[6028040] = clik.newPhoto({"id":6028040,"src":"111111_thumb.jpg","galleries_id":94911,"server_id":18,"link":"photo_6028040.html","width":130,"caption":"","height":102});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[94911] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photos","link":"gallery.html","maxRecords":0.0,"photoIDs":[1355074.0,1355110.0,1356327.0,1356330.0,1356332.0,1356333.0,1356336.0,1356338.0,1356339.0,1356340.0,1356343.0,1356344.0,1356346.0,1356348.0,1359286.0,1359296.0,1359300.0,1359308.0,1359309.0,1359310.0,1359311.0,1359316.0,1359325.0,1359328.0,1359370.0,1361690.0,1361691.0,1362026.0,1362029.0,1362033.0,1362036.0,1362039.0,1362042.0,1362046.0,1365033.0,1365037.0,1365041.0,1365043.0,1365449.0,1365459.0,1365465.0,1368596.0,1730748.0,2117763.0,2117764.0,2117772.0,3127724.0,3644726.0,6027616.0,6028035.0,6028040.0],"skipIndex":0,"section_code":"gallery","featured_images":"6028040,6028035,6027616,3644726,3127724,2117772,2117764,2117763,1730748,1368596","id":94911,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1355074';
imageSets[3] = '6028040,6028035,6027616,3644726,3127724,2117772,2117764,2117763,1730748,1368596,1365465,1365459,1365449,1365043,1365041,1365037,1365033,1362046,1362042,1362039,1362036,1362033,1362029,1362026,1361691,1361690,1359370,1359328,1359325,1359316,1359311,1359310,1359309,1359308,1359300,1359296,1359286,1356348,1356346,1356344,1356343,1356340,1356339,1356338,1356336,1356333,1356332,1356330,1356327,1355110';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/AndrewChapman/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/AndrewChapman/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 += '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 = 'Andrew Chapman  Photographer: ' + 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.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 += '<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;
	}
}

		

