window.thumbnails = {};
															thumbnails[4086668] = clik.newPhoto({"id":4086668,"src":"Ice_cream_on_the_pier_thumb.jpg","galleries_id":245481,"server_id":15,"link":"photo_4086668.html","width":130,"caption":"Ice cream on the pier","height":124});
															thumbnails[4086681] = clik.newPhoto({"id":4086681,"src":"Night1_thumb.jpg","galleries_id":245481,"server_id":15,"link":"photo_4086681.html","width":130,"caption":"Night digging","height":130});
															thumbnails[4086686] = clik.newPhoto({"id":4086686,"src":"Jumping1_thumb.jpg","galleries_id":245481,"server_id":15,"link":"photo_4086686.html","width":130,"caption":"Jumping the waves","height":135});
															thumbnails[4086700] = clik.newPhoto({"id":4086700,"src":"dont_hurt_me_thumb.jpg","galleries_id":245481,"server_id":15,"link":"photo_4086700.html","width":130,"caption":"Scared of the water","height":130});
															thumbnails[4086707] = clik.newPhoto({"id":4086707,"src":"surfacing_thumb.jpg","galleries_id":245481,"server_id":15,"link":"photo_4086707.html","width":130,"caption":"Surfacing the pool","height":123});
															thumbnails[4460886] = clik.newPhoto({"id":4460886,"src":"Bun_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460886.html","width":130,"caption":"Iced bun","height":132});
															thumbnails[4460889] = clik.newPhoto({"id":4460889,"src":"Cherries_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460889.html","width":130,"caption":"Cherries","height":128});
															thumbnails[4460927] = clik.newPhoto({"id":4460927,"src":"Lemon_slices_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460927.html","width":130,"caption":"Lemon","height":203});
															thumbnails[4460936] = clik.newPhoto({"id":4460936,"src":"Meze_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460936.html","width":130,"caption":"Mezze","height":158});
															thumbnails[4460943] = clik.newPhoto({"id":4460943,"src":"Slice_of_pie_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460943.html","width":130,"caption":"Slice of pie","height":136});
															thumbnails[4460947] = clik.newPhoto({"id":4460947,"src":"Tangerines_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460947.html","width":130,"caption":"Tangerines","height":179});
															thumbnails[4460955] = clik.newPhoto({"id":4460955,"src":"Mug_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4460955.html","width":130,"caption":"Mug of Earl Grey","height":129});
															thumbnails[4461022] = clik.newPhoto({"id":4461022,"src":"shoes1_thumb.jpg","galleries_id":260617,"server_id":15,"link":"photo_4461022.html","width":130,"caption":"Ballet shoes","height":141});
															thumbnails[4461107] = clik.newPhoto({"id":4461107,"src":"BAD_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461107.html","width":130,"caption":"Bad times...","height":135});
															thumbnails[4461108] = clik.newPhoto({"id":4461108,"src":"GOOD_TIMES_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461108.html","width":130,"caption":"Good times...","height":126});
															thumbnails[4461110] = clik.newPhoto({"id":4461110,"src":"FAIRYTALES_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461110.html","width":130,"caption":"A fairytale waiting to come true","height":107});
															thumbnails[4461113] = clik.newPhoto({"id":4461113,"src":"Happy_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461113.html","width":130,"caption":"There are the happy times, and the sad...","height":111});
															thumbnails[4461116] = clik.newPhoto({"id":4461116,"src":"MAGIC_SCISSORS_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461116.html","width":130,"caption":"There's a pair of magic scissors","height":127});
															thumbnails[4461118] = clik.newPhoto({"id":4461118,"src":"MISSIN_SHOE_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461118.html","width":130,"caption":"A missing shoe and a dream waiting to come true","height":128});
															thumbnails[4461120] = clik.newPhoto({"id":4461120,"src":"SINGING_BALLERINA_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461120.html","width":130,"caption":"There's a ballerina that sings","height":135});
															thumbnails[4461177] = clik.newPhoto({"id":4461177,"src":"SOLID_GOLD_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461177.html","width":130,"caption":"A palace made of solid gold","height":124});
															thumbnails[4461178] = clik.newPhoto({"id":4461178,"src":"SPECIAL-POWERS_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461178.html","width":130,"caption":"And special powers...","height":133});
															thumbnails[4461181] = clik.newPhoto({"id":4461181,"src":"TINY_FAIRIES_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461181.html","width":130,"caption":"And tiny fairies with wings","height":114});
															thumbnails[4461182] = clik.newPhoto({"id":4461182,"src":"TRAPPED_BUTTERFLY_thumb.jpg","galleries_id":245482,"server_id":15,"link":"photo_4461182.html","width":130,"caption":"There's a trapped butterfly looking for an escape route","height":130});
															thumbnails[4461263] = clik.newPhoto({"id":4461263,"src":"Deep_thumb.jpg","galleries_id":260631,"server_id":15,"link":"photo_4461263.html","width":130,"caption":"Into the deep dark night","height":132});
															thumbnails[4461264] = clik.newPhoto({"id":4461264,"src":"Ready_thumb.jpg","galleries_id":260631,"server_id":15,"link":"photo_4461264.html","width":130,"caption":"Ready or not, here I come...","height":130});
															thumbnails[4461266] = clik.newPhoto({"id":4461266,"src":"walls_thumb.jpg","galleries_id":260631,"server_id":15,"link":"photo_4461266.html","width":130,"caption":"If these walls could talk...","height":129});
															thumbnails[4461271] = clik.newPhoto({"id":4461271,"src":"Didnt_thumb.jpg","galleries_id":260631,"server_id":15,"link":"photo_4461271.html","width":130,"caption":"I didn't mean to do it!","height":128});
															thumbnails[6886592] = clik.newPhoto({"id":6886592,"src":"LAND1_thumb.jpg","galleries_id":373775,"server_id":15,"link":"photo_6886592.html","width":130,"caption":"Surface 1","height":131});
															thumbnails[6886597] = clik.newPhoto({"id":6886597,"src":"LAND2_thumb.jpg","galleries_id":373775,"server_id":15,"link":"photo_6886597.html","width":130,"caption":"Surface 2","height":117});
															thumbnails[6886601] = clik.newPhoto({"id":6886601,"src":"LAND3_thumb.jpg","galleries_id":373775,"server_id":15,"link":"photo_6886601.html","width":130,"caption":"Surface 3","height":115});
															thumbnails[7453360] = clik.newPhoto({"id":7453360,"src":"Image0317_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453360.html","width":130,"caption":"Home","height":109});
															thumbnails[7453375] = clik.newPhoto({"id":7453375,"src":"Image0468_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453375.html","width":130,"caption":"Gifts","height":173});
															thumbnails[7453379] = clik.newPhoto({"id":7453379,"src":"Image0404_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453379.html","width":130,"caption":"Rapunzel's tower","height":173});
															thumbnails[7453382] = clik.newPhoto({"id":7453382,"src":"Image0185_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453382.html","width":130,"caption":"Room","height":98});
															thumbnails[7453383] = clik.newPhoto({"id":7453383,"src":"Image0202_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453383.html","width":130,"caption":"Wound healing","height":173});
															thumbnails[7453384] = clik.newPhoto({"id":7453384,"src":"Image0271_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453384.html","width":130,"caption":"Womb","height":98});
															thumbnails[7453386] = clik.newPhoto({"id":7453386,"src":"Image0320_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453386.html","width":130,"caption":"Silenced","height":92});
															thumbnails[7453395] = clik.newPhoto({"id":7453395,"src":"Image0353_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453395.html","width":130,"caption":"Crushed","height":173});
															thumbnails[7453398] = clik.newPhoto({"id":7453398,"src":"Image0274_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453398.html","width":130,"caption":"On the edge","height":98});
															thumbnails[7453407] = clik.newPhoto({"id":7453407,"src":"Image0449_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453407.html","width":130,"caption":"Secrets and lies","height":173});
															thumbnails[7453409] = clik.newPhoto({"id":7453409,"src":"Image0718_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453409.html","width":130,"caption":"What remains","height":173});
															thumbnails[7453411] = clik.newPhoto({"id":7453411,"src":"Image0722_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453411.html","width":130,"caption":"Vest","height":90});
															thumbnails[7453415] = clik.newPhoto({"id":7453415,"src":"Image0723_thumb.jpg","galleries_id":404084,"server_id":15,"link":"photo_7453415.html","width":130,"caption":"There will be blood","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[404084] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Art therapy artwork","link":"section482966.html","maxRecords":0.0,"photoIDs":[7453360.0,7453375.0,7453379.0,7453382.0,7453383.0,7453384.0,7453386.0,7453395.0,7453398.0,7453407.0,7453409.0,7453411.0,7453415.0],"skipIndex":0,"section_code":"section482966","featured_images":"7453415,7453411,7453409,7453407,7453398,7453395,7453386,7453384,7453383,7453382","id":404084,"singleSection":true});				  						galleries[260617] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_260617.html","maxRecords":0.0,"photoIDs":[4460886.0,4460889.0,4460927.0,4460936.0,4460943.0,4460947.0,4460955.0,4461022.0],"skipIndex":0,"section_code":"gallery","featured_images":"4461022,4460955,4460947,4460943,4460936,4460927,4460889,4460886","id":260617,"singleSection":false});				  						galleries[245481] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_245481.html","maxRecords":0.0,"photoIDs":[4086668.0,4086681.0,4086686.0,4086700.0,4086707.0],"skipIndex":0,"section_code":"gallery","featured_images":"4086707,4086700,4086686,4086681,4086668","id":245481,"singleSection":false});				  						galleries[245482] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 3","link":"gallery_245482.html","maxRecords":0.0,"photoIDs":[4461107.0,4461108.0,4461110.0,4461113.0,4461116.0,4461118.0,4461120.0,4461177.0,4461178.0,4461181.0,4461182.0],"skipIndex":0,"section_code":"gallery","featured_images":"4461182,4461181,4461178,4461177,4461120,4461118,4461116,4461113,4461110,4461108","id":245482,"singleSection":false});				  						galleries[260631] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 4","link":"gallery_260631.html","maxRecords":0.0,"photoIDs":[4461263.0,4461264.0,4461266.0,4461271.0],"skipIndex":0,"section_code":"gallery","featured_images":"4461271,4461266,4461264,4461263","id":260631,"singleSection":false});				  						galleries[373775] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 5","link":"gallery_373775.html","maxRecords":0.0,"photoIDs":[6886592.0,6886597.0,6886601.0],"skipIndex":0,"section_code":"gallery","featured_images":"6886601,6886597,6886592","id":373775,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4461264,4461263,4086700';
imageSets[3] = '4086707,4086700,4086686,4086681,4086668';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/caitlinsmail/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/caitlinsmail/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 = 'www.caitlinsmail.net: ' + 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;
	}
}

			

