window.thumbnails = {};
															thumbnails[4478357] = clik.newPhoto({"id":4478357,"src":"The_wedding_dress_355E7BAD-24E8-5EC4-4F700E3FD6F528F6_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478357.html","width":100,"caption":"","height":150});
															thumbnails[4478363] = clik.newPhoto({"id":4478363,"src":"Portrait_Groom_9E991DD2-24E8-5EC4-4FEAF70A80DD43BA_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478363.html","width":130,"caption":"","height":139});
															thumbnails[8973805] = clik.newPhoto({"id":8973805,"src":"Hello_34F877CE-24E8-5EC4-4F4866F054DDBC69_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8973805.html","width":130,"caption":"","height":95});
															thumbnails[4478360] = clik.newPhoto({"id":4478360,"src":"greetings_ladies_34F3938B-24E8-5EC4-4F819E770FA6DD7B_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478360.html","width":100,"caption":"","height":150});
															thumbnails[8220147] = clik.newPhoto({"id":8220147,"src":"laugh_3517DDAD-24E8-5EC4-4FB5A246BA6BA2A2_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220147.html","width":130,"caption":"","height":102});
															thumbnails[8220156] = clik.newPhoto({"id":8220156,"src":"tee_hee_3542FA5C-24E8-5EC4-4F39D34CF997394E_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220156.html","width":130,"caption":"","height":97});
															thumbnails[8220148] = clik.newPhoto({"id":8220148,"src":"hors_d_oeuvre_35265BA2-1EC9-D45B-1CCC837EFA3C37FA_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220148.html","width":130,"caption":"","height":95});
															thumbnails[8220144] = clik.newPhoto({"id":8220144,"src":"page_boy_2_3530FA09-24E8-5EC4-4F6BC68B29D988D5_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220144.html","width":130,"caption":"","height":85});
															thumbnails[4478356] = clik.newPhoto({"id":4478356,"src":"Bouquet_34EF4E3D-1EC9-D45B-1CEE8A6236385A31_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478356.html","width":130,"caption":"","height":102});
															thumbnails[4478342] = clik.newPhoto({"id":4478342,"src":"The_Best_Man_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478342.html","width":130,"caption":"","height":87});
															thumbnails[4478352] = clik.newPhoto({"id":4478352,"src":"Wedding_shoes_35EE1B18-24E8-5EC4-4F179566DDF76219_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478352.html","width":130,"caption":"","height":79});
															thumbnails[4478358] = clik.newPhoto({"id":4478358,"src":"Page_boy_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478358.html","width":117,"caption":"","height":150});
															thumbnails[8033495] = clik.newPhoto({"id":8033495,"src":"church_decorations_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033495.html","width":130,"caption":"","height":87});
															thumbnails[8033511] = clik.newPhoto({"id":8033511,"src":"knot_tied_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033511.html","width":130,"caption":"","height":87});
															thumbnails[8033507] = clik.newPhoto({"id":8033507,"src":"church_bell_chiming_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033507.html","width":100,"caption":"","height":150});
															thumbnails[4478346] = clik.newPhoto({"id":4478346,"src":"The_Confetti_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478346.html","width":130,"caption":"","height":87});
															thumbnails[4478350] = clik.newPhoto({"id":4478350,"src":"Bridesmaid_34DA9CBF-24E8-5EC4-4F79E044A079111D_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478350.html","width":130,"caption":"","height":93});
															thumbnails[8220298] = clik.newPhoto({"id":8220298,"src":"couple_portrait_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220298.html","width":100,"caption":"","height":150});
															thumbnails[7787029] = clik.newPhoto({"id":7787029,"src":"married_couple_2_35228E3F-24E8-5EC4-4FD5C6EE65D4B0AA_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_7787029.html","width":130,"caption":"","height":128});
															thumbnails[8033532] = clik.newPhoto({"id":8033532,"src":"bride_groom_34D29A20-24E8-5EC4-4FAF0E24CC19E0CE_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033532.html","width":126,"caption":"","height":150});
															thumbnails[8220146] = clik.newPhoto({"id":8220146,"src":"the_group_shot_35781ABA-1EC9-D45B-1C80751604C37EB0_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220146.html","width":130,"caption":"","height":82});
															thumbnails[8979974] = clik.newPhoto({"id":8979974,"src":"child_portrait_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_8979974.html","width":104,"caption":"","height":150});
															thumbnails[4478100] = clik.newPhoto({"id":4478100,"src":"p_9EA01418-24E8-5EC4-4F60001E0E8385E6_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_4478100.html","width":100,"caption":"","height":150});
															thumbnails[7787022] = clik.newPhoto({"id":7787022,"src":"The_bridesmaid_3571BF2F-1EC9-D45B-1CDB1CEC095514A2_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_7787022.html","width":130,"caption":"","height":104});
															thumbnails[8033629] = clik.newPhoto({"id":8033629,"src":"the_venue_35582E2A-24E8-5EC4-4FC8A9A26DBC09E4_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033629.html","width":130,"caption":"","height":95});
															thumbnails[8033599] = clik.newPhoto({"id":8033599,"src":"top-_hats_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033599.html","width":130,"caption":"","height":94});
															thumbnails[8220258] = clik.newPhoto({"id":8220258,"src":"_MG_9058_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220258.html","width":113,"caption":"","height":150});
															thumbnails[8220260] = clik.newPhoto({"id":8220260,"src":"dessert_34E969B1-24E8-5EC4-4F71086C30A9CDD8_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220260.html","width":130,"caption":"","height":100});
															thumbnails[8220293] = clik.newPhoto({"id":8220293,"src":"speech_353DFC2D-24E8-5EC4-4F4F689AA53EB1F6_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220293.html","width":130,"caption":"","height":90});
															thumbnails[8033603] = clik.newPhoto({"id":8033603,"src":"wedding_cake_decoration_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033603.html","width":109,"caption":"","height":150});
															thumbnails[8033625] = clik.newPhoto({"id":8033625,"src":"cutting_the_cake_34E19DD0-24E8-5EC4-4F6393562195548A_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033625.html","width":130,"caption":"","height":117});
															thumbnails[8973927] = clik.newPhoto({"id":8973927,"src":"Mother_and_daughter_3529590A-24E8-5EC4-4F20949DA747DD9E_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8973927.html","width":130,"caption":"","height":89});
															thumbnails[4478164] = clik.newPhoto({"id":4478164,"src":"kids_352E19C5-1EC9-D45B-1CA8F2D0CF6FEF5F_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478164.html","width":130,"caption":"","height":94});
															thumbnails[4874601] = clik.newPhoto({"id":4874601,"src":"model_portrait_367E90F6-24E8-5EC4-4FD3B17D85A2D9AD_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_4874601.html","width":130,"caption":"","height":115});
															thumbnails[8973934] = clik.newPhoto({"id":8973934,"src":"Friends_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8973934.html","width":130,"caption":"","height":68});
															thumbnails[8973939] = clik.newPhoto({"id":8973939,"src":"First_dance_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8973939.html","width":125,"caption":"","height":150});
															thumbnails[8220304] = clik.newPhoto({"id":8220304,"src":"dancing_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220304.html","width":90,"caption":"","height":150});
															thumbnails[4478361] = clik.newPhoto({"id":4478361,"src":"after_the_dance_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_4478361.html","width":130,"caption":"","height":87});
															thumbnails[8220301] = clik.newPhoto({"id":8220301,"src":"_MG_9281_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8220301.html","width":130,"caption":"","height":87});
															thumbnails[8033624] = clik.newPhoto({"id":8033624,"src":"always_and_forever_thumb.jpg","galleries_id":261151,"server_id":18,"link":"photo_8033624.html","width":130,"caption":"","height":87});
															thumbnails[7620909] = clik.newPhoto({"id":7620909,"src":"celebrity_portrait_36DA1E5F-24E8-5EC4-4F055377120E04A2_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_7620909.html","width":130,"caption":"","height":89});
															thumbnails[4478094] = clik.newPhoto({"id":4478094,"src":"couple_portrait_9E8D87E7-24E8-5EC4-4FCBE7AB9B41DB3B_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_4478094.html","width":130,"caption":"","height":81});
															thumbnails[7620911] = clik.newPhoto({"id":7620911,"src":"business_portrait_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_7620911.html","width":130,"caption":"","height":87});
															thumbnails[7620913] = clik.newPhoto({"id":7620913,"src":"stage_portrait1_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_7620913.html","width":130,"caption":"","height":87});
															thumbnails[8979730] = clik.newPhoto({"id":8979730,"src":"fashion_portrait_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_8979730.html","width":130,"caption":"","height":117});
															thumbnails[7620904] = clik.newPhoto({"id":7620904,"src":"childrens_portrait_9EA69C3D-24E8-5EC4-4FB755070CD70240_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_7620904.html","width":130,"caption":"","height":110});
															thumbnails[7700203] = clik.newPhoto({"id":7700203,"src":"musician_portrait_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_7700203.html","width":100,"caption":"","height":150});
															thumbnails[4478161] = clik.newPhoto({"id":4478161,"src":"entrepreneur_portrait_thumb.jpg","galleries_id":261150,"server_id":18,"link":"photo_4478161.html","width":99,"caption":"","height":150});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[261151] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_261151.html","maxRecords":0.0,"photoIDs":[4478357.0,4478363.0,8973805.0,4478360.0,8220147.0,8220156.0,8220148.0,8220144.0,4478356.0,4478342.0,4478352.0,4478358.0,8033495.0,8033511.0,8033507.0,4478346.0,4478350.0,8220298.0,7787029.0,8033532.0,8220146.0,7787022.0,8033629.0,8033599.0,8220258.0,8220260.0,8220293.0,8033603.0,8033625.0,8973927.0,4478164.0,8973934.0,8973939.0,8220304.0,4478361.0,8220301.0,8033624.0],"skipIndex":0,"section_code":"gallery","featured_images":8220298.0,"id":261151,"singleSection":false});				  						galleries[261150] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_261150.html","maxRecords":0.0,"photoIDs":[8979974.0,4478100.0,4874601.0,7620909.0,4478094.0,7620911.0,7620913.0,8979730.0,7620904.0,7700203.0,4478161.0],"skipIndex":0,"section_code":"gallery","featured_images":8979974.0,"id":261150,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8973805,4478352,8220298,8979974';
imageSets[2] = '8220298,8979974';
imageSets[3] = '4478357,8973805,4478360,8220147,8220156,8220148,8220144,4478356,4478342,4478352,8033495,4478358,8033511,8033507,4478346,4478350,8220298,8033532,8220146,7787022,8033629,8033599,8220258,8220260,8220293,8033603,8033625,4874601,4478164,8220304,4478361,8220301,8033624,7620909,4478094,7620911,7620913,7620904,7700203,4478161';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/jans/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jans/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jans/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 = 'Reportage Wedding/Portrait Photos : by Jan Nevill: ' + 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.item_price !== '') {
			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;
	}
}

			

