window.thumbnails = {};
															thumbnails[8415531] = clik.newPhoto({"id":8415531,"src":"IMG_8021-Elise--Aidy-at-th_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":89,"caption":"Elise & Adie at the alter","height":130});
															thumbnails[5105032] = clik.newPhoto({"id":5105032,"src":"IMG_8793final_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Village children in the Gambia","height":62});
															thumbnails[5030195] = clik.newPhoto({"id":5030195,"src":"2---IMG_1693-pett-bouy_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"About a buoy","height":87});
															thumbnails[6547844] = clik.newPhoto({"id":6547844,"src":"IMG_5519-boys-at-bexhill_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"double trouble on the beach","height":87});
															thumbnails[6722371] = clik.newPhoto({"id":6722371,"src":"IMG_5699---Molly_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Molly in the garden","height":81});
															thumbnails[5030250] = clik.newPhoto({"id":5030250,"src":"3---IMG_1840-row-boat-at-su_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"Row boat at sunrise","height":130});
															thumbnails[7451676] = clik.newPhoto({"id":7451676,"src":"12-23_1864-Sophie-elf_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Sophie makes sure she's ready for the call up from Santa","height":92});
															thumbnails[5307271] = clik.newPhoto({"id":5307271,"src":"IMG_3350-at-the-bottom_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"April - At cliff base","height":87});
															thumbnails[7896148] = clik.newPhoto({"id":7896148,"src":"IMG_7321_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Fairy Sophie","height":87});
															thumbnails[5149397] = clik.newPhoto({"id":5149397,"src":"IMG_0407-antelope-slot-cany_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":87,"caption":"The light entering the canyon casts a rainbow of colours on the walls. The smallest yet probably my favourite canyon I have visited","height":130});
															thumbnails[5159738] = clik.newPhoto({"id":5159738,"src":"IMG_2991-mirror_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"June - Reflections of Rye Harbour","height":87});
															thumbnails[7468589] = clik.newPhoto({"id":7468589,"src":"Jan-03-2011_2050-boys-at-pe_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"twins ","height":87});
															thumbnails[7500557] = clik.newPhoto({"id":7500557,"src":"IMG_5691-judith--molly_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Mother and daughter in peaceful garden setting","height":87});
															thumbnails[7687749] = clik.newPhoto({"id":7687749,"src":"matt--sam-bodium-IMG_7120_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"time to relax after repelling invaders","height":84});
															thumbnails[7032814] = clik.newPhoto({"id":7032814,"src":"IMG_5412---at-the-end-of-hi_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"August - At the end of his rope","height":87});
															thumbnails[7697381] = clik.newPhoto({"id":7697381,"src":"IMG_7241_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Hastings - home to the best dressed fishermen in the country","height":86});
															thumbnails[7701026] = clik.newPhoto({"id":7701026,"src":"matt--sam-bodium-IMG_7091_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"brothers at the castle gate","height":92});
															thumbnails[7032824] = clik.newPhoto({"id":7032824,"src":"IMG_3396-descent_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"September - The descent","height":87});
															thumbnails[5280602] = clik.newPhoto({"id":5280602,"src":"IMG_2859-cliff-top_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"  Over the edge","height":87});
															thumbnails[5307321] = clik.newPhoto({"id":5307321,"src":"IMG_3343-starting-the-climb_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"first foot over","height":87});
															thumbnails[7032851] = clik.newPhoto({"id":7032851,"src":"IMG_2996-truck-and-hut_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"November - On the beach","height":84});
															thumbnails[8005616] = clik.newPhoto({"id":8005616,"src":"IMG_7451-winchelsea-beach_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_8005616.html","width":130,"caption":"weather beaten groyne at winchelsea beach","height":87});
															thumbnails[7703109] = clik.newPhoto({"id":7703109,"src":"11-17_1711-lou--ben-hands-_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_7703109.html","width":130,"caption":"lou, ben and bump","height":87});
															thumbnails[6037059] = clik.newPhoto({"id":6037059,"src":"IMG_5223-rock-with-a-view_thumb.jpg","galleries_id":438268,"server_id":5,"link":"photo_6037059.html","width":130,"caption":"rock with a view","height":89});
															thumbnails[5105072] = clik.newPhoto({"id":5105072,"src":"IMG_4998-red-rock-canyon_thumb.jpg","galleries_id":438267,"server_id":5,"link":"photo_5105072.html","width":130,"caption":"Red Rock Canyon, Las Vegas","height":87});
															thumbnails[7707399] = clik.newPhoto({"id":7707399,"src":"sophies-foot-bw-darkened--_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_7707399.html","width":88,"caption":"sophie in mums safe hands","height":130});
															thumbnails[6037061] = clik.newPhoto({"id":6037061,"src":"A-place-to-hide---IMG_5301_thumb.jpg","galleries_id":438268,"server_id":5,"link":"photo_6037061.html","width":130,"caption":"a place to hide","height":87});
															thumbnails[5105742] = clik.newPhoto({"id":5105742,"src":"IMG-0562_Arches-national-pa_thumb.jpg","galleries_id":438267,"server_id":5,"link":"photo_5105742.html","width":130,"caption":"Arches national park","height":87});
															thumbnails[5026691] = clik.newPhoto({"id":5026691,"src":"01-IMG-8456-boat-at-sunrise_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5026691.html","width":130,"caption":"Winter sunshine on Hastings beach.","height":87});
															thumbnails[5223007] = clik.newPhoto({"id":5223007,"src":"IMG_3215_C57E606A-1EC9-D45B-1C18153AB0ECBC81_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5223007.html","width":130,"caption":" Fairlight radar station at dusk","height":87});
															thumbnails[5104916] = clik.newPhoto({"id":5104916,"src":"5_-_IMG_1617-blue-boat-dun_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5104916.html","width":130,"caption":"Blue june day at Dungeness","height":87});
															thumbnails[5105772] = clik.newPhoto({"id":5105772,"src":"IMG_0732---Bryce-Canyon-sun_thumb.jpg","galleries_id":438267,"server_id":5,"link":"photo_5105772.html","width":130,"caption":"Sunrise at Bryce","height":87});
															thumbnails[7027889] = clik.newPhoto({"id":7027889,"src":"IMG_4842-leaving-the-blues-_thumb.jpg","galleries_id":438268,"server_id":5,"link":"photo_7027889.html","width":130,"caption":"leaving the blues behind","height":91});
															thumbnails[8217866] = clik.newPhoto({"id":8217866,"src":"hide--seek-the-sun-colour-_thumb.jpg","galleries_id":438268,"server_id":5,"link":"photo_8217866.html","width":130,"caption":"Hide and seek the sun","height":87});
															thumbnails[5026927] = clik.newPhoto({"id":5026927,"src":"8_-_IMG_2301_marine_court__groyne_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5026927.html","width":130,"caption":"Marine Court through the groyne","height":87});
															thumbnails[5104911] = clik.newPhoto({"id":5104911,"src":"4_-_IMG_1873_spade_in_the_sand_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5104911.html","width":130,"caption":"spade in the sand","height":87});
															thumbnails[8719323] = clik.newPhoto({"id":8719323,"src":"Zion-National-Park-IMG_0516_thumb.jpg","galleries_id":438267,"server_id":5,"link":"photo_8719323.html","width":87,"caption":"The hanging valley","height":130});
															thumbnails[6704514] = clik.newPhoto({"id":6704514,"src":"IMG_5008_thumb.jpg","galleries_id":438268,"server_id":5,"link":"photo_6704514.html","width":130,"caption":"surrender to the new day","height":78});
															thumbnails[5026951] = clik.newPhoto({"id":5026951,"src":"9_-_IMG_8614_worn_groyne__wave_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5026951.html","width":130,"caption":"Wave worn groyne","height":87});
															thumbnails[8754682] = clik.newPhoto({"id":8754682,"src":"IMG_8602-SOPHIE-XMAS_C48A023D-1EC9-D45B-1C3B785CD6F99A68_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_8754682.html","width":87,"caption":"getting ready for xmas","height":130});
															thumbnails[8574687] = clik.newPhoto({"id":8574687,"src":"IMG_8504-harry-with-hairbru_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_8574687.html","width":87,"caption":"Harry in his christening suit","height":130});
															thumbnails[5026811] = clik.newPhoto({"id":5026811,"src":"6---IMG_1395-boat--bulldoz_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5026811.html","width":87,"caption":"Fishing boat and bulldozer in the 6 a.m. sun","height":130});
															thumbnails[8953498] = clik.newPhoto({"id":8953498,"src":"IMG_8665_C49EC550-1EC9-D45B-1CAECB277FA2DFB4_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_8953498.html","width":87,"caption":"Fairy Sophie","height":130});
															thumbnails[5104994] = clik.newPhoto({"id":5104994,"src":"11---IMG_1834-boulder--cli_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5104994.html","width":87,"caption":"Early morning in June at Pett","height":130});
															thumbnails[5104932] = clik.newPhoto({"id":5104932,"src":"07---IMG_2146-pier_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5104932.html","width":87,"caption":"late afternoon sun on Hastings Pier","height":130});
															thumbnails[8718917] = clik.newPhoto({"id":8718917,"src":"IMG_7502-stanley--felicity_thumb.jpg","galleries_id":417094,"server_id":5,"link":"photo_8718917.html","width":87,"caption":"stanley & felicity","height":130});
															thumbnails[5027307] = clik.newPhoto({"id":5027307,"src":"10---IMG_1605-wooden-boat_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5027307.html","width":87,"caption":"End of the journey","height":130});
															thumbnails[5244088] = clik.newPhoto({"id":5244088,"src":"IMG_3306-fairlight-sun-thro_thumb.jpg","galleries_id":375118,"server_id":5,"link":"photo_5244088.html","width":130,"caption":"storm clouds over the channel","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[438267] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"U.S.A","link":"gallery_438267.html","maxRecords":0.0,"photoIDs":[5105072.0,5105742.0,5105772.0,8719323.0],"skipIndex":0,"section_code":"gallery","featured_images":"8719323,5105772,5105742,5105072","id":438267,"singleSection":false});				  						galleries[375118] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Land & Seascape Photography","link":"gallery_375118.html","maxRecords":0.0,"photoIDs":[8005616.0,5026691.0,5223007.0,5104916.0,5026927.0,5104911.0,5026951.0,5026811.0,5104994.0,5104932.0,5027307.0,5244088.0],"skipIndex":0,"section_code":"gallery","featured_images":"8005616,5244088,5223007,5104994,5104932,5104916,5104911,5027307,5026951,5026927","id":375118,"singleSection":false});				  						galleries[417094] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Baby","link":"gallery_417094.html","maxRecords":0.0,"photoIDs":[7703109.0,7707399.0,8754682.0,8574687.0,8953498.0,8718917.0],"skipIndex":0,"section_code":"gallery","featured_images":7703109.0,"id":417094,"singleSection":false});				  						galleries[438268] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Beauty and the beach","link":"gallery_438268.html","maxRecords":0.0,"photoIDs":[6037059.0,6037061.0,7027889.0,8217866.0,6704514.0],"skipIndex":0,"section_code":"gallery","featured_images":8217866.0,"id":438268,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7687749';
imageSets[2] = '7703109,5105032,8217866,7687749';
imageSets[3] = '8953498,8754682,8719323,8718917,8574687,8415531,8217866,8005616,7896148,7707399,7703109,7701026,7697381,7687749,7500557,7468589,7451676,7032851,7032824,7032814,7027889,6722371,6704514,6547844,6037061,6037059,5307321,5307271,5280602,5244088,5223007,5159738,5149397,5105772,5105742,5105072,5105032,5104994,5104932,5104916,5104911,5030250,5030195,5027307,5026951,5026927,5026811,5026691';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/flathead99/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/flathead99/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/flathead99/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 = 'steve boydell 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.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;
	}
}

			

