window.thumbnails = {};
															thumbnails[4854107] = clik.newPhoto({"id":4854107,"src":"new_web_pics_025_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Sunshine £18.50","height":98});
															thumbnails[5009313] = clik.newPhoto({"id":5009313,"src":"new_web_pics_069_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Toucan £18.50","height":98});
															thumbnails[5500125] = clik.newPhoto({"id":5500125,"src":"new_web_pics_079_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":130,"caption":"Mardi Gras £18.50","height":98});
															thumbnails[4854061] = clik.newPhoto({"id":4854061,"src":"new_web_pics_088_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854061.html","width":130,"caption":"Black £10","height":98});
															thumbnails[4854067] = clik.newPhoto({"id":4854067,"src":"box_thumb.jpg","galleries_id":277003,"server_id":18,"link":"photo_4854067.html","width":130,"caption":"Necklet Gift Box","height":98});
															thumbnails[4854069] = clik.newPhoto({"id":4854069,"src":"new_web_pics_153_thumb.jpg","galleries_id":276999,"server_id":18,"link":"photo_4854069.html","width":130,"caption":"Chocolate £10","height":98});
															thumbnails[4854077] = clik.newPhoto({"id":4854077,"src":"new_web_pics_135_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854077.html","width":130,"caption":"Denim £10","height":98});
															thumbnails[4854080] = clik.newPhoto({"id":4854080,"src":"new_web_pics_129_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854080.html","width":130,"caption":"Ecru £10","height":98});
															thumbnails[4854104] = clik.newPhoto({"id":4854104,"src":"new_web_pics_083_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854104.html","width":130,"caption":"Silver £10","height":98});
															thumbnails[4854114] = clik.newPhoto({"id":4854114,"src":"new_web_pics_139_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854114.html","width":130,"caption":"Lilac £10","height":98});
															thumbnails[4854116] = clik.newPhoto({"id":4854116,"src":"new_web_pics_111_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854116.html","width":130,"caption":"Lilac Rose £10","height":95});
															thumbnails[4854123] = clik.newPhoto({"id":4854123,"src":"new_web_pics_142_thumb.jpg","galleries_id":276999,"server_id":18,"link":"photo_4854123.html","width":130,"caption":"Ruby £10","height":98});
															thumbnails[4854135] = clik.newPhoto({"id":4854135,"src":"new_web_pics_116_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854135.html","width":130,"caption":"Pink £10","height":98});
															thumbnails[4854142] = clik.newPhoto({"id":4854142,"src":"new_web_pics_132_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854142.html","width":130,"caption":"Sage £10","height":98});
															thumbnails[4854145] = clik.newPhoto({"id":4854145,"src":"new_web_pics_125_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_4854145.html","width":130,"caption":"Tango £10","height":98});
															thumbnails[4854153] = clik.newPhoto({"id":4854153,"src":"sw_1227_thumb.jpg","galleries_id":277003,"server_id":18,"link":"photo_4854153.html","width":130,"caption":"Shawl \/ Loop Scarf Gift Box","height":103});
															thumbnails[4854308] = clik.newPhoto({"id":4854308,"src":"new_web_pics_032_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_4854308.html","width":130,"caption":"Sahara £18.50","height":98});
															thumbnails[4854318] = clik.newPhoto({"id":4854318,"src":"new_web_pics_048_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_4854318.html","width":130,"caption":"Sea Breeze £18.50","height":98});
															thumbnails[4854323] = clik.newPhoto({"id":4854323,"src":"new_web_pics_053_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_4854323.html","width":130,"caption":"Lilac £18.50","height":99});
															thumbnails[5009304] = clik.newPhoto({"id":5009304,"src":"new_web_pics_061_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5009304.html","width":130,"caption":"Dark Royal £18.50","height":98});
															thumbnails[5009325] = clik.newPhoto({"id":5009325,"src":"new_web_pics_148_thumb.jpg","galleries_id":276999,"server_id":18,"link":"photo_5009325.html","width":130,"caption":"Onyx £10","height":98});
															thumbnails[5009334] = clik.newPhoto({"id":5009334,"src":"new_web_pics_099_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009334.html","width":130,"caption":"Midnight £10","height":98});
															thumbnails[5009337] = clik.newPhoto({"id":5009337,"src":"new_web_pics_114_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009337.html","width":130,"caption":"Aqua £10","height":97});
															thumbnails[5009339] = clik.newPhoto({"id":5009339,"src":"new_web_pics_081_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009339.html","width":130,"caption":"Teal £10","height":98});
															thumbnails[5009340] = clik.newPhoto({"id":5009340,"src":"new_web_pics_102_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009340.html","width":130,"caption":"Bronze £10","height":98});
															thumbnails[5009344] = clik.newPhoto({"id":5009344,"src":"new_web_pics_093_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009344.html","width":130,"caption":"Mosaic £10","height":98});
															thumbnails[5009350] = clik.newPhoto({"id":5009350,"src":"new_web_pics_105_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009350.html","width":130,"caption":"Baroque £10","height":98});
															thumbnails[5009352] = clik.newPhoto({"id":5009352,"src":"new_web_pics_087_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_5009352.html","width":130,"caption":"Harlequin £10","height":98});
															thumbnails[5500061] = clik.newPhoto({"id":5500061,"src":"new_web_pics_020_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500061.html","width":130,"caption":"October Afternoon £18.50","height":98});
															thumbnails[5500113] = clik.newPhoto({"id":5500113,"src":"new_web_pics_030_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500113.html","width":130,"caption":"Sweet Dreams £18.50","height":98});
															thumbnails[5500114] = clik.newPhoto({"id":5500114,"src":"new_web_pics_036_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500114.html","width":130,"caption":"Pretty Pink £18.50","height":98});
															thumbnails[5500115] = clik.newPhoto({"id":5500115,"src":"new_web_pics_040_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500115.html","width":130,"caption":"Berry Mix £18.50","height":98});
															thumbnails[5500116] = clik.newPhoto({"id":5500116,"src":"new_web_pics_044_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500116.html","width":130,"caption":"Sable £18.50","height":97});
															thumbnails[5500118] = clik.newPhoto({"id":5500118,"src":"new_web_pics_056_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500118.html","width":130,"caption":"Moss £18.50","height":98});
															thumbnails[5500121] = clik.newPhoto({"id":5500121,"src":"new_web_pics_072_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500121.html","width":130,"caption":"Marble £18.50","height":98});
															thumbnails[5500123] = clik.newPhoto({"id":5500123,"src":"new_web_pics_075_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500123.html","width":130,"caption":"Velvet Leaf £18.50","height":98});
															thumbnails[5500126] = clik.newPhoto({"id":5500126,"src":"new_web_pics_158_thumb.jpg","galleries_id":263736,"server_id":18,"link":"photo_5500126.html","width":130,"caption":"Fresco £18.50","height":99});
															thumbnails[5500305] = clik.newPhoto({"id":5500305,"src":"new_web_pics_149_thumb.jpg","galleries_id":276999,"server_id":18,"link":"photo_5500305.html","width":130,"caption":"Amethyst £10","height":98});
															thumbnails[6875021] = clik.newPhoto({"id":6875021,"src":"new_web_pics_108_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_6875021.html","width":130,"caption":"Claret £10","height":98});
															thumbnails[6875025] = clik.newPhoto({"id":6875025,"src":"new_web_pics_120_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_6875025.html","width":130,"caption":"Orchid £10","height":98});
															thumbnails[6875028] = clik.newPhoto({"id":6875028,"src":"new_web_pics_122_thumb.jpg","galleries_id":263733,"server_id":18,"link":"photo_6875028.html","width":130,"caption":"Splash £10","height":98});
															thumbnails[6875053] = clik.newPhoto({"id":6875053,"src":"new_web_pics_156_thumb.jpg","galleries_id":276999,"server_id":18,"link":"photo_6875053.html","width":130,"caption":"Ruby Dazzle","height":98});
															thumbnails[5500345] = clik.newPhoto({"id":5500345,"src":"Shawls_plus_colour_swatches1_thumb.gif","galleries_id":263732,"server_id":18,"link":"photo_5500345.html","width":130,"caption":"","height":98});
															thumbnails[4854160] = clik.newPhoto({"id":4854160,"src":"black1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854160.html","width":130,"caption":"Black  £30.00","height":98});
															thumbnails[4854195] = clik.newPhoto({"id":4854195,"src":"baroque_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854195.html","width":130,"caption":"Baroque £30.00","height":98});
															thumbnails[4854199] = clik.newPhoto({"id":4854199,"src":"Harlequin_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854199.html","width":130,"caption":"Harlequin £30.00","height":98});
															thumbnails[4854204] = clik.newPhoto({"id":4854204,"src":"Lilac_Rose1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854204.html","width":130,"caption":"Lilac Rose £30.00","height":98});
															thumbnails[5009368] = clik.newPhoto({"id":5009368,"src":"Green_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5009368.html","width":130,"caption":"Green £30.00","height":98});
															thumbnails[5500632] = clik.newPhoto({"id":5500632,"src":"Aqua2_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5500632.html","width":130,"caption":"Aqua £30.00","height":98});
															thumbnails[5500634] = clik.newPhoto({"id":5500634,"src":"Midnight1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5500634.html","width":130,"caption":"Midnight £30.00","height":98});
															thumbnails[5500635] = clik.newPhoto({"id":5500635,"src":"Dawn1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5500635.html","width":130,"caption":"Dawn £30.00","height":98});
															thumbnails[5500637] = clik.newPhoto({"id":5500637,"src":"Ecru1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5500637.html","width":130,"caption":"Ecru £30.00","height":98});
															thumbnails[4854210] = clik.newPhoto({"id":4854210,"src":"Amethyst_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854210.html","width":130,"caption":"Amethyst Glitz £30.00","height":98});
															thumbnails[4854216] = clik.newPhoto({"id":4854216,"src":"Burnished_Bronze_Glitz12_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854216.html","width":130,"caption":"Chocolate Glitz £30.00","height":98});
															thumbnails[4854222] = clik.newPhoto({"id":4854222,"src":"Midnight_Glitz1_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_4854222.html","width":130,"caption":"Midnight Glitz £30.00","height":98});
															thumbnails[5008004] = clik.newPhoto({"id":5008004,"src":"Onyx_Glitz_thumb.jpg","galleries_id":263732,"server_id":18,"link":"photo_5008004.html","width":130,"caption":"Onyz Glitz £30.00","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[263736] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Loop scarves","link":"gallery_263736.html","maxRecords":0.0,"photoIDs":[4854308.0,4854318.0,4854323.0,5009304.0,5500061.0,5500113.0,5500114.0,5500115.0,5500116.0,5500118.0,5500121.0,5500123.0,5500126.0],"skipIndex":0,"section_code":"gallery","featured_images":"5500126,5500123,5500118,5500116,5500115,5500114,5500113,5500061,4854323","id":263736,"singleSection":false});				  						galleries[263733] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Necklets","link":"gallery_263733.html","maxRecords":0.0,"photoIDs":[4854061.0,4854077.0,4854080.0,4854104.0,4854114.0,4854116.0,4854135.0,4854142.0,4854145.0,5009334.0,5009337.0,5009339.0,5009340.0,5009344.0,5009350.0,5009352.0,6875021.0,6875025.0,6875028.0],"skipIndex":0,"section_code":"gallery","featured_images":"5009344,5009339,5009334,4854145,4854142,4854116,4854114","id":263733,"singleSection":false});				  						galleries[276999] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Glitzy Necklets","link":"gallery_276999.html","maxRecords":0.0,"photoIDs":[4854069.0,4854123.0,5009325.0,5500305.0,6875053.0],"skipIndex":0,"section_code":"gallery","featured_images":5500305.0,"id":276999,"singleSection":false});				  						galleries[263732] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Shawls","link":"gallery_263732.html","maxRecords":0.0,"photoIDs":[5500345.0,4854160.0,4854195.0,4854199.0,4854204.0,5009368.0,5500632.0,5500634.0,5500635.0,5500637.0,4854210.0,4854216.0,4854222.0,5008004.0],"skipIndex":0,"section_code":"gallery","featured_images":5500345.0,"id":263732,"singleSection":false});				  						galleries[277003] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gift Boxes","link":"gallery_277003.html","maxRecords":0.0,"photoIDs":[4854067.0,4854153.0],"skipIndex":0,"section_code":"gallery","featured_images":4854153.0,"id":277003,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5500126,5500123,5500118,5500116,5500115,5500114,5500061,5009304,4854323,4854308';
imageSets[2] = '5500305,5500126,5500123,5500118,5500116,5500115,5500114,5500113,5500061,5009344,5009339,5009334,4854323,4854153,4854145,4854142,4854116,4854114,5500345';
imageSets[3] = '5500126,5500123,5500121,5500118,5500116,5500115,5500114,5500113,5500061,4854323,4854318,4854308,4854145';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/AngelaEleri/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/AngelaEleri/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 = 'Knit and Twist: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>    </p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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>   </p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp += '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="ANGELAELERI">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

			

