window.thumbnails = {};
															thumbnails[2886251] = clik.newPhoto({"id":2886251,"src":"Moon_and_magic_stained_glass_thumb.jpg.jpg","galleries_id":179107,"server_id":1,"link":"photo_2886251.html","width":130,"caption":"'Moon and Magic'","height":321});
															thumbnails[2886504] = clik.newPhoto({"id":2886504,"src":"scilly_rocks_fused_glass_thumb.jpg.jpg","galleries_id":179127,"server_id":1,"link":"photo_2886504.html","width":130,"caption":"'Scilly Rocks'","height":197});
															thumbnails[3326764] = clik.newPhoto({"id":3326764,"src":"candle_bridge2_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_3326764.html","width":130,"caption":"Fused & slumped candle bridge 2","height":98});
															thumbnails[3326477] = clik.newPhoto({"id":3326477,"src":"candle_bridge1_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_3326477.html","width":130,"caption":"fused & slumped candle bridge1","height":98});
															thumbnails[5740869] = clik.newPhoto({"id":5740869,"src":"DSCF4048_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_5740869.html","width":130,"caption":"Lime Green Candle bridge","height":104});
															thumbnails[8898191] = clik.newPhoto({"id":8898191,"src":"P1030378_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_8898191.html","width":130,"caption":"Green Candle bridge","height":103});
															thumbnails[2886201] = clik.newPhoto({"id":2886201,"src":"four_directions_stained_glass_kate_doig_thumb.jpg.jpg","galleries_id":179107,"server_id":1,"link":"photo_2886201.html","width":130,"caption":"Kate Doig with 'Four Directions'","height":86});
															thumbnails[2886574] = clik.newPhoto({"id":2886574,"src":"four_directions_wedding_window_thumb.jpg.jpg","galleries_id":179107,"server_id":1,"link":"photo_2886574.html","width":130,"caption":"'Four directions' ","height":125});
															thumbnails[3310221] = clik.newPhoto({"id":3310221,"src":"Dichroic_slump_dish1_thumb.jpeg.JPG","galleries_id":201684,"server_id":1,"link":"photo_3310221.html","width":130,"caption":"Fused & slumped dish (I)","height":127});
															thumbnails[2886288] = clik.newPhoto({"id":2886288,"src":"fruits_of_the_oak_stained_glass_thumb.jpg.jpg","galleries_id":179107,"server_id":1,"link":"photo_2886288.html","width":130,"caption":"'Fruits of the Oak'","height":115});
															thumbnails[3310241] = clik.newPhoto({"id":3310241,"src":"DSC00825_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_3310241.html","width":130,"caption":"Fused & slumped dishes ","height":98});
															thumbnails[8865132] = clik.newPhoto({"id":8865132,"src":"P1030321_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_8865132.html","width":130,"caption":"Emerald green glass dish","height":97});
															thumbnails[5991168] = clik.newPhoto({"id":5991168,"src":"restoration_2_thumb.jpg","galleries_id":335820,"server_id":1,"link":"photo_5991168.html","width":130,"caption":"Victorian restoration 1","height":125});
															thumbnails[8865188] = clik.newPhoto({"id":8865188,"src":"P1030329_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_8865188.html","width":130,"caption":"Red glass dish","height":105});
															thumbnails[5992374] = clik.newPhoto({"id":5992374,"src":"restoration3_thumb.jpg","galleries_id":335820,"server_id":1,"link":"photo_5992374.html","width":130,"caption":"Victorian restoration 2","height":131});
															thumbnails[8865249] = clik.newPhoto({"id":8865249,"src":"P1030336_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_8865249.html","width":130,"caption":"Lime green dish","height":127});
															thumbnails[5951180] = clik.newPhoto({"id":5951180,"src":"Towans_Front_Door_thumb.JPG","galleries_id":335820,"server_id":1,"link":"photo_5951180.html","width":130,"caption":"Towans Front Door panel (inside)","height":173});
															thumbnails[8865286] = clik.newPhoto({"id":8865286,"src":"P1030338_thumb.JPG","galleries_id":201684,"server_id":1,"link":"photo_8865286.html","width":130,"caption":"orange glass dish","height":107});
															thumbnails[5951209] = clik.newPhoto({"id":5951209,"src":"Towans_Front_Door_outside_thumb.JPG","galleries_id":335820,"server_id":1,"link":"photo_5951209.html","width":130,"caption":"Towans front Door Panel (outside)","height":173});
															thumbnails[2886393] = clik.newPhoto({"id":2886393,"src":"firewolf1_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_2886393.html","width":130,"caption":"'Firewolf'","height":130});
															thumbnails[2923096] = clik.newPhoto({"id":2923096,"src":"Ravens_Call_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_2923096.html","width":130,"caption":"'The Ravens Call'","height":131});
															thumbnails[2886581] = clik.newPhoto({"id":2886581,"src":"gorillas_stained_glass_thumb.jpg.jpg","galleries_id":179107,"server_id":1,"link":"photo_2886581.html","width":130,"caption":"'Gorillas'","height":38});
															thumbnails[3312943] = clik.newPhoto({"id":3312943,"src":"Gorilla_portrait_thumb.jpg","galleries_id":179107,"server_id":1,"link":"photo_3312943.html","width":130,"caption":"'Gorilla study'","height":106});
															thumbnails[5732258] = clik.newPhoto({"id":5732258,"src":"P1020787_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_5732258.html","width":130,"caption":"Mystic Hare","height":173});
															thumbnails[5732357] = clik.newPhoto({"id":5732357,"src":"P10207811_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_5732357.html","width":130,"caption":"Moonlit hare","height":173});
															thumbnails[6094024] = clik.newPhoto({"id":6094024,"src":"DSCF0593_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_6094024.html","width":130,"caption":"Dreaming Hare","height":154});
															thumbnails[8716751] = clik.newPhoto({"id":8716751,"src":"moon_shone_thumb.jpg","galleries_id":179107,"server_id":1,"link":"photo_8716751.html","width":130,"caption":"The moon shone","height":173});
															thumbnails[5772384] = clik.newPhoto({"id":5772384,"src":"cottagewindow1_thumb.jpg","galleries_id":179107,"server_id":1,"link":"photo_5772384.html","width":130,"caption":"Cottage sign 1","height":98});
															thumbnails[5772400] = clik.newPhoto({"id":5772400,"src":"cottagewindow2_thumb.jpg","galleries_id":179107,"server_id":1,"link":"photo_5772400.html","width":130,"caption":"Cottage sign 2","height":98});
															thumbnails[7839985] = clik.newPhoto({"id":7839985,"src":"P1010556_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_7839985.html","width":130,"caption":"Commissioned glass hanging","height":173});
															thumbnails[7840035] = clik.newPhoto({"id":7840035,"src":"P1000706_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_7840035.html","width":130,"caption":"Angel in glass","height":98});
															thumbnails[7840048] = clik.newPhoto({"id":7840048,"src":"P1000710_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_7840048.html","width":130,"caption":"Angel detail","height":98});
															thumbnails[8852385] = clik.newPhoto({"id":8852385,"src":"P1000829_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_8852385.html","width":130,"caption":"Angel in glass","height":61});
															thumbnails[8852395] = clik.newPhoto({"id":8852395,"src":"P1000831_thumb.JPG","galleries_id":179107,"server_id":1,"link":"photo_8852395.html","width":130,"caption":"Angel in glass","height":54});
															thumbnails[8852577] = clik.newPhoto({"id":8852577,"src":"IMAG0053_thumb.jpg","galleries_id":335820,"server_id":1,"link":"photo_8852577.html","width":130,"caption":"Front door restoration","height":217});
															thumbnails[8852619] = clik.newPhoto({"id":8852619,"src":"IMAG0052_thumb.jpg","galleries_id":335820,"server_id":1,"link":"photo_8852619.html","width":130,"caption":"Detail of damaged stained glass.","height":217});
															thumbnails[8852910] = clik.newPhoto({"id":8852910,"src":"P1020765_thumb.JPG","galleries_id":335820,"server_id":1,"link":"photo_8852910.html","width":130,"caption":"Badly damaged double front doors.","height":173});
															thumbnails[8852918] = clik.newPhoto({"id":8852918,"src":"P1020764_thumb.JPG","galleries_id":335820,"server_id":1,"link":"photo_8852918.html","width":130,"caption":"Badly damaged double front doors ","height":173});
															thumbnails[8852924] = clik.newPhoto({"id":8852924,"src":"P1030314_thumb.JPG","galleries_id":335820,"server_id":1,"link":"photo_8852924.html","width":130,"caption":"Fully restored double stained glass doors.","height":145});
															thumbnails[8852994] = clik.newPhoto({"id":8852994,"src":"P1020610_thumb.JPG","galleries_id":465539,"server_id":1,"link":"photo_8852994.html","width":130,"caption":"Fleurs de Lys window. ","height":106});
															thumbnails[8853067] = clik.newPhoto({"id":8853067,"src":"DSC00534c_thumb.jpg","galleries_id":465539,"server_id":1,"link":"photo_8853067.html","width":130,"caption":"A beautiful window frame.","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[179107] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Traditional leaded work","link":"gallery_179107.html","maxRecords":0.0,"photoIDs":[2886251.0,2886201.0,2886574.0,2886288.0,2886393.0,2923096.0,2886581.0,3312943.0,5732258.0,5732357.0,6094024.0,8716751.0,5772384.0,5772400.0,7839985.0,7840035.0,7840048.0,8852385.0,8852395.0],"skipIndex":0,"section_code":"gallery","featured_images":"8716751,5732357,5732258,2923096,2886574,2886393,2886288,2886251","id":179107,"singleSection":false});				  						galleries[179127] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Unleaded work","link":"gallery_179127.html","maxRecords":0.0,"photoIDs":[2886504.0],"skipIndex":0,"section_code":"gallery","featured_images":2886504.0,"id":179127,"singleSection":false});				  						galleries[201684] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fused & Slumped Glass","link":"gallery_201684.html","maxRecords":0.0,"photoIDs":[3326764.0,3326477.0,5740869.0,8898191.0,3310221.0,3310241.0,8865132.0,8865188.0,8865249.0,8865286.0],"skipIndex":0,"section_code":"gallery","featured_images":"8898191,8865286,8865249,8865132,5740869,3326764,3326477,3310241","id":201684,"singleSection":false});				  						galleries[335820] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Restorations","link":"gallery_335820.html","maxRecords":0.0,"photoIDs":[5991168.0,5992374.0,5951180.0,5951209.0,8852577.0,8852619.0,8852910.0,8852918.0,8852924.0],"skipIndex":0,"section_code":"gallery","featured_images":5991168.0,"id":335820,"singleSection":false});				  						galleries[465539] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Work in Progress","link":"gallery_465539.html","maxRecords":0.0,"photoIDs":[8852994.0,8853067.0],"skipIndex":0,"section_code":"gallery","featured_images":8852994.0,"id":465539,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[245786] = '3326477,2886201,2886574,3310241,2886288,5991168,8865249,8865286,2886393,2923096,3312943,5732258,5732357,8716751';
imageSets[1] = '3326477,5740869,2886201,2886574,3310241,2886288,8865132,5991168,2886393,2923096,3312943,5732258,5732357,8716751';
imageSets[2] = '3326764,2886504,2886251,3326477,5740869,8898191,2886574,3310241,2886288,8865132,5991168,8865249,8865286,2886393,2923096,5732258,5732357,8716751,8852994';
imageSets[3] = '2886504,5740869,8898191,2886574,3310241,2886288,5991168,2886393,2923096,5732258,5732357,8716751';
imageSets[245787] = '3326764,2886504,5740869,8898191,2886574,3310241,2886288,8865132,5991168,8865249,8865286,2886393,5732258,8716751';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/katedoig/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/katedoig/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/katedoig/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 = 'Kate Doig - Stained Glass Artistry: ' + 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>Artist </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="KATEDOIG">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

