window.thumbnails = {};
															thumbnails[3858342] = clik.newPhoto({"id":3858342,"src":"AbInitio_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858342.html","width":130,"caption":"Ab Initio","height":295});
															thumbnails[3858345] = clik.newPhoto({"id":3858345,"src":"MicroscopicLandscape_I_thumb.jpg","galleries_id":234700,"server_id":15,"link":"photo_3858345.html","width":130,"caption":"Microscopic Landscape_I","height":130});
															thumbnails[3858347] = clik.newPhoto({"id":3858347,"src":"MicroscopicLandscape_II_thumb.jpg","galleries_id":234700,"server_id":15,"link":"photo_3858347.html","width":130,"caption":"Microscopic Landscape_II","height":130});
															thumbnails[3858348] = clik.newPhoto({"id":3858348,"src":"InfiniteCascades_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858348.html","width":130,"caption":"Infinite Cascades","height":116});
															thumbnails[3858349] = clik.newPhoto({"id":3858349,"src":"KineticFlow_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858349.html","width":130,"caption":"Kinetic Flow","height":137});
															thumbnails[3858350] = clik.newPhoto({"id":3858350,"src":"Oscillations_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858350.html","width":130,"caption":"Oscillations","height":140});
															thumbnails[3858351] = clik.newPhoto({"id":3858351,"src":"ParticleClusters_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858351.html","width":130,"caption":"Particle Clusters","height":141});
															thumbnails[3858352] = clik.newPhoto({"id":3858352,"src":"StaticBoundary_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858352.html","width":130,"caption":"Static Boundary","height":137});
															thumbnails[3858353] = clik.newPhoto({"id":3858353,"src":"Microcosm_II_thumb.JPG","galleries_id":233205,"server_id":15,"link":"photo_3858353.html","width":130,"caption":"Microcosm_II","height":139});
															thumbnails[3858354] = clik.newPhoto({"id":3858354,"src":"SecretGarden_thumb.JPG","galleries_id":233205,"server_id":15,"link":"photo_3858354.html","width":130,"caption":"Secret Garden","height":139});
															thumbnails[3858355] = clik.newPhoto({"id":3858355,"src":"Transmutations_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3858355.html","width":130,"caption":"Transmutations","height":138});
															thumbnails[3858356] = clik.newPhoto({"id":3858356,"src":"Rift_I_thumb.jpg","galleries_id":233206,"server_id":15,"link":"photo_3858356.html","width":130,"caption":"Rift_I","height":150});
															thumbnails[3858357] = clik.newPhoto({"id":3858357,"src":"Divide_thumb.JPG","galleries_id":233206,"server_id":15,"link":"photo_3858357.html","width":130,"caption":"Divide","height":139});
															thumbnails[3858358] = clik.newPhoto({"id":3858358,"src":"Conciliation_thumb.jpg","galleries_id":233206,"server_id":15,"link":"photo_3858358.html","width":130,"caption":"Conciliation","height":140});
															thumbnails[3858359] = clik.newPhoto({"id":3858359,"src":"RitualisticLandscape_thumb.JPG","galleries_id":234701,"server_id":15,"link":"photo_3858359.html","width":130,"caption":"Ritualistic Landscape","height":72});
															thumbnails[3858360] = clik.newPhoto({"id":3858360,"src":"ChannelCountry_I_thumb.jpg","galleries_id":234701,"server_id":15,"link":"photo_3858360.html","width":130,"caption":"Channel Country_I","height":65});
															thumbnails[3858569] = clik.newPhoto({"id":3858569,"src":"ChannelCountry_II_thumb.jpg","galleries_id":234701,"server_id":15,"link":"photo_3858569.html","width":130,"caption":"Channel Country_II","height":81});
															thumbnails[3858778] = clik.newPhoto({"id":3858778,"src":"Reef_I_thumb.JPG","galleries_id":234708,"server_id":15,"link":"photo_3858778.html","width":130,"caption":"Reef_I","height":131});
															thumbnails[3858779] = clik.newPhoto({"id":3858779,"src":"Reef_II_thumb.JPG","galleries_id":234708,"server_id":15,"link":"photo_3858779.html","width":130,"caption":"Reef_II","height":131});
															thumbnails[3858780] = clik.newPhoto({"id":3858780,"src":"Reef_IV_thumb.JPG","galleries_id":234708,"server_id":15,"link":"photo_3858780.html","width":130,"caption":"Reef_IV","height":130});
															thumbnails[3858781] = clik.newPhoto({"id":3858781,"src":"Reef_V_thumb.JPG","galleries_id":234708,"server_id":15,"link":"photo_3858781.html","width":130,"caption":"Reef_V","height":127});
															thumbnails[3858782] = clik.newPhoto({"id":3858782,"src":"Sanctuary_thumb.JPG","galleries_id":234701,"server_id":15,"link":"photo_3858782.html","width":130,"caption":"Sanctuary<br>\r\n<br>\r\n","height":85});
															thumbnails[3858784] = clik.newPhoto({"id":3858784,"src":"TheGrid_thumb.JPG","galleries_id":234709,"server_id":15,"link":"photo_3858784.html","width":130,"caption":"The Grid","height":169});
															thumbnails[3858872] = clik.newPhoto({"id":3858872,"src":"Ritual_Fire_Dance_thumb.JPG","galleries_id":234709,"server_id":15,"link":"photo_3858872.html","width":130,"caption":"Ritual Fire Dance","height":99});
															thumbnails[3858881] = clik.newPhoto({"id":3858881,"src":"Sabre_Dance2_thumb.jpg","galleries_id":234709,"server_id":15,"link":"photo_3858881.html","width":130,"caption":"Sabre Dance","height":98});
															thumbnails[3863279] = clik.newPhoto({"id":3863279,"src":"ParadigmDrift_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_3863279.html","width":130,"caption":"Paradigm Drift","height":139});
															thumbnails[3883067] = clik.newPhoto({"id":3883067,"src":"PG_05_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883067.html","width":130,"caption":"Microbes Exposed V","height":169});
															thumbnails[3883068] = clik.newPhoto({"id":3883068,"src":"PG_06_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883068.html","width":130,"caption":"Microbes Exposed VI","height":169});
															thumbnails[3883069] = clik.newPhoto({"id":3883069,"src":"PG_07_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883069.html","width":130,"caption":"Microbes Exposed VII","height":171});
															thumbnails[3883070] = clik.newPhoto({"id":3883070,"src":"PG_08_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883070.html","width":130,"caption":"Microbes Exposed VIII","height":169});
															thumbnails[3883071] = clik.newPhoto({"id":3883071,"src":"PG_10_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883071.html","width":130,"caption":"Microbes Exposed X","height":168});
															thumbnails[3883072] = clik.newPhoto({"id":3883072,"src":"PG_11_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883072.html","width":130,"caption":"Microbes Exposed XI","height":171});
															thumbnails[3883073] = clik.newPhoto({"id":3883073,"src":"PG_14_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883073.html","width":130,"caption":"Microbes Exposed XIV","height":168});
															thumbnails[3883074] = clik.newPhoto({"id":3883074,"src":"PG_17_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883074.html","width":130,"caption":"Microbes Exposed XVII","height":170});
															thumbnails[3883075] = clik.newPhoto({"id":3883075,"src":"PG_19_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883075.html","width":130,"caption":"Microbes Exposed XIX","height":168});
															thumbnails[3883076] = clik.newPhoto({"id":3883076,"src":"PG_20_thumb.jpg","galleries_id":235878,"server_id":15,"link":"photo_3883076.html","width":130,"caption":"Microbes Exposed XX","height":171});
															thumbnails[4771536] = clik.newPhoto({"id":4771536,"src":"KineticFlow_II_thumb.jpg","galleries_id":234700,"server_id":15,"link":"photo_4771536.html","width":130,"caption":"Kinetic Flow II","height":103});
															thumbnails[4771554] = clik.newPhoto({"id":4771554,"src":"ParadigmDrift_II_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_4771554.html","width":130,"caption":"Paradigm Drift II","height":104});
															thumbnails[4771563] = clik.newPhoto({"id":4771563,"src":"ParadigmDrift_III_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_4771563.html","width":130,"caption":"Paradigm Drift III","height":104});
															thumbnails[4771564] = clik.newPhoto({"id":4771564,"src":"Static_Boundary_II_thumb.JPG","galleries_id":234700,"server_id":15,"link":"photo_4771564.html","width":130,"caption":"Static Boundary II","height":103});
															thumbnails[5625101] = clik.newPhoto({"id":5625101,"src":"A_Walk_01_web_thumb.JPG","galleries_id":234701,"server_id":15,"link":"photo_5625101.html","width":130,"caption":"A Walk in the Park<br>\r\nBerowra Valley Regional Park","height":53});
															thumbnails[6118262] = clik.newPhoto({"id":6118262,"src":"NewDimensions_W_thumb.JPG","galleries_id":234709,"server_id":15,"link":"photo_6118262.html","width":130,"caption":"New Dimensions","height":173});
															thumbnails[8521652] = clik.newPhoto({"id":8521652,"src":"AfterTheRains_W_thumb.JPG","galleries_id":234701,"server_id":15,"link":"photo_8521652.html","width":130,"caption":"After The Rains","height":109});
															thumbnails[8521661] = clik.newPhoto({"id":8521661,"src":"After_The_Rains_II_W_thumb.jpg","galleries_id":234701,"server_id":15,"link":"photo_8521661.html","width":130,"caption":"After The Rains II","height":86});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[234700] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Ab Initio Series","link":"gallery_234700.html","maxRecords":0.0,"photoIDs":[3858342.0,3858345.0,3858347.0,3858348.0,3858349.0,3858350.0,3858351.0,3858352.0,3858355.0,3863279.0,4771536.0,4771554.0,4771563.0,4771564.0],"skipIndex":0,"section_code":"gallery","featured_images":"4771564,4771563,4771554,4771536,3863279,3858355,3858352,3858351,3858350,3858349","id":234700,"singleSection":false});				  						galleries[233206] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Rift Series","link":"gallery_233206.html","maxRecords":0.0,"photoIDs":[3858356.0,3858357.0,3858358.0],"skipIndex":0,"section_code":"gallery","featured_images":"3858358,3858357,3858356","id":233206,"singleSection":false});				  						galleries[233205] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Microcosm Series","link":"gallery_233205.html","maxRecords":0.0,"photoIDs":[3858353.0,3858354.0],"skipIndex":0,"section_code":"gallery","featured_images":"3858354,3858353","id":233205,"singleSection":false});				  						galleries[235878] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photograms","link":"gallery_235878.html","maxRecords":0.0,"photoIDs":[3883067.0,3883068.0,3883069.0,3883070.0,3883071.0,3883072.0,3883073.0,3883074.0,3883075.0,3883076.0],"skipIndex":0,"section_code":"gallery","featured_images":"3883076,3883075,3883074,3883073,3883072,3883071,3883070,3883069,3883068,3883067","id":235878,"singleSection":false});				  						galleries[234709] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract Images","link":"gallery_234709.html","maxRecords":0.0,"photoIDs":[3858784.0,3858872.0,3858881.0,6118262.0],"skipIndex":0,"section_code":"gallery","featured_images":"6118262,3858881,3858872,3858784","id":234709,"singleSection":false});				  						galleries[234701] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_234701.html","maxRecords":0.0,"photoIDs":[3858359.0,3858360.0,3858569.0,3858782.0,5625101.0,8521652.0,8521661.0],"skipIndex":0,"section_code":"gallery","featured_images":"8521661,8521652,5625101,3858782,3858569,3858360,3858359","id":234701,"singleSection":false});				  						galleries[234708] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Smaller Works","link":"gallery_234708.html","maxRecords":0.0,"photoIDs":[3858778.0,3858779.0,3858780.0,3858781.0],"skipIndex":0,"section_code":"gallery","featured_images":"3858781,3858780,3858779,3858778","id":234708,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8521661,8521652,6118262,5625101,4771564,4771563,4771554,4771536,3883076,3883075,3883074,3883073,3883072,3883071,3883070,3883069,3883068,3883067,3863279,3858881,3858872,3858784,3858782,3858781,3858780,3858779,3858778,3858569,3858360,3858359,3858358,3858357,3858356,3858355,3858354,3858353,3858352,3858351,3858350,3858349,3858348,3858347,3858345,3858342';
imageSets[3] = '8521661,8521652,6118262,5625101,4771564,4771563,4771554,4771536,3883076,3883075,3883074,3883073,3883072,3883071,3883070,3883069,3883068,3883067,3863279,3858881,3858872,3858784,3858782,3858781,3858780,3858779,3858778,3858569,3858360,3858359,3858358,3858357,3858356,3858355,3858354,3858353,3858352,3858351,3858350,3858349,3858348,3858347,3858345,3858342';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Margaret09/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Margaret09/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 = 'Margaret Norris Contemporary Artist: ' + 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;
	}
}

			

