window.thumbnails = {};
															thumbnails[7540836] = clik.newPhoto({"id":7540836,"src":"IMG_5496NW9_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7541006] = clik.newPhoto({"id":7541006,"src":"IMG_5496NW11e_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7541038] = clik.newPhoto({"id":7541038,"src":"IMG_5496NW1111_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7541910] = clik.newPhoto({"id":7541910,"src":"IMG_9140e27NW_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":87});
															thumbnails[7542771] = clik.newPhoto({"id":7542771,"src":"PARIS_April2010_023e2_edited-1_thumb.jpg","galleries_id":123427,"server_id":1,"link":"photo_7542771.html","width":130,"caption":"","height":87});
															thumbnails[7542775] = clik.newPhoto({"id":7542775,"src":"PARIS_April2010_002e7_edited-1_thumb.jpg","galleries_id":123427,"server_id":1,"link":"photo_7542775.html","width":130,"caption":"","height":87});
															thumbnails[7575355] = clik.newPhoto({"id":7575355,"src":"IMG_2592_016e2NWe_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7575355.html","width":130,"caption":"","height":87});
															thumbnails[7541921] = clik.newPhoto({"id":7541921,"src":"IMG_2606_028NW_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7541921.html","width":130,"caption":"","height":87});
															thumbnails[7551490] = clik.newPhoto({"id":7551490,"src":"2010_Oct_21_057e10NW23_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7551490.html","width":130,"caption":"","height":87});
															thumbnails[7541931] = clik.newPhoto({"id":7541931,"src":"IMG_9916UL2NW_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7541931.html","width":130,"caption":"","height":87});
															thumbnails[7543066] = clik.newPhoto({"id":7543066,"src":"2010_Oct_14_054EDIT_edited-1_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7543066.html","width":130,"caption":"","height":87});
															thumbnails[7573486] = clik.newPhoto({"id":7573486,"src":"IMG1198FULLag2_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7573486.html","width":130,"caption":"","height":87});
															thumbnails[7542032] = clik.newPhoto({"id":7542032,"src":"IMG_1344NWe_thumb.jpg","galleries_id":100307,"server_id":1,"link":"photo_7542032.html","width":130,"caption":"","height":87});
															thumbnails[7542132] = clik.newPhoto({"id":7542132,"src":"IMG_5247UDe_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542132.html","width":130,"caption":"","height":87});
															thumbnails[7542134] = clik.newPhoto({"id":7542134,"src":"IMG_4770NW_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542134.html","width":130,"caption":"","height":87});
															thumbnails[7542136] = clik.newPhoto({"id":7542136,"src":"IMG_5033NW_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542136.html","width":130,"caption":"","height":87});
															thumbnails[7542143] = clik.newPhoto({"id":7542143,"src":"IMG_5021NW_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542143.html","width":130,"caption":"","height":87});
															thumbnails[7542147] = clik.newPhoto({"id":7542147,"src":"IMG_4987NW_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542147.html","width":130,"caption":"","height":87});
															thumbnails[7542150] = clik.newPhoto({"id":7542150,"src":"IMG_4909NW_thumb.jpg","galleries_id":126556,"server_id":1,"link":"photo_7542150.html","width":130,"caption":"","height":87});
															thumbnails[7542166] = clik.newPhoto({"id":7542166,"src":"IMG_4846NW_thumb.jpg","galleries_id":126557,"server_id":1,"link":"photo_7542166.html","width":130,"caption":"","height":87});
															thumbnails[7542180] = clik.newPhoto({"id":7542180,"src":"IMG_5461NWe_thumb.jpg","galleries_id":126559,"server_id":1,"link":"photo_7542180.html","width":130,"caption":"","height":87});
															thumbnails[7542181] = clik.newPhoto({"id":7542181,"src":"IMG_5658NWe_thumb.jpg","galleries_id":126559,"server_id":1,"link":"photo_7542181.html","width":130,"caption":"","height":87});
															thumbnails[7542110] = clik.newPhoto({"id":7542110,"src":"editNW_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7542110.html","width":130,"caption":"","height":87});
															thumbnails[7543045] = clik.newPhoto({"id":7543045,"src":"IMG_4794NW_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7543045.html","width":130,"caption":"","height":87});
															thumbnails[7543048] = clik.newPhoto({"id":7543048,"src":"IMG_4808NW_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7543048.html","width":130,"caption":"","height":87});
															thumbnails[7542129] = clik.newPhoto({"id":7542129,"src":"IMG_3365UL2_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7542129.html","width":130,"caption":"","height":87});
															thumbnails[7542156] = clik.newPhoto({"id":7542156,"src":"IMG_4824NW_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7542156.html","width":130,"caption":"","height":87});
															thumbnails[7542159] = clik.newPhoto({"id":7542159,"src":"IMG_4833NW_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7542159.html","width":130,"caption":"","height":87});
															thumbnails[7542176] = clik.newPhoto({"id":7542176,"src":"IMG_5615NW_thumb.jpg","galleries_id":130571,"server_id":1,"link":"photo_7542176.html","width":130,"caption":"","height":87});
															thumbnails[7542163] = clik.newPhoto({"id":7542163,"src":"IMG_5269NW2_thumb.jpg","galleries_id":126558,"server_id":1,"link":"photo_7542163.html","width":130,"caption":"","height":87});
															thumbnails[7542179] = clik.newPhoto({"id":7542179,"src":"IMG_4752NW2e_thumb.jpg","galleries_id":130571,"server_id":1,"link":"photo_7542179.html","width":130,"caption":"","height":87});
															thumbnails[7542172] = clik.newPhoto({"id":7542172,"src":"IMG_5496NW_thumb.jpg","galleries_id":130571,"server_id":1,"link":"photo_7542172.html","width":130,"caption":"","height":87});
															thumbnails[7542533] = clik.newPhoto({"id":7542533,"src":"IMG_5727NW_thumb.jpg","galleries_id":126560,"server_id":1,"link":"photo_7542533.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[90021] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"event sub gallery","link":"gallery_90021.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":90021,"singleSection":false});				  						galleries[126559] = clik.newGallery({"parentGallery":86771,"usePopups":false,"title":"Modern","link":"gallery_126559.html","maxRecords":0.0,"photoIDs":[7542180.0,7542181.0],"skipIndex":0,"section_code":"gallery","featured_images":"7542181,7542180","id":126559,"singleSection":false});				  						galleries[126558] = clik.newGallery({"parentGallery":86771,"usePopups":false,"title":"Buildings","link":"gallery_126558.html","maxRecords":0.0,"photoIDs":[7542110.0,7543045.0,7543048.0,7542129.0,7542156.0,7542159.0,7542163.0],"skipIndex":0,"section_code":"gallery","featured_images":"7543048,7543045,7542163,7542159,7542156,7542129,7542110","id":126558,"singleSection":false});				  						galleries[123427] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Photo examples","link":"gallery_123427.html","maxRecords":0.0,"photoIDs":[7542771.0,7542775.0],"skipIndex":0,"section_code":"gallery","featured_images":"7542775,7542771","id":123427,"singleSection":false});				  						galleries[100307] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_100307.html","maxRecords":0.0,"photoIDs":[7575355.0,7541921.0,7551490.0,7541931.0,7543066.0,7573486.0,7542032.0],"skipIndex":0,"section_code":"gallery","featured_images":"7575355,7573486,7551490,7543066,7542032,7541931,7541921","id":100307,"singleSection":false});				  						galleries[100352] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Events","link":"gallery_100352.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":100352,"singleSection":false});				  						galleries[103322] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_103322.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":103322,"singleSection":false});				  						galleries[86151] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cityscapes","link":"gallery_86151.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"7542166,7542150,7542147,7542143,7542136,7542134,7542132","id":86151,"singleSection":false});				  						galleries[126556] = clik.newGallery({"parentGallery":86151,"usePopups":false,"title":"Places","link":"gallery_126556.html","maxRecords":0.0,"photoIDs":[7542132.0,7542134.0,7542136.0,7542143.0,7542147.0,7542150.0],"skipIndex":0,"section_code":"gallery","featured_images":"7542150,7542147,7542143,7542136,7542134,7542132","id":126556,"singleSection":false});				  						galleries[151123] = clik.newGallery({"parentGallery":100352,"usePopups":false,"title":"Races","link":"gallery_151123.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":151123,"singleSection":false});				  						galleries[86771] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Architecture","link":"gallery_86771.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"7543048,7543045,7542533,7542181,7542180,7542179,7542176,7542172,7542163,7542159","id":86771,"singleSection":false});				  						galleries[130571] = clik.newGallery({"parentGallery":86771,"usePopups":false,"title":"Skylines","link":"gallery_130571.html","maxRecords":0.0,"photoIDs":[7542176.0,7542179.0,7542172.0],"skipIndex":0,"section_code":"gallery","featured_images":"7542179,7542176,7542172","id":130571,"singleSection":false});				  						galleries[126560] = clik.newGallery({"parentGallery":86771,"usePopups":false,"title":"Interiors","link":"gallery_126560.html","maxRecords":0.0,"photoIDs":[7542533.0],"skipIndex":0,"section_code":"gallery","featured_images":7542533.0,"id":126560,"singleSection":false});				  						galleries[100353] = clik.newGallery({"parentGallery":100352,"usePopups":false,"title":"Brighton Carnival '07","link":"gallery_100353.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":100353,"singleSection":false});				  						galleries[126557] = clik.newGallery({"parentGallery":86151,"usePopups":false,"title":"People","link":"gallery_126557.html","maxRecords":0.0,"photoIDs":[7542166.0],"skipIndex":0,"section_code":"gallery","featured_images":7542166.0,"id":126557,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '7541038,7542132,7542134,7542136,7542143,7542147,7542150,7542180,7542181,7542110,7543045,7543048,7542533';
imageSets[3] = '7575355,7573486,7551490,7543066,7543048,7543045,7542775,7542771,7542533,7542181,7542180,7542179,7542176,7542172,7542166,7542163,7542159,7542156,7542150,7542147,7542143,7542136,7542134,7542132,7542129,7542110,7542032,7541931,7541921,7541910,7541038,7541006,7540836';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/eventpicturer/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/eventpicturer/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 = 'ncgfoto.com: ' + 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;
	}
}

			

