window.thumbnails = {};
															thumbnails[3785659] = clik.newPhoto({"id":3785659,"src":"Picture1_thumb.gif","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":184});
															thumbnails[3798866] = clik.newPhoto({"id":3798866,"src":"Picture11_thumb.gif","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":184});
															thumbnails[3877846] = clik.newPhoto({"id":3877846,"src":"Restaurant_interior__food_030_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"The Private Room","height":98});
															thumbnails[3877843] = clik.newPhoto({"id":3877843,"src":"Photo_rest_cellar_table_10p_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877843.html","width":130,"caption":"The Cellar, perfect for a small intimate party","height":109});
															thumbnails[3877849] = clik.newPhoto({"id":3877849,"src":"Photo_rest_interior_down_specials_4_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877849.html","width":130,"caption":"Specials","height":89});
															thumbnails[3877850] = clik.newPhoto({"id":3877850,"src":"Photo_rest_upstairs_14p_table_5_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877850.html","width":130,"caption":"The Private Room <br>\r\nSet for 14 guests","height":98});
															thumbnails[4129304] = clik.newPhoto({"id":4129304,"src":"Moulin_de_Flagy_Front_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129304.html","width":130,"caption":"Hostellerie du Moulin de Flagy","height":98});
															thumbnails[4129307] = clik.newPhoto({"id":4129307,"src":"Moulin_de_Flagy_interior_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129307.html","width":130,"caption":"Moulin de Flagy - Reception","height":98});
															thumbnails[4129343] = clik.newPhoto({"id":4129343,"src":"p-chateau_montreuil1_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129343.html","width":130,"caption":"Chateau de Montreuil - Montreuil sur Mer","height":79});
															thumbnails[4129348] = clik.newPhoto({"id":4129348,"src":"p-chateau_montreuil_dining_room_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129348.html","width":130,"caption":"Chateau de Montrieul - Dining room","height":79});
															thumbnails[4155706] = clik.newPhoto({"id":4155706,"src":"Auberge_de_la_Mole_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4155706.html","width":130,"caption":"Auberge de la Mole","height":86});
															thumbnails[4221244] = clik.newPhoto({"id":4221244,"src":"la_Mole_Village_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4221244.html","width":130,"caption":"La Mole Village","height":90});
															thumbnails[5071597] = clik.newPhoto({"id":5071597,"src":"portofino_3_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_5071597.html","width":130,"caption":"Portofino, The Italian Riviera","height":104});
															thumbnails[3786963] = clik.newPhoto({"id":3786963,"src":"Restaurant_Photos_-_Tessa_2_038_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3786963.html","width":130,"caption":"The classic onion soup","height":87});
															thumbnails[3786974] = clik.newPhoto({"id":3786974,"src":"Restaurant_Photos_-_Tessa_2_066_thumb.jpg","galleries_id":232378,"server_id":15,"link":"photo_3786974.html","width":130,"caption":"The Rees Walsh family<br>\r\nFrom left; Max Rees, Jenny Walsh, Chris Rees and Geoff Rees","height":89});
															thumbnails[4129291] = clik.newPhoto({"id":4129291,"src":"Fox-Auberge_du_Vieux_Fox-BD1_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129291.html","width":130,"caption":"Auberge du Vieux Fox - Fox Amphoux - Provence","height":129});
															thumbnails[3786950] = clik.newPhoto({"id":3786950,"src":"James_at_Moretons_thumb.jpg","galleries_id":232378,"server_id":15,"link":"photo_3786950.html","width":130,"caption":"James - Doing a stint in the kitchen during a holiday from the UK","height":173});
															thumbnails[3786958] = clik.newPhoto({"id":3786958,"src":"Restaurant_Photos_-_Tessa_022_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3786958.html","width":130,"caption":"Duck liver pate","height":90});
															thumbnails[4129297] = clik.newPhoto({"id":4129297,"src":"Fox-Auberge_du_Vieux_Fox-BD2_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129297.html","width":130,"caption":"Vieux Fox - Dining room","height":104});
															thumbnails[3785180] = clik.newPhoto({"id":3785180,"src":"moretons4_thumb.JPG","galleries_id":232380,"server_id":15,"link":"photo_3785180.html","width":130,"caption":"Salade de Chevre Chaud","height":102});
															thumbnails[3785582] = clik.newPhoto({"id":3785582,"src":"CIMG0014_edited_thumb.JPG","galleries_id":232379,"server_id":15,"link":"photo_3785582.html","width":130,"caption":"Jenny taking an order","height":98});
															thumbnails[4129298] = clik.newPhoto({"id":4129298,"src":"Fox-Auberge_du_Vieux_Fox-BD3_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129298.html","width":130,"caption":"Vieux Fox - View from patio","height":94});
															thumbnails[3785648] = clik.newPhoto({"id":3785648,"src":"Geoff_in_kitchen_3_thumb.jpg","galleries_id":232378,"server_id":15,"link":"photo_3785648.html","width":130,"caption":"Geoff on a break","height":173});
															thumbnails[3877887] = clik.newPhoto({"id":3877887,"src":"Restaurant_interior__food_038_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3877887.html","width":130,"caption":"Snapper on sweet potato mash with<br>\r\nroasted capsicum oil","height":98});
															thumbnails[3786957] = clik.newPhoto({"id":3786957,"src":"Restaurant_Photos_-_Tessa_021_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3786957.html","width":130,"caption":"Bouillabaisse","height":92});
															thumbnails[3786964] = clik.newPhoto({"id":3786964,"src":"Restaurant_Photos_-_Tessa_2_055_thumb.jpg","galleries_id":232379,"server_id":15,"link":"photo_3786964.html","width":130,"caption":"In a rush","height":87});
															thumbnails[4129302] = clik.newPhoto({"id":4129302,"src":"imgh-chateau-cocove-calais_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129302.html","width":130,"caption":"Chateau de Cocove - from the gates","height":82});
															thumbnails[3786966] = clik.newPhoto({"id":3786966,"src":"Restaurant_Photos_-_Tessa_2_059_thumb.jpg","galleries_id":232379,"server_id":15,"link":"photo_3786966.html","width":130,"caption":"Max chatting","height":87});
															thumbnails[3822272] = clik.newPhoto({"id":3822272,"src":"Slow_cooked_lamb_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3822272.html","width":130,"caption":"Slow Cooked Lamb Shoulder with Puy Lentils","height":98});
															thumbnails[4129364] = clik.newPhoto({"id":4129364,"src":"Chateau_de_Cocove_5_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129364.html","width":130,"caption":"Chateau de Cocove - Entrance","height":130});
															thumbnails[3786968] = clik.newPhoto({"id":3786968,"src":"Restaurant_Photos_-_Tessa_2_060_thumb.jpg","galleries_id":232379,"server_id":15,"link":"photo_3786968.html","width":130,"caption":"Pouring wine","height":87});
															thumbnails[3822278] = clik.newPhoto({"id":3822278,"src":"Cote_de_Boeuf_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3822278.html","width":130,"caption":"Cote de Boeuf - <br>\r\nRoast rib of beef for 2 cvts","height":88});
															thumbnails[4129366] = clik.newPhoto({"id":4129366,"src":"Cocove_Cellar_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129366.html","width":130,"caption":"Chateau de Cocove - Cellar","height":51});
															thumbnails[3786953] = clik.newPhoto({"id":3786953,"src":"lastfrinight_134_thumb.jpg","galleries_id":232378,"server_id":15,"link":"photo_3786953.html","width":130,"caption":"Three generations of the Rees Walsh family - Back row Chris & Max Rees<br>\r\nMiddle row Jenny Walsh<br>\r\nFront row Geoff Rees & Joyce Walsh","height":173});
															thumbnails[3877911] = clik.newPhoto({"id":3877911,"src":"Summer_Pudding_-_Tessa_2_028_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3877911.html","width":130,"caption":"Summer Pudding","height":87});
															thumbnails[4129368] = clik.newPhoto({"id":4129368,"src":"Cocove_dining_room_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4129368.html","width":130,"caption":"Chateau de Cocove - dining room","height":100});
															thumbnails[3786970] = clik.newPhoto({"id":3786970,"src":"Restaurant_Photos_-_Tessa_2_064_thumb.jpg","galleries_id":232379,"server_id":15,"link":"photo_3786970.html","width":130,"caption":"The restaurant front at night","height":87});
															thumbnails[3877912] = clik.newPhoto({"id":3877912,"src":"Pot_Creme_2_-_Tessa_2_044_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3877912.html","width":130,"caption":"Pot Creme Framboise","height":87});
															thumbnails[3786961] = clik.newPhoto({"id":3786961,"src":"Restaurant_Photos_-_Tessa_025_thumb.jpg","galleries_id":232380,"server_id":15,"link":"photo_3786961.html","width":130,"caption":"Tarte Citron","height":82});
															thumbnails[4128596] = clik.newPhoto({"id":4128596,"src":"Auberge_dInxent_Front_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4128596.html","width":130,"caption":"Auberge d'Inxent","height":86});
															thumbnails[3785175] = clik.newPhoto({"id":3785175,"src":"moretons2_thumb.JPG","galleries_id":232379,"server_id":15,"link":"photo_3785175.html","width":130,"caption":"View from the bar","height":92});
															thumbnails[3785177] = clik.newPhoto({"id":3785177,"src":"moretons3_thumb.JPG","galleries_id":232379,"server_id":15,"link":"photo_3785177.html","width":130,"caption":"View from the front door","height":85});
															thumbnails[3877848] = clik.newPhoto({"id":3877848,"src":"Photo_rest_down_fromage_mirroe_1_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877848.html","width":130,"caption":"The cheese specials","height":173});
															thumbnails[3785173] = clik.newPhoto({"id":3785173,"src":"moretons1_thumb.JPG","galleries_id":232379,"server_id":15,"link":"photo_3785173.html","width":130,"caption":"View from the stairs","height":196});
															thumbnails[3877844] = clik.newPhoto({"id":3877844,"src":"Photo_rest_citron_poster_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877844.html","width":130,"caption":"The Citron poster","height":206});
															thumbnails[3877845] = clik.newPhoto({"id":3877845,"src":"Photo_rest_sisca_print_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877845.html","width":130,"caption":"The Cassis poster","height":199});
															thumbnails[4128510] = clik.newPhoto({"id":4128510,"src":"Auberge_dInxent_dining_room_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_4128510.html","width":130,"caption":"Auberge d'Inxent - Dining room","height":130});
															thumbnails[3877847] = clik.newPhoto({"id":3877847,"src":"Photo_rest_absinthe_poster_thumb.jpeg","galleries_id":232379,"server_id":15,"link":"photo_3877847.html","width":130,"caption":"The Absinthe poster","height":178});
															thumbnails[5130317] = clik.newPhoto({"id":5130317,"src":"Aux_Pecheurs_dEtaples_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_5130317.html","width":130,"caption":"Restaurant Aux Pecheurs d'Etaples<br>\r\nNr Boulogne","height":92});
															thumbnails[5130302] = clik.newPhoto({"id":5130302,"src":"The_Fruit_de_Mer_at_Aux_Pecheurs_dEtaples__3_thumb.jpg","galleries_id":247189,"server_id":15,"link":"photo_5130302.html","width":130,"caption":"Restaurant Aux Pecheurs d'Etaples<br>\r\nThe Assiette de Fruits de Mer<br>\r\n","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[232378] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Family","link":"gallery_232378.html","maxRecords":0.0,"photoIDs":[3786974.0,3786950.0,3785648.0,3786953.0],"skipIndex":0,"section_code":"gallery","featured_images":3785648.0,"id":232378,"singleSection":false});				  						galleries[232380] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Food","link":"gallery_232380.html","maxRecords":0.0,"photoIDs":[3786963.0,3786958.0,3785180.0,3877887.0,3786957.0,3822272.0,3822278.0,3877911.0,3877912.0,3786961.0],"skipIndex":0,"section_code":"gallery","featured_images":"3822278,3822272,3785180","id":232380,"singleSection":false});				  						galleries[232379] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"The Restaurant","link":"gallery_232379.html","maxRecords":0.0,"photoIDs":[3877843.0,3877849.0,3877850.0,3785582.0,3786964.0,3786966.0,3786968.0,3786970.0,3785175.0,3785177.0,3877848.0,3785173.0,3877844.0,3877845.0,3877847.0],"skipIndex":0,"section_code":"gallery","featured_images":"3785582,3785177,3785175,3785173","id":232379,"singleSection":false});				  						galleries[247189] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Our French Selection","link":"gallery_247189.html","maxRecords":0.0,"photoIDs":[4129304.0,4129307.0,4129343.0,4129348.0,4155706.0,4221244.0,5071597.0,4129291.0,4129297.0,4129298.0,4129302.0,4129364.0,4129366.0,4129368.0,4128596.0,4128510.0,5130317.0,5130302.0],"skipIndex":0,"section_code":"gallery","featured_images":"5130317,5130302,5071597,4221244,4155706,4129368,4129366,4129364,4129348,4129343","id":247189,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3798866';
imageSets[2] = '3785582,3785180,3785648,3822272,3822278,3785175,3785177,3785173';
imageSets[3] = '5130317,5130302,5071597,4221244,4155706,4129368,4129366,4129364,4129348,4129343,4129307,4129304,4129302,4129298,4129297,4129291,4128596,4128510,3877912,3877911,3877887,3877850,3877849,3877848,3877847,3877846,3877845,3877844,3877843,3822278,3822272,3798866,3786974,3786970,3786968,3786966,3786964,3786963,3786961,3786958,3786957,3786953,3786950,3785659,3785648,3785582,3785180,3785177,3785175,3785173';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Moretons/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Moretons/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Moretons/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 = 'Moretons Brasserie: ' + 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;
	}
}

			

