window.thumbnails = {};
															thumbnails[1799082] = clik.newPhoto({"id":1799082,"src":"ECHO-BEACH--PORTRAIT--c1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"","height":33});
															thumbnails[6707769] = clik.newPhoto({"id":6707769,"src":"Aurora_tiff_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Aurora","height":130});
															thumbnails[6707981] = clik.newPhoto({"id":6707981,"src":"Porphura_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Porphura","height":130});
															thumbnails[7543502] = clik.newPhoto({"id":7543502,"src":"215_RachelBuck_FragmentedFlower_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Fragmented Flower","height":91});
															thumbnails[7543505] = clik.newPhoto({"id":7543505,"src":"216_RachelBuck_Poppylove_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Poppy Love","height":93});
															thumbnails[7543507] = clik.newPhoto({"id":7543507,"src":"217_RachelBuck_loveheart_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Love Heart","height":91});
															thumbnails[8362368] = clik.newPhoto({"id":8362368,"src":"312055_251010878266418_182960255071481_856215_8374789_s_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Beachcombing","height":129});
															thumbnails[7326186] = clik.newPhoto({"id":7326186,"src":"LightBite_postcardcopy_50_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"http:\/\/lightbite.blogspot.com\/","height":168});
															thumbnails[7326060] = clik.newPhoto({"id":7326060,"src":"Hula_Hoop_Illuminate_I__thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Hula Hoop Illuminate I ","height":98});
															thumbnails[7326064] = clik.newPhoto({"id":7326064,"src":"Hula_Hoop_Illuminate_II_B532CB3E-1EC9-D45B-1C5F936EDFA288AC_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Hula Hoop Illuminate II","height":98});
															thumbnails[2460760] = clik.newPhoto({"id":2460760,"src":"sonar-copyright_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_2460760.html","width":130,"caption":"Sonar","height":130});
															thumbnails[6707826] = clik.newPhoto({"id":6707826,"src":"Aurora-tiff_thumb.jpg","galleries_id":366102,"server_id":18,"link":"photo_6707826.html","width":130,"caption":"Aurora","height":130});
															thumbnails[6708002] = clik.newPhoto({"id":6708002,"src":"Porphura1_thumb.jpg","galleries_id":366102,"server_id":18,"link":"photo_6708002.html","width":130,"caption":"Porphura","height":130});
															thumbnails[1790646] = clik.newPhoto({"id":1790646,"src":"ECHO-BEACH-l3_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1790646.html","width":130,"caption":"Echo Beach ","height":58});
															thumbnails[1790629] = clik.newPhoto({"id":1790629,"src":"ECHO-BEACH-ll4_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1790629.html","width":130,"caption":"Echo Beach II","height":58});
															thumbnails[1790550] = clik.newPhoto({"id":1790550,"src":"ECHO-BEACH-lll3_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1790550.html","width":130,"caption":"Echo Beach III","height":58});
															thumbnails[1791231] = clik.newPhoto({"id":1791231,"src":"Tide lines7_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1791231.html","width":130,"caption":"Tide Lines","height":111});
															thumbnails[1790658] = clik.newPhoto({"id":1790658,"src":"EMERALD-WASH_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1790658.html","width":130,"caption":"Emerald Wash","height":130});
															thumbnails[1799151] = clik.newPhoto({"id":1799151,"src":"untitled1_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1799151.html","width":130,"caption":"Untitled","height":130});
															thumbnails[1801484] = clik.newPhoto({"id":1801484,"src":"Weathered3_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1801484.html","width":130,"caption":"Weathered","height":59});
															thumbnails[1801461] = clik.newPhoto({"id":1801461,"src":"Eventide_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_1801461.html","width":130,"caption":"Eventide","height":42});
															thumbnails[1860645] = clik.newPhoto({"id":1860645,"src":"Yellow Square_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_1860645.html","width":130,"caption":"Yellow Square","height":130});
															thumbnails[1790976] = clik.newPhoto({"id":1790976,"src":"Pink Square_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_1790976.html","width":130,"caption":"Pink Square","height":130});
															thumbnails[6123203] = clik.newPhoto({"id":6123203,"src":"Saffron_sky12_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_6123203.html","width":130,"caption":"Saffron Sky","height":68});
															thumbnails[2390541] = clik.newPhoto({"id":2390541,"src":"CHANGES5_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_2390541.html","width":130,"caption":"Changes","height":371});
															thumbnails[1860504] = clik.newPhoto({"id":1860504,"src":"Tranquil2_thumb.jpg","galleries_id":125187,"server_id":18,"link":"photo_1860504.html","width":130,"caption":"Tranquil","height":426});
															thumbnails[3235522] = clik.newPhoto({"id":3235522,"src":"Echo-Harbour-Creek-for-web_new1_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_3235522.html","width":130,"caption":"Echo Harbour Creek","height":58});
															thumbnails[4071686] = clik.newPhoto({"id":4071686,"src":"Cornwall_I123_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_4071686.html","width":130,"caption":"Cornwall ","height":65});
															thumbnails[4072243] = clik.newPhoto({"id":4072243,"src":"Cornwall-ll-new_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_4072243.html","width":130,"caption":"Cornwall ll","height":65});
															thumbnails[6123399] = clik.newPhoto({"id":6123399,"src":"Cornwall_lll1234567_thumb.jpg","galleries_id":119859,"server_id":18,"link":"photo_6123399.html","width":130,"caption":"Cornwall lll","height":65});
															thumbnails[8362388] = clik.newPhoto({"id":8362388,"src":"Beachcombing1_thumb.jpg","galleries_id":366102,"server_id":18,"link":"photo_8362388.html","width":130,"caption":"Beachcombing","height":130});
															thumbnails[7248672] = clik.newPhoto({"id":7248672,"src":"Boat_Woodbridge__6x4_web_copy_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7248672.html","width":130,"caption":"Clinker, Woodbridge","height":62});
															thumbnails[7248678] = clik.newPhoto({"id":7248678,"src":"Sunset_at_Burnham_4_6x4_web_copy1_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7248678.html","width":130,"caption":"Sunset at Burnham Overy Staithe","height":198});
															thumbnails[7249935] = clik.newPhoto({"id":7249935,"src":"DSC01299_web1_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7249935.html","width":130,"caption":"Catnap 001","height":93});
															thumbnails[7249938] = clik.newPhoto({"id":7249938,"src":"DSC01413_web1_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7249938.html","width":130,"caption":"Catnap 002","height":93});
															thumbnails[7249997] = clik.newPhoto({"id":7249997,"src":"DSC01339_web_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7249997.html","width":130,"caption":"Windows","height":93});
															thumbnails[7250017] = clik.newPhoto({"id":7250017,"src":"DSC01341_web_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7250017.html","width":130,"caption":"A Quiet Moment","height":182});
															thumbnails[7250024] = clik.newPhoto({"id":7250024,"src":"DSC01364_web_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7250024.html","width":130,"caption":"The Catch","height":102});
															thumbnails[7250036] = clik.newPhoto({"id":7250036,"src":"Fishing_boats_thumb.jpg","galleries_id":391909,"server_id":18,"link":"photo_7250036.html","width":130,"caption":"Sardine Boats","height":47});
															thumbnails[7326930] = clik.newPhoto({"id":7326930,"src":"DSC02451a_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7326930.html","width":130,"caption":"Donna and Koby","height":98});
															thumbnails[7326941] = clik.newPhoto({"id":7326941,"src":"DSC02531bb_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7326941.html","width":130,"caption":"Donna, Stu and Koby","height":173});
															thumbnails[7247658] = clik.newPhoto({"id":7247658,"src":"001a_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247658.html","width":130,"caption":"Ketan 001","height":165});
															thumbnails[7247670] = clik.newPhoto({"id":7247670,"src":"002a_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247670.html","width":130,"caption":"Ketan 002","height":165});
															thumbnails[7247884] = clik.newPhoto({"id":7247884,"src":"DSC02204a_web_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7247884.html","width":130,"caption":"Sarah and Saffron","height":260});
															thumbnails[7247677] = clik.newPhoto({"id":7247677,"src":"005a_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247677.html","width":130,"caption":"Ketan 003","height":102});
															thumbnails[7247684] = clik.newPhoto({"id":7247684,"src":"cd_flowers_2_copy_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247684.html","width":130,"caption":"Poppy Love - Cd Cover","height":130});
															thumbnails[7247879] = clik.newPhoto({"id":7247879,"src":"DSC02178_web_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7247879.html","width":130,"caption":"Saffron","height":98});
															thumbnails[7247712] = clik.newPhoto({"id":7247712,"src":"DSC02170_web1_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7247712.html","width":130,"caption":"Southwold Shadows 001","height":173});
															thumbnails[7247717] = clik.newPhoto({"id":7247717,"src":"DSC02171web_thumb.jpg","galleries_id":391931,"server_id":18,"link":"photo_7247717.html","width":130,"caption":"Sothwold Shadows 002","height":98});
															thumbnails[7247594] = clik.newPhoto({"id":7247594,"src":"Hula_Hoop_Illuminate_I_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247594.html","width":130,"caption":"Hula Hoop Illuminate I","height":98});
															thumbnails[7247614] = clik.newPhoto({"id":7247614,"src":"Hula_Hoop_Illuminate_II_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247614.html","width":130,"caption":"Hula Hoop Illuminate II","height":98});
															thumbnails[7379012] = clik.newPhoto({"id":7379012,"src":"Fragmented_Flower123_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7379012.html","width":130,"caption":"Fragmented Flower","height":98});
															thumbnails[7247759] = clik.newPhoto({"id":7247759,"src":"loveheart_for_card_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247759.html","width":130,"caption":"Love Heart 001","height":130});
															thumbnails[7247763] = clik.newPhoto({"id":7247763,"src":"loveheart_for_card_2_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247763.html","width":130,"caption":"Love Heart 002","height":130});
															thumbnails[7247779] = clik.newPhoto({"id":7247779,"src":"Garden_of_eden_a_thumb.jpg","galleries_id":391908,"server_id":18,"link":"photo_7247779.html","width":130,"caption":"Garden of Eden","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[391909] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Contemporary","link":"section465595_391909.html","maxRecords":0.0,"photoIDs":[7248672.0,7248678.0,7249935.0,7249938.0,7249997.0,7250017.0,7250024.0,7250036.0],"skipIndex":0,"section_code":"section465595","featured_images":"7250036,7250024,7250017,7249997,7249938,7249935,7248678,7248672","id":391909,"singleSection":false});				  						galleries[391931] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"section465595_391931.html","maxRecords":0.0,"photoIDs":[7326930.0,7326941.0,7247884.0,7247879.0,7247712.0,7247717.0],"skipIndex":0,"section_code":"section465595","featured_images":"7326941,7326930,7247884,7247879,7247717,7247712","id":391931,"singleSection":false});				  						galleries[391908] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Digital Design","link":"section465595_391908.html","maxRecords":0.0,"photoIDs":[7247658.0,7247670.0,7247677.0,7247684.0,7247594.0,7247614.0,7379012.0,7247759.0,7247763.0,7247779.0],"skipIndex":0,"section_code":"section465595","featured_images":"7379012,7247779,7247763,7247759,7247684,7247677,7247670,7247658,7247614,7247594","id":391908,"singleSection":false});				  						galleries[119859] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 1","link":"gallery_119859.html","maxRecords":0.0,"photoIDs":[1790646.0,1790629.0,1790550.0,1791231.0,1790658.0,1799151.0,1801484.0,1801461.0,3235522.0,4071686.0,4072243.0,6123399.0],"skipIndex":0,"section_code":"gallery","featured_images":1799151.0,"id":119859,"singleSection":false});				  						galleries[125187] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 2","link":"gallery_125187.html","maxRecords":0.0,"photoIDs":[2460760.0,1860645.0,1790976.0,6123203.0,2390541.0,1860504.0],"skipIndex":0,"section_code":"gallery","featured_images":2460760.0,"id":125187,"singleSection":false});				  						galleries[366102] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery 3","link":"gallery_366102.html","maxRecords":0.0,"photoIDs":[6707826.0,6708002.0,8362388.0],"skipIndex":0,"section_code":"gallery","featured_images":"8362388,6708002,6707826","id":366102,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1799082';
imageSets[2] = '2460760,1799151';
imageSets[3] = '8362388,8362368,7543507,7543505,7543502,7379012,7326941,7326930,7326186,7326064,7326060,7250036,7250024,7250017,7249997,7249938,7249935,7248678,7248672,7247884,7247879,7247779,7247763,7247759,7247717,7247712,7247684,7247677,7247670,7247658,7247614,7247594,6708002,6707981,6707826,6707769,6123399,6123203,4072243,4071686,3235522,2460760,2390541,1860645,1860504,1801484,1801461,1799151,1799082,1791231';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/rachelbuck/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/rachelbuck/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 = 'Rachel Buck Abstract Artworks & 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.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="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		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 += '<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;
	}
}

			

