window.thumbnails = {};
															thumbnails[7064893] = clik.newPhoto({"id":7064893,"src":"Deer-1_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_7064893.html","width":130,"caption":"Who's there?\/","height":159});
															thumbnails[6967110] = clik.newPhoto({"id":6967110,"src":"Racer-1_thumb.jpg","galleries_id":566,"server_id":15,"link":"photo_6967110.html","width":130,"caption":"Its OK I am harmless but fast!!! ","height":98});
															thumbnails[6967128] = clik.newPhoto({"id":6967128,"src":"spider-1_thumb.jpg","galleries_id":14028,"server_id":15,"link":"photo_6967128.html","width":130,"caption":"Came into my Parlour!!!","height":183});
															thumbnails[6928036] = clik.newPhoto({"id":6928036,"src":"Heron1-1-2_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6928036.html","width":130,"caption":"Wading Heron","height":122});
															thumbnails[6938064] = clik.newPhoto({"id":6938064,"src":"Dragonfly-3_thumb.jpg","galleries_id":14028,"server_id":15,"link":"photo_6938064.html","width":130,"caption":"Dragon Fly landing","height":93});
															thumbnails[6938087] = clik.newPhoto({"id":6938087,"src":"Dragonfly-6_thumb.jpg","galleries_id":14028,"server_id":15,"link":"photo_6938087.html","width":130,"caption":"Dragonfly refuelling","height":101});
															thumbnails[6938110] = clik.newPhoto({"id":6938110,"src":"Dragonfly-4_thumb.jpg","galleries_id":14028,"server_id":15,"link":"photo_6938110.html","width":130,"caption":"Dragonfly on lilypad","height":85});
															thumbnails[5198283] = clik.newPhoto({"id":5198283,"src":"Fungi_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_5198283.html","width":130,"caption":"Wood Fungi","height":107});
															thumbnails[5193120] = clik.newPhoto({"id":5193120,"src":"Slowworm_thumb.jpg","galleries_id":566,"server_id":15,"link":"photo_5193120.html","width":130,"caption":"Snake in the grass sorry (Lizard(legless))","height":87});
															thumbnails[5193394] = clik.newPhoto({"id":5193394,"src":"Natures-Diamonds_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_5193394.html","width":130,"caption":"Natures Jewels","height":87});
															thumbnails[5193398] = clik.newPhoto({"id":5193398,"src":"Rayofhope_51726BE7-2219-B5B5-4C40B9C1EF17B7FC_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_5193398.html","width":130,"caption":"Sunrise in the bushes","height":87});
															thumbnails[5193417] = clik.newPhoto({"id":5193417,"src":"Rhoddie_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_5193417.html","width":130,"caption":" Flowers in the sky","height":87});
															thumbnails[2655958] = clik.newPhoto({"id":2655958,"src":"Bridge-2_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_2655958.html","width":130,"caption":" Bridge over quite waters","height":87});
															thumbnails[2659104] = clik.newPhoto({"id":2659104,"src":"Badgers-Bridge-1_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_2659104.html","width":130,"caption":"Broken Bridge","height":87});
															thumbnails[2659116] = clik.newPhoto({"id":2659116,"src":"Badgers-Holt-1_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_2659116.html","width":130,"caption":"Going South","height":87});
															thumbnails[2659125] = clik.newPhoto({"id":2659125,"src":"Badgers-Lagoon-1_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_2659125.html","width":130,"caption":"Badgers Lagoon","height":87});
															thumbnails[2655974] = clik.newPhoto({"id":2655974,"src":"Rhodedenron-21_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_2655974.html","width":130,"caption":"In full bloom","height":87});
															thumbnails[5193068] = clik.newPhoto({"id":5193068,"src":"Blue-Heron_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_5193068.html","width":130,"caption":"Dinner Time","height":102});
															thumbnails[1255377] = clik.newPhoto({"id":1255377,"src":"GurnseyRocks_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1255377.html","width":130,"caption":"Rocks and Water","height":73});
															thumbnails[1255382] = clik.newPhoto({"id":1255382,"src":"GurnseyRocks2_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1255382.html","width":130,"caption":"Sea and Land","height":73});
															thumbnails[1255225] = clik.newPhoto({"id":1255225,"src":"Lovebug_thumb.jpg","galleries_id":14028,"server_id":15,"link":"photo_1255225.html","width":130,"caption":"Love is just a blade of grass","height":121});
															thumbnails[1255253] = clik.newPhoto({"id":1255253,"src":"Gorilla_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_1255253.html","width":130,"caption":"You look'in at me","height":87});
															thumbnails[1255264] = clik.newPhoto({"id":1255264,"src":"Gorilla1_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_1255264.html","width":130,"caption":"In the light","height":195});
															thumbnails[1255090] = clik.newPhoto({"id":1255090,"src":"Skywards_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1255090.html","width":130,"caption":"Skywards","height":195});
															thumbnails[1254931] = clik.newPhoto({"id":1254931,"src":"Windy-Pier_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1254931.html","width":130,"caption":"A windy day on the Pier","height":87});
															thumbnails[1255080] = clik.newPhoto({"id":1255080,"src":"SunsetinOz_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1255080.html","width":130,"caption":"Nearly as good as Key West","height":87});
															thumbnails[1255315] = clik.newPhoto({"id":1255315,"src":"Dragon-head_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_1255315.html","width":130,"caption":"Bright and Beautiful","height":195});
															thumbnails[1254923] = clik.newPhoto({"id":1254923,"src":"Colours-of-Perth_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_1254923.html","width":130,"caption":"Colours over Perth","height":195});
															thumbnails[660213] = clik.newPhoto({"id":660213,"src":"Bear2_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_660213.html","width":130,"caption":"I'm just Lucky","height":87});
															thumbnails[660226] = clik.newPhoto({"id":660226,"src":"Naturalbridge2_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_660226.html","width":130,"caption":"Going down!!!!","height":87});
															thumbnails[683617] = clik.newPhoto({"id":683617,"src":"Coola2_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_683617.html","width":130,"caption":"Coola the Bear","height":87});
															thumbnails[678773] = clik.newPhoto({"id":678773,"src":"Canadiancolour_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_678773.html","width":130,"caption":"True Colour","height":87});
															thumbnails[660107] = clik.newPhoto({"id":660107,"src":"LakePeyto1_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_660107.html","width":130,"caption":"It really is that colour!!","height":87});
															thumbnails[660126] = clik.newPhoto({"id":660126,"src":"MtPeyto2_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_660126.html","width":130,"caption":"The climb up is worth it","height":87});
															thumbnails[660162] = clik.newPhoto({"id":660162,"src":"MtRobson2_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_660162.html","width":130,"caption":"High and Mighty","height":87});
															thumbnails[683577] = clik.newPhoto({"id":683577,"src":"Tacky_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_683577.html","width":130,"caption":"Takkalaw Falls","height":195});
															thumbnails[5193657] = clik.newPhoto({"id":5193657,"src":"CanadaTaka_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_5193657.html","width":130,"caption":"The Canadian Rockies","height":87});
															thumbnails[404993] = clik.newPhoto({"id":404993,"src":"Greek Sunset_thumb.jpg","galleries_id":567,"server_id":15,"link":"photo_404993.html","width":130,"caption":"A Greek Sunrise","height":87});
															thumbnails[182459] = clik.newPhoto({"id":182459,"src":"falls-01_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_182459.html","width":130,"caption":"Water after the rains","height":195});
															thumbnails[150891] = clik.newPhoto({"id":150891,"src":"Can you hear me_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_150891.html","width":130,"caption":"Can you hear me?","height":110});
															thumbnails[150883] = clik.newPhoto({"id":150883,"src":"Squalk_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_150883.html","width":130,"caption":"Noisey Hawk","height":87});
															thumbnails[182447] = clik.newPhoto({"id":182447,"src":"Squirrel01_thumb.jpg","galleries_id":564,"server_id":15,"link":"photo_182447.html","width":130,"caption":"Nuts!!!!","height":87});
															thumbnails[3008] = clik.newPhoto({"id":3008,"src":"121204003_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_3008.html","width":130,"caption":"","height":98});
															thumbnails[3013] = clik.newPhoto({"id":3013,"src":"121204004_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_3013.html","width":130,"caption":"The Lupin","height":173});
															thumbnails[188028] = clik.newPhoto({"id":188028,"src":"Croak_thumb.jpg","galleries_id":566,"server_id":15,"link":"photo_188028.html","width":130,"caption":"Excuse me!!!","height":98});
															thumbnails[3212] = clik.newPhoto({"id":3212,"src":"121204034 copy_thumb.jpg","galleries_id":524,"server_id":15,"link":"photo_3212.html","width":130,"caption":"Not mushroom!!!","height":98});
															thumbnails[6928015] = clik.newPhoto({"id":6928015,"src":"eyes2-1_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6928015.html","width":130,"caption":"My Better Side","height":195});
															thumbnails[6928017] = clik.newPhoto({"id":6928017,"src":"eyes-1_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6928017.html","width":130,"caption":"I have eyes for you","height":87});
															thumbnails[6928019] = clik.newPhoto({"id":6928019,"src":"Heron1-1_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6928019.html","width":130,"caption":"Came to Daddy","height":89});
															thumbnails[6928024] = clik.newPhoto({"id":6928024,"src":"Heron-10_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6928024.html","width":130,"caption":"Lunch in the Beak","height":90});
															thumbnails[6934111] = clik.newPhoto({"id":6934111,"src":"Heron1-2_thumb.jpg","galleries_id":565,"server_id":15,"link":"photo_6934111.html","width":130,"caption":"Ive seen you!!!","height":187});
															thumbnails[6987765] = clik.newPhoto({"id":6987765,"src":"100_0600_thumb.jpg","galleries_id":1819,"server_id":15,"link":"photo_6987765.html","width":130,"caption":"","height":173});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[14028] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Insects(Creepy Crawlies)","link":"gallery_14028.html","maxRecords":0.0,"photoIDs":[6967128.0,6938064.0,6938087.0,6938110.0,1255225.0],"skipIndex":0,"section_code":"gallery","featured_images":"6967128,6938110,6938087,6938064,1255225","id":14028,"singleSection":false});				  						galleries[1819] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Photographer","link":"gallery_1819.html","maxRecords":0.0,"photoIDs":[6987765.0],"skipIndex":0,"section_code":"gallery","featured_images":6987765.0,"id":1819,"singleSection":false});				  						galleries[524] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flora\/Fauna","link":"gallery_524.html","maxRecords":0.0,"photoIDs":[5198283.0,5193394.0,5193417.0,2655974.0,1255315.0,678773.0,182459.0,3008.0,3013.0,3212.0],"skipIndex":0,"section_code":"gallery","featured_images":3008.0,"id":524,"singleSection":false});				  						galleries[566] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Reptiles","link":"gallery_566.html","maxRecords":0.0,"photoIDs":[6967110.0,5193120.0,188028.0],"skipIndex":0,"section_code":"gallery","featured_images":6967110.0,"id":566,"singleSection":false});				  						galleries[564] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mammals","link":"gallery_564.html","maxRecords":0.0,"photoIDs":[7064893.0,1255253.0,1255264.0,660213.0,683617.0,182447.0],"skipIndex":0,"section_code":"gallery","featured_images":"7064893,1255264,1255253,683617,660213,182447","id":564,"singleSection":false});				  						galleries[565] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds","link":"gallery_565.html","maxRecords":0.0,"photoIDs":[6928036.0,5193068.0,150891.0,150883.0,6928015.0,6928017.0,6928019.0,6928024.0,6934111.0],"skipIndex":0,"section_code":"gallery","featured_images":"6934111,6928036,6928024,6928019,6928017,6928015,5193068,150891,150883","id":565,"singleSection":false});				  						galleries[567] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_567.html","maxRecords":0.0,"photoIDs":[5193398.0,2655958.0,2659104.0,2659116.0,2659125.0,1255377.0,1255382.0,1255090.0,1254931.0,1255080.0,1254923.0,660226.0,660107.0,660126.0,660162.0,683577.0,5193657.0,404993.0],"skipIndex":0,"section_code":"gallery","featured_images":"5193657,5193398,2659125,2659116,2659104,2655958,1255382,1255377,1255090,1255080","id":567,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2659104,2655958';
imageSets[2] = '6967110,3008';
imageSets[3] = '7064893,6987765,6938110,6938087,6934111,6928036,6928024,6928019,6928017,6928015';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/billinghamr/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/billinghamr/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 = 'Nature in Digital: ' + 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>Equipment:- </strong>' + this.photographer + '</div>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="BILLINGHAMR">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

