window.thumbnails = {};
															thumbnails[6113784] = clik.newPhoto({"id":6113784,"src":"bsphotographysurfer_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"A Surfer on Luz Beach, Algarve, Portugal","height":87});
															thumbnails[6113802] = clik.newPhoto({"id":6113802,"src":"bsphotographysheds_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Colourful beach huts in LLeyn Peninsula, North Wales","height":196});
															thumbnails[6113838] = clik.newPhoto({"id":6113838,"src":"bsphotographycannockchase_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Trees on Cannock Chase National Park, Staffordshire","height":86});
															thumbnails[6113843] = clik.newPhoto({"id":6113843,"src":"bsphotographyclenthills_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"The Clent Hills, Worcestershire, on a snowy day","height":194});
															thumbnails[6113853] = clik.newPhoto({"id":6113853,"src":"bsphotographyparis_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Overlooking the Parisian Landscape, from Sacre Coeur. ","height":81});
															thumbnails[6113854] = clik.newPhoto({"id":6113854,"src":"bsphotographycannockchase2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Woodlands on Cannock Chase National Park","height":86});
															thumbnails[6113857] = clik.newPhoto({"id":6113857,"src":"bsphotographysand_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Footprints in the sand","height":200});
															thumbnails[6113861] = clik.newPhoto({"id":6113861,"src":"bsphotographyllynpeninsularbeach_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"The Lleyn Peninuslar, North Wales","height":195});
															thumbnails[6113864] = clik.newPhoto({"id":6113864,"src":"bsphotographywaterfall_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"A tranquil waterfall just outside of Barmouth, North Wales","height":86});
															thumbnails[6113881] = clik.newPhoto({"id":6113881,"src":"bsphotographyslittingmill_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Rapeseed field in Slitting Mill, Staffordshire","height":86});
															thumbnails[6113889] = clik.newPhoto({"id":6113889,"src":"bsphotographywaves_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"The waves of the Atlantic Ocean crashing against the rocks","height":87});
															thumbnails[6113905] = clik.newPhoto({"id":6113905,"src":"bsphotographyclenthills1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Snow on the Standing Stones of the Clent hills, Worcestershire","height":195});
															thumbnails[6113939] = clik.newPhoto({"id":6113939,"src":"bsphotographylonelyheart_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"A lone figure on Barmouth Beach, North Wales","height":195});
															thumbnails[6114136] = clik.newPhoto({"id":6114136,"src":"bsphotographychasewater_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Chase Water, Cannock","height":201});
															thumbnails[6114147] = clik.newPhoto({"id":6114147,"src":"bsphotographycardingmillvalley_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Atmospheric clouds high up in Carding Mill Valley","height":195});
															thumbnails[6114149] = clik.newPhoto({"id":6114149,"src":"white_lily_funeral_service-_212_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"White Lily Funeral Service","height":86});
															thumbnails[6114240] = clik.newPhoto({"id":6114240,"src":"Year_photo1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"School Year Photographs","height":65});
															thumbnails[6114828] = clik.newPhoto({"id":6114828,"src":"edgbaston_ball_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"BCU Graduation Ball, Edgbaston","height":194});
															thumbnails[6114879] = clik.newPhoto({"id":6114879,"src":"edgbaston_ball_4_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"BCU Graduation Ball, Edgbaston","height":196});
															thumbnails[6114990] = clik.newPhoto({"id":6114990,"src":"edgbaston_ball_5_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"BCU Graduation Ball, Edgbaston","height":196});
															thumbnails[6115211] = clik.newPhoto({"id":6115211,"src":"product_shot_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Product based Photography","height":195});
															thumbnails[6302917] = clik.newPhoto({"id":6302917,"src":"192_Richard_Wlakerdine-Laura_Bennett_x_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prom Photography","height":173});
															thumbnails[6302918] = clik.newPhoto({"id":6302918,"src":"196_Jack_Smith_x_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prom Photography","height":173});
															thumbnails[6302920] = clik.newPhoto({"id":6302920,"src":"Walsall_Academy_prom_46_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prom Photography","height":86});
															thumbnails[6302922] = clik.newPhoto({"id":6302922,"src":"Walsall_Academy_prom_93_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prom Photography","height":103});
															thumbnails[6302956] = clik.newPhoto({"id":6302956,"src":"147_laura_cooper-naomi_gill-_Reanne_Landston_x_312_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Prom Photography","height":173});
															thumbnails[6302983] = clik.newPhoto({"id":6302983,"src":"DSC_0637_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"White Lily Funeral Services","height":120});
															thumbnails[6672849] = clik.newPhoto({"id":6672849,"src":"Business1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Corporate Photography","height":196});
															thumbnails[6672852] = clik.newPhoto({"id":6672852,"src":"business2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Corporate Photography","height":196});
															thumbnails[6672853] = clik.newPhoto({"id":6672853,"src":"business3_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Corporate Photography","height":193});
															thumbnails[6672855] = clik.newPhoto({"id":6672855,"src":"business4_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Corporate Photography","height":88});
															thumbnails[7398291] = clik.newPhoto({"id":7398291,"src":"sandra_website_1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":196});
															thumbnails[7398293] = clik.newPhoto({"id":7398293,"src":"sandra_website_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":217});
															thumbnails[7398295] = clik.newPhoto({"id":7398295,"src":"sandra_website_3_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":180});
															thumbnails[7398297] = clik.newPhoto({"id":7398297,"src":"sandra_website_4_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":200});
															thumbnails[7398299] = clik.newPhoto({"id":7398299,"src":"sandra_website_5_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":181});
															thumbnails[7139669] = clik.newPhoto({"id":7139669,"src":"Sandra48_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":86});
															thumbnails[7139676] = clik.newPhoto({"id":7139676,"src":"Sandra66_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":185});
															thumbnails[7139659] = clik.newPhoto({"id":7139659,"src":"Sandra38_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Sandra Marie Lees- Miss Earth England 2010","height":105});
															thumbnails[7398304] = clik.newPhoto({"id":7398304,"src":"Ruby_website_2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":110});
															thumbnails[7398301] = clik.newPhoto({"id":7398301,"src":"Ruby_website_1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":205});
															thumbnails[7398305] = clik.newPhoto({"id":7398305,"src":"Ruby_website_3_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":193});
															thumbnails[7398307] = clik.newPhoto({"id":7398307,"src":"Ruby_website_4_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":196});
															thumbnails[7413207] = clik.newPhoto({"id":7413207,"src":"Sarah_wbs1_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":204});
															thumbnails[7413209] = clik.newPhoto({"id":7413209,"src":"Sarah_wbs2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":204});
															thumbnails[7413210] = clik.newPhoto({"id":7413210,"src":"Sarah_wbs3_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Studio 2011","height":204});
															thumbnails[7196453] = clik.newPhoto({"id":7196453,"src":"Mika4_Colour_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Mika the Samoyed","height":171});
															thumbnails[7196446] = clik.newPhoto({"id":7196446,"src":"Mika2_Colour_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Mika the Samoyed","height":196});
															thumbnails[7196455] = clik.newPhoto({"id":7196455,"src":"Mika5_Colour_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Mika the Samoyed","height":187});
															thumbnails[7196451] = clik.newPhoto({"id":7196451,"src":"Mika3_Colour_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Mika the Samoyed","height":120});
															thumbnails[7196442] = clik.newPhoto({"id":7196442,"src":"Mika1_Colour_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Mika the Samoyed","height":100});
															thumbnails[7440133] = clik.newPhoto({"id":7440133,"src":"Zoe_Website11_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Fashion Narrative","height":212});
															thumbnails[7440146] = clik.newPhoto({"id":7440146,"src":"Zoe_Website2_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Fashion Narrative","height":196});
															thumbnails[7440197] = clik.newPhoto({"id":7440197,"src":"Zoe_Website3_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Fashion Narrative","height":191});
															thumbnails[7440209] = clik.newPhoto({"id":7440209,"src":"Zoe_Website4_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"Fashion Narrative","height":196});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6672855,6672853,6672852,6672849,6302983,6302956,6302922,6302920,6302918,6302917,6115211,6114149,6114147,6114136,6113939,6113905,6113889,6113881,6113864,6113861,6113857,6113854,6113853,6113843,6113838,6113802,7398291,7398293,7398295,7398297,7398299,7139669,7139676,7139659,7398304,7398301,7398305,7398307,7413207,7413209,7413210,7196453,7196451,7196442,7440133,7440146,7440197,7440209';
imageSets[2] = '6672855,6672853,6672852,6672849,6302983,6302956,6302922,6302920,6302918,6302917,6115211,6114990,6114879,6114240,6114149,6114147,6114136,6113939,6113905,6113889,6113881,6113864,6113861,6113857,6113854,6113853,6113843,6113838,6113802,7398291,7398293,7398295,7398297,7398299,7139669,7139676,7139659,7398304,7398301,7398305,7398307,7413207,7413209,7413210,7196453,7196451,7196442,7440133,7440146,7440197,7440209';
imageSets[3] = '6672855,6672853,6672852,6672849,7398291,7398293,7398295,7398297,7398299,7139669,7139676,7139659,7398304,7398301,7398305,7398307,7413207,7413209,7413210,7196453,7196451,7196442,7440133,7440146,7440197,7440209';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/bsphotography/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/bsphotography/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 += '.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 && '' != '') {
					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 = 'B&S Freelance 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;
	}
}

			

