window.thumbnails = {};
															thumbnails[6266838] = clik.newPhoto({"id":6266838,"src":"n230610jz665_thumb.jpg","galleries_id":348348,"server_id":15,"link":"photo_6266838.html","width":130,"caption":"Dashing Hounds(Watercolour)53.5cm X 123.5cm..*FOR SALE*","height":56});
															thumbnails[6266776] = clik.newPhoto({"id":6266776,"src":"230610jz664_thumb.jpg","galleries_id":348348,"server_id":15,"link":"photo_6266776.html","width":130,"caption":"Sun, Sea and Breeze(Watercolour) 31cm X 53cm..*FOR SALE*","height":76});
															thumbnails[6283360] = clik.newPhoto({"id":6283360,"src":"e020210pbp661_Flam_thumb.jpg","galleries_id":348348,"server_id":15,"link":"photo_6283360.html","width":130,"caption":"Flamingos In Flight (Oil On Boxed Canvas)61.5cm X 122cm X 3.5cm)..*FOR SALE*","height":65});
															thumbnails[3553796] = clik.newPhoto({"id":3553796,"src":"Shamble_Grove_______________76cm_by_51cm1_thumb.jpg","galleries_id":109485,"server_id":15,"link":"photo_3553796.html","width":130,"caption":"Shamble Grove<br>\r\n(Oil Painting)<br>\r\n76cm by 51cm","height":86});
															thumbnails[5173229] = clik.newPhoto({"id":5173229,"src":"Carob_Tree_Ps_thumb.jpg","galleries_id":109485,"server_id":15,"link":"photo_5173229.html","width":130,"caption":"Carob Tree(Acrylic On Canvas) 60cm X 90cm..*FOR SALE*","height":87});
															thumbnails[5582163] = clik.newPhoto({"id":5582163,"src":"Colourful_Morning_thumb.jpg","galleries_id":217480,"server_id":15,"link":"photo_5582163.html","width":130,"caption":"Colourful Morning(Oil On Canvas)","height":174});
															thumbnails[5582207] = clik.newPhoto({"id":5582207,"src":"RedMax_Internet_thumb.jpg","galleries_id":217480,"server_id":15,"link":"photo_5582207.html","width":130,"caption":"Red Max(Oil On Canvas) 50cm X100cm","height":263});
															thumbnails[5582280] = clik.newPhoto({"id":5582280,"src":"Merrygolds_Less_100_thumb.jpg","galleries_id":109484,"server_id":15,"link":"photo_5582280.html","width":130,"caption":"    Merrygolds(Oil On Canvas)  60cm X 60cm","height":130});
															thumbnails[6266767] = clik.newPhoto({"id":6266767,"src":"230610jz662_thumb.jpg","galleries_id":217480,"server_id":15,"link":"photo_6266767.html","width":130,"caption":"Good Morning(Watercolour) 53cm X 37.5..*FOR SALE*","height":181});
															thumbnails[6266780] = clik.newPhoto({"id":6266780,"src":"230610jz669_thumb.jpg","galleries_id":109482,"server_id":15,"link":"photo_6266780.html","width":130,"caption":"        Vessels<br>\r\n  (Oil on Canvas) <br>\r\n   80cm X 100cm","height":163});
															thumbnails[6266790] = clik.newPhoto({"id":6266790,"src":"230610jz670_thumb.jpg","galleries_id":109482,"server_id":15,"link":"photo_6266790.html","width":130,"caption":"Soul Searchers(Oil on Canvas)70cm X 100cm","height":91});
															thumbnails[6266804] = clik.newPhoto({"id":6266804,"src":"230610jz673_thumb.jpg","galleries_id":217480,"server_id":15,"link":"photo_6266804.html","width":130,"caption":"Make Up<br>\r\n(Oil on Boxed Canvas)<br>\r\n51cm X 76cm X 3.5cm <br>\r\n<br>\r\n","height":86});
															thumbnails[6266845] = clik.newPhoto({"id":6266845,"src":"n230610jz667_thumb.jpg","galleries_id":101278,"server_id":15,"link":"photo_6266845.html","width":130,"caption":"Rita Zara<br>\r\n(Oil On Canvas)<br>\r\n120cm X 100cm","height":155});
															thumbnails[6283366] = clik.newPhoto({"id":6283366,"src":"Fish_thumb.jpg","galleries_id":348348,"server_id":15,"link":"photo_6283366.html","width":130,"caption":"Fish(Oil On Canvas)40cm X 80cm *FOR SALE*","height":64});
															thumbnails[8844715] = clik.newPhoto({"id":8844715,"src":"72dpi.099_thumb.jpg","galleries_id":109483,"server_id":15,"link":"photo_8844715.html","width":130,"caption":"Abstract Painting (untitled) Acrylic 60cmX119.5cmX1.8cm","height":65});
															thumbnails[8844723] = clik.newPhoto({"id":8844723,"src":"72dpi.102_thumb.jpg","galleries_id":109483,"server_id":15,"link":"photo_8844723.html","width":130,"caption":"Abstract (Square)","height":130});
															thumbnails[8844726] = clik.newPhoto({"id":8844726,"src":"72dpi.106_thumb.jpg","galleries_id":430445,"server_id":15,"link":"photo_8844726.html","width":130,"caption":"BLACK CAT","height":183});
															thumbnails[8844840] = clik.newPhoto({"id":8844840,"src":"72dpi.104_thumb.jpg","galleries_id":348348,"server_id":15,"link":"photo_8844840.html","width":130,"caption":"Untitled Original Watercolour","height":96});
															thumbnails[9090478] = clik.newPhoto({"id":9090478,"src":"72dpi.ver.21107_3_thumb.jpg","galleries_id":430441,"server_id":15,"link":"photo_9090478.html","width":130,"caption":"","height":98});
															thumbnails[9101829] = clik.newPhoto({"id":9101829,"src":"400_x400__73_thumb.jpg","galleries_id":109483,"server_id":37,"link":"photo_9101829.html","width":130,"caption":"BLISS (70CM x 70CM)","height":130});
															thumbnails[1469250] = clik.newPhoto({"id":1469250,"src":"Iris_Sunrise_thumb.jpg","galleries_id":109482,"server_id":15,"link":"photo_1469250.html","width":130,"caption":"  Iris Sunrise(oil on canvas) 80cm X 100cm","height":103});
															thumbnails[8011322] = clik.newPhoto({"id":8011322,"src":"e.171110.pbp.769_Aargh_thumb.jpg","galleries_id":430441,"server_id":15,"link":"photo_8011322.html","width":130,"caption":"Aargh!! (Oil On Canvas) 30.5cm X 41.5cm X 1.7cm ","height":174});
															thumbnails[8011407] = clik.newPhoto({"id":8011407,"src":"e1.201210.pbp.544____HookLine_and_Sinker_thumb.jpg","galleries_id":430445,"server_id":15,"link":"photo_8011407.html","width":130,"caption":"HOOK,LINE AND SINKER (Oil On Boxed Canvas) 59.5cm X 49.8cm X 3.3cm (Boxed)","height":155});
															thumbnails[3553853] = clik.newPhoto({"id":3553853,"src":"Life________91cm_by_91cm_thumb.jpg","galleries_id":109483,"server_id":15,"link":"photo_3553853.html","width":130,"caption":"Life(Mixed Media)Boxed Canvas91cm X 91cm..*FOR SALE*","height":132});
															thumbnails[1461465] = clik.newPhoto({"id":1461465,"src":"Green_&_Violet_thumb.jpg","galleries_id":109484,"server_id":15,"link":"photo_1461465.html","width":130,"caption":"   Green&Violet(Acrylic on Board)  40cm X 50cm","height":161});
															thumbnails[1469336] = clik.newPhoto({"id":1469336,"src":"Zack2_thumb.JPG","galleries_id":101278,"server_id":15,"link":"photo_1469336.html","width":130,"caption":" Zack (Watercolour)","height":105});
															thumbnails[9101770] = clik.newPhoto({"id":9101770,"src":"72dpi.ver.21105_2_thumb.jpg","galleries_id":430445,"server_id":37,"link":"photo_9101770.html","width":130,"caption":"PASSION (Oil Painting 50.5c.m.(H)X60.5c.m(L)X3.5c.m(D)","height":155});
															thumbnails[8011339] = clik.newPhoto({"id":8011339,"src":"e.171110.pbp.775____Short_John_Silver_thumb.jpg","galleries_id":430441,"server_id":15,"link":"photo_8011339.html","width":130,"caption":"Short John Silver (Oil On Canvas) 30.5cm X 41.5cm X 1.7cm","height":173});
															thumbnails[3553756] = clik.newPhoto({"id":3553756,"src":"Guardian_Angel__________70cm_by_100cm_thumb.jpg","galleries_id":101278,"server_id":15,"link":"photo_3553756.html","width":130,"caption":"Guardian Angel(Oil Painting)70cm by 100cm..*FOR SALE*","height":90});
															thumbnails[1471641] = clik.newPhoto({"id":1471641,"src":"Misty_Grove_thumb.jpg","galleries_id":109485,"server_id":15,"link":"photo_1471641.html","width":130,"caption":"    Misty Grove(Acrylic on Canvas)  80cm X 120cm..*FOR SALE*","height":87});
															thumbnails[1469420] = clik.newPhoto({"id":1469420,"src":"Flowers_in_Green_Vase_thumb.JPG","galleries_id":109484,"server_id":15,"link":"photo_1469420.html","width":130,"caption":" Flowers in Green Vase  (Acrylic on Canvas)","height":133});
															thumbnails[1473763] = clik.newPhoto({"id":1473763,"src":"Nugget_thumb.jpg","galleries_id":109483,"server_id":15,"link":"photo_1473763.html","width":130,"caption":"Nugget(Embossed Acrylic\/Marble)   60cm X 80cm *FOR SALE*","height":98});
															thumbnails[1581799] = clik.newPhoto({"id":1581799,"src":"Detail_Of_Soul_Searchers_thumb.jpg","galleries_id":109482,"server_id":15,"link":"photo_1581799.html","width":130,"caption":"Detail Of Soul Seachers","height":87});
															thumbnails[1825327] = clik.newPhoto({"id":1825327,"src":"In_Name_Of_Plumage_thumb.JPG","galleries_id":217480,"server_id":15,"link":"photo_1825327.html","width":130,"caption":"In Name Of Plumage (Oil On Canvas)60cm X 80cm","height":98});
															thumbnails[8011370] = clik.newPhoto({"id":8011370,"src":"e.171110.pbp.779___________Gulp_thumb.jpg","galleries_id":430441,"server_id":15,"link":"photo_8011370.html","width":130,"caption":"GULP! (Oil On Canvas) 30.5cm X 41.5cm X 1.7cm","height":173});
															thumbnails[1469311] = clik.newPhoto({"id":1469311,"src":"400 x 600 @ 72  Morning_Catch_thumb.jpg","galleries_id":109485,"server_id":15,"link":"photo_1469311.html","width":130,"caption":" Morning Catch(Oil on Canvas) 70cm X 100cm","height":87});
															thumbnails[1469371] = clik.newPhoto({"id":1469371,"src":"Red&WhiteFlowers_thumb.JPG","galleries_id":109484,"server_id":15,"link":"photo_1469371.html","width":130,"caption":" Red&WhiteFlowers(Acylic on Canvas)   50cm X 70cm","height":92});
															thumbnails[1500144] = clik.newPhoto({"id":1500144,"src":"morning catch croped_thumb.jpg","galleries_id":109485,"server_id":15,"link":"photo_1500144.html","width":130,"caption":"Detail Of Morning Catch","height":130});
															thumbnails[2656600] = clik.newPhoto({"id":2656600,"src":"Envy_thumb.jpg","galleries_id":101278,"server_id":15,"link":"photo_2656600.html","width":130,"caption":"Envy (Oil on Canvas)","height":87});
															thumbnails[3553851] = clik.newPhoto({"id":3553851,"src":"Gossip_thumb.jpg","galleries_id":217480,"server_id":15,"link":"photo_3553851.html","width":130,"caption":"Gossip(Oil Painting)","height":80});
															thumbnails[8011285] = clik.newPhoto({"id":8011285,"src":"e1.210111.pbp.855_________The_Hunted_thumb.jpg","galleries_id":109483,"server_id":15,"link":"photo_8011285.html","width":130,"caption":"The Hunted (Oil On Canvas) 50cm X 120cm X 1.7cm - Frameless..*FOR SALE*","height":54});
															thumbnails[8011384] = clik.newPhoto({"id":8011384,"src":"e.171110.pbp.771_____Whoopie_thumb.jpg","galleries_id":430441,"server_id":15,"link":"photo_8011384.html","width":130,"caption":"Whoopie! (Oil On Canvas) 30.5cm X 41.5cm X 1.7cm","height":172});
															thumbnails[1469326] = clik.newPhoto({"id":1469326,"src":"Creme_Roses_thumb.JPG","galleries_id":109484,"server_id":15,"link":"photo_1469326.html","width":130,"caption":" Creme Roses (Watercolour)","height":100});
															thumbnails[1469333] = clik.newPhoto({"id":1469333,"src":"Treasure_thumb.JPG","galleries_id":101278,"server_id":15,"link":"photo_1469333.html","width":130,"caption":" Treasure (Watercolour)","height":94});
															thumbnails[1500141] = clik.newPhoto({"id":1500141,"src":"merrygolds croped_thumb.jpg","galleries_id":109484,"server_id":15,"link":"photo_1500141.html","width":130,"caption":"Detail of Merrygolds","height":130});
															thumbnails[1500018] = clik.newPhoto({"id":1500018,"src":"Berry_Tree_Bright_thumb.jpg","galleries_id":109484,"server_id":15,"link":"photo_1500018.html","width":130,"caption":"Berry Tree Bright (50cm X 70cm)   Oil on Canvas","height":87});
															thumbnails[7542764] = clik.newPhoto({"id":7542764,"src":"e_Woolly_Mundane_671_thumb.jpg","galleries_id":101278,"server_id":15,"link":"photo_7542764.html","width":130,"caption":"Woolley Mundane","height":101});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[109482] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Surrealism","link":"section135360_109482.html","maxRecords":0.0,"photoIDs":[6266780.0,6266790.0,1469250.0,1581799.0],"skipIndex":0,"section_code":"section135360","featured_images":6266790.0,"id":109482,"singleSection":false});				  						galleries[348348] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Kinetic Art","link":"section135360_348348.html","maxRecords":0.0,"photoIDs":[6266838.0,6266776.0,6283360.0,6283366.0,8844840.0],"skipIndex":0,"section_code":"section135360","featured_images":6266838.0,"id":348348,"singleSection":false});				  						galleries[109483] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract","link":"section135360_109483.html","maxRecords":0.0,"photoIDs":[8844715.0,8844723.0,9101829.0,3553853.0,1473763.0,8011285.0],"skipIndex":0,"section_code":"section135360","featured_images":"8011285,3553853","id":109483,"singleSection":false});				  						galleries[430445] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ALLEGORIC","link":"section135360_430445.html","maxRecords":0.0,"photoIDs":[8844726.0,8011407.0,9101770.0],"skipIndex":0,"section_code":"section135360","featured_images":8011407.0,"id":430445,"singleSection":false});				  						galleries[217480] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"AVIARY","link":"section135360_217480.html","maxRecords":0.0,"photoIDs":[5582163.0,5582207.0,6266767.0,6266804.0,1825327.0,3553851.0],"skipIndex":0,"section_code":"section135360","featured_images":6266804.0,"id":217480,"singleSection":false});				  						galleries[101278] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Paintings","link":"section135360_101278.html","maxRecords":0.0,"photoIDs":[6266845.0,1469336.0,3553756.0,2656600.0,1469333.0,7542764.0],"skipIndex":0,"section_code":"section135360","featured_images":6266845.0,"id":101278,"singleSection":false});				  						galleries[109485] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Scenic","link":"section135360_109485.html","maxRecords":0.0,"photoIDs":[3553796.0,5173229.0,1471641.0,1469311.0,1500144.0],"skipIndex":0,"section_code":"section135360","featured_images":3553796.0,"id":109485,"singleSection":false});				  						galleries[109484] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Floral","link":"section135360_109484.html","maxRecords":0.0,"photoIDs":[5582280.0,1461465.0,1469420.0,1469371.0,1469326.0,1500141.0,1500018.0],"skipIndex":0,"section_code":"section135360","featured_images":"5582280,1500141,1500018,1469420,1469371,1469326,1461465","id":109484,"singleSection":false});				  						galleries[430441] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"ANIMATION","link":"section135360_430441.html","maxRecords":0.0,"photoIDs":[9090478.0,8011322.0,8011339.0,8011370.0,8011384.0],"skipIndex":0,"section_code":"section135360","featured_images":"8011370,8011322","id":430441,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6283366,6283360,6266845,6266838,6266804,6266790,3553796,1469250,9101770,8011407,8011322,3553853,1469336,1825327,3553851,1500141';
imageSets[2] = '6266845,6266838,6266804,6266790,3553796,8011407,8011322,3553853,8011370,8011285';
imageSets[3] = '6266845,6266838,6266804,6266790,1469250,8011407,1469336,3553756,1825327,1581799,2656600,1469311,1500141';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/surealzeal/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/surealzeal/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 += 'section135360.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 && 'section135360' != '') {
					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 = 'Zeal Stocks : ' + 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>Artist </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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="JasZa5@hotmail.com">';
					temp += '<input type="hidden" name="currency_code" value="EUR">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="JasZa5@hotmail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

