window.thumbnails = {};
															thumbnails[6707104] = clik.newPhoto({"id":6707104,"src":"Ireland_Cong1_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707104.html","width":130,"caption":"Cong Ireland","height":92});
															thumbnails[6707108] = clik.newPhoto({"id":6707108,"src":"Flood_Barrier_Wivenhoe_14x101_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707108.html","width":130,"caption":"Flood Barrier Wivenhoe","height":97});
															thumbnails[6707111] = clik.newPhoto({"id":6707111,"src":"Pontoon_Ireland_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707111.html","width":130,"caption":"Lake Pontoon Ireland","height":85});
															thumbnails[6707114] = clik.newPhoto({"id":6707114,"src":"Marsh_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707114.html","width":130,"caption":"Marshland Wivenhoe","height":97});
															thumbnails[6707116] = clik.newPhoto({"id":6707116,"src":"Quay_reflection_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707116.html","width":130,"caption":"Quay Reflection","height":87});
															thumbnails[6707119] = clik.newPhoto({"id":6707119,"src":"Reflection_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707119.html","width":130,"caption":"Reflection","height":181});
															thumbnails[6707121] = clik.newPhoto({"id":6707121,"src":"Sunrise-in-wivenhoe_Essex_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707121.html","width":130,"caption":"Sunrise-Wivenhoe","height":91});
															thumbnails[6707123] = clik.newPhoto({"id":6707123,"src":"Sunset-on-Mersea-Beach_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707123.html","width":130,"caption":"Sunset on Mersea Beach","height":97});
															thumbnails[6707125] = clik.newPhoto({"id":6707125,"src":"View-from-Wiv-Trail_Essex_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_6707125.html","width":130,"caption":"View From Wivenhoe Trail","height":97});
															thumbnails[6707291] = clik.newPhoto({"id":6707291,"src":"Thomas_and_Daniel_Feb_09_003_copy_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707291.html","width":130,"caption":"","height":168});
															thumbnails[6707292] = clik.newPhoto({"id":6707292,"src":"Thomas_and_Daniel_Dec_08_170_copy_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707292.html","width":130,"caption":"","height":160});
															thumbnails[6707293] = clik.newPhoto({"id":6707293,"src":"Thomas_and_Daniel_Apr_09_147_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707293.html","width":130,"caption":"","height":108});
															thumbnails[6707294] = clik.newPhoto({"id":6707294,"src":"Thomas_and_Daniel_Apr_09_121_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707294.html","width":130,"caption":"","height":108});
															thumbnails[6707295] = clik.newPhoto({"id":6707295,"src":"Picture-0351_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707295.html","width":130,"caption":"","height":158});
															thumbnails[6707296] = clik.newPhoto({"id":6707296,"src":"Picture-029_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707296.html","width":130,"caption":"","height":107});
															thumbnails[6707298] = clik.newPhoto({"id":6707298,"src":"Picture-017_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707298.html","width":130,"caption":"","height":149});
															thumbnails[6707299] = clik.newPhoto({"id":6707299,"src":"25-6-06-089_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707299.html","width":130,"caption":"","height":158});
															thumbnails[6707300] = clik.newPhoto({"id":6707300,"src":"Paula_and_Dave_042a_1_copy_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707300.html","width":130,"caption":"","height":93});
															thumbnails[6707304] = clik.newPhoto({"id":6707304,"src":"139_thumb.jpg","galleries_id":366022,"server_id":5,"link":"photo_6707304.html","width":130,"caption":"","height":195});
															thumbnails[6787616] = clik.newPhoto({"id":6787616,"src":"cosmos_1_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787616.html","width":130,"caption":"Cosmos","height":81});
															thumbnails[6787624] = clik.newPhoto({"id":6787624,"src":"flowers-328-12x8_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787624.html","width":130,"caption":"Pansy Butterfly","height":92});
															thumbnails[6787628] = clik.newPhoto({"id":6787628,"src":"Harwich_Flowers_157_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787628.html","width":130,"caption":"Pink Gerberer","height":182});
															thumbnails[6787630] = clik.newPhoto({"id":6787630,"src":"Orange-Flower_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787630.html","width":130,"caption":"Orange Mist","height":92});
															thumbnails[6787641] = clik.newPhoto({"id":6787641,"src":"Picture_066_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787641.html","width":130,"caption":"Orange Gerberer","height":182});
															thumbnails[6787651] = clik.newPhoto({"id":6787651,"src":"sandra_garden_111_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787651.html","width":130,"caption":"Golden Poppy","height":91});
															thumbnails[6787656] = clik.newPhoto({"id":6787656,"src":"White-Tulip-Stamen-10x14_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787656.html","width":130,"caption":"White Tulip","height":182});
															thumbnails[6787658] = clik.newPhoto({"id":6787658,"src":"cosmos_2_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787658.html","width":130,"caption":"Cosmos 2","height":175});
															thumbnails[6787660] = clik.newPhoto({"id":6787660,"src":"cosmos_3_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787660.html","width":130,"caption":"Cosmos 3","height":77});
															thumbnails[6833295] = clik.newPhoto({"id":6833295,"src":"Lily_053_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6833295.html","width":130,"caption":"Yellow Lily","height":87});
															thumbnails[6833298] = clik.newPhoto({"id":6833298,"src":"Cosmos_3_024_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6833298.html","width":130,"caption":"Cosmos 4","height":94});
															thumbnails[6852912] = clik.newPhoto({"id":6852912,"src":"Picture-reflected-trees_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_6852912.html","width":130,"caption":"Reflected Tree","height":173});
															thumbnails[6852916] = clik.newPhoto({"id":6852916,"src":"black-buoy-wivenhoe_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_6852916.html","width":130,"caption":"Black Buoy ","height":164});
															thumbnails[6852924] = clik.newPhoto({"id":6852924,"src":"Marks-Hall-106_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_6852924.html","width":130,"caption":"Marks Hall","height":91});
															thumbnails[6852935] = clik.newPhoto({"id":6852935,"src":"snowy-churchyard-14x10_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_6852935.html","width":130,"caption":"Snowy Churchyard ","height":93});
															thumbnails[6852957] = clik.newPhoto({"id":6852957,"src":"view-from-rose-and-crown_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_6852957.html","width":130,"caption":"River View Wivenhoe","height":102});
															thumbnails[6854730] = clik.newPhoto({"id":6854730,"src":"Beach_Huts_Brightlingsea_018_16x5_thumb.jpg","galleries_id":372034,"server_id":5,"link":"photo_6854730.html","width":130,"caption":"Beach Huts","height":39});
															thumbnails[6854738] = clik.newPhoto({"id":6854738,"src":"Gone_Fishing_16x6_thumb.jpg","galleries_id":372034,"server_id":5,"link":"photo_6854738.html","width":130,"caption":"Gone Fishing","height":49});
															thumbnails[6854796] = clik.newPhoto({"id":6854796,"src":"1_Table_and_Chair_12x8_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854796.html","width":130,"caption":"In The Shade","height":87});
															thumbnails[6854848] = clik.newPhoto({"id":6854848,"src":"geramiaha_10x8_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854848.html","width":130,"caption":"Geramiah","height":163});
															thumbnails[6854859] = clik.newPhoto({"id":6854859,"src":"Momentary_Reflection_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854859.html","width":130,"caption":"Momentary Reflection ","height":130});
															thumbnails[6854867] = clik.newPhoto({"id":6854867,"src":"Sensational_Sax16x10_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854867.html","width":130,"caption":"Sensational Sax","height":208});
															thumbnails[6854875] = clik.newPhoto({"id":6854875,"src":"Zebra-border-w_thumb.gif","galleries_id":366024,"server_id":5,"link":"photo_6854875.html","width":130,"caption":"Zebra","height":91});
															thumbnails[6854887] = clik.newPhoto({"id":6854887,"src":"Basket-and-Bike_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854887.html","width":130,"caption":"Basket and Bike","height":195});
															thumbnails[6854892] = clik.newPhoto({"id":6854892,"src":"tree-spotlight_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_6854892.html","width":130,"caption":"Spotlight","height":183});
															thumbnails[8341220] = clik.newPhoto({"id":8341220,"src":"Flood_Barrier_Wivenhoe_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_8341220.html","width":130,"caption":"Flood Barrier 2 Wivenhoe","height":87});
															thumbnails[8341258] = clik.newPhoto({"id":8341258,"src":"IMG_7013_boardwalk_2_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_8341258.html","width":130,"caption":"Boardwalk Wivenhoe","height":81});
															thumbnails[8341264] = clik.newPhoto({"id":8341264,"src":"Wivenhoe_from_on_high_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_8341264.html","width":130,"caption":"Wivenhoe","height":81});
															thumbnails[8341269] = clik.newPhoto({"id":8341269,"src":"May_2011_056_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_8341269.html","width":130,"caption":"Acer","height":81});
															thumbnails[9027082] = clik.newPhoto({"id":9027082,"src":"5_Quay_Barge_10x16_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_9027082.html","width":130,"caption":"Ship Ahoy!","height":208});
															thumbnails[9027102] = clik.newPhoto({"id":9027102,"src":"View-from-sailing-club14x10_thumb.gif","galleries_id":364107,"server_id":5,"link":"photo_9027102.html","width":130,"caption":"Boat in the mist","height":93});
															thumbnails[9027122] = clik.newPhoto({"id":9027122,"src":"Yellow-rowing-Boat_thumb.jpg","galleries_id":364107,"server_id":5,"link":"photo_9027122.html","width":130,"caption":"Yellow rowing boat","height":156});
															thumbnails[9027133] = clik.newPhoto({"id":9027133,"src":"4_Churchyard_Alresford_10x14_thumb.jpg","galleries_id":366024,"server_id":5,"link":"photo_9027133.html","width":130,"caption":"","height":182});
															thumbnails[9027139] = clik.newPhoto({"id":9027139,"src":"Colchester-castle_thumb.jpg","galleries_id":364108,"server_id":5,"link":"photo_9027139.html","width":130,"caption":"Colchester Castle","height":157});
															thumbnails[6787634] = clik.newPhoto({"id":6787634,"src":"Osteospernum_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787634.html","width":130,"caption":"Osteospernum","height":93});
															thumbnails[6787637] = clik.newPhoto({"id":6787637,"src":"Picture_030_rose_5_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787637.html","width":130,"caption":"Rose","height":93});
															thumbnails[6787647] = clik.newPhoto({"id":6787647,"src":"Red_Poppy_2_thumb.jpg","galleries_id":366023,"server_id":5,"link":"photo_6787647.html","width":130,"caption":"Red Poppy","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[364107] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes 1","link":"gallery_364107.html","maxRecords":0.0,"photoIDs":[6707104.0,6707108.0,6707111.0,6707114.0,6707116.0,6707119.0,6707121.0,6707123.0,6707125.0,8341220.0,8341258.0,8341264.0,9027102.0,9027122.0],"skipIndex":0,"section_code":"gallery","featured_images":"9027122,9027102,8341264,8341258,8341220,6707125,6707123,6707121,6707119,6707116","id":364107,"singleSection":false});				  						galleries[364108] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes Black and White","link":"gallery_364108.html","maxRecords":0.0,"photoIDs":[6852912.0,6852916.0,6852924.0,6852935.0,6852957.0,9027139.0],"skipIndex":0,"section_code":"gallery","featured_images":"9027139,6852957,6852935,6852924,6852916,6852912","id":364108,"singleSection":false});				  						galleries[366024] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fine Art","link":"gallery_366024.html","maxRecords":0.0,"photoIDs":[6854796.0,6854848.0,6854859.0,6854867.0,6854875.0,6854887.0,6854892.0,8341269.0,9027082.0,9027133.0],"skipIndex":0,"section_code":"gallery","featured_images":"9027133,9027082,8341269,6854892,6854887,6854875,6854867,6854859,6854848,6854796","id":366024,"singleSection":false});				  						galleries[366023] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Flowers","link":"gallery_366023.html","maxRecords":0.0,"photoIDs":[6787616.0,6787624.0,6787628.0,6787630.0,6787641.0,6787651.0,6787656.0,6787658.0,6787660.0,6833295.0,6833298.0,6787634.0,6787637.0,6787647.0],"skipIndex":0,"section_code":"gallery","featured_images":"6833298,6833295,6787660,6787658,6787656,6787651,6787647,6787641,6787637,6787634","id":366023,"singleSection":false});				  						galleries[366022] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_366022.html","maxRecords":0.0,"photoIDs":[6707291.0,6707292.0,6707293.0,6707294.0,6707295.0,6707296.0,6707298.0,6707299.0,6707300.0,6707304.0],"skipIndex":0,"section_code":"gallery","featured_images":"6707304,6707300,6707299,6707298,6707296,6707295,6707294,6707293,6707292,6707291","id":366022,"singleSection":false});				  						galleries[372034] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Panoramic","link":"gallery_372034.html","maxRecords":0.0,"photoIDs":[6854730.0,6854738.0],"skipIndex":0,"section_code":"gallery","featured_images":"6854738,6854730","id":372034,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8341220';
imageSets[3] = '8341220';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/francesbel/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/francesbel/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/francesbel/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 = 'Photographic Memories: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp += '<p>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
		else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
											temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="FRANCESBEL">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

		

