window.thumbnails = {};
															thumbnails[2827498] = clik.newPhoto({"id":2827498,"src":"RecliningStudy450x442_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Reclining Study","height":128});
															thumbnails[2828877] = clik.newPhoto({"id":2828877,"src":"Lfaura37x450_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Laura at work","height":174});
															thumbnails[8135136] = clik.newPhoto({"id":8135136,"src":"LCramer_RadissonBlu_Gorilla2_thumb.JPG","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":98});
															thumbnails[5686781] = clik.newPhoto({"id":5686781,"src":"FlowerGirl_withBirds842x1000_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Flower Girl with Birds","height":154});
															thumbnails[2823478] = clik.newPhoto({"id":2823478,"src":"AFlowerGirl_399x404_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"Flower Girl","height":132});
															thumbnails[2816885] = clik.newPhoto({"id":2816885,"src":"APerosBridge450x391_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_2816885.html","width":130,"caption":"Pero's Bridge, Bristol<br>\r\n","height":113});
															thumbnails[2823976] = clik.newPhoto({"id":2823976,"src":"BristolMontage_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_2823976.html","width":130,"caption":"A Bristol Montage","height":115});
															thumbnails[2826980] = clik.newPhoto({"id":2826980,"src":"GloucesterRoad450x393_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_2826980.html","width":130,"caption":"Gloucester Road","height":113});
															thumbnails[2827615] = clik.newPhoto({"id":2827615,"src":"Horfield2450x329_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_2827615.html","width":130,"caption":"Horfield Parish Church","height":95});
															thumbnails[2835092] = clik.newPhoto({"id":2835092,"src":"TMeads450x335_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_2835092.html","width":130,"caption":"Bristol Temple Meads","height":97});
															thumbnails[3071816] = clik.newPhoto({"id":3071816,"src":"Rudkobing450x330_thumb.jpg","galleries_id":175613,"server_id":5,"link":"photo_3071816.html","width":130,"caption":"Rudkobing, Denmark","height":95});
															thumbnails[5913695] = clik.newPhoto({"id":5913695,"src":"Joker2_992x1000_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913695.html","width":130,"caption":"\"The Flea\"","height":131});
															thumbnails[5913697] = clik.newPhoto({"id":5913697,"src":"Joker3_988x1000_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913697.html","width":130,"caption":"\"A Soldier's Tale\"","height":132});
															thumbnails[5913704] = clik.newPhoto({"id":5913704,"src":"Joker4_980x1000_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913704.html","width":130,"caption":"\"The Nose\" by Nikolai Gogol","height":133});
															thumbnails[5913724] = clik.newPhoto({"id":5913724,"src":"Joker5_1000x993_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913724.html","width":130,"caption":"\"Lieutenant Kije\"","height":129});
															thumbnails[7449717] = clik.newPhoto({"id":7449717,"src":"ThreeRavens_Web_thumb.jpg","galleries_id":403827,"server_id":5,"link":"photo_7449717.html","width":130,"caption":"Three Ravens","height":100});
															thumbnails[7449722] = clik.newPhoto({"id":7449722,"src":"TheLoreli_Web_thumb.jpg","galleries_id":403827,"server_id":5,"link":"photo_7449722.html","width":130,"caption":"The Loreli","height":98});
															thumbnails[7449751] = clik.newPhoto({"id":7449751,"src":"Kore_Web_thumb.jpg","galleries_id":403827,"server_id":5,"link":"photo_7449751.html","width":130,"caption":"Kore","height":100});
															thumbnails[7643154] = clik.newPhoto({"id":7643154,"src":"FlowerGirl_in_Spring_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7643154.html","width":130,"caption":"\"Flower Girl in Spring\"","height":131});
															thumbnails[7643158] = clik.newPhoto({"id":7643158,"src":"Sleeping_2_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7643158.html","width":130,"caption":"\"Sleeping II\"","height":84});
															thumbnails[7643162] = clik.newPhoto({"id":7643162,"src":"Sleeping_I_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7643162.html","width":130,"caption":"\"Sleeping I\"","height":84});
															thumbnails[7643166] = clik.newPhoto({"id":7643166,"src":"TowardsChristchurch_Clifton_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7643166.html","width":130,"caption":"\"Towards Christchurch, Clifton\"","height":134});
															thumbnails[7643171] = clik.newPhoto({"id":7643171,"src":"WelshBack_BristolBridge_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7643171.html","width":130,"caption":"\"Welsh Back and Bristol Bridge\"","height":133});
															thumbnails[8135073] = clik.newPhoto({"id":8135073,"src":"Bristol_Harbourside_StMaryRedcliffe_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_8135073.html","width":130,"caption":"\"Bristol Harbourside with St Mary Redcliffe\"","height":132});
															thumbnails[8135098] = clik.newPhoto({"id":8135098,"src":"PerosBridge_MShed_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_8135098.html","width":130,"caption":"\"Pero's Bridge and M Shed, Bristol\"","height":132});
															thumbnails[8135107] = clik.newPhoto({"id":8135107,"src":"Lunchtime_College_Green_Bristol_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_8135107.html","width":130,"caption":"\"Lunchtime at College Green, Bristol\"","height":132});
															thumbnails[8183630] = clik.newPhoto({"id":8183630,"src":"Crabbing_at_Clevedon_Pier_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_8183630.html","width":130,"caption":"\"Crabbing at Clevedon Pier\"","height":132});
															thumbnails[2823969] = clik.newPhoto({"id":2823969,"src":"PanoramicHarbourside50x229_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_2823969.html","width":130,"caption":"Panoramic Harbourside","height":66});
															thumbnails[7449482] = clik.newPhoto({"id":7449482,"src":"TowardsClifton_Web_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7449482.html","width":130,"caption":"Towards Clifton, Bristol","height":97});
															thumbnails[2827670] = clik.newPhoto({"id":2827670,"src":"ChristchurchSpring1450x331_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_2827670.html","width":130,"caption":"Christchurch in the Spring, Clifton","height":96});
															thumbnails[5913710] = clik.newPhoto({"id":5913710,"src":"Joker5_994x1000_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913710.html","width":130,"caption":"\"Lady Macbeth of Mtsensk\"","height":131});
															thumbnails[7449503] = clik.newPhoto({"id":7449503,"src":"Whitehall_London_Web_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7449503.html","width":130,"caption":"Whitehall, London","height":133});
															thumbnails[7449502] = clik.newPhoto({"id":7449502,"src":"TheNationalGalleryLondon_Web_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7449502.html","width":130,"caption":"The National Gallery, London","height":130});
															thumbnails[7449501] = clik.newPhoto({"id":7449501,"src":"CanaryWharf_Thames_Web_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_7449501.html","width":130,"caption":"Canary Wharf From The Thames","height":128});
															thumbnails[5077695] = clik.newPhoto({"id":5077695,"src":"TowardsClifton091000x773_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077695.html","width":130,"caption":"Towards Clifton, Bristol","height":100});
															thumbnails[5913687] = clik.newPhoto({"id":5913687,"src":"Joker1_1000x980_thumb.jpg","galleries_id":333723,"server_id":5,"link":"photo_5913687.html","width":130,"caption":"\"The Jazz Suite\"","height":127});
															thumbnails[3075951] = clik.newPhoto({"id":3075951,"src":"StMichaelsHill450x301_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_3075951.html","width":130,"caption":"St Michael's Hill, Bristol","height":87});
															thumbnails[4427843] = clik.newPhoto({"id":4427843,"src":"Millennium_Bridge_London_979x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_4427843.html","width":130,"caption":"Millennium Bridge, London","height":133});
															thumbnails[4427847] = clik.newPhoto({"id":4427847,"src":"ThroughTowerBridge_London_976x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_4427847.html","width":130,"caption":"Through Tower Bridge, London","height":133});
															thumbnails[5941066] = clik.newPhoto({"id":5941066,"src":"FGirl_Chair_Bird996x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_5941066.html","width":130,"caption":"\"Flower Girl - Bird on a Chair\"","height":131});
															thumbnails[5077717] = clik.newPhoto({"id":5077717,"src":"BristolMontagePrint448x396_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077717.html","width":130,"caption":"A Bristol Montage","height":115});
															thumbnails[5876524] = clik.newPhoto({"id":5876524,"src":"GoodByeTree3_862x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_5876524.html","width":130,"caption":"\"The Goodbye Tree III\"","height":151});
															thumbnails[5876544] = clik.newPhoto({"id":5876544,"src":"BirdGarden2_755x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_5876544.html","width":130,"caption":"\"Bird Garden I\".  ","height":172});
															thumbnails[5876543] = clik.newPhoto({"id":5876543,"src":"BirdGarden1_767x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_5876543.html","width":130,"caption":"\"Bird Garden II\"","height":170});
															thumbnails[5876557] = clik.newPhoto({"id":5876557,"src":"The_GoodByeTree4_Loan_810x1000_thumb.jpg","galleries_id":176369,"server_id":5,"link":"photo_5876557.html","width":130,"caption":"\"The Goodbye Tree\"","height":161});
															thumbnails[5077736] = clik.newPhoto({"id":5077736,"src":"APerosBridgePrint450x391_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077736.html","width":130,"caption":"Pero's Bridge, Bristol ","height":113});
															thumbnails[5077767] = clik.newPhoto({"id":5077767,"src":"Gloucester_RoadPrint1000x734_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077767.html","width":130,"caption":"Gloucester Road, Bristol","height":96});
															thumbnails[5077754] = clik.newPhoto({"id":5077754,"src":"AFlowerGirlPrint399x403_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077754.html","width":130,"caption":"Flower Girl","height":132});
															thumbnails[5077759] = clik.newPhoto({"id":5077759,"src":"FlowerGirlSnailsPrint977x1000_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077759.html","width":130,"caption":"Flower Girl with Snails","height":133});
															thumbnails[5941107] = clik.newPhoto({"id":5941107,"src":"FlowerGirl_withBirds_Crop1000x1000_878F2DE4-1D09-001F-99D23CAAE83B99D8_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5941107.html","width":130,"caption":"\"Flower Girl with Birds\"","height":130});
															thumbnails[5077730] = clik.newPhoto({"id":5077730,"src":"HepworthSculpturePrint337x449_thumb.jpg","galleries_id":287231,"server_id":5,"link":"photo_5077730.html","width":130,"caption":"Barbara Hepworth's Sculpture Garden, Cornwall","height":174});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[176369] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Original Paintings For Sale","link":"gallery_176369.html","maxRecords":0.0,"photoIDs":[7643154.0,7643158.0,7643162.0,7643166.0,7643171.0,8135073.0,8135098.0,8135107.0,8183630.0,7449482.0,7449503.0,7449502.0,7449501.0,4427843.0,4427847.0,5941066.0,5876524.0,5876544.0,5876543.0,5876557.0],"skipIndex":0,"section_code":"gallery","featured_images":"8183630,8135107,8135098,8135073,7643171,7643166,7643162,7643158,7643154,7449503","id":176369,"singleSection":false});				  						galleries[287231] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Limited Edition Prints For Sale","link":"gallery_287231.html","maxRecords":0.0,"photoIDs":[2823969.0,2827670.0,5077695.0,3075951.0,5077717.0,5077736.0,5077767.0,5077754.0,5077759.0,5941107.0,5077730.0],"skipIndex":0,"section_code":"gallery","featured_images":"5941107,5077767,5077759,5077754,5077736,5077730,5077717,5077695,3075951,2827670","id":287231,"singleSection":false});				  						galleries[333723] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"A Musical Collaboration - Part 1","link":"gallery_333723.html","maxRecords":0.0,"photoIDs":[5913695.0,5913697.0,5913704.0,5913724.0,5913710.0,5913687.0],"skipIndex":0,"section_code":"gallery","featured_images":"5913724,5913710,5913704,5913697,5913695,5913687","id":333723,"singleSection":false});				  						galleries[403827] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"A Musical Collaboration - Part II","link":"gallery_403827.html","maxRecords":0.0,"photoIDs":[7449717.0,7449722.0,7449751.0],"skipIndex":0,"section_code":"gallery","featured_images":"7449751,7449722,7449717","id":403827,"singleSection":false});				  						galleries[175613] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Previous Work - Cityscapes","link":"gallery_175613.html","maxRecords":0.0,"photoIDs":[2816885.0,2823976.0,2826980.0,2827615.0,2835092.0,3071816.0],"skipIndex":0,"section_code":"gallery","featured_images":"2823976,2816885","id":175613,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8135136';
imageSets[2] = '2823976,2816885';
imageSets[3] = '8183630,8135136,8135107,8135098,8135073,7643171,7643166,7643162,7643158,7643154,7449751,7449722,7449717,7449503,7449502,7449501,7449482,5941107,5941066,5913724,5913710,5913704,5913697,5913695,5913687,5876557,5876544,5876543,5876524,5686781,5077767,5077759,5077754,5077736,5077730,5077717,5077695,4427847,4427843,3075951,3071816,2835092,2828877,2827670,2827615,2827498,2826980,2823976,2823969,2823478';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ljcramer/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/ljcramer/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 = 'Laura Cramer Paintings: ' + 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 !== '' || this.payment_groups_id !== '') {
			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;
	}
}

			

