window.thumbnails = {};
															thumbnails[463583] = clik.newPhoto({"id":463583,"src":"african bronze_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463583.html","width":130,"caption":"","height":228});
															thumbnails[471960] = clik.newPhoto({"id":471960,"src":"IMG_0138_thumb1.jpg","galleries_id":36641,"server_id":1,"link":"photo_471960.html","width":130,"caption":" <br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n<br>\r\n","height":131});
															thumbnails[472482] = clik.newPhoto({"id":472482,"src":"IMG_0175_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472482.html","width":130,"caption":"","height":98});
															thumbnails[2735123] = clik.newPhoto({"id":2735123,"src":"IMG_3301_thumb.jpg","galleries_id":171909,"server_id":1,"link":"photo_2735123.html","width":130,"caption":"","height":181});
															thumbnails[2735125] = clik.newPhoto({"id":2735125,"src":"IMG_3300_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_2735125.html","width":130,"caption":"","height":208});
															thumbnails[463585] = clik.newPhoto({"id":463585,"src":"african orange_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463585.html","width":130,"caption":"","height":218});
															thumbnails[463900] = clik.newPhoto({"id":463900,"src":"accretion_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_463900.html","width":130,"caption":"","height":155});
															thumbnails[472506] = clik.newPhoto({"id":472506,"src":"IMG_0181_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472506.html","width":130,"caption":"","height":98});
															thumbnails[2735117] = clik.newPhoto({"id":2735117,"src":"Camo triangles_thumb.jpg","galleries_id":171909,"server_id":1,"link":"photo_2735117.html","width":130,"caption":"","height":112});
															thumbnails[2738835] = clik.newPhoto({"id":2738835,"src":"IMG_0925_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2738835.html","width":130,"caption":"","height":99});
															thumbnails[463905] = clik.newPhoto({"id":463905,"src":"galaxy_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_463905.html","width":130,"caption":"","height":98});
															thumbnails[469353] = clik.newPhoto({"id":469353,"src":"IMG_1814_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_469353.html","width":130,"caption":"","height":185});
															thumbnails[472500] = clik.newPhoto({"id":472500,"src":"IMG_0178_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472500.html","width":130,"caption":"","height":98});
															thumbnails[2735107] = clik.newPhoto({"id":2735107,"src":"Rainbow triangle_thumb.jpg","galleries_id":171909,"server_id":1,"link":"photo_2735107.html","width":130,"caption":"","height":113});
															thumbnails[2735235] = clik.newPhoto({"id":2735235,"src":"IMGJock_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2735235.html","width":130,"caption":"","height":70});
															thumbnails[463591] = clik.newPhoto({"id":463591,"src":"In the beginning_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_463591.html","width":130,"caption":"","height":88});
															thumbnails[469362] = clik.newPhoto({"id":469362,"src":"IMG_1813_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_469362.html","width":130,"caption":"","height":187});
															thumbnails[472484] = clik.newPhoto({"id":472484,"src":"IMG_0188_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472484.html","width":130,"caption":"","height":98});
															thumbnails[2735121] = clik.newPhoto({"id":2735121,"src":"IMG_3298_thumb.jpg","galleries_id":171909,"server_id":1,"link":"photo_2735121.html","width":130,"caption":"","height":179});
															thumbnails[2738763] = clik.newPhoto({"id":2738763,"src":"IMG_sling_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2738763.html","width":130,"caption":"","height":101});
															thumbnails[463906] = clik.newPhoto({"id":463906,"src":"galaxy2_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_463906.html","width":130,"caption":"","height":81});
															thumbnails[463908] = clik.newPhoto({"id":463908,"src":"landscape_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463908.html","width":130,"caption":"","height":130});
															thumbnails[463912] = clik.newPhoto({"id":463912,"src":"together 2_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_463912.html","width":130,"caption":"","height":115});
															thumbnails[472526] = clik.newPhoto({"id":472526,"src":"IMG_0184_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472526.html","width":130,"caption":"","height":98});
															thumbnails[463579] = clik.newPhoto({"id":463579,"src":"Interlude_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_463579.html","width":130,"caption":"","height":200});
															thumbnails[463907] = clik.newPhoto({"id":463907,"src":"hornbill_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463907.html","width":130,"caption":"","height":121});
															thumbnails[463910] = clik.newPhoto({"id":463910,"src":"over hills_thumb.jpg","galleries_id":36645,"server_id":1,"link":"photo_463910.html","width":130,"caption":"","height":96});
															thumbnails[472498] = clik.newPhoto({"id":472498,"src":"IMG_0180_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472498.html","width":130,"caption":"","height":98});
															thumbnails[463911] = clik.newPhoto({"id":463911,"src":"Phoenix_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463911.html","width":130,"caption":"","height":95});
															thumbnails[472483] = clik.newPhoto({"id":472483,"src":"IMG_0177_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472483.html","width":130,"caption":"","height":98});
															thumbnails[2738753] = clik.newPhoto({"id":2738753,"src":"IMG_camo_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2738753.html","width":130,"caption":"","height":183});
															thumbnails[463580] = clik.newPhoto({"id":463580,"src":"Red line_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_463580.html","width":130,"caption":"","height":164});
															thumbnails[463586] = clik.newPhoto({"id":463586,"src":"Aloe_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463586.html","width":130,"caption":"","height":91});
															thumbnails[463902] = clik.newPhoto({"id":463902,"src":"aloe3_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_463902.html","width":130,"caption":"","height":93});
															thumbnails[472486] = clik.newPhoto({"id":472486,"src":"IMG_0191_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472486.html","width":130,"caption":"","height":98});
															thumbnails[2738765] = clik.newPhoto({"id":2738765,"src":"IMG_Waiting_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2738765.html","width":130,"caption":"","height":166});
															thumbnails[472504] = clik.newPhoto({"id":472504,"src":"IMG_0183_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_472504.html","width":130,"caption":"","height":98});
															thumbnails[2735232] = clik.newPhoto({"id":2735232,"src":"IMG_weave_thumb.jpg","galleries_id":36667,"server_id":1,"link":"photo_2735232.html","width":130,"caption":"","height":82});
															thumbnails[2738766] = clik.newPhoto({"id":2738766,"src":"IMG_Xcross_thumb.jpg","galleries_id":36641,"server_id":1,"link":"photo_2738766.html","width":130,"caption":"","height":184});
															thumbnails[2735213] = clik.newPhoto({"id":2735213,"src":"IMG_1664_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735213.html","width":130,"caption":"","height":98});
															thumbnails[8472015] = clik.newPhoto({"id":8472015,"src":"Badlad1_thumb.jpeg","galleries_id":36641,"server_id":1,"link":"photo_8472015.html","width":130,"caption":"","height":172});
															thumbnails[2735215] = clik.newPhoto({"id":2735215,"src":"IMG_1663_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735215.html","width":130,"caption":"","height":98});
															thumbnails[2735221] = clik.newPhoto({"id":2735221,"src":"IMG_1759_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735221.html","width":130,"caption":"","height":98});
															thumbnails[2735223] = clik.newPhoto({"id":2735223,"src":"IMG_2710_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735223.html","width":130,"caption":"","height":98});
															thumbnails[2735227] = clik.newPhoto({"id":2735227,"src":"IMG_2722_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735227.html","width":130,"caption":"","height":98});
															thumbnails[2735230] = clik.newPhoto({"id":2735230,"src":"IMG_2697_thumb.jpg","galleries_id":37312,"server_id":1,"link":"photo_2735230.html","width":130,"caption":"","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[36641] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"THE MALE FORM","link":"gallery_36641.html","maxRecords":0.0,"photoIDs":[471960.0,2738835.0,2735235.0,2738763.0,463912.0,463579.0,2738753.0,463580.0,2738765.0,2738766.0,8472015.0],"skipIndex":0,"section_code":"gallery","featured_images":463579.0,"id":36641,"singleSection":false});				  						galleries[36645] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ABSTRACT","link":"gallery_36645.html","maxRecords":0.0,"photoIDs":[2735125.0,463900.0,463905.0,463591.0,463906.0,463910.0],"skipIndex":0,"section_code":"gallery","featured_images":463591.0,"id":36645,"singleSection":false});				  						galleries[36667] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"FORM IN NATURE","link":"gallery_36667.html","maxRecords":0.0,"photoIDs":[463583.0,463585.0,469353.0,469362.0,463908.0,463907.0,463911.0,463586.0,463902.0,2735232.0],"skipIndex":0,"section_code":"gallery","featured_images":"2735232,469362,469353,463911,463908,463907,463902,463586,463585,463583","id":36667,"singleSection":false});				  						galleries[171909] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"CAMOUFLAGE","link":"gallery_171909.html","maxRecords":0.0,"photoIDs":[2735123.0,2735117.0,2735107.0,2735121.0],"skipIndex":0,"section_code":"gallery","featured_images":"2735123,2735121,2735117,2735107","id":171909,"singleSection":false});				  						galleries[37312] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"PHOTOGRAPHY","link":"gallery_37312.html","maxRecords":0.0,"photoIDs":[472482.0,472506.0,472500.0,472484.0,472526.0,472498.0,472483.0,472486.0,472504.0,2735213.0,2735215.0,2735221.0,2735223.0,2735227.0,2735230.0],"skipIndex":0,"section_code":"gallery","featured_images":"2735230,2735227,2735223,2735221,2735215,2735213,472526,472506,472504,472500","id":37312,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2738835,2735117,463912,463908,463586';
imageSets[2] = '463591,463579';
imageSets[3] = '8472015,2738835,2738766,2738765,2738763,2738753,2735235,2735232,2735230,2735227,2735223,2735221,2735215,2735213,2735125,2735123,2735121,2735117,2735107,472526,472506,472504,472500,472498,472486,472484,472483,472482,471960,469362,469353,463912,463911,463910,463908,463907,463906,463905,463902,463900,463591,463586,463585,463583,463580,463579';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gabbott/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gabbott/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gabbott/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gabbott/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/gabbott/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gabbott/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/gabbott/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 = 'barrie-gabbott.co.uk: ' + 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;
	}
}

			

