window.thumbnails = {};
															thumbnails[3434395] = clik.newPhoto({"id":3434395,"src":"02_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":87});
															thumbnails[3434402] = clik.newPhoto({"id":3434402,"src":"02-rotated_thumb.jpg","galleries_id":208079,"server_id":15,"link":"photo_3434402.html","width":130,"caption":"","height":195});
															thumbnails[3434404] = clik.newPhoto({"id":3434404,"src":"04_thumb.jpg","galleries_id":208079,"server_id":15,"link":"photo_3434404.html","width":130,"caption":"","height":87});
															thumbnails[3434412] = clik.newPhoto({"id":3434412,"src":"021_thumb.jpg","galleries_id":208079,"server_id":15,"link":"photo_3434412.html","width":130,"caption":"","height":87});
															thumbnails[3434717] = clik.newPhoto({"id":3434717,"src":"011_thumb.jpg","galleries_id":208080,"server_id":15,"link":"photo_3434717.html","width":130,"caption":"","height":87});
															thumbnails[3434721] = clik.newPhoto({"id":3434721,"src":"022_thumb.jpg","galleries_id":208080,"server_id":15,"link":"photo_3434721.html","width":130,"caption":"","height":87});
															thumbnails[3434724] = clik.newPhoto({"id":3434724,"src":"031_thumb.jpg","galleries_id":208080,"server_id":15,"link":"photo_3434724.html","width":130,"caption":"","height":87});
															thumbnails[3434728] = clik.newPhoto({"id":3434728,"src":"041_thumb.jpg","galleries_id":208080,"server_id":15,"link":"photo_3434728.html","width":130,"caption":"","height":87});
															thumbnails[3434732] = clik.newPhoto({"id":3434732,"src":"05_thumb.jpg","galleries_id":208080,"server_id":15,"link":"photo_3434732.html","width":130,"caption":"","height":87});
															thumbnails[3435014] = clik.newPhoto({"id":3435014,"src":"013_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435014.html","width":130,"caption":"","height":195});
															thumbnails[3435015] = clik.newPhoto({"id":3435015,"src":"024_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435015.html","width":130,"caption":"","height":195});
															thumbnails[3435018] = clik.newPhoto({"id":3435018,"src":"033_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435018.html","width":130,"caption":"","height":195});
															thumbnails[3435019] = clik.newPhoto({"id":3435019,"src":"043_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435019.html","width":130,"caption":"","height":195});
															thumbnails[3435020] = clik.newPhoto({"id":3435020,"src":"052_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435020.html","width":130,"caption":"","height":195});
															thumbnails[3435021] = clik.newPhoto({"id":3435021,"src":"06_thumb.jpg","galleries_id":209916,"server_id":15,"link":"photo_3435021.html","width":130,"caption":"","height":87});
															thumbnails[3435034] = clik.newPhoto({"id":3435034,"src":"014_thumb.jpg","galleries_id":209915,"server_id":15,"link":"photo_3435034.html","width":130,"caption":"","height":87});
															thumbnails[3435037] = clik.newPhoto({"id":3435037,"src":"025_thumb.jpg","galleries_id":209915,"server_id":15,"link":"photo_3435037.html","width":130,"caption":"","height":87});
															thumbnails[3435038] = clik.newPhoto({"id":3435038,"src":"034_thumb.jpg","galleries_id":209915,"server_id":15,"link":"photo_3435038.html","width":130,"caption":"","height":87});
															thumbnails[3435040] = clik.newPhoto({"id":3435040,"src":"044_thumb.jpg","galleries_id":209915,"server_id":15,"link":"photo_3435040.html","width":130,"caption":"","height":87});
															thumbnails[3435041] = clik.newPhoto({"id":3435041,"src":"053_thumb.jpg","galleries_id":209915,"server_id":15,"link":"photo_3435041.html","width":130,"caption":"","height":87});
															thumbnails[3435329] = clik.newPhoto({"id":3435329,"src":"001_thumb.jpg","galleries_id":208079,"server_id":15,"link":"photo_3435329.html","width":130,"caption":"","height":195});
															thumbnails[3464585] = clik.newPhoto({"id":3464585,"src":"01_thumb.jpeg","galleries_id":211604,"server_id":15,"link":"photo_3464585.html","width":130,"caption":"","height":87});
															thumbnails[3464605] = clik.newPhoto({"id":3464605,"src":"Untitled1_thumb.jpg","galleries_id":211604,"server_id":15,"link":"photo_3464605.html","width":130,"caption":"","height":87});
															thumbnails[3464608] = clik.newPhoto({"id":3464608,"src":"Untitled-6_thumb.jpg","galleries_id":211604,"server_id":15,"link":"photo_3464608.html","width":130,"caption":"","height":87});
															thumbnails[3464672] = clik.newPhoto({"id":3464672,"src":"Untitled3_thumb.jpg","galleries_id":211604,"server_id":15,"link":"photo_3464672.html","width":130,"caption":"","height":87});
															thumbnails[3464674] = clik.newPhoto({"id":3464674,"src":"Untitled5_thumb.jpg","galleries_id":211604,"server_id":15,"link":"photo_3464674.html","width":130,"caption":"","height":87});
															thumbnails[3464676] = clik.newPhoto({"id":3464676,"src":"Untitled4_thumb.jpg","galleries_id":211604,"server_id":15,"link":"photo_3464676.html","width":130,"caption":"","height":87});
															thumbnails[3500494] = clik.newPhoto({"id":3500494,"src":"IMG_001_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500494.html","width":130,"caption":"","height":87});
															thumbnails[3500495] = clik.newPhoto({"id":3500495,"src":"IMG_002_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500495.html","width":130,"caption":"","height":87});
															thumbnails[3500497] = clik.newPhoto({"id":3500497,"src":"IMG_003_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500497.html","width":130,"caption":"","height":87});
															thumbnails[3500498] = clik.newPhoto({"id":3500498,"src":"IMG_004_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500498.html","width":130,"caption":"","height":87});
															thumbnails[3500500] = clik.newPhoto({"id":3500500,"src":"IMG_005_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500500.html","width":130,"caption":"","height":87});
															thumbnails[3500501] = clik.newPhoto({"id":3500501,"src":"IMG_006_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500501.html","width":130,"caption":"","height":87});
															thumbnails[3500503] = clik.newPhoto({"id":3500503,"src":"IMG_007_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500503.html","width":130,"caption":"","height":87});
															thumbnails[3500504] = clik.newPhoto({"id":3500504,"src":"IMG_008_thumb.jpg","galleries_id":209917,"server_id":15,"link":"photo_3500504.html","width":130,"caption":"","height":87});
															thumbnails[3769567] = clik.newPhoto({"id":3769567,"src":"046_thumb.jpg","galleries_id":229951,"server_id":15,"link":"photo_3769567.html","width":130,"caption":"","height":87});
															thumbnails[3769578] = clik.newPhoto({"id":3769578,"src":"037_thumb.jpg","galleries_id":229951,"server_id":15,"link":"photo_3769578.html","width":130,"caption":"","height":87});
															thumbnails[3769587] = clik.newPhoto({"id":3769587,"src":"028_thumb.jpg","galleries_id":229951,"server_id":15,"link":"photo_3769587.html","width":130,"caption":"","height":87});
															thumbnails[3769591] = clik.newPhoto({"id":3769591,"src":"0111_thumb.jpg","galleries_id":229951,"server_id":15,"link":"photo_3769591.html","width":130,"caption":"","height":87});
															thumbnails[5754085] = clik.newPhoto({"id":5754085,"src":"0011_thumb.jpg","galleries_id":325960,"server_id":15,"link":"photo_5754085.html","width":130,"caption":"","height":86});
															thumbnails[5754087] = clik.newPhoto({"id":5754087,"src":"002_thumb.jpg","galleries_id":325960,"server_id":15,"link":"photo_5754087.html","width":130,"caption":"","height":86});
															thumbnails[5754103] = clik.newPhoto({"id":5754103,"src":"003_thumb.jpg","galleries_id":325960,"server_id":15,"link":"photo_5754103.html","width":130,"caption":"","height":86});
															thumbnails[5754105] = clik.newPhoto({"id":5754105,"src":"004_thumb.jpg","galleries_id":325960,"server_id":15,"link":"photo_5754105.html","width":130,"caption":"","height":86});
															thumbnails[5754131] = clik.newPhoto({"id":5754131,"src":"005_thumb.jpg","galleries_id":325960,"server_id":15,"link":"photo_5754131.html","width":130,"caption":"","height":86});
															thumbnails[5760710] = clik.newPhoto({"id":5760710,"src":"vw001_thumb.jpg","galleries_id":306881,"server_id":15,"link":"photo_5760710.html","width":130,"caption":"","height":87});
															thumbnails[5760717] = clik.newPhoto({"id":5760717,"src":"vw002_thumb.jpg","galleries_id":306881,"server_id":15,"link":"photo_5760717.html","width":130,"caption":"","height":87});
															thumbnails[5760724] = clik.newPhoto({"id":5760724,"src":"vw003_thumb.jpg","galleries_id":306881,"server_id":15,"link":"photo_5760724.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[211604] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 6","link":"gallery_211604.html","maxRecords":0.0,"photoIDs":[3464585.0,3464605.0,3464608.0,3464672.0,3464674.0,3464676.0],"skipIndex":0,"section_code":"gallery","featured_images":"3464676,3464674,3464672,3464608,3464605,3464585","id":211604,"singleSection":false});				  						galleries[229951] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 7","link":"gallery_229951.html","maxRecords":0.0,"photoIDs":[3769567.0,3769578.0,3769587.0,3769591.0],"skipIndex":0,"section_code":"gallery","featured_images":"3769591,3769587,3769578,3769567","id":229951,"singleSection":false});				  						galleries[306881] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 8","link":"gallery_306881.html","maxRecords":0.0,"photoIDs":[5760710.0,5760717.0,5760724.0],"skipIndex":0,"section_code":"gallery","featured_images":"5760724,5760717,5760710","id":306881,"singleSection":false});				  						galleries[325960] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 9","link":"gallery_325960.html","maxRecords":0.0,"photoIDs":[5754085.0,5754087.0,5754103.0,5754105.0,5754131.0],"skipIndex":0,"section_code":"gallery","featured_images":"5754131,5754105,5754103,5754087,5754085","id":325960,"singleSection":false});				  						galleries[209915] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery3","link":"gallery_209915.html","maxRecords":0.0,"photoIDs":[3435034.0,3435037.0,3435038.0,3435040.0,3435041.0],"skipIndex":0,"section_code":"gallery","featured_images":3435034.0,"id":209915,"singleSection":false});				  						galleries[209916] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery4","link":"gallery_209916.html","maxRecords":0.0,"photoIDs":[3435014.0,3435015.0,3435018.0,3435019.0,3435020.0,3435021.0],"skipIndex":0,"section_code":"gallery","featured_images":3435021.0,"id":209916,"singleSection":false});				  						galleries[209917] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery5","link":"gallery_209917.html","maxRecords":0.0,"photoIDs":[3500494.0,3500495.0,3500497.0,3500498.0,3500500.0,3500501.0,3500503.0,3500504.0],"skipIndex":0,"section_code":"gallery","featured_images":3500494.0,"id":209917,"singleSection":false});				  						galleries[208079] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_208079.html","maxRecords":0.0,"photoIDs":[3434402.0,3434404.0,3434412.0,3435329.0],"skipIndex":0,"section_code":"gallery","featured_images":3435329.0,"id":208079,"singleSection":false});				  						galleries[208080] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_208080.html","maxRecords":0.0,"photoIDs":[3434717.0,3434721.0,3434724.0,3434728.0,3434732.0],"skipIndex":0,"section_code":"gallery","featured_images":3434717.0,"id":208080,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5760724,5760717,5760710,5754131,5754105,5754103,5754087,5754085,3769591,3769587,3769578,3769567,3500504,3500503,3500501,3500500,3500498,3500497,3500495,3500494,3464676,3464674,3464672,3464608,3464605,3464585,3435329,3435041,3435040,3435038,3435037,3435034,3435021,3435020,3435019,3435018,3435015,3435014,3434732,3434728,3434724,3434721,3434717,3434412,3434404,3434402,3434395';
imageSets[2] = '3500494,3435329,3435034,3435021,3434717';
imageSets[3] = '5760724,5760717,5760710,5754131,5754105,5754103,5754087,5754085,3769591,3769587,3769578,3769567,3500504,3500503,3500501,3500500,3500498,3500497,3500495,3500494,3464676,3464674,3464672,3464608,3464605,3464585,3435329,3435041,3435040,3435038,3435037,3435034,3435021,3435020,3435019,3435018,3435015,3435014,3434732,3434728,3434724,3434721,3434717,3434412,3434404,3434402,3434395';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'www.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/janeosgood/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/janeosgood/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 = 'Jane Osgood Photography: ' + 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;
	}
}

			

