window.thumbnails = {};
															thumbnails[3884393] = clik.newPhoto({"id":3884393,"src":"The_Descent_II_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_3884393.html","width":130,"caption":"The Descent II <br> Digital print, edt 15 <br> 106 x 119 cm, 2006","height":117});
															thumbnails[3884397] = clik.newPhoto({"id":3884397,"src":"Emanation_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_3884397.html","width":130,"caption":"Emanation <br> Etching, edt 6 <br> 50 x 60 cm, 2007","height":90});
															thumbnails[3884411] = clik.newPhoto({"id":3884411,"src":"Ex_nihilo_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_3884411.html","width":130,"caption":"Ex nihilo <br> Etching, edt 15 <br> 55 x 60 cm, 2008","height":151});
															thumbnails[3884417] = clik.newPhoto({"id":3884417,"src":"Ex_nihilo_II_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_3884417.html","width":130,"caption":"Ex nihilo II <br> Etching, edt 10 <br> 55 x 60 cm, 2008","height":151});
															thumbnails[3884420] = clik.newPhoto({"id":3884420,"src":"Effloresce_thumb.jpg","galleries_id":234727,"server_id":15,"link":"photo_3884420.html","width":130,"caption":"Effloresce <br> Etching, edt 6 <br> 50 x 60 cm, 2007","height":98});
															thumbnails[3884435] = clik.newPhoto({"id":3884435,"src":"h_Gestation_thumb.jpg","galleries_id":234727,"server_id":15,"link":"photo_3884435.html","width":130,"caption":"Gestation <br> Etching, edt 6 <br> 55 x 60 cm, 2007","height":161});
															thumbnails[3884461] = clik.newPhoto({"id":3884461,"src":"Reflection_thumb.jpg","galleries_id":234727,"server_id":15,"link":"photo_3884461.html","width":130,"caption":"Reflection <br> Etching, edt 10 <br> 55 x 60 cm, 2009","height":142});
															thumbnails[3884905] = clik.newPhoto({"id":3884905,"src":"L1050569_thumb.jpg","galleries_id":235123,"server_id":15,"link":"photo_3884905.html","width":130,"caption":"Emote <br> Installation <br> Exhibition 'Surfaces Imbued' <br> 2008","height":231});
															thumbnails[3884911] = clik.newPhoto({"id":3884911,"src":"L1050576_thumb.jpg","galleries_id":235123,"server_id":15,"link":"photo_3884911.html","width":130,"caption":"Clothes for Ophelia's Children <br> Japanese paper, thread, etching and drawing <br> Exhibition 'Surfaces Imbued', 2008","height":73});
															thumbnails[3884923] = clik.newPhoto({"id":3884923,"src":"Red_mantis_detail_thumb.jpg","galleries_id":234953,"server_id":15,"link":"photo_3884923.html","width":130,"caption":"Red Mantis Religiosa (detail) <br> Etching, edt 10 <br> 60 x 70 cm, 2008","height":105});
															thumbnails[3884942] = clik.newPhoto({"id":3884942,"src":"eL1030555_thumb.jpg","galleries_id":235124,"server_id":15,"link":"photo_3884942.html","width":130,"caption":"Ecco II <br> Photograph, 2007","height":73});
															thumbnails[3884946] = clik.newPhoto({"id":3884946,"src":"eL1030559_thumb.jpg","galleries_id":235124,"server_id":15,"link":"photo_3884946.html","width":130,"caption":"Ecco III <br> Photograph, 2007","height":98});
															thumbnails[3884954] = clik.newPhoto({"id":3884954,"src":"Roots_thumb.jpg","galleries_id":235124,"server_id":15,"link":"photo_3884954.html","width":130,"caption":"Roots <br> Installation at the Exhibition 'Surfaces Imbued' <br> Photograph, lead figure and root, 2008","height":73});
															thumbnails[5032070] = clik.newPhoto({"id":5032070,"src":"Subvitrinal_web_thumb.jpg","galleries_id":284897,"server_id":15,"link":"photo_5032070.html","width":130,"caption":"Subvitrinal<br>Beneath the vitreous (glasslike or hyaline; the vitreous body of the eye)<br>glass, 2009","height":231});
															thumbnails[5032205] = clik.newPhoto({"id":5032205,"src":"Subvitrinal_detail1_web_thumb.jpg","galleries_id":284897,"server_id":15,"link":"photo_5032205.html","width":130,"caption":"Subvitrinal (detail)<br>glass, 2009","height":98});
															thumbnails[5032208] = clik.newPhoto({"id":5032208,"src":"Subvitrinal_detail2_web_thumb.jpg","galleries_id":284897,"server_id":15,"link":"photo_5032208.html","width":130,"caption":"Subvitrinal (detail)<br>glass, 2009","height":87});
															thumbnails[5032241] = clik.newPhoto({"id":5032241,"src":"Subvitrinal_detail_web_thumb.jpg","galleries_id":284897,"server_id":15,"link":"photo_5032241.html","width":130,"caption":"Subvitrinal (detail)<br>glass, 2009","height":87});
															thumbnails[6289633] = clik.newPhoto({"id":6289633,"src":"Flowing_II_web_thumb.jpg","galleries_id":234727,"server_id":15,"link":"photo_6289633.html","width":130,"caption":"Flowing II <br> Etching, edt 10 <br> 55 x 60 cm, 2008","height":118});
															thumbnails[6290070] = clik.newPhoto({"id":6290070,"src":"Inflorescence_web_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290070.html","width":130,"caption":"Inflorescence <br> Etching, thread on Japanese paper, edt 10 <br> 60 x 68 cm, 2010","height":112});
															thumbnails[3882946] = clik.newPhoto({"id":3882946,"src":"1938_II_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_3882946.html","width":130,"caption":"1938 II <br> Etching, edt 10 <br> 55 x 60 cm, 2007 ","height":98});
															thumbnails[6290054] = clik.newPhoto({"id":6290054,"src":"Inflorescence_detail_web_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290054.html","width":130,"caption":"Inflorescence <br> Detail","height":82});
															thumbnails[6290094] = clik.newPhoto({"id":6290094,"src":"Inflorescence_web_4E20F732-1E4F-37DC-7176C68E9A034B39_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290094.html","width":130,"caption":"Inflorescence II <br> Etching, edt 15 <br> 57 x 69 cm, 2010","height":107});
															thumbnails[6290101] = clik.newPhoto({"id":6290101,"src":"Sero_web_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290101.html","width":130,"caption":"Sero <br> Etching, thread on Japanese paper, edt 15 <br> 38 x 44 cm, 2009","height":106});
															thumbnails[6290106] = clik.newPhoto({"id":6290106,"src":"Sero_detail_web_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290106.html","width":130,"caption":"Sero <br> Detail","height":73});
															thumbnails[3884426] = clik.newPhoto({"id":3884426,"src":"Flowing_III_thumb.jpg","galleries_id":234727,"server_id":15,"link":"photo_3884426.html","width":130,"caption":"Flowing III <br> Etching, edt 10 <br> 55 x 60 cm, 2008","height":118});
															thumbnails[6290111] = clik.newPhoto({"id":6290111,"src":"Sero_II_web_thumb.jpg","galleries_id":349102,"server_id":15,"link":"photo_6290111.html","width":130,"caption":"Sero <br> Etching, edt 15 <br> 38 x 44 cm, 2009","height":101});
															thumbnails[3884928] = clik.newPhoto({"id":3884928,"src":"Stitched_Mantis_Religiosa_thumb.jpg","galleries_id":234953,"server_id":15,"link":"photo_3884928.html","width":130,"caption":"Stitched Mantis Religiosa <br> Etching, thread on Japanese paper, edt 4 <br> 60 x 70 cm, 2009","height":113});
															thumbnails[3884468] = clik.newPhoto({"id":3884468,"src":"Ophelia_thumb.jpg","galleries_id":235123,"server_id":15,"link":"photo_3884468.html","width":130,"caption":"Ophelia <br> Digital print, edt 10 <br> 90 x 100 cm, 2007","height":118});
															thumbnails[3884944] = clik.newPhoto({"id":3884944,"src":"Ecco1_thumb.jpg","galleries_id":235124,"server_id":15,"link":"photo_3884944.html","width":130,"caption":"Ecco <br> Photograph, 2007","height":231});
															thumbnails[3884483] = clik.newPhoto({"id":3884483,"src":"Luminescent_thumb.jpg","galleries_id":235125,"server_id":15,"link":"photo_3884483.html","width":130,"caption":"Luminescent <br> Photograph, 2007","height":200});
															thumbnails[4436479] = clik.newPhoto({"id":4436479,"src":"My_Gradmothers_Return_Web_thumb.jpg","galleries_id":234728,"server_id":15,"link":"photo_4436479.html","width":130,"caption":"My Grandmother's Return to dell'Accademia <br> Etching, thread, powder box, photograph <br> 3 x 3 x 2.5 cm, 2009","height":97});
															thumbnails[3884888] = clik.newPhoto({"id":3884888,"src":"Corrosion_thumb.jpg","galleries_id":235125,"server_id":15,"link":"photo_3884888.html","width":130,"caption":"Corrosion <br> Photograph, 2007","height":189});
															thumbnails[3884893] = clik.newPhoto({"id":3884893,"src":"Transience_thumb.jpg","galleries_id":235125,"server_id":15,"link":"photo_3884893.html","width":130,"caption":"Transience <br> Photograph, 2007 ","height":190});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[349102] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Inflorescence","link":"gallery_349102.html","maxRecords":0.0,"photoIDs":[6290070.0,6290054.0,6290094.0,6290101.0,6290106.0,6290111.0],"skipIndex":0,"section_code":"gallery","featured_images":"6290111,6290106,6290101,6290094,6290070,6290054","id":349102,"singleSection":false});				  						galleries[234727] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Surfaces Imbued","link":"gallery_234727.html","maxRecords":0.0,"photoIDs":[3884420.0,3884435.0,3884461.0,6289633.0,3884426.0],"skipIndex":0,"section_code":"gallery","featured_images":"6289633,3884461,3884435,3884426,3884420","id":234727,"singleSection":false});				  						galleries[234728] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Significant Objects","link":"gallery_234728.html","maxRecords":0.0,"photoIDs":[3884393.0,3884397.0,3884411.0,3884417.0,3882946.0,4436479.0],"skipIndex":0,"section_code":"gallery","featured_images":"4436479,3884417,3884411,3884397,3884393,3882946","id":234728,"singleSection":false});				  						galleries[234953] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mantis Religiosa","link":"gallery_234953.html","maxRecords":0.0,"photoIDs":[3884923.0,3884928.0],"skipIndex":0,"section_code":"gallery","featured_images":"3884928,3884923","id":234953,"singleSection":false});				  						galleries[235123] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ophelia","link":"gallery_235123.html","maxRecords":0.0,"photoIDs":[3884905.0,3884911.0,3884468.0],"skipIndex":0,"section_code":"gallery","featured_images":"3884911,3884905,3884468","id":235123,"singleSection":false});				  						galleries[235124] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ecco","link":"gallery_235124.html","maxRecords":0.0,"photoIDs":[3884942.0,3884946.0,3884954.0,3884944.0],"skipIndex":0,"section_code":"gallery","featured_images":"3884954,3884946,3884944,3884942","id":235124,"singleSection":false});				  						galleries[235125] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Momentary","link":"gallery_235125.html","maxRecords":0.0,"photoIDs":[3884483.0,3884888.0,3884893.0],"skipIndex":0,"section_code":"gallery","featured_images":"3884893,3884888,3884483","id":235125,"singleSection":false});				  						galleries[284897] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Subvitrinal","link":"gallery_284897.html","maxRecords":0.0,"photoIDs":[5032070.0,5032205.0,5032208.0,5032241.0],"skipIndex":0,"section_code":"gallery","featured_images":"5032241,5032208,5032205,5032070","id":284897,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6290111,6290106,6290101,6290094,6290070,6290054,6289633,5032241,5032208,5032205,5032070,4436479,3884954,3884946,3884944,3884942,3884928,3884923,3884911,3884905,3884893,3884888,3884483,3884468,3884461,3884435,3884426,3884420,3884417,3884411,3884397,3884393,3882946';
imageSets[3] = '6290111,6290106,6290101,6290094,6290070,6290054,6289633,5032241,5032208,5032205,5032070,4436479,3884954,3884946,3884944,3884942,3884928,3884923,3884911,3884905,3884893,3884888,3884483,3884468,3884461,3884435,3884426,3884420,3884417,3884411,3884397,3884393,3882946';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Eleanor1/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Eleanor1/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 = 'Eleanor Havsteen-Franklin : ' + 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.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;
	}
}

			

