window.thumbnails = {};
															thumbnails[880200] = clik.newPhoto({"id":880200,"src":"IMG_4014_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880200.html","width":130,"caption":"","height":81});
															thumbnails[880214] = clik.newPhoto({"id":880214,"src":"IMG_1018_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880214.html","width":130,"caption":"","height":110});
															thumbnails[880216] = clik.newPhoto({"id":880216,"src":"IMG_1156_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880216.html","width":130,"caption":"","height":154});
															thumbnails[880219] = clik.newPhoto({"id":880219,"src":"IMG_1172_thumb.jpg","galleries_id":67385,"server_id":18,"link":"photo_880219.html","width":130,"caption":"","height":110});
															thumbnails[880221] = clik.newPhoto({"id":880221,"src":"IMG_84131_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880221.html","width":130,"caption":"","height":195});
															thumbnails[880224] = clik.newPhoto({"id":880224,"src":"IMG_9287_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880224.html","width":130,"caption":"","height":195});
															thumbnails[880226] = clik.newPhoto({"id":880226,"src":"IMG_7860_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880226.html","width":130,"caption":"","height":110});
															thumbnails[880228] = clik.newPhoto({"id":880228,"src":"IMG_2063_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880228.html","width":130,"caption":"","height":188});
															thumbnails[880229] = clik.newPhoto({"id":880229,"src":"IMG_0167_465D9939-1EC9-D45B-1CA878030A006873_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880229.html","width":130,"caption":"","height":190});
															thumbnails[880234] = clik.newPhoto({"id":880234,"src":"IMG_6167_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880234.html","width":130,"caption":"","height":87});
															thumbnails[880237] = clik.newPhoto({"id":880237,"src":"IMG_5069_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880237.html","width":130,"caption":"","height":154});
															thumbnails[880242] = clik.newPhoto({"id":880242,"src":"IMG_0039_1BCD33C3-1D09-001F-9954670322CD6ACF_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880242.html","width":130,"caption":"","height":190});
															thumbnails[880245] = clik.newPhoto({"id":880245,"src":"IMG_5333_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880245.html","width":130,"caption":"","height":89});
															thumbnails[880247] = clik.newPhoto({"id":880247,"src":"IMG_1121_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880247.html","width":130,"caption":"","height":90});
															thumbnails[880248] = clik.newPhoto({"id":880248,"src":"IMG_3020_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880248.html","width":130,"caption":"","height":188});
															thumbnails[880251] = clik.newPhoto({"id":880251,"src":"IMG_6326_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880251.html","width":130,"caption":"","height":66});
															thumbnails[880253] = clik.newPhoto({"id":880253,"src":"IMG_8699_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880253.html","width":130,"caption":"","height":90});
															thumbnails[880256] = clik.newPhoto({"id":880256,"src":"IMG_7906_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880256.html","width":130,"caption":"","height":80});
															thumbnails[880258] = clik.newPhoto({"id":880258,"src":"IMG_7989_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880258.html","width":130,"caption":"","height":95});
															thumbnails[880260] = clik.newPhoto({"id":880260,"src":"IMG_8423_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880260.html","width":130,"caption":"","height":130});
															thumbnails[880263] = clik.newPhoto({"id":880263,"src":"IMG_6073_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880263.html","width":130,"caption":"","height":187});
															thumbnails[880264] = clik.newPhoto({"id":880264,"src":"IMG_0083_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_880264.html","width":130,"caption":"","height":162});
															thumbnails[884563] = clik.newPhoto({"id":884563,"src":"IMG_5002_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884563.html","width":130,"caption":"","height":90});
															thumbnails[884565] = clik.newPhoto({"id":884565,"src":"IMG_3808_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884565.html","width":130,"caption":"","height":189});
															thumbnails[884573] = clik.newPhoto({"id":884573,"src":"IMG_0925_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884573.html","width":130,"caption":"","height":189});
															thumbnails[884574] = clik.newPhoto({"id":884574,"src":"IMG_8564_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884574.html","width":130,"caption":"","height":219});
															thumbnails[884576] = clik.newPhoto({"id":884576,"src":"IMG_5197_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884576.html","width":130,"caption":"","height":90});
															thumbnails[884577] = clik.newPhoto({"id":884577,"src":"IMG_1019_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884577.html","width":130,"caption":"","height":106});
															thumbnails[884578] = clik.newPhoto({"id":884578,"src":"IMG_0192_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884578.html","width":130,"caption":"","height":195});
															thumbnails[884581] = clik.newPhoto({"id":884581,"src":"IMG_4022_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884581.html","width":130,"caption":"","height":153});
															thumbnails[884584] = clik.newPhoto({"id":884584,"src":"IMG_0155_8959E269-24E8-5EC4-4F011D8169C37751_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884584.html","width":130,"caption":"","height":190});
															thumbnails[884586] = clik.newPhoto({"id":884586,"src":"IMG_9439_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884586.html","width":130,"caption":"","height":110});
															thumbnails[884591] = clik.newPhoto({"id":884591,"src":"IMG_5176_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884591.html","width":130,"caption":"","height":241});
															thumbnails[884595] = clik.newPhoto({"id":884595,"src":"IMG_0027_0F137D70-1D09-001F-99CD286391FFDE24_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884595.html","width":130,"caption":"","height":190});
															thumbnails[884597] = clik.newPhoto({"id":884597,"src":"IMG_71881_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884597.html","width":130,"caption":"","height":188});
															thumbnails[884598] = clik.newPhoto({"id":884598,"src":"IMG_8068_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884598.html","width":130,"caption":"","height":90});
															thumbnails[884599] = clik.newPhoto({"id":884599,"src":"IMG_2086_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884599.html","width":130,"caption":"","height":154});
															thumbnails[884603] = clik.newPhoto({"id":884603,"src":"IMG_8671_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884603.html","width":130,"caption":"","height":69});
															thumbnails[884604] = clik.newPhoto({"id":884604,"src":"IMG_6468_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884604.html","width":130,"caption":"","height":154});
															thumbnails[884606] = clik.newPhoto({"id":884606,"src":"IMG_8042_8F3738F3-1EC9-DFB6-09D60F584DDEBF8E_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884606.html","width":130,"caption":"","height":130});
															thumbnails[884619] = clik.newPhoto({"id":884619,"src":"IMG_0376_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884619.html","width":130,"caption":"","height":87});
															thumbnails[884620] = clik.newPhoto({"id":884620,"src":"IMG_2699_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884620.html","width":130,"caption":"","height":195});
															thumbnails[884622] = clik.newPhoto({"id":884622,"src":"IMG_1142_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884622.html","width":130,"caption":"","height":120});
															thumbnails[884631] = clik.newPhoto({"id":884631,"src":"Copy_of_sarah_14_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884631.html","width":130,"caption":"","height":93});
															thumbnails[884632] = clik.newPhoto({"id":884632,"src":"IMG_3173_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884632.html","width":130,"caption":"","height":87});
															thumbnails[884634] = clik.newPhoto({"id":884634,"src":"IMG_0053_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884634.html","width":130,"caption":"","height":130});
															thumbnails[884636] = clik.newPhoto({"id":884636,"src":"IMG_5921_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884636.html","width":130,"caption":"","height":193});
															thumbnails[884639] = clik.newPhoto({"id":884639,"src":"IMG_0048_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884639.html","width":130,"caption":"","height":190});
															thumbnails[884643] = clik.newPhoto({"id":884643,"src":"IMG_8591_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884643.html","width":130,"caption":"","height":130});
															thumbnails[884646] = clik.newPhoto({"id":884646,"src":"IMG_9749_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884646.html","width":130,"caption":"","height":130});
															thumbnails[884647] = clik.newPhoto({"id":884647,"src":"IMG_0027_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884647.html","width":130,"caption":"","height":193});
															thumbnails[884652] = clik.newPhoto({"id":884652,"src":"IMG_3146_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884652.html","width":130,"caption":"","height":87});
															thumbnails[884656] = clik.newPhoto({"id":884656,"src":"IMG_3965_thumb.JPG","galleries_id":67529,"server_id":18,"link":"photo_884656.html","width":130,"caption":"","height":87});
															thumbnails[884665] = clik.newPhoto({"id":884665,"src":"gm_thumb.jpg","galleries_id":67528,"server_id":18,"link":"photo_884665.html","width":130,"caption":"","height":163});
															thumbnails[884670] = clik.newPhoto({"id":884670,"src":"IMG_4995gm_thumb.jpg","galleries_id":67528,"server_id":18,"link":"photo_884670.html","width":130,"caption":"","height":163});
															thumbnails[884672] = clik.newPhoto({"id":884672,"src":"IMG_4990gm_thumb.jpg","galleries_id":67528,"server_id":18,"link":"photo_884672.html","width":130,"caption":"","height":173});
															thumbnails[884676] = clik.newPhoto({"id":884676,"src":"IMG_5618gm_thumb.jpg","galleries_id":67528,"server_id":18,"link":"photo_884676.html","width":130,"caption":"","height":173});
															thumbnails[884681] = clik.newPhoto({"id":884681,"src":"IMG_5013gm_thumb.jpg","galleries_id":67528,"server_id":18,"link":"photo_884681.html","width":130,"caption":"","height":173});
															thumbnails[884693] = clik.newPhoto({"id":884693,"src":"IMG_2142_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884693.html","width":130,"caption":"","height":189});
															thumbnails[884694] = clik.newPhoto({"id":884694,"src":"IMG_1154_thumb.JPG","galleries_id":67385,"server_id":18,"link":"photo_884694.html","width":130,"caption":"","height":189});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[67385] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_67385.html","maxRecords":0.0,"photoIDs":[880200.0,880214.0,880216.0,880219.0,880221.0,880224.0,880226.0,880228.0,880229.0,880234.0,880237.0,880242.0,880245.0,880247.0,880248.0,880251.0,880253.0,880256.0,880258.0,880260.0,880263.0,880264.0,884563.0,884565.0,884573.0,884574.0,884576.0,884577.0,884578.0,884581.0,884584.0,884586.0,884591.0,884595.0,884597.0,884598.0,884599.0,884603.0,884604.0,884606.0,884619.0,884620.0,884622.0,884693.0,884694.0],"skipIndex":0,"section_code":"gallery","featured_images":884693.0,"id":67385,"singleSection":false});				  						galleries[67529] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_67529.html","maxRecords":0.0,"photoIDs":[884631.0,884632.0,884634.0,884636.0,884639.0,884643.0,884646.0,884647.0,884652.0,884656.0],"skipIndex":0,"section_code":"gallery","featured_images":884639.0,"id":67529,"singleSection":false});				  						galleries[67528] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Buildings","link":"gallery_67528.html","maxRecords":0.0,"photoIDs":[884665.0,884670.0,884672.0,884676.0,884681.0],"skipIndex":0,"section_code":"gallery","featured_images":"884681,884670","id":67528,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '884693,880214,880200';
imageSets[2] = '884693,884681,884670,884639';
imageSets[3] = '884694,884693,884681,884676,884672,884670,884665,884656,884652,884647,884646,884643,884639,884636,884634,884632,884631,884622,884620,884619,884606,884604,884603,884599,884598,884597,884595,884591,884586,884584,884581,884578,884577,884576,884574,884573,884565,884563,880264,880263,880260,880258,880256,880253,880251,880248,880247,880245,880242,880237';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Stephenmilner/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Stephenmilner/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 = 'Stephen Milner 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;
	}
}

			

