window.thumbnails = {};
															thumbnails[325907] = clik.newPhoto({"id":325907,"src":"japonica desire_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_325907.html","width":130,"caption":"Japonica Desire","height":130});
															thumbnails[5869010] = clik.newPhoto({"id":5869010,"src":"Watervole_for_web_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_5869010.html","width":130,"caption":"Watervole","height":107});
															thumbnails[6312292] = clik.newPhoto({"id":6312292,"src":"001_Grey_Heron_in_flight_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_6312292.html","width":130,"caption":"Grey Heron in Flight","height":115});
															thumbnails[6312295] = clik.newPhoto({"id":6312295,"src":"002_Marbled_White_L_Melanargia_galathea_web_thumb.jpg","galleries_id":350726,"server_id":18,"link":"photo_6312295.html","width":130,"caption":"Marbled White","height":155});
															thumbnails[6374961] = clik.newPhoto({"id":6374961,"src":"003_Carnival_Girl_web_thumb.jpg","galleries_id":352761,"server_id":18,"link":"photo_6374961.html","width":130,"caption":"Carnival Girl","height":194});
															thumbnails[9036389] = clik.newPhoto({"id":9036389,"src":"001_Lolo_CE976D66-1EC9-D45B-1C399C019ED09B2C_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036389.html","width":130,"caption":"Lolo","height":137});
															thumbnails[7254982] = clik.newPhoto({"id":7254982,"src":"_Abstract_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7254982.html","width":130,"caption":"Abstract","height":184});
															thumbnails[325912] = clik.newPhoto({"id":325912,"src":"bearded iris_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_325912.html","width":130,"caption":"Bearded Iris","height":130});
															thumbnails[5837812] = clik.newPhoto({"id":5837812,"src":"Kingfisher_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5837812.html","width":130,"caption":"Kingfisher  ","height":139});
															thumbnails[6320063] = clik.newPhoto({"id":6320063,"src":"001_Yummy_Orange_web_thumb.jpg","galleries_id":350726,"server_id":18,"link":"photo_6320063.html","width":130,"caption":"Yummy Orange","height":128});
															thumbnails[9036390] = clik.newPhoto({"id":9036390,"src":"002_Family_Portrait_CE97898E-1EC9-D45B-1CF76E3780476BF8_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036390.html","width":130,"caption":"Family Portrait","height":66});
															thumbnails[325913] = clik.newPhoto({"id":325913,"src":"Flower_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_325913.html","width":130,"caption":"Flower - No Name","height":130});
															thumbnails[5863506] = clik.newPhoto({"id":5863506,"src":"Blue_Tit_in_Spring_for_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5863506.html","width":130,"caption":"Blue Tit in spring","height":117});
															thumbnails[5868998] = clik.newPhoto({"id":5868998,"src":"Dragonfly_for_web_thumb.jpg","galleries_id":350726,"server_id":18,"link":"photo_5868998.html","width":130,"caption":"Dragonfly","height":96});
															thumbnails[9036391] = clik.newPhoto({"id":9036391,"src":"003_Say_Cheese_CE97ABFA-1EC9-D45B-1C75FC3FA8F5E64C_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036391.html","width":130,"caption":"Say Cheese","height":86});
															thumbnails[326994] = clik.newPhoto({"id":326994,"src":"cyclamenonce_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_326994.html","width":130,"caption":"Cyclamenonce","height":130});
															thumbnails[327010] = clik.newPhoto({"id":327010,"src":"orange buds_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327010.html","width":130,"caption":"Orange Buds","height":130});
															thumbnails[5869066] = clik.newPhoto({"id":5869066,"src":"Robin_in_Winter_for_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5869066.html","width":130,"caption":"Robin in Winter","height":90});
															thumbnails[9036392] = clik.newPhoto({"id":9036392,"src":"CSC_0064_CE97F415-1EC9-D45B-1CA13A8DF9F7069A_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036392.html","width":130,"caption":"Tiles","height":87});
															thumbnails[7254986] = clik.newPhoto({"id":7254986,"src":"Canary_Wharf_Tower_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7254986.html","width":130,"caption":"Canary Wharf Tower","height":187});
															thumbnails[327006] = clik.newPhoto({"id":327006,"src":"thisthle head_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327006.html","width":130,"caption":"Thistle Head","height":130});
															thumbnails[327015] = clik.newPhoto({"id":327015,"src":"morning sun_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327015.html","width":130,"caption":"Morning Sun","height":130});
															thumbnails[5863509] = clik.newPhoto({"id":5863509,"src":"Puffin_in_Flight_for_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5863509.html","width":130,"caption":"Puffin in Flight","height":98});
															thumbnails[5863511] = clik.newPhoto({"id":5863511,"src":"Grey_Heron_for_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5863511.html","width":130,"caption":"Grey Heron","height":96});
															thumbnails[6320052] = clik.newPhoto({"id":6320052,"src":"002_Ladakh_lady_with_a_ram_web_thumb.jpg","galleries_id":352761,"server_id":18,"link":"photo_6320052.html","width":130,"caption":"Ladakd Lady","height":104});
															thumbnails[6374541] = clik.newPhoto({"id":6374541,"src":"002_Bruges_in_April_web_thumb.jpg","galleries_id":352754,"server_id":18,"link":"photo_6374541.html","width":130,"caption":"Bruges in April","height":87});
															thumbnails[9036393] = clik.newPhoto({"id":9036393,"src":"DSC_0025_CE983542-1EC9-D45B-1CBC28A61E65EC57_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036393.html","width":130,"caption":"Stand","height":86});
															thumbnails[7254988] = clik.newPhoto({"id":7254988,"src":"Clock_Face_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7254988.html","width":130,"caption":"Clock Face","height":186});
															thumbnails[327018] = clik.newPhoto({"id":327018,"src":"No Title_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327018.html","width":130,"caption":"No Title","height":130});
															thumbnails[5863512] = clik.newPhoto({"id":5863512,"src":"Herring_Gull_for_web_thumb.jpg","galleries_id":350709,"server_id":18,"link":"photo_5863512.html","width":130,"caption":"Herring Gull","height":112});
															thumbnails[9036394] = clik.newPhoto({"id":9036394,"src":"DSC_0063_CE986026-1EC9-D45B-1CF243AC5C48F551_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_9036394.html","width":130,"caption":"Rock On Spidey","height":190});
															thumbnails[7255234] = clik.newPhoto({"id":7255234,"src":"Flower_Power_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7255234.html","width":130,"caption":"Flower Power","height":186});
															thumbnails[327023] = clik.newPhoto({"id":327023,"src":"thistlehead21_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327023.html","width":130,"caption":"Thistle Head","height":130});
															thumbnails[7255240] = clik.newPhoto({"id":7255240,"src":"Jake_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7255240.html","width":130,"caption":"Jake","height":119});
															thumbnails[327045] = clik.newPhoto({"id":327045,"src":"fuschia bud2_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_327045.html","width":130,"caption":"Fushia Bud","height":130});
															thumbnails[7255248] = clik.newPhoto({"id":7255248,"src":"Las_Vegas_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7255248.html","width":130,"caption":"Las Vegas","height":91});
															thumbnails[7255258] = clik.newPhoto({"id":7255258,"src":"Shapes_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_7255258.html","width":130,"caption":"Shapes","height":173});
															thumbnails[6320060] = clik.newPhoto({"id":6320060,"src":"001_Lilly_web_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_6320060.html","width":130,"caption":"Lily","height":123});
															thumbnails[7255263] = clik.newPhoto({"id":7255263,"src":"South_Downs_thumb.jpg","galleries_id":352754,"server_id":18,"link":"photo_7255263.html","width":130,"caption":"South Downs","height":91});
															thumbnails[7255267] = clik.newPhoto({"id":7255267,"src":"The_Haunted_Farm_thumb.jpg","galleries_id":352754,"server_id":18,"link":"photo_7255267.html","width":130,"caption":"The Haunted Farm","height":76});
															thumbnails[7255271] = clik.newPhoto({"id":7255271,"src":"Untitled_Panorama_thumb.jpg","galleries_id":352754,"server_id":18,"link":"photo_7255271.html","width":130,"caption":"Panorama","height":41});
															thumbnails[6320033] = clik.newPhoto({"id":6320033,"src":"001_Dancing_Bushmen_Balloon_web_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_6320033.html","width":130,"caption":"Dancing Bushman Balloon","height":87});
															thumbnails[6320047] = clik.newPhoto({"id":6320047,"src":"001_Ladakh_Lamayuru__Gompa_seens_to_grow_out_of_the_rock_web_thumb.jpg","galleries_id":352754,"server_id":18,"link":"photo_6320047.html","width":130,"caption":"Ladakh Lamayuru","height":73});
															thumbnails[6320062] = clik.newPhoto({"id":6320062,"src":"002_Headlamp_pattern_web_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_6320062.html","width":130,"caption":"Headlamp Pattern","height":94});
															thumbnails[6320068] = clik.newPhoto({"id":6320068,"src":"002_Columns_web_thumb.jpg","galleries_id":350254,"server_id":18,"link":"photo_6320068.html","width":130,"caption":"Columns","height":173});
															thumbnails[6374447] = clik.newPhoto({"id":6374447,"src":"003_Tulip_at_Keukenhof_Gardens_web_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_6374447.html","width":130,"caption":"Tulip at Keukenhof Gardens","height":87});
															thumbnails[6320056] = clik.newPhoto({"id":6320056,"src":"001_Daffodil_web_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_6320056.html","width":130,"caption":"Daffodill","height":95});
															thumbnails[6320058] = clik.newPhoto({"id":6320058,"src":"002_Olive_Grove_web_thumb.jpg","galleries_id":350710,"server_id":18,"link":"photo_6320058.html","width":130,"caption":"Olive Grove","height":95});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[350254] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"members images","link":"gallery_350254.html","maxRecords":0.0,"photoIDs":[5869010.0,9036389.0,7254982.0,9036390.0,9036391.0,9036392.0,7254986.0,9036393.0,7254988.0,9036394.0,7255234.0,7255240.0,7255248.0,7255258.0,6320033.0,6320062.0,6320068.0],"skipIndex":0,"section_code":"gallery","featured_images":"9036394,9036393,9036392,9036391,9036390,9036389,7255258,7255248,7255240,7255234","id":350254,"singleSection":false});				  						galleries[350709] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"birds","link":"gallery_350709.html","maxRecords":0.0,"photoIDs":[6312292.0,5837812.0,5863506.0,5869066.0,5863509.0,5863511.0,5863512.0],"skipIndex":0,"section_code":"gallery","featured_images":"6312292,5869066,5863512,5863511,5863509,5863506,5837812","id":350709,"singleSection":false});				  						galleries[350726] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"insects","link":"gallery_350726.html","maxRecords":0.0,"photoIDs":[6312295.0,6320063.0,5868998.0],"skipIndex":0,"section_code":"gallery","featured_images":"6320063,6312295,5868998","id":350726,"singleSection":false});				  						galleries[350710] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"flora","link":"gallery_350710.html","maxRecords":0.0,"photoIDs":[325907.0,325912.0,325913.0,326994.0,327010.0,327006.0,327015.0,327018.0,327023.0,327045.0,6320060.0,6374447.0,6320056.0,6320058.0],"skipIndex":0,"section_code":"gallery","featured_images":"6374447,6320060,6320058,6320056,327045,327023,327018,327015,327010,327006","id":350710,"singleSection":false});				  						galleries[350728] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"fauna","link":"gallery_350728.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":350728,"singleSection":false});				  						galleries[352761] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_352761.html","maxRecords":0.0,"photoIDs":[6374961.0,6320052.0],"skipIndex":0,"section_code":"gallery","featured_images":"6374961,6320052","id":352761,"singleSection":false});				  						galleries[352754] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscapes","link":"gallery_352754.html","maxRecords":0.0,"photoIDs":[6374541.0,7255263.0,7255267.0,7255271.0,6320047.0],"skipIndex":0,"section_code":"gallery","featured_images":"7255271,7255267,7255263,6374541,6320047","id":352754,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9036394,9036393,9036392,9036391,9036390,9036389,7255271,7255267,7255263,7255258,7255248,7255240,7255234,7254988,7254986,7254982,6374961,6374541,6374447,6320068,6320063,6320062,6320060,6320058,6320056,6320052,6320047,6320033,6312295,6312292,5869066,5869010,5868998,5863512,5863511,5863509,5863506,5837812,327045,327023,327018,327015,327010,327006,326994,325913,325912,325907';
imageSets[3] = '9036394,9036393,9036392,9036391,9036390,9036389,7255271,7255267,7255263,7255258,7255248,7255240,7255234,7254988,7254986,7254982,6374961,6374541,6374447,6320068,6320063,6320062,6320060,6320058,6320056,6320052,6320047,6320033,6312295,6312292,5869066,5869010,5868998,5863512,5863511,5863509,5863506,5837812,327045,327023,327018,327015,327010,327006,326994,325913,325912,325907';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Colinc/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Colinc/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Colinc/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 = 'Cheam Camera Club: ' + 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;
	}
}

			

