window.thumbnails = {};
															thumbnails[4515563] = clik.newPhoto({"id":4515563,"src":"me-3_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":36});
															thumbnails[6319819] = clik.newPhoto({"id":6319819,"src":"home_page_image-1a_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":70});
															thumbnails[6969076] = clik.newPhoto({"id":6969076,"src":"msd_01A_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"small dish","height":143});
															thumbnails[4471903] = clik.newPhoto({"id":4471903,"src":"msd-2A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4471903.html","width":130,"caption":"Two buildings<br>\r\nLeft: h.27cm, w.15cm, d.10cm<br>\r\nRight: h.19cm, w.23cm, d.7cm","height":86});
															thumbnails[4471905] = clik.newPhoto({"id":4471905,"src":"msd-3A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4471905.html","width":130,"caption":"Building<br>\r\nh.20cm, w.22cm, d.9cm","height":86});
															thumbnails[4517782] = clik.newPhoto({"id":4517782,"src":"msd-5A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4517782.html","width":130,"caption":"Bowl<br>\r\n23cm square","height":88});
															thumbnails[4517784] = clik.newPhoto({"id":4517784,"src":"msd-7A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4517784.html","width":130,"caption":"Left: Bowl: 18cm square<br>\r\nRight: Box: h.16cm, w.7cm, d.6cm","height":86});
															thumbnails[4517785] = clik.newPhoto({"id":4517785,"src":"msd-9A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4517785.html","width":130,"caption":"Three bowls.<br>\r\nLeft: 23cm square<br>\r\nCentre: 16cm Square<br>\r\nRight: 18cm square","height":78});
															thumbnails[4517788] = clik.newPhoto({"id":4517788,"src":"msd-11A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4517788.html","width":130,"caption":"Two bowls<br>\r\nLeft: 23cm square<br>\r\nRight: 16cm square","height":75});
															thumbnails[4517789] = clik.newPhoto({"id":4517789,"src":"msd-6A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4517789.html","width":130,"caption":"20cm square","height":86});
															thumbnails[4517794] = clik.newPhoto({"id":4517794,"src":"drawing-21_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4517794.html","width":130,"caption":"","height":134});
															thumbnails[4517800] = clik.newPhoto({"id":4517800,"src":"drawing-1_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4517800.html","width":130,"caption":"","height":134});
															thumbnails[4517803] = clik.newPhoto({"id":4517803,"src":"print-1_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4517803.html","width":130,"caption":"","height":92});
															thumbnails[4525721] = clik.newPhoto({"id":4525721,"src":"monoprint-buildings-1_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525721.html","width":130,"caption":"","height":178});
															thumbnails[4525728] = clik.newPhoto({"id":4525728,"src":"monoprint-pavement1_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525728.html","width":130,"caption":"","height":176});
															thumbnails[4525731] = clik.newPhoto({"id":4525731,"src":"Untitled-1_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525731.html","width":130,"caption":"","height":177});
															thumbnails[4525732] = clik.newPhoto({"id":4525732,"src":"drawing-3_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525732.html","width":130,"caption":"","height":170});
															thumbnails[4525736] = clik.newPhoto({"id":4525736,"src":"drawing-5_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525736.html","width":130,"caption":"","height":179});
															thumbnails[4525738] = clik.newPhoto({"id":4525738,"src":"drawing-4_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_4525738.html","width":130,"caption":"","height":179});
															thumbnails[4562921] = clik.newPhoto({"id":4562921,"src":"msd-4_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4562921.html","width":130,"caption":"Tower<br>\r\nh.28cm","height":196});
															thumbnails[4562937] = clik.newPhoto({"id":4562937,"src":"msd-1a1_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_4562937.html","width":130,"caption":"Three towers.<br>\r\nLeft: h.40cm<br>\r\nCentre: h.55cm<br>\r\nRight: h.30cm","height":123});
															thumbnails[5235561] = clik.newPhoto({"id":5235561,"src":"detail1_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_5235561.html","width":130,"caption":"Glaze detail","height":218});
															thumbnails[6969199] = clik.newPhoto({"id":6969199,"src":"msd_07A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_6969199.html","width":130,"caption":"large panel","height":104});
															thumbnails[6969430] = clik.newPhoto({"id":6969430,"src":"msd_4a1_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_6969430.html","width":130,"caption":"'Blue windows'","height":309});
															thumbnails[6969446] = clik.newPhoto({"id":6969446,"src":"msd_10A123_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_6969446.html","width":130,"caption":"small tower","height":233});
															thumbnails[6970540] = clik.newPhoto({"id":6970540,"src":"PICT0736_thumb.JPG","galleries_id":260596,"server_id":18,"link":"photo_6970540.html","width":130,"caption":"White House - arch","height":123});
															thumbnails[6970660] = clik.newPhoto({"id":6970660,"src":"PICT0749_thumb.JPG","galleries_id":260596,"server_id":18,"link":"photo_6970660.html","width":130,"caption":"large dish","height":123});
															thumbnails[6970684] = clik.newPhoto({"id":6970684,"src":"lantern_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_6970684.html","width":130,"caption":"garden lantern","height":262});
															thumbnails[8804561] = clik.newPhoto({"id":8804561,"src":"flying_the_flag_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_8804561.html","width":130,"caption":"Flying the flag for Glasgow","height":237});
															thumbnails[8804563] = clik.newPhoto({"id":8804563,"src":"PICT0150A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_8804563.html","width":130,"caption":"wall panel","height":173});
															thumbnails[8804573] = clik.newPhoto({"id":8804573,"src":"PICT0148A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_8804573.html","width":130,"caption":"Panel","height":173});
															thumbnails[8805178] = clik.newPhoto({"id":8805178,"src":"PICT0146A_thumb.jpg","galleries_id":260596,"server_id":18,"link":"photo_8805178.html","width":130,"caption":"Panel - ceramic, reclaimed wood & lead","height":103});
															thumbnails[8838927] = clik.newPhoto({"id":8838927,"src":"Silvery_Moon_A_BF955169-1EC9-D45B-1CBEEFCA791CC99A_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_8838927.html","width":98,"caption":"Silvery Moon","height":130});
															thumbnails[8838928] = clik.newPhoto({"id":8838928,"src":"Windy_RowA_BFA2CA7B-1EC9-D45B-1CA0A467F5100FC0_thumb.jpg","galleries_id":260597,"server_id":18,"link":"photo_8838928.html","width":130,"caption":"Windy Row","height":98});
															thumbnails[4542046] = clik.newPhoto({"id":4542046,"src":"PICT0023_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4542046.html","width":130,"caption":"Peeling paint on the ceiling of the baths","height":173});
															thumbnails[4542047] = clik.newPhoto({"id":4542047,"src":"PICT0025_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4542047.html","width":130,"caption":"Peeling paint on the ceiling of the baths","height":98});
															thumbnails[4541263] = clik.newPhoto({"id":4541263,"src":"govanhill_doors_open_4_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4541263.html","width":130,"caption":"Twisted porcelain","height":318});
															thumbnails[4541267] = clik.newPhoto({"id":4541267,"src":"govanhill_doors_open_3a_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4541267.html","width":130,"caption":"Drawing of suspended porcelain pieces","height":270});
															thumbnails[4541259] = clik.newPhoto({"id":4541259,"src":"govanhill_doors_open_2_a_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4541259.html","width":130,"caption":"View of the main pool towards the showers","height":154});
															thumbnails[4541261] = clik.newPhoto({"id":4541261,"src":"govanhill_doors_open_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4541261.html","width":130,"caption":"Shower area with drawing of the porcelain 'curtains'","height":176});
															thumbnails[4730695] = clik.newPhoto({"id":4730695,"src":"During_installation_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4730695.html","width":130,"caption":"During installation","height":173});
															thumbnails[4945244] = clik.newPhoto({"id":4945244,"src":"open_studio_thumb.jpg","galleries_id":261298,"server_id":18,"link":"photo_4945244.html","width":130,"caption":"Govanhill Baths installation re-worked for the WASPS open studio weekend","height":355});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[261298] = clik.newGallery({"parentGallery":260979,"usePopups":false,"title":"Govanhill Baths","link":"gallery_261298.html","maxRecords":0.0,"photoIDs":[4542046.0,4542047.0,4541263.0,4541267.0,4541259.0,4541261.0,4730695.0,4945244.0],"skipIndex":0,"section_code":"gallery","featured_images":"4945244,4730695,4542047,4542046,4541267,4541263,4541261,4541259","id":261298,"singleSection":false});				  						galleries[260596] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ceramics","link":"gallery_260596.html","maxRecords":0.0,"photoIDs":[4471903.0,4471905.0,4517782.0,4517784.0,4517785.0,4517788.0,4517789.0,4562921.0,4562937.0,5235561.0,6969199.0,6969430.0,6969446.0,6970540.0,6970660.0,6970684.0,8804561.0,8804563.0,8804573.0,8805178.0],"skipIndex":0,"section_code":"gallery","featured_images":"8805178,8804573,8804563,8804561,6970684,6970660,6970540,6969446,6969430,6969199","id":260596,"singleSection":false});				  						galleries[260597] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Prints & drawings","link":"gallery_260597.html","maxRecords":0.0,"photoIDs":[4517794.0,4517800.0,4517803.0,4525721.0,4525728.0,4525731.0,4525732.0,4525736.0,4525738.0,8838927.0,8838928.0],"skipIndex":0,"section_code":"gallery","featured_images":"8838928,8838927,4525738,4525736,4525732,4525731,4525728,4525721,4517803,4517800","id":260597,"singleSection":false});				  						galleries[260979] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"projects","link":"gallery_260979.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"4945244,4730695,4542047,4542046,4541267,4541263,4541261,4541259","id":260979,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8838928,8838927,8805178,8804573,8804563,8804561,6970684,6970660,6970540,6969446,6969430,6969199,6969076,6319819,5235561,4945244,4730695,4562937,4562921,4542047,4542046,4541267,4541263,4541261,4541259,4525738,4525736,4525732,4525731,4525728,4525721,4517803,4517800,4517794,4517789,4517788,4517785,4517784,4517782,4515563,4471905,4471903';
imageSets[3] = '8838928,8838927,8805178,8804573,8804563,8804561,6970684,6970660,6970540,6969446,6969430,6969199,6969076,6319819,5235561,4945244,4730695,4562937,4562921,4542047,4542046,4541267,4541263,4541261,4541259,4525738,4525736,4525732,4525731,4525728,4525721,4517803,4517800,4517794,4517789,4517788,4517785,4517784,4517782,4515563,4471905,4471903';
imageSets[241674] = '4515563';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/dobsonm/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/dobsonm/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 = 'malcolm s. dobson: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

