window.thumbnails = {};
															thumbnails[3804888] = clik.newPhoto({"id":3804888,"src":"A_Winters_Prom_thumb.jpg","galleries_id":328272,"server_id":18,"link":"photo_3804888.html","width":130,"caption":"1st...Club Competition...Open","height":87});
															thumbnails[7337274] = clik.newPhoto({"id":7337274,"src":"Forgotten_1st_Colour_Print_027337BD-1EC9-D45B-1C535C53A75D162E_thumb.jpg","galleries_id":327933,"server_id":18,"link":"photo_7337274.html","width":130,"caption":"1st Club Competition.... Open","height":184});
															thumbnails[8213807] = clik.newPhoto({"id":8213807,"src":"Gary_Heath_-_Leading_Light_thumb.jpg","galleries_id":477675,"server_id":18,"link":"photo_8213807.html","width":130,"caption":"1st..B Group Club Club Competition...Open","height":86});
															thumbnails[7159274] = clik.newPhoto({"id":7159274,"src":"Capital_captures_1_thumb.jpg","galleries_id":386983,"server_id":18,"link":"photo_7159274.html","width":130,"caption":"Panel of three colour","height":92});
															thumbnails[916553] = clik.newPhoto({"id":916553,"src":"The_Wreck_1_thumb.jpg","galleries_id":477675,"server_id":38,"link":"photo_916553.html","width":130,"caption":"1st...B Group Competition...Open","height":87});
															thumbnails[8782904] = clik.newPhoto({"id":8782904,"src":"Capital_captures_212_thumb.jpg","galleries_id":386983,"server_id":18,"link":"photo_8782904.html","width":130,"caption":"Panel of Three  colour     First","height":184});
															thumbnails[8213916] = clik.newPhoto({"id":8213916,"src":"A_study_in_blue_3rd_monochrome_Print_thumb.jpg","galleries_id":328272,"server_id":18,"link":"photo_8213916.html","width":130,"caption":"1st...Club...Competition...open","height":194});
															thumbnails[8724170] = clik.newPhoto({"id":8724170,"src":"Gary_Heath_-_Place_to_Pray_thumb.jpg","galleries_id":477675,"server_id":18,"link":"photo_8724170.html","width":130,"caption":"1st B Group Club Competition Open","height":86});
															thumbnails[8782907] = clik.newPhoto({"id":8782907,"src":"Capital_captures_3_thumb.jpg","galleries_id":386983,"server_id":18,"link":"photo_8782907.html","width":130,"caption":"Panel of Three  winner","height":92});
															thumbnails[7627539] = clik.newPhoto({"id":7627539,"src":"Human_statues_thumb.jpg","galleries_id":327933,"server_id":18,"link":"photo_7627539.html","width":130,"caption":"1st...Club Competition...Open","height":107});
															thumbnails[3804872] = clik.newPhoto({"id":3804872,"src":"_DSC6221LRFINAL_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3804872.html","width":130,"caption":"","height":130});
															thumbnails[7362865] = clik.newPhoto({"id":7362865,"src":"2012-01-17_152205_IMG_2469_thumb.JPG","galleries_id":327933,"server_id":38,"link":"photo_7362865.html","width":130,"caption":"1st Club Competition...Open ","height":87});
															thumbnails[909419] = clik.newPhoto({"id":909419,"src":"Leading_Light_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_909419.html","width":130,"caption":"","height":92});
															thumbnails[7340642] = clik.newPhoto({"id":7340642,"src":"Trunk_Call_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7340642.html","width":130,"caption":"","height":92});
															thumbnails[3804887] = clik.newPhoto({"id":3804887,"src":"Old_Friends_lowres_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3804887.html","width":130,"caption":"","height":92});
															thumbnails[4194926] = clik.newPhoto({"id":4194926,"src":"DSC_0015mono_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_4194926.html","width":130,"caption":"","height":75});
															thumbnails[1193586] = clik.newPhoto({"id":1193586,"src":"DSC_0035mono_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_1193586.html","width":130,"caption":"","height":74});
															thumbnails[3815498] = clik.newPhoto({"id":3815498,"src":"SmallPortions_LR_hc_thumb.JPG","galleries_id":327980,"server_id":18,"link":"photo_3815498.html","width":130,"caption":"","height":152});
															thumbnails[3804852] = clik.newPhoto({"id":3804852,"src":"_MG_0492_edited-3_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3804852.html","width":130,"caption":"","height":92});
															thumbnails[3834759] = clik.newPhoto({"id":3834759,"src":"_MG_0047_edited-1_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3834759.html","width":130,"caption":"","height":133});
															thumbnails[1169741] = clik.newPhoto({"id":1169741,"src":"Youre_gonna_get_by_wet_alison1_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_1169741.html","width":130,"caption":"","height":92});
															thumbnails[3804865] = clik.newPhoto({"id":3804865,"src":"The_Low_Lighthouse_HIGHLY_COMMENDED_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3804865.html","width":130,"caption":"","height":92});
															thumbnails[8401239] = clik.newPhoto({"id":8401239,"src":"Happeny_pier_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8401239.html","width":130,"caption":"","height":92});
															thumbnails[8480507] = clik.newPhoto({"id":8480507,"src":"_MG_0543_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8480507.html","width":130,"caption":"","height":175});
															thumbnails[8213800] = clik.newPhoto({"id":8213800,"src":"1_coming_in_to_land_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8213800.html","width":130,"caption":"","height":87});
															thumbnails[8674036] = clik.newPhoto({"id":8674036,"src":"Night_Stalker_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8674036.html","width":130,"caption":"","height":92});
															thumbnails[8213829] = clik.newPhoto({"id":8213829,"src":"3_jet_skier_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8213829.html","width":130,"caption":"","height":87});
															thumbnails[8316590] = clik.newPhoto({"id":8316590,"src":"The_enchanted_tree_by_the_mill-_2nd_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8316590.html","width":130,"caption":"","height":97});
															thumbnails[8291980] = clik.newPhoto({"id":8291980,"src":"Lady_In_Red_1st_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8291980.html","width":130,"caption":"","height":110});
															thumbnails[8292027] = clik.newPhoto({"id":8292027,"src":"Maritime_Mayhem_2nd_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8292027.html","width":130,"caption":"","height":92});
															thumbnails[8316559] = clik.newPhoto({"id":8316559,"src":"Let_me_out-3rd_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8316559.html","width":130,"caption":"","height":78});
															thumbnails[8401194] = clik.newPhoto({"id":8401194,"src":"Pirate_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8401194.html","width":130,"caption":"","height":184});
															thumbnails[8673932] = clik.newPhoto({"id":8673932,"src":"red_wine_30.12tex_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8673932.html","width":130,"caption":"","height":92});
															thumbnails[8674052] = clik.newPhoto({"id":8674052,"src":"Water_People_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8674052.html","width":130,"caption":"","height":92});
															thumbnails[8674030] = clik.newPhoto({"id":8674030,"src":"After_the_Fire_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8674030.html","width":130,"caption":"","height":92});
															thumbnails[2674039] = clik.newPhoto({"id":2674039,"src":"Houghton_Mill_thumb.jpg","galleries_id":327946,"server_id":18,"link":"photo_2674039.html","width":130,"caption":"Best of Season...Mono","height":88});
															thumbnails[7014338] = clik.newPhoto({"id":7014338,"src":"_Memories_3_2639_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7014338.html","width":130,"caption":"","height":92});
															thumbnails[7340569] = clik.newPhoto({"id":7340569,"src":"Maldon_view_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7340569.html","width":130,"caption":"","height":89});
															thumbnails[7337406] = clik.newPhoto({"id":7337406,"src":"red_tulip_04_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7337406.html","width":130,"caption":"","height":184});
															thumbnails[916749] = clik.newPhoto({"id":916749,"src":"Summer_Fruits_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_916749.html","width":130,"caption":"April...1st Summer Fruits","height":130});
															thumbnails[7337376] = clik.newPhoto({"id":7337376,"src":"BabyTomatoes_small_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7337376.html","width":130,"caption":"","height":130});
															thumbnails[5796898] = clik.newPhoto({"id":5796898,"src":"The_Meeting_Place_thumb.jpg","galleries_id":327946,"server_id":18,"link":"photo_5796898.html","width":130,"caption":" Best of Season...Colour","height":92});
															thumbnails[3804844] = clik.newPhoto({"id":3804844,"src":"Crimson_Eclipse_1st_place12_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3804844.html","width":130,"caption":"","height":184});
															thumbnails[5860564] = clik.newPhoto({"id":5860564,"src":"Wrabness_Panorama_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_5860564.html","width":130,"caption":"","height":39});
															thumbnails[7620430] = clik.newPhoto({"id":7620430,"src":"Fresh_Breath_2nd_Place_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7620430.html","width":130,"caption":"","height":92});
															thumbnails[7627535] = clik.newPhoto({"id":7627535,"src":"_MG_0107_edited-1_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_7627535.html","width":130,"caption":"","height":184});
															thumbnails[3807082] = clik.newPhoto({"id":3807082,"src":"DSC_4123-boatlow-res_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3807082.html","width":130,"caption":"","height":95});
															thumbnails[3037503] = clik.newPhoto({"id":3037503,"src":"Cocktails_LR_03_thumb.JPG","galleries_id":327980,"server_id":18,"link":"photo_3037503.html","width":130,"caption":"","height":58});
															thumbnails[8316564] = clik.newPhoto({"id":8316564,"src":"Waiting_in_the_wings_1st_mono_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_8316564.html","width":130,"caption":"","height":196});
															thumbnails[3834874] = clik.newPhoto({"id":3834874,"src":"_MG_9976_edited-3_thumb.jpg","galleries_id":327980,"server_id":18,"link":"photo_3834874.html","width":130,"caption":"","height":92});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[327933] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Group A Colour Competition Winners 2012","link":"gallery_327933.html","maxRecords":0.0,"photoIDs":[7337274.0,7627539.0,7362865.0],"skipIndex":0,"section_code":"gallery","featured_images":"7627539,7362865,7337274","id":327933,"singleSection":false});				  						galleries[328272] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Group A Monochrome Competition Winners 2012","link":"gallery_328272.html","maxRecords":0.0,"photoIDs":[3804888.0,8213916.0],"skipIndex":0,"section_code":"gallery","featured_images":"8213916,3804888","id":328272,"singleSection":false});				  						galleries[477675] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"(B) Group Competition Winners 2012","link":"gallery_477675.html","maxRecords":0.0,"photoIDs":[8213807.0,916553.0,8724170.0],"skipIndex":0,"section_code":"gallery","featured_images":"8724170,8213807,916553","id":477675,"singleSection":false});				  						galleries[327980] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Members Photo Gallery","link":"gallery_327980.html","maxRecords":0.0,"photoIDs":[3804872.0,909419.0,7340642.0,3804887.0,4194926.0,1193586.0,3815498.0,3804852.0,3834759.0,1169741.0,3804865.0,8401239.0,8480507.0,8213800.0,8674036.0,8213829.0,8316590.0,8291980.0,8292027.0,8316559.0,8401194.0,8673932.0,8674052.0,8674030.0,7014338.0,7340569.0,7337406.0,916749.0,7337376.0,3804844.0,5860564.0,7620430.0,7627535.0,3807082.0,3037503.0,8316564.0,3834874.0],"skipIndex":0,"section_code":"gallery","featured_images":"8674052,8674036,8674030,8673932,8480507,8401239,8401194,8316590,8316564,8316559","id":327980,"singleSection":false});				  						galleries[327946] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Best Of Season","link":"gallery_327946.html","maxRecords":0.0,"photoIDs":[2674039.0,5796898.0],"skipIndex":0,"section_code":"gallery","featured_images":"5796898,2674039","id":327946,"singleSection":false});				  						galleries[386983] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Panel of Three Winners 2010","link":"gallery_386983.html","maxRecords":0.0,"photoIDs":[7159274.0,8782904.0,8782907.0],"skipIndex":0,"section_code":"gallery","featured_images":"8782907,8782904,7159274","id":386983,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '916553,1193586,916749,3037503';
imageSets[3] = '3804888,3804872,3804887,4194926,1193586,3815498,3804852,3834759,1169741,3804865,2674039,916749,3804844,3807082,3037503,3834874';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/dougdale/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/dougdale/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/dougdale/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 = 'Harwich & Dovercourt 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;
	}
}

			

