window.thumbnails = {};
thumbnails[7564925] = clik.newPhoto({"link":"#","caption":"","height":92,"id":7564925,"server_id":31,"src":"kate_and_alf_thumb.jpg","galleries_id":"","width":130});
thumbnails[7338871] = clik.newPhoto({"link":"photo_7338871.html","caption":"Lamb Illustration","height":130,"id":7338871,"server_id":31,"src":"lamb_bird_white_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339204] = clik.newPhoto({"link":"photo_7339204.html","caption":"Mary had a Little Lamb","height":130,"id":7339204,"server_id":31,"src":"Mary_had_a_Little_Lamb1_thumb.jpg","galleries_id":399523,"width":130});
thumbnails[7339209] = clik.newPhoto({"link":"photo_7339209.html","caption":"Jack and Jill","height":129,"id":7339209,"server_id":31,"src":"Jack_and_Jill_thumb.jpeg","galleries_id":399523,"width":130});
thumbnails[7339212] = clik.newPhoto({"link":"photo_7339212.html","caption":"A Little Princess","height":179,"id":7339212,"server_id":31,"src":"A_Little_Pricess_thumb.jpg","galleries_id":399523,"width":130});
thumbnails[7339273] = clik.newPhoto({"link":"photo_7339273.html","caption":"The Collector","height":195,"id":7339273,"server_id":31,"src":"The_Collector_thumb.jpg","galleries_id":397192,"width":130});
thumbnails[7339275] = clik.newPhoto({"link":"photo_7339275.html","caption":"Midnight in the Garden of Good and Evil","height":188,"id":7339275,"server_id":31,"src":"Midnight_thumb.jpg","galleries_id":397192,"width":130});
thumbnails[7339278] = clik.newPhoto({"link":"photo_7339278.html","caption":"Messy Baby","height":137,"id":7339278,"server_id":31,"src":"I_love_my_baby_because_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339396] = clik.newPhoto({"link":"photo_7339396.html","caption":"Alice in Wonderland","height":158,"id":7339396,"server_id":31,"src":"Alice_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7339397] = clik.newPhoto({"link":"photo_7339397.html","caption":"Gargoyle","height":110,"id":7339397,"server_id":31,"src":"aoi11_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339399] = clik.newPhoto({"link":"photo_7339399.html","caption":"Gargoyle Introduction","height":111,"id":7339399,"server_id":31,"src":"aoi12_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339401] = clik.newPhoto({"link":"photo_7339401.html","caption":"Cover Sample","height":185,"id":7339401,"server_id":31,"src":"aoi21_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339404] = clik.newPhoto({"link":"photo_7339404.html","caption":"Missy and Me","height":169,"id":7339404,"server_id":31,"src":"dancing_bear_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339406] = clik.newPhoto({"link":"photo_7339406.html","caption":"Amelia's Wings","height":154,"id":7339406,"server_id":31,"src":"fairy_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7339408] = clik.newPhoto({"link":"photo_7339408.html","caption":"Promotional","height":73,"id":7339408,"server_id":31,"src":"Idea_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339410] = clik.newPhoto({"link":"photo_7339410.html","caption":"Snuffler","height":120,"id":7339410,"server_id":31,"src":"snuffler_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7339413] = clik.newPhoto({"link":"photo_7339413.html","caption":"Tickle the Moon","height":79,"id":7339413,"server_id":31,"src":"tickle_the_moon_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7339415] = clik.newPhoto({"link":"photo_7339415.html","caption":"Card Design","height":175,"id":7339415,"server_id":31,"src":"wrapping_thumb.jpg","galleries_id":397192,"width":130});
thumbnails[7339418] = clik.newPhoto({"link":"photo_7339418.html","caption":"Butterfly Design","height":124,"id":7339418,"server_id":31,"src":"butterfly_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7565078] = clik.newPhoto({"link":"photo_7565078.html","caption":"","height":197,"id":7565078,"server_id":31,"src":"Ivy_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7565079] = clik.newPhoto({"link":"photo_7565079.html","caption":"","height":128,"id":7565079,"server_id":31,"src":"Queen_Sardine_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7565080] = clik.newPhoto({"link":"photo_7565080.html","caption":"","height":130,"id":7565080,"server_id":31,"src":"queen_sardine_and_ivy_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7565081] = clik.newPhoto({"link":"photo_7565081.html","caption":"","height":124,"id":7565081,"server_id":31,"src":"I_Dream_of_Cats_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[7663679] = clik.newPhoto({"link":"photo_7663679.html","caption":"Cats","height":163,"id":7663679,"server_id":31,"src":"cp_cat_sketches_1_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[7663681] = clik.newPhoto({"link":"photo_7663681.html","caption":"Cats","height":125,"id":7663681,"server_id":31,"src":"cp_cat_sketches_2_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[7663683] = clik.newPhoto({"link":"photo_7663683.html","caption":"Mushroom","height":195,"id":7663683,"server_id":31,"src":"cp_mushroom_sketch_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[7663685] = clik.newPhoto({"link":"photo_7663685.html","caption":"Peter Pan","height":71,"id":7663685,"server_id":31,"src":"cp_peter_pan_sketches_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[7663692] = clik.newPhoto({"link":"photo_7663692.html","caption":"Robot (character idea)","height":154,"id":7663692,"server_id":31,"src":"cp_robot_sketches_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[7663694] = clik.newPhoto({"link":"photo_7663694.html","caption":"Unicorn","height":93,"id":7663694,"server_id":31,"src":"cp_unicorn_sketch_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511803] = clik.newPhoto({"link":"photo_8511803.html","caption":"","height":208,"id":8511803,"server_id":31,"src":"1Harriet_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511808] = clik.newPhoto({"link":"photo_8511808.html","caption":"Goldilocks","height":155,"id":8511808,"server_id":31,"src":"2Goldilocks_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511818] = clik.newPhoto({"link":"photo_8511818.html","caption":"Imp","height":157,"id":8511818,"server_id":31,"src":"3Imp_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511840] = clik.newPhoto({"link":"photo_8511840.html","caption":"Imp","height":52,"id":8511840,"server_id":31,"src":"4ImpSpread_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511858] = clik.newPhoto({"link":"photo_8511858.html","caption":"Picture book spread","height":82,"id":8511858,"server_id":31,"src":"5Troll_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511862] = clik.newPhoto({"link":"photo_8511862.html","caption":"Picture book spread","height":79,"id":8511862,"server_id":31,"src":"6Troll_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511870] = clik.newPhoto({"link":"photo_8511870.html","caption":"Picture book spread","height":75,"id":8511870,"server_id":31,"src":"7TicklyFingers_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511887] = clik.newPhoto({"link":"photo_8511887.html","caption":"Gargoyles","height":168,"id":8511887,"server_id":31,"src":"9Gargoyles_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511917] = clik.newPhoto({"link":"photo_8511917.html","caption":"","height":191,"id":8511917,"server_id":31,"src":"Big_Sister1_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511920] = clik.newPhoto({"link":"photo_8511920.html","caption":"","height":140,"id":8511920,"server_id":31,"src":"Big_Sister2_thumb.jpg","galleries_id":397191,"width":130});
thumbnails[8511923] = clik.newPhoto({"link":"photo_8511923.html","caption":"","height":93,"id":8511923,"server_id":31,"src":"celeste_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511926] = clik.newPhoto({"link":"photo_8511926.html","caption":"","height":93,"id":8511926,"server_id":31,"src":"celestes_friends_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511930] = clik.newPhoto({"link":"photo_8511930.html","caption":"","height":166,"id":8511930,"server_id":31,"src":"Goldilocks_sketch_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511939] = clik.newPhoto({"link":"photo_8511939.html","caption":"","height":156,"id":8511939,"server_id":31,"src":"Goldilocks_sketch__2_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511940] = clik.newPhoto({"link":"photo_8511940.html","caption":"","height":199,"id":8511940,"server_id":31,"src":"hair1_thumb.jpg","galleries_id":397192,"width":130});
thumbnails[8511943] = clik.newPhoto({"link":"photo_8511943.html","caption":"","height":188,"id":8511943,"server_id":31,"src":"harriets_grandparents_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511944] = clik.newPhoto({"link":"photo_8511944.html","caption":"","height":159,"id":8511944,"server_id":31,"src":"harriets_parents_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511946] = clik.newPhoto({"link":"photo_8511946.html","caption":"","height":92,"id":8511946,"server_id":31,"src":"Imp_1_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511948] = clik.newPhoto({"link":"photo_8511948.html","caption":"","height":171,"id":8511948,"server_id":31,"src":"ivy_968BAEA8-24E8-5EC4-4F8C2EEDB34AC8ED_thumb.jpg","galleries_id":415377,"width":130});
thumbnails[8511956] = clik.newPhoto({"link":"photo_8511956.html","caption":"","height":94,"id":8511956,"server_id":31,"src":"Queen_Sardine_spread_idea_thumb.jpg","galleries_id":399525,"width":130});
thumbnails[7564809] = clik.newPhoto({"link":"photo_7564809.html","caption":"Davy Doolittle","height":183,"id":7564809,"server_id":31,"src":"Davy_thumb.jpg","galleries_id":397191,"width":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
galleries[399525] = clik.newGallery({"photoIDs":[7339396,7339406,7339410,7339418,7565078,7565079,7565080,8511956],"link":"gallery_399525.html","skipIndex":0,"section_code":"gallery","id":399525,"parentGallery":"","featured_images":"8511956,7565080,7565079,7565078,7339418,7339410,7339406,7339396","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Children's Black and White"});galleries[399523] = clik.newGallery({"photoIDs":[7339204,7339209,7339212],"link":"gallery_399523.html","skipIndex":0,"section_code":"gallery","id":399523,"parentGallery":"","featured_images":"7339212,7339209,7339204","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Published Work"});galleries[415377] = clik.newGallery({"photoIDs":[7663679,7663681,7663683,7663685,7663692,7663694,8511917,8511923,8511926,8511930,8511939,8511943,8511944,8511946,8511948],"link":"gallery_415377.html","skipIndex":0,"section_code":"gallery","id":415377,"parentGallery":"","featured_images":"8511948,8511946,8511944,8511943,8511939,8511930,8511926,8511923,8511917,7663694,7663683,7663681,7663679","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Sketchbook"});galleries[397191] = clik.newGallery({"photoIDs":[7338871,7339278,7339397,7339399,7339401,7339404,7339408,7339413,7565081,8511803,8511808,8511818,8511840,8511858,8511862,8511870,8511887,8511920,7564809],"link":"gallery_397191.html","skipIndex":0,"section_code":"gallery","id":397191,"parentGallery":"","featured_images":"8511920,8511887,8511870,8511862,8511858,8511840,8511818,8511808,8511803,7565081,7564809,7339413,7339404,7339401,7339399,7339397,7339278","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Children's Colour "});galleries[397192] = clik.newGallery({"photoIDs":[7339273,7339275,7339415,8511940],"link":"gallery_397192.html","skipIndex":0,"section_code":"gallery","id":397192,"parentGallery":"","featured_images":"8511940,7339415,7339275,7339273","maxRecords":0,"usePopups":false,"singleSection":false,"title":"Other Projects..."});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[3] = '7565078,7339415,7339413,7339410,7339406,7339404,7339401,7339399,7339397,7339278,7339275,7339273,7339212,7339209,7339204,7564809';
imageSets[2] = '8511956,8511948,8511946,8511944,8511943,8511940,8511939,8511930,8511926,8511923,8511920,8511917,8511887,8511870,8511862,8511858,8511840,8511818,8511808,8511803,7663694,7663683,7663681,7663679,7565081,7565080,7565079,7565078,7339418,7339415,7339413,7339410,7339406,7339404,7339401,7339399,7339397,7339396,7339278,7339275,7339273,7339212,7339209,7339204,7564809';
imageSets[1] = '8511946,8511940,8511930,8511920,8511870,8511862,8511858,8511840,8511818,8511808,8511803,7565081,7339415,7339413,7339406,7339404,7339401,7339399,7339397,7339278,7339275,7339273,7339212,7339209,7339204,7564809';
imageSets[240833] = '7564925';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/katewilliscrowley/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/katewilliscrowley/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 = 'Kate Willis-Crowley: ' + 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;
	}
}

		

