window.thumbnails = {};
															thumbnails[2519276] = clik.newPhoto({"id":2519276,"src":"me_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2714760] = clik.newPhoto({"id":2714760,"src":"button_illy_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":43});
															thumbnails[2714761] = clik.newPhoto({"id":2714761,"src":"button_lino_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":41});
															thumbnails[2719287] = clik.newPhoto({"id":2719287,"src":"button_mono_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":29});
															thumbnails[3472111] = clik.newPhoto({"id":3472111,"src":"blogger_logo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":45,"caption":"","height":45});
															thumbnails[5093572] = clik.newPhoto({"id":5093572,"src":"AOI_Logo_Member_278c_Blk_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":46});
															thumbnails[6325611] = clik.newPhoto({"id":6325611,"src":"handsome_frank_logo-1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":50,"caption":"","height":44});
															thumbnails[6484737] = clik.newPhoto({"id":6484737,"src":"facebook_logo_copy_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":45,"caption":"","height":45});
															thumbnails[7106671] = clik.newPhoto({"id":7106671,"src":"twitter-logo-45x45_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":45,"caption":"","height":45});
															thumbnails[7504278] = clik.newPhoto({"id":7504278,"src":"Home_chutney_03D73D05-24E8-5EC4-4F7EA71D37F2D64E_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[7978946] = clik.newPhoto({"id":7978946,"src":"converse_home_D190351F-1EC9-D45B-1C53A72486AF9B4C_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":96});
															thumbnails[8994808] = clik.newPhoto({"id":8994808,"src":"shop_thumb_compassionate-dorset-logo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[8994814] = clik.newPhoto({"id":8994814,"src":"shop_thumb_Etsy_Logo-300_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[8994823] = clik.newPhoto({"id":8994823,"src":"shop_thumb_FolksyLogo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[8994844] = clik.newPhoto({"id":8994844,"src":"shop_thumb_Society6_logo_white_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[8995655] = clik.newPhoto({"id":8995655,"src":"shop_thumb_swa_cic_logo_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":180});
															thumbnails[8999505] = clik.newPhoto({"id":8999505,"src":"onions_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":271});
															thumbnails[8999542] = clik.newPhoto({"id":8999542,"src":"Home_tawnyowl_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[3576714] = clik.newPhoto({"id":3576714,"src":"Gallery_Thumbnail_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[3199421] = clik.newPhoto({"id":3199421,"src":"Gallerythumbnail_editorials_2E675EA9-1EC9-D45B-1C92D96EC5AD0708_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[8999144] = clik.newPhoto({"id":8999144,"src":"contact_page_bird_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":383});
															thumbnails[2515018] = clik.newPhoto({"id":2515018,"src":"Gallerythumbnail_everythingelse_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":200,"caption":"","height":200});
															thumbnails[2516372] = clik.newPhoto({"id":2516372,"src":"osprey_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[3431007] = clik.newPhoto({"id":3431007,"src":"bambi_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2515340] = clik.newPhoto({"id":2515340,"src":"dogman_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2657390] = clik.newPhoto({"id":2657390,"src":"homezebra_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2515324] = clik.newPhoto({"id":2515324,"src":"dogbone_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2516473] = clik.newPhoto({"id":2516473,"src":"sanxaviersnail_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2516380] = clik.newPhoto({"id":2516380,"src":"zebra_print_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[2657388] = clik.newPhoto({"id":2657388,"src":"lacuna_cabal_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_2657388.html","width":130,"caption":"","height":130});
															thumbnails[3312658] = clik.newPhoto({"id":3312658,"src":"Rapunzel_30F90E69-1EC9-D45B-1CDDE3224E6A6844_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_3312658.html","width":130,"caption":"","height":130});
															thumbnails[3953996] = clik.newPhoto({"id":3953996,"src":"KingsJustice1-2_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_3953996.html","width":130,"caption":"","height":130});
															thumbnails[2542628] = clik.newPhoto({"id":2542628,"src":"Chess_07927483-24E8-5EC4-4FC8CF556A6A2707_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_2542628.html","width":130,"caption":"","height":130});
															thumbnails[5360935] = clik.newPhoto({"id":5360935,"src":"TheOrchard_D65C61C2-1EC9-D45B-1CF84EA9A4D4F810_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_5360935.html","width":130,"caption":"","height":130});
															thumbnails[5360957] = clik.newPhoto({"id":5360957,"src":"SecretAgent_BBC_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_5360957.html","width":130,"caption":"","height":130});
															thumbnails[2657385] = clik.newPhoto({"id":2657385,"src":"WTGTB_cover_06E0C94B-24E8-5EC4-4F0ADB9CEC69486A_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_2657385.html","width":130,"caption":"","height":130});
															thumbnails[5976287] = clik.newPhoto({"id":5976287,"src":"Diggers_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_5976287.html","width":130,"caption":"","height":130});
															thumbnails[8972631] = clik.newPhoto({"id":8972631,"src":"BWF_cover_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_8972631.html","width":130,"caption":"","height":130});
															thumbnails[3041409] = clik.newPhoto({"id":3041409,"src":"Coriander_308AD542-1EC9-D45B-1CEF4C98F8175785_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_3041409.html","width":130,"caption":"","height":130});
															thumbnails[5994682] = clik.newPhoto({"id":5994682,"src":"BWF-Finals_0616536D-24E8-5EC4-4F22FDA9F4F0D861_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_5994682.html","width":130,"caption":"","height":130});
															thumbnails[6213582] = clik.newPhoto({"id":6213582,"src":"SightSound_AugCover_06920774-24E8-5EC4-4F3BF165BD1FB099_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_6213582.html","width":130,"caption":"","height":130});
															thumbnails[8988501] = clik.newPhoto({"id":8988501,"src":"BWF-Finals2_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_8988501.html","width":130,"caption":"","height":130});
															thumbnails[3041416] = clik.newPhoto({"id":3041416,"src":"SpringOnions_08CCA6AE-24E8-5EC4-4F01D947F4D5B49D_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_3041416.html","width":130,"caption":"","height":130});
															thumbnails[5360986] = clik.newPhoto({"id":5360986,"src":"GHOSTRIDER-Final_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_5360986.html","width":130,"caption":"","height":130});
															thumbnails[6484801] = clik.newPhoto({"id":6484801,"src":"GQ_sole_06AB05D9-24E8-5EC4-4F63B3B2A9937244_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_6484801.html","width":130,"caption":"","height":130});
															thumbnails[3604642] = clik.newPhoto({"id":3604642,"src":"Blewits_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_3604642.html","width":130,"caption":"","height":130});
															thumbnails[7001015] = clik.newPhoto({"id":7001015,"src":"wiredFinal2_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_7001015.html","width":130,"caption":"","height":130});
															thumbnails[7504268] = clik.newPhoto({"id":7504268,"src":"Tomatoes2_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_7504268.html","width":130,"caption":"","height":130});
															thumbnails[5116941] = clik.newPhoto({"id":5116941,"src":"ChildsI1_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_5116941.html","width":130,"caption":"","height":130});
															thumbnails[7000958] = clik.newPhoto({"id":7000958,"src":"coldcomfort-final_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_7000958.html","width":130,"caption":"","height":130});
															thumbnails[7504275] = clik.newPhoto({"id":7504275,"src":"Tomatoes1_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_7504275.html","width":130,"caption":"","height":130});
															thumbnails[5116944] = clik.newPhoto({"id":5116944,"src":"ChildI2_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_5116944.html","width":130,"caption":"","height":130});
															thumbnails[7001023] = clik.newPhoto({"id":7001023,"src":"Potatoes1_2EDA10BC-1EC9-D45B-1CD054A4725A7C4F_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_7001023.html","width":130,"caption":"","height":130});
															thumbnails[7504325] = clik.newPhoto({"id":7504325,"src":"gamechanger-final_thumb.jpg","galleries_id":473385,"server_id":1,"link":"photo_7504325.html","width":130,"caption":"","height":130});
															thumbnails[3631058] = clik.newPhoto({"id":3631058,"src":"RedRidingHood_302F17E5-1EC9-D45B-1C7C139B35A93A4C_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_3631058.html","width":130,"caption":"","height":130});
															thumbnails[7001028] = clik.newPhoto({"id":7001028,"src":"Potatoes2_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_7001028.html","width":130,"caption":"","height":130});
															thumbnails[6213559] = clik.newPhoto({"id":6213559,"src":"Headlights_cover_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_6213559.html","width":130,"caption":"","height":130});
															thumbnails[7842955] = clik.newPhoto({"id":7842955,"src":"TheWaitingRoom_067B1CAB-24E8-5EC4-4FC1868898DF85C2_thumb.jpg","galleries_id":473384,"server_id":1,"link":"photo_7842955.html","width":130,"caption":"","height":130});
															thumbnails[8977134] = clik.newPhoto({"id":8977134,"src":"ChambersandValves_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_8977134.html","width":130,"caption":"","height":130});
															thumbnails[7504679] = clik.newPhoto({"id":7504679,"src":"EyeofWorld_cover_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_7504679.html","width":130,"caption":"","height":130});
															thumbnails[8979093] = clik.newPhoto({"id":8979093,"src":"Serge_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_8979093.html","width":130,"caption":"","height":130});
															thumbnails[8016630] = clik.newPhoto({"id":8016630,"src":"LouieLola_06D7F423-24E8-5EC4-4FC6E7083AD8EBFE_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_8016630.html","width":130,"caption":"","height":130});
															thumbnails[7684599] = clik.newPhoto({"id":7684599,"src":"BigWillyBabykins1_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_7684599.html","width":130,"caption":"","height":117});
															thumbnails[8979098] = clik.newPhoto({"id":8979098,"src":"TheGoodLife_thumb.jpg","galleries_id":473386,"server_id":1,"link":"photo_8979098.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[473384] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Books","link":"Illustration_473384.html","maxRecords":0.0,"photoIDs":[2657388.0,5360935.0,8972631.0,5994682.0,8988501.0,5360986.0,7504268.0,7504275.0,7001023.0,7001028.0,7842955.0],"skipIndex":0,"section_code":"Illustration","featured_images":3576714,"id":473384,"singleSection":false});				  						galleries[473385] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Editorials","link":"Illustration_473385.html","maxRecords":0.0,"photoIDs":[3953996.0,5360957.0,5976287.0,6213582.0,6484801.0,7001015.0,7000958.0,7504325.0],"skipIndex":0,"section_code":"Illustration","featured_images":3199421,"id":473385,"singleSection":false});				  						galleries[473386] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Everything Else","link":"Illustration_473386.html","maxRecords":0.0,"photoIDs":[3312658.0,2542628.0,2657385.0,3041409.0,3041416.0,3604642.0,5116941.0,5116944.0,3631058.0,6213559.0,8977134.0,7504679.0,8979093.0,8016630.0,7684599.0,8979098.0],"skipIndex":0,"section_code":"Illustration","featured_images":2515018,"id":473386,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8999542,7504278,7504325,7684599';
imageSets[2] = '6484801,5116944,3431007,2516473';
imageSets[3] = '8999542,8999505,8999144,8995655,8994844,8994823,8994814,8994808,8988501,8979098,8979093,8977134,8972631,8016630,7978946,7842955,7684599,7504679,7504325,7504278,7504275,7504268,7106671,7001028,7001023,7001015,7000958,6484801,6484737,6325611,6213582,6213559,5994682,5976287,5360986,5360957,5360935,5116944,5116941,5093572,3953996,3631058,3604642,3576714,3472111,3431007,3312658,3199421,3041416,3041409';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/beccaj/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/beccaj/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/beccaj/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 += 'Illustration.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 && 'Illustration' != '') {
					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 = 'Becca Thorne Illustrator: ' + 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;
	}
}

			

