window.thumbnails = {};
															thumbnails[1650431] = clik.newPhoto({"id":1650431,"src":"Newborns001_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1650431.html","width":130,"caption":"","height":130});
															thumbnails[1654202] = clik.newPhoto({"id":1654202,"src":"Newborns002_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654202.html","width":130,"caption":"","height":130});
															thumbnails[1654203] = clik.newPhoto({"id":1654203,"src":"Newborns003_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654203.html","width":130,"caption":"","height":130});
															thumbnails[1654205] = clik.newPhoto({"id":1654205,"src":"Newborns004_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654205.html","width":130,"caption":"","height":130});
															thumbnails[1654206] = clik.newPhoto({"id":1654206,"src":"Newborns005_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654206.html","width":130,"caption":"","height":130});
															thumbnails[1654208] = clik.newPhoto({"id":1654208,"src":"Newborns006_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654208.html","width":130,"caption":"","height":130});
															thumbnails[1654209] = clik.newPhoto({"id":1654209,"src":"Newborns007_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654209.html","width":130,"caption":"","height":130});
															thumbnails[1654210] = clik.newPhoto({"id":1654210,"src":"Newborns008_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654210.html","width":130,"caption":"","height":130});
															thumbnails[1700778] = clik.newPhoto({"id":1700778,"src":"Newborns009_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1700778.html","width":130,"caption":"","height":130});
															thumbnails[1650320] = clik.newPhoto({"id":1650320,"src":"Weddings0017_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1650320.html","width":130,"caption":"","height":130});
															thumbnails[1650378] = clik.newPhoto({"id":1650378,"src":"Children001_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1650378.html","width":130,"caption":"","height":130});
															thumbnails[1650427] = clik.newPhoto({"id":1650427,"src":"Pregnancy001_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1650427.html","width":130,"caption":"","height":130});
															thumbnails[1654179] = clik.newPhoto({"id":1654179,"src":"Location0013_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1654179.html","width":130,"caption":"","height":130});
															thumbnails[1662513] = clik.newPhoto({"id":1662513,"src":"Portraits0014_thumb.jpg","galleries_id":111367,"server_id":1,"link":"photo_1662513.html","width":130,"caption":"","height":130});
															thumbnails[1650321] = clik.newPhoto({"id":1650321,"src":"Weddings0026_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1650321.html","width":130,"caption":"","height":130});
															thumbnails[1650416] = clik.newPhoto({"id":1650416,"src":"Children002_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1650416.html","width":130,"caption":"","height":130});
															thumbnails[1654282] = clik.newPhoto({"id":1654282,"src":"Portraits002_thumb.jpg","galleries_id":111367,"server_id":1,"link":"photo_1654282.html","width":130,"caption":"","height":130});
															thumbnails[1654360] = clik.newPhoto({"id":1654360,"src":"Location003_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1654360.html","width":130,"caption":"","height":130});
															thumbnails[1654184] = clik.newPhoto({"id":1654184,"src":"Pregnancy005_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1654184.html","width":130,"caption":"","height":130});
															thumbnails[1650344] = clik.newPhoto({"id":1650344,"src":"Weddings0032_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1650344.html","width":130,"caption":"","height":130});
															thumbnails[1650438] = clik.newPhoto({"id":1650438,"src":"Location002_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1650438.html","width":130,"caption":"","height":130});
															thumbnails[1654236] = clik.newPhoto({"id":1654236,"src":"Children003_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654236.html","width":130,"caption":"","height":130});
															thumbnails[1654180] = clik.newPhoto({"id":1654180,"src":"Pregnancy0034_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1654180.html","width":130,"caption":"","height":130});
															thumbnails[1650353] = clik.newPhoto({"id":1650353,"src":"Weddings004_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1650353.html","width":130,"caption":"","height":130});
															thumbnails[1654319] = clik.newPhoto({"id":1654319,"src":"Portraits0033_thumb.jpg","galleries_id":111367,"server_id":1,"link":"photo_1654319.html","width":130,"caption":"","height":130});
															thumbnails[1654361] = clik.newPhoto({"id":1654361,"src":"Location004_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1654361.html","width":130,"caption":"","height":130});
															thumbnails[1700675] = clik.newPhoto({"id":1700675,"src":"Pregnancy006_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1700675.html","width":130,"caption":"","height":130});
															thumbnails[1650357] = clik.newPhoto({"id":1650357,"src":"Weddings005_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1650357.html","width":130,"caption":"","height":130});
															thumbnails[1654182] = clik.newPhoto({"id":1654182,"src":"Pregnancy0042_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1654182.html","width":130,"caption":"","height":130});
															thumbnails[1654238] = clik.newPhoto({"id":1654238,"src":"Children005_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654238.html","width":130,"caption":"","height":130});
															thumbnails[1654362] = clik.newPhoto({"id":1654362,"src":"Location005_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1654362.html","width":130,"caption":"","height":130});
															thumbnails[1654239] = clik.newPhoto({"id":1654239,"src":"Children006_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654239.html","width":130,"caption":"","height":130});
															thumbnails[1654464] = clik.newPhoto({"id":1654464,"src":"Weddings006_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654464.html","width":130,"caption":"","height":130});
															thumbnails[1700657] = clik.newPhoto({"id":1700657,"src":"Pregnancy007_thumb.jpg","galleries_id":111354,"server_id":1,"link":"photo_1700657.html","width":130,"caption":"","height":130});
															thumbnails[1700814] = clik.newPhoto({"id":1700814,"src":"Location006_thumb.jpg","galleries_id":111368,"server_id":1,"link":"photo_1700814.html","width":130,"caption":"","height":130});
															thumbnails[1654240] = clik.newPhoto({"id":1654240,"src":"Children007_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654240.html","width":130,"caption":"","height":130});
															thumbnails[1654466] = clik.newPhoto({"id":1654466,"src":"Weddings007_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654466.html","width":130,"caption":"","height":130});
															thumbnails[1654242] = clik.newPhoto({"id":1654242,"src":"Children008_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654242.html","width":130,"caption":"","height":130});
															thumbnails[1654473] = clik.newPhoto({"id":1654473,"src":"Weddings008_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654473.html","width":130,"caption":"","height":130});
															thumbnails[1654243] = clik.newPhoto({"id":1654243,"src":"Children009_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654243.html","width":130,"caption":"","height":130});
															thumbnails[1654244] = clik.newPhoto({"id":1654244,"src":"Children010_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654244.html","width":130,"caption":"","height":130});
															thumbnails[1654251] = clik.newPhoto({"id":1654251,"src":"Children0113_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654251.html","width":130,"caption":"","height":130});
															thumbnails[1654256] = clik.newPhoto({"id":1654256,"src":"Children012_thumb.jpg","galleries_id":111365,"server_id":1,"link":"photo_1654256.html","width":130,"caption":"","height":130});
															thumbnails[1654481] = clik.newPhoto({"id":1654481,"src":"Weddings009_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654481.html","width":130,"caption":"","height":130});
															thumbnails[1654482] = clik.newPhoto({"id":1654482,"src":"Weddings0101_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654482.html","width":130,"caption":"","height":130});
															thumbnails[1654483] = clik.newPhoto({"id":1654483,"src":"Weddings0111_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654483.html","width":130,"caption":"","height":130});
															thumbnails[1654484] = clik.newPhoto({"id":1654484,"src":"Weddings0121_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654484.html","width":130,"caption":"","height":130});
															thumbnails[1654485] = clik.newPhoto({"id":1654485,"src":"Weddings0131_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654485.html","width":130,"caption":"","height":130});
															thumbnails[1654487] = clik.newPhoto({"id":1654487,"src":"Weddings0151_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654487.html","width":130,"caption":"","height":130});
															thumbnails[1654488] = clik.newPhoto({"id":1654488,"src":"Weddings0161_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654488.html","width":130,"caption":"","height":130});
															thumbnails[1654489] = clik.newPhoto({"id":1654489,"src":"Weddings0171_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654489.html","width":130,"caption":"","height":130});
															thumbnails[1654490] = clik.newPhoto({"id":1654490,"src":"Weddings0181_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654490.html","width":130,"caption":"","height":130});
															thumbnails[1654479] = clik.newPhoto({"id":1654479,"src":"Weddings0191_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654479.html","width":130,"caption":"","height":130});
															thumbnails[1654480] = clik.newPhoto({"id":1654480,"src":"Weddings0202_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1654480.html","width":130,"caption":"","height":130});
															thumbnails[1671356] = clik.newPhoto({"id":1671356,"src":"Weddings022_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1671356.html","width":130,"caption":"","height":130});
															thumbnails[1671362] = clik.newPhoto({"id":1671362,"src":"Weddings023_thumb.jpg","galleries_id":111366,"server_id":1,"link":"photo_1671362.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[111354] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Maternity","link":"gallery_111354.html","maxRecords":0.0,"photoIDs":[1650427.0,1654184.0,1654180.0,1700675.0,1654182.0,1700657.0],"skipIndex":0,"section_code":"gallery","featured_images":"1700675,1700657,1654184,1654182,1654180,1650427","id":111354,"singleSection":false});				  						galleries[111365] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Children","link":"gallery_111365.html","maxRecords":0.0,"photoIDs":[1650431.0,1654202.0,1654203.0,1654205.0,1654206.0,1654208.0,1654209.0,1654210.0,1700778.0,1650378.0,1650416.0,1654236.0,1654238.0,1654239.0,1654240.0,1654242.0,1654243.0,1654244.0,1654251.0,1654256.0],"skipIndex":0,"section_code":"gallery","featured_images":1650378.0,"id":111365,"singleSection":false});				  						galleries[111366] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery_111366.html","maxRecords":0.0,"photoIDs":[1650320.0,1650321.0,1650344.0,1650353.0,1650357.0,1654464.0,1654466.0,1654473.0,1654481.0,1654482.0,1654483.0,1654484.0,1654485.0,1654487.0,1654488.0,1654489.0,1654490.0,1654479.0,1654480.0,1671356.0,1671362.0],"skipIndex":0,"section_code":"gallery","featured_images":"1671362,1671356,1654490,1654489,1654488,1654487,1654485,1654484,1654483,1654482","id":111366,"singleSection":false});				  						galleries[111367] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_111367.html","maxRecords":0.0,"photoIDs":[1662513.0,1654282.0,1654319.0],"skipIndex":0,"section_code":"gallery","featured_images":"1662513,1654319,1654282","id":111367,"singleSection":false});				  						galleries[111368] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Location shots","link":"gallery_111368.html","maxRecords":0.0,"photoIDs":[1654179.0,1654360.0,1650438.0,1654361.0,1654362.0,1700814.0],"skipIndex":0,"section_code":"gallery","featured_images":"1700814,1654362,1654361,1654360,1654179,1650438","id":111368,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1650431,1654210,1662513,1654179,1650378,1650320,1654184,1654362,1654239,1654251';
imageSets[2] = '1650378';
imageSets[3] = '1700814,1700778,1700675,1700657,1671362,1671356,1662513,1654490,1654489,1654488,1654487,1654485,1654484,1654483,1654482,1654481,1654480,1654479,1654473,1654466,1654464,1654362,1654361,1654360,1654319,1654282,1654256,1654251,1654244,1654243,1654242,1654240,1654239,1654238,1654236,1654210,1654209,1654208,1654206,1654205,1654203,1654202,1654184,1654182,1654180,1654179,1650438,1650431,1650427,1650416';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/sallyanne/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/sallyanne/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Sally-Anne Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

