window.thumbnails = {};
															thumbnails[194350] = clik.newPhoto({"id":194350,"src":"america2005a-0281_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194350.html","width":130,"caption":"The Teton National Park, Wyoming","height":87});
															thumbnails[194353] = clik.newPhoto({"id":194353,"src":"america2005a-0531_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194353.html","width":130,"caption":"The Tetons National Park, Wyoming","height":64});
															thumbnails[194358] = clik.newPhoto({"id":194358,"src":"usa-2004-015_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194358.html","width":130,"caption":"Antelope Canyon, Arizona","height":205});
															thumbnails[194370] = clik.newPhoto({"id":194370,"src":"usa-2004-039_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194370.html","width":130,"caption":"Antelope Canyon, Arizona","height":173});
															thumbnails[194379] = clik.newPhoto({"id":194379,"src":"america2005b-216_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194379.html","width":130,"caption":"The Tetons National Park, Wyoming","height":87});
															thumbnails[194382] = clik.newPhoto({"id":194382,"src":"usa-2004-107_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194382.html","width":130,"caption":"Canyonlands National Park, Utah","height":98});
															thumbnails[194383] = clik.newPhoto({"id":194383,"src":"usa-2004-058_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_194383.html","width":130,"caption":"Monument Valley,Arizona","height":197});
															thumbnails[198038] = clik.newPhoto({"id":198038,"src":"lakes-dales-yosemite-006_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_198038.html","width":130,"caption":"The Lake District National Park","height":98});
															thumbnails[198041] = clik.newPhoto({"id":198041,"src":"lakes-dales-yosemite-002_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_198041.html","width":130,"caption":"Autumn","height":173});
															thumbnails[198059] = clik.newPhoto({"id":198059,"src":"lakes-dales-yosemite-003_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_198059.html","width":130,"caption":"The Yorkshire Dales National Park","height":173});
															thumbnails[198066] = clik.newPhoto({"id":198066,"src":"lakes-dales-yosemite-009_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_198066.html","width":130,"caption":"The North Yorkshire Moors National Park","height":173});
															thumbnails[198083] = clik.newPhoto({"id":198083,"src":"usa-2004-148_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_198083.html","width":130,"caption":"Tree Bark","height":214});
															thumbnails[198095] = clik.newPhoto({"id":198095,"src":"lakes-dales-yosemite-005_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_198095.html","width":130,"caption":"The Lake District National Park","height":98});
															thumbnails[198104] = clik.newPhoto({"id":198104,"src":"lakes-dales-yosemite-022_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_198104.html","width":130,"caption":"Yosemite National Park, California","height":98});
															thumbnails[198116] = clik.newPhoto({"id":198116,"src":"lakes-dales-yosemite-001_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_198116.html","width":130,"caption":"A Hard Life","height":173});
															thumbnails[198119] = clik.newPhoto({"id":198119,"src":"grand-circle-2002-046_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_198119.html","width":130,"caption":"The Grand Canyon National Park, Arizona","height":173});
															thumbnails[198120] = clik.newPhoto({"id":198120,"src":"IMG_7888_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_198120.html","width":130,"caption":"Lone Pine","height":241});
															thumbnails[203122] = clik.newPhoto({"id":203122,"src":"america2005a-064_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_203122.html","width":130,"caption":"The Tetons National Park, Wyoming","height":205});
															thumbnails[203126] = clik.newPhoto({"id":203126,"src":"IMG_7970_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_203126.html","width":130,"caption":"The Aliens are coming!","height":195});
															thumbnails[203127] = clik.newPhoto({"id":203127,"src":"usa-2004-111_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_203127.html","width":130,"caption":"Arches National Park, Utah","height":173});
															thumbnails[203130] = clik.newPhoto({"id":203130,"src":"grand-circle-2002-129_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_203130.html","width":130,"caption":"Canyonlands National Park, Utah","height":98});
															thumbnails[203133] = clik.newPhoto({"id":203133,"src":"usa-2004-102_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_203133.html","width":130,"caption":"Canyonlands National Park, Utah","height":98});
															thumbnails[203136] = clik.newPhoto({"id":203136,"src":"america2005b-226_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_203136.html","width":130,"caption":"The Tetons National Park","height":87});
															thumbnails[205969] = clik.newPhoto({"id":205969,"src":"america2005b-075_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205969.html","width":130,"caption":"American Great Blue Heron","height":201});
															thumbnails[205970] = clik.newPhoto({"id":205970,"src":"america2005b-079_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205970.html","width":130,"caption":"Bison family","height":87});
															thumbnails[205971] = clik.newPhoto({"id":205971,"src":"america2005b-152_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205971.html","width":130,"caption":"Bull Elk","height":202});
															thumbnails[205972] = clik.newPhoto({"id":205972,"src":"america2005b-100_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205972.html","width":130,"caption":"Pronghorn Antelope","height":190});
															thumbnails[205973] = clik.newPhoto({"id":205973,"src":"america-2004-073_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205973.html","width":130,"caption":"Autumn Colours","height":98});
															thumbnails[205974] = clik.newPhoto({"id":205974,"src":"america2005b-008_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_205974.html","width":130,"caption":"Log Cabin","height":195});
															thumbnails[205975] = clik.newPhoto({"id":205975,"src":"DSC01668_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_205975.html","width":130,"caption":"Frozen puddle","height":173});
															thumbnails[205977] = clik.newPhoto({"id":205977,"src":"america2005b-164_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_205977.html","width":130,"caption":"Mule Ear Deer","height":287});
															thumbnails[205981] = clik.newPhoto({"id":205981,"src":"horseshoe-bend_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_205981.html","width":130,"caption":"Horse Shoe Bend","height":80});
															thumbnails[205984] = clik.newPhoto({"id":205984,"src":"yosemite-easter-2003-040_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_205984.html","width":130,"caption":"Pebbles","height":98});
															thumbnails[505609] = clik.newPhoto({"id":505609,"src":"usa-2006c-069_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_505609.html","width":130,"caption":"Yosemite Valley ","height":87});
															thumbnails[505636] = clik.newPhoto({"id":505636,"src":"usa-2006c-018_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_505636.html","width":130,"caption":"California Pelicans","height":86});
															thumbnails[505642] = clik.newPhoto({"id":505642,"src":"usa-2006d-042_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_505642.html","width":130,"caption":"Yosemite National Park","height":195});
															thumbnails[548413] = clik.newPhoto({"id":548413,"src":"lyme-regis-2006-012_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_548413.html","width":130,"caption":"The beach at Lyme Regis","height":195});
															thumbnails[548414] = clik.newPhoto({"id":548414,"src":"usa-2006b-001_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_548414.html","width":130,"caption":"Yosemite National Park","height":87});
															thumbnails[548415] = clik.newPhoto({"id":548415,"src":"lyme-regis-2006-083_thumb.jpg","galleries_id":18041,"server_id":15,"link":"photo_548415.html","width":130,"caption":"Dorset Coast line","height":87});
															thumbnails[548419] = clik.newPhoto({"id":548419,"src":"lyme-regis-2006-060_thumb.jpg","galleries_id":18042,"server_id":15,"link":"photo_548419.html","width":130,"caption":"Working gear","height":87});
															thumbnails[548421] = clik.newPhoto({"id":548421,"src":"lyme-regis-2006-101_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_548421.html","width":130,"caption":"Defiant","height":195});
															thumbnails[548422] = clik.newPhoto({"id":548422,"src":"usa-2006f-016_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_548422.html","width":130,"caption":"Dragonfly","height":88});
															thumbnails[548425] = clik.newPhoto({"id":548425,"src":"usa-2006a-023_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_548425.html","width":130,"caption":"Sunset","height":195});
															thumbnails[548429] = clik.newPhoto({"id":548429,"src":"usa-2006e-036_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_548429.html","width":130,"caption":"Yosemite","height":195});
															thumbnails[548432] = clik.newPhoto({"id":548432,"src":"grand-circle-2002-104_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_548432.html","width":130,"caption":"Arches","height":173});
															thumbnails[548433] = clik.newPhoto({"id":548433,"src":"IMG_7926_thumb.jpg","galleries_id":17543,"server_id":15,"link":"photo_548433.html","width":130,"caption":"Zion","height":180});
															thumbnails[5080933] = clik.newPhoto({"id":5080933,"src":"sparrowhawk2_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_5080933.html","width":130,"caption":"Male Sparrowhawk","height":171});
															thumbnails[5081187] = clik.newPhoto({"id":5081187,"src":"littleowlcopy_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_5081187.html","width":130,"caption":"Little Owl","height":104});
															thumbnails[5222086] = clik.newPhoto({"id":5222086,"src":"bobcat_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_5222086.html","width":130,"caption":"Bobcat","height":141});
															thumbnails[5222100] = clik.newPhoto({"id":5222100,"src":"greatwhiteegret_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_5222100.html","width":130,"caption":"Great White Egret","height":156});
															thumbnails[5471025] = clik.newPhoto({"id":5471025,"src":"vulture_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_5471025.html","width":130,"caption":"Turkey Vulture","height":99});
															thumbnails[8967808] = clik.newPhoto({"id":8967808,"src":"USA_2011_wildlife_090_copy_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_8967808.html","width":160,"caption":"Black Wolf of the Canyon Pack, Yellowstone National Park","height":109});
															thumbnails[8967819] = clik.newPhoto({"id":8967819,"src":"usa-xmas-2008-231-copy_thumb.jpg","galleries_id":18750,"server_id":15,"link":"photo_8967819.html","width":160,"caption":"Annas Hummingbird. Sedona, Arizona","height":117});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[17543] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"American National Parks","link":"gallery_17543.html","maxRecords":0.0,"photoIDs":[194350.0,194353.0,194358.0,194370.0,194379.0,194382.0,194383.0,198104.0,198119.0,203122.0,203127.0,203130.0,203133.0,203136.0,205981.0,505609.0,548414.0,548425.0,548429.0,548432.0,548433.0],"skipIndex":0,"section_code":"gallery","featured_images":"548433,548432,548429,548425,548414,505609,205981,203136,203133,203130","id":17543,"singleSection":false});				  						galleries[18041] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"English Landscape","link":"gallery_18041.html","maxRecords":0.0,"photoIDs":[198038.0,198059.0,198066.0,198095.0,548413.0,548415.0],"skipIndex":0,"section_code":"gallery","featured_images":"198059,198038","id":18041,"singleSection":false});				  						galleries[18042] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paterns in Nature and Abstract","link":"gallery_18042.html","maxRecords":0.0,"photoIDs":[198041.0,198083.0,198116.0,198120.0,203126.0,205974.0,205975.0,205984.0,548419.0],"skipIndex":0,"section_code":"gallery","featured_images":198041.0,"id":18042,"singleSection":false});				  						galleries[18750] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flora and Fauna","link":"gallery_18750.html","maxRecords":0.0,"photoIDs":[205969.0,205970.0,205971.0,205972.0,205973.0,205977.0,505636.0,505642.0,548421.0,548422.0,5080933.0,5081187.0,5222086.0,5222100.0,5471025.0,8967808.0,8967819.0],"skipIndex":0,"section_code":"gallery","featured_images":"205971,205969","id":18750,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '205971,198041,198038,194382,194350';
imageSets[2] = '205971,205969,198059,198041,198038';
imageSets[3] = '5081187,5080933,548433,548432,548429,548425,548422,548421,548419,548415,548414,548413,505642,505636,505609,205984,205981,205977,205975,205974,205973,205972,205971,205970,205969,203136,203133,203130,203127,203126,203122,198120,198119,198116,198104,198095,198083,198066,198059,198041,198038,194383,194382,194379,194370,194358,194353,194350';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/acorncarver/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/acorncarver/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 = 'American Landscapes: ' + 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;
	}
}

			

