window.thumbnails = {};
															thumbnails[5107590] = clik.newPhoto({"id":5107590,"src":"Ive_3_3_edited-6_copy_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":175});
															thumbnails[5214732] = clik.newPhoto({"id":5214732,"src":"LV_6_1_thumb.jpg","galleries_id":288457,"server_id":5,"link":"photo_5214732.html","width":130,"caption":"","height":87});
															thumbnails[8941185] = clik.newPhoto({"id":8941185,"src":"IMG_5630-6_1_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8941185.html","width":130,"caption":"","height":195});
															thumbnails[5102280] = clik.newPhoto({"id":5102280,"src":"Ive_3_3_edited-6123_thumb.jpg","galleries_id":288450,"server_id":5,"link":"photo_5102280.html","width":130,"caption":"","height":175});
															thumbnails[5104090] = clik.newPhoto({"id":5104090,"src":"IMG_0355_2_edited-3_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5104090.html","width":130,"caption":"","height":219});
															thumbnails[5104189] = clik.newPhoto({"id":5104189,"src":"Ive1_1_edited-21_thumb.jpg","galleries_id":287603,"server_id":5,"link":"photo_5104189.html","width":130,"caption":"","height":126});
															thumbnails[7827486] = clik.newPhoto({"id":7827486,"src":"IMG_4531-11_1-Edit-1_web_thumb.jpg","galleries_id":422487,"server_id":5,"link":"photo_7827486.html","width":130,"caption":"Jewellery by NNOODL Ltd","height":195});
															thumbnails[8425678] = clik.newPhoto({"id":8425678,"src":"IMG_5186-1_0_8_velmex_web22_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8425678.html","width":130,"caption":"","height":92});
															thumbnails[5104094] = clik.newPhoto({"id":5104094,"src":"Ric1_edited-2_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5104094.html","width":130,"caption":"","height":194});
															thumbnails[5104154] = clik.newPhoto({"id":5104154,"src":"IMG_0998_edited-2_thumb.jpg","galleries_id":288450,"server_id":5,"link":"photo_5104154.html","width":130,"caption":"","height":211});
															thumbnails[7827480] = clik.newPhoto({"id":7827480,"src":"IMG_4508-9_1-Edit-1_web_thumb.jpg","galleries_id":422487,"server_id":5,"link":"photo_7827480.html","width":130,"caption":"Jewellery by NNOODL Ltd","height":195});
															thumbnails[8425689] = clik.newPhoto({"id":8425689,"src":"IMG_5309-1_1.cs-2_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8425689.html","width":130,"caption":"","height":195});
															thumbnails[5104098] = clik.newPhoto({"id":5104098,"src":"IMG_0746_1_edited-2_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5104098.html","width":130,"caption":"","height":179});
															thumbnails[5104192] = clik.newPhoto({"id":5104192,"src":"IMG_1011_1_edited-3_thumb.jpg","galleries_id":287603,"server_id":5,"link":"photo_5104192.html","width":130,"caption":"","height":153});
															thumbnails[7827476] = clik.newPhoto({"id":7827476,"src":"IMG_4494-6_1-Edit-1_web_thumb.jpg","galleries_id":422487,"server_id":5,"link":"photo_7827476.html","width":130,"caption":"Jewellery by NNOODL Ltd","height":195});
															thumbnails[8425685] = clik.newPhoto({"id":8425685,"src":"IMG_5260_5262_2_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8425685.html","width":130,"caption":"","height":104});
															thumbnails[5104101] = clik.newPhoto({"id":5104101,"src":"IMG_0759_1_edited-2_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5104101.html","width":130,"caption":"","height":203});
															thumbnails[8531749] = clik.newPhoto({"id":8531749,"src":"IMG_5209-1_3_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531749.html","width":130,"caption":"","height":185});
															thumbnails[5104201] = clik.newPhoto({"id":5104201,"src":"IMG_1177_1_edited-1_thumb.jpg","galleries_id":287603,"server_id":5,"link":"photo_5104201.html","width":130,"caption":"","height":154});
															thumbnails[8531752] = clik.newPhoto({"id":8531752,"src":"IMG_5211-2_3_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531752.html","width":130,"caption":"","height":201});
															thumbnails[5104109] = clik.newPhoto({"id":5104109,"src":"Tristan_close-up_edited-2_thumb.jpg","galleries_id":288457,"server_id":5,"link":"photo_5104109.html","width":130,"caption":"","height":168});
															thumbnails[5107743] = clik.newPhoto({"id":5107743,"src":"21_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5107743.html","width":130,"caption":"","height":186});
															thumbnails[7321489] = clik.newPhoto({"id":7321489,"src":"IMG_3065_1_web_thumb.jpg","galleries_id":288457,"server_id":5,"link":"photo_7321489.html","width":130,"caption":"","height":195});
															thumbnails[8531757] = clik.newPhoto({"id":8531757,"src":"IMG_5214-3_2-Edit-1_HDR_2-1_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531757.html","width":130,"caption":"","height":204});
															thumbnails[5107746] = clik.newPhoto({"id":5107746,"src":"IMG_0685_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5107746.html","width":130,"caption":"","height":195});
															thumbnails[6168081] = clik.newPhoto({"id":6168081,"src":"IMG_2121_2new_1_rs1_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_6168081.html","width":130,"caption":"","height":198});
															thumbnails[8531761] = clik.newPhoto({"id":8531761,"src":"IMG_5333-16_2_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531761.html","width":130,"caption":"","height":109});
															thumbnails[5107749] = clik.newPhoto({"id":5107749,"src":"IMG_0687_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5107749.html","width":130,"caption":"","height":206});
															thumbnails[5214722] = clik.newPhoto({"id":5214722,"src":"IMG_1232_1_thumb.jpg","galleries_id":287603,"server_id":5,"link":"photo_5214722.html","width":130,"caption":"","height":194});
															thumbnails[8531764] = clik.newPhoto({"id":8531764,"src":"IMG_5272-9_6_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531764.html","width":130,"caption":"","height":105});
															thumbnails[8531775] = clik.newPhoto({"id":8531775,"src":"IMG_5252_6_web_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8531775.html","width":130,"caption":"","height":87});
															thumbnails[5446695] = clik.newPhoto({"id":5446695,"src":"Imc2_3ppcf_v3-lpaco_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_5446695.html","width":130,"caption":"","height":215});
															thumbnails[8941198] = clik.newPhoto({"id":8941198,"src":"IMG_5756-25_HDR-Edit-1_thumb.jpg","galleries_id":422487,"server_id":5,"link":"photo_8941198.html","width":130,"caption":"","height":202});
															thumbnails[7325963] = clik.newPhoto({"id":7325963,"src":"IMG_3537-3_1-Edit-1_1_web2_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_7325963.html","width":130,"caption":"","height":176});
															thumbnails[8952564] = clik.newPhoto({"id":8952564,"src":"cutout_edited-4-Edit-11_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8952564.html","width":130,"caption":"","height":108});
															thumbnails[7317692] = clik.newPhoto({"id":7317692,"src":"IMG_3566_HDR-Edit-1_2_gb_web_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_7317692.html","width":130,"caption":"","height":180});
															thumbnails[6877609] = clik.newPhoto({"id":6877609,"src":"IMG_2606_4_fb_thumb.jpg","galleries_id":287602,"server_id":5,"link":"photo_6877609.html","width":130,"caption":"","height":163});
															thumbnails[8941182] = clik.newPhoto({"id":8941182,"src":"IMG_5600-1_2-Edit-1_edited-_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8941182.html","width":130,"caption":"","height":187});
															thumbnails[8941189] = clik.newPhoto({"id":8941189,"src":"IMG_5686-9_5_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_8941189.html","width":130,"caption":"","height":195});
															thumbnails[9004994] = clik.newPhoto({"id":9004994,"src":"IMG_5776-28_edited-1-Edit-E_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_9004994.html","width":130,"caption":"","height":124});
															thumbnails[9005006] = clik.newPhoto({"id":9005006,"src":"IMG_5558-1_edited-2-Edit-1-web2_thumb.jpg","galleries_id":446151,"server_id":5,"link":"photo_9005006.html","width":130,"caption":"","height":215});
															thumbnails[6178726] = clik.newPhoto({"id":6178726,"src":"IMG_0353new_rs_1_1_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6178726.html","width":130,"caption":"","height":169});
															thumbnails[6168044] = clik.newPhoto({"id":6168044,"src":"IMG_0742_1new_rs2_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6168044.html","width":130,"caption":"","height":169});
															thumbnails[6168052] = clik.newPhoto({"id":6168052,"src":"IMG_0810new_1_rs1_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6168052.html","width":130,"caption":"","height":176});
															thumbnails[6177557] = clik.newPhoto({"id":6177557,"src":"IMG_2018_4bw_60_-50_1rs_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6177557.html","width":130,"caption":"","height":161});
															thumbnails[6177559] = clik.newPhoto({"id":6177559,"src":"IMG_2074_1_1-Edit-2rs_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6177559.html","width":130,"caption":"","height":169});
															thumbnails[6168084] = clik.newPhoto({"id":6168084,"src":"IMG_2136_2new2_rs1_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6168084.html","width":130,"caption":"","height":165});
															thumbnails[6356479] = clik.newPhoto({"id":6356479,"src":"IMG_1563_5-4cp_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6356479.html","width":130,"caption":"","height":194});
															thumbnails[6446213] = clik.newPhoto({"id":6446213,"src":"IMG_2326_1_1-45a1_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_6446213.html","width":130,"caption":"","height":178});
															thumbnails[7325978] = clik.newPhoto({"id":7325978,"src":"IMG_3537-3_1-Edit-Edit-1_web2_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_7325978.html","width":130,"caption":"","height":176});
															thumbnails[8941171] = clik.newPhoto({"id":8941171,"src":"IMG_5544_rs_bw2_300_thumb.jpg","galleries_id":352061,"server_id":5,"link":"photo_8941171.html","width":130,"caption":"","height":181});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[287602] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_287602.html","maxRecords":0.0,"photoIDs":[5104090.0,5104094.0,5104098.0,5104101.0,5107743.0,5107746.0,6168081.0,5107749.0,5446695.0,7325963.0,7317692.0,6877609.0],"skipIndex":0,"section_code":"gallery","featured_images":5104090.0,"id":287602,"singleSection":false});				  						galleries[287603] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Magnetism","link":"gallery_287603.html","maxRecords":0.0,"photoIDs":[5104189.0,5104192.0,5104201.0,5214722.0],"skipIndex":0,"section_code":"gallery","featured_images":5104189.0,"id":287603,"singleSection":false});				  						galleries[352061] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Headshots for Actors","link":"section420136.html","maxRecords":0.0,"photoIDs":[6178726.0,6168044.0,6168052.0,6177557.0,6177559.0,6168084.0,6356479.0,6446213.0,7325978.0,8941171.0],"skipIndex":0,"section_code":"section420136","featured_images":"8941171,7325978,6446213,6356479,6178726,6177559,6177557,6168084,6168052,6168044","id":352061,"singleSection":true});				  						galleries[288450] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Location portraits","link":"gallery_288450.html","maxRecords":0.0,"photoIDs":[5102280.0,5104154.0],"skipIndex":0,"section_code":"gallery","featured_images":"5104154,5102280","id":288450,"singleSection":false});				  						galleries[288457] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Performance & Musicians","link":"gallery_288457.html","maxRecords":0.0,"photoIDs":[5214732.0,5104109.0,7321489.0],"skipIndex":0,"section_code":"gallery","featured_images":"7321489,5214732,5104109","id":288457,"singleSection":false});				  						galleries[422487] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Commercial","link":"gallery_422487.html","maxRecords":0.0,"photoIDs":[7827486.0,7827480.0,7827476.0,8941198.0],"skipIndex":0,"section_code":"gallery","featured_images":"8941198,7827486,7827480,7827476","id":422487,"singleSection":false});				  						galleries[446151] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Dance","link":"gallery_446151.html","maxRecords":0.0,"photoIDs":[8941185.0,8425678.0,8425689.0,8425685.0,8531749.0,8531752.0,8531757.0,8531761.0,8531764.0,8531775.0,8952564.0,8941182.0,8941189.0,9004994.0,9005006.0],"skipIndex":0,"section_code":"gallery","featured_images":"9005006,9004994,8952564,8941189,8941185,8941182,8531775,8531764,8531761,8531757","id":446151,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5107590';
imageSets[2] = '5104189,5104090';
imageSets[3] = '6168044,6168052,6177557,6168084';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/landberle/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/landberle/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/landberle/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 = 'Ian Berle Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.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;
	}
}

			

