window.thumbnails = {};
															thumbnails[5782132] = clik.newPhoto({"id":5782132,"src":"Workshops5_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":32});
															thumbnails[5923147] = clik.newPhoto({"id":5923147,"src":"Twitter_button_smaller_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[8650664] = clik.newPhoto({"id":8650664,"src":"IMG_1488_2smaller_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":88,"caption":"","height":130});
															thumbnails[5348700] = clik.newPhoto({"id":5348700,"src":"1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5805438] = clik.newPhoto({"id":5805438,"src":"Website152_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5805447] = clik.newPhoto({"id":5805447,"src":"Website162_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5805528] = clik.newPhoto({"id":5805528,"src":"Website17_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5805542] = clik.newPhoto({"id":5805542,"src":"Website182_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5356429] = clik.newPhoto({"id":5356429,"src":"Website7_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":130});
															thumbnails[5348286] = clik.newPhoto({"id":5348286,"src":"IMG_2251_13FA6BD1-1D09-001F-993CE089BFE21E7E_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_5348286.html","width":130,"caption":"","height":130});
															thumbnails[5348340] = clik.newPhoto({"id":5348340,"src":"IMG_2315_thumb.jpg","galleries_id":444242,"server_id":5,"link":"photo_5348340.html","width":130,"caption":"","height":130});
															thumbnails[5348413] = clik.newPhoto({"id":5348413,"src":"website4_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_5348413.html","width":130,"caption":"","height":130});
															thumbnails[5348556] = clik.newPhoto({"id":5348556,"src":"Untitled101_thumb.jpg","galleries_id":444234,"server_id":5,"link":"photo_5348556.html","width":130,"caption":"","height":130});
															thumbnails[5348716] = clik.newPhoto({"id":5348716,"src":"Film_thumb.jpg","galleries_id":292594,"server_id":5,"link":"photo_5348716.html","width":130,"caption":"","height":130});
															thumbnails[5356451] = clik.newPhoto({"id":5356451,"src":"Websiteagain_thumb.jpg","galleries_id":292594,"server_id":5,"link":"photo_5356451.html","width":130,"caption":"","height":130});
															thumbnails[5356568] = clik.newPhoto({"id":5356568,"src":"websiteagain1_thumb.jpg","galleries_id":292594,"server_id":5,"link":"photo_5356568.html","width":130,"caption":"","height":130});
															thumbnails[7401795] = clik.newPhoto({"id":7401795,"src":"Website24_thumb.jpg","galleries_id":444243,"server_id":5,"link":"photo_7401795.html","width":130,"caption":"","height":130});
															thumbnails[7570705] = clik.newPhoto({"id":7570705,"src":"kathryn_desforges_artist_printmaker_corners_book1_thumb.jpg","galleries_id":410596,"server_id":5,"link":"photo_7570705.html","width":130,"caption":"","height":130});
															thumbnails[7570709] = clik.newPhoto({"id":7570709,"src":"kathryn_desforges_artist_printmaker_corners_book2_thumb.jpg","galleries_id":410596,"server_id":5,"link":"photo_7570709.html","width":130,"caption":"","height":130});
															thumbnails[7570711] = clik.newPhoto({"id":7570711,"src":"kathryn_desforges_artist_printmaker_corners_book3_thumb.jpg","galleries_id":410596,"server_id":5,"link":"photo_7570711.html","width":130,"caption":"","height":130});
															thumbnails[7570716] = clik.newPhoto({"id":7570716,"src":"kathryn_desforges_artist_printmaker_corners_book4_thumb.jpg","galleries_id":410596,"server_id":5,"link":"photo_7570716.html","width":130,"caption":"","height":130});
															thumbnails[7570841] = clik.newPhoto({"id":7570841,"src":"kathryn_desforges_artist_printmaker_of_walls_pavements_and_shadows2_thumb.jpg","galleries_id":410597,"server_id":5,"link":"photo_7570841.html","width":130,"caption":"","height":130});
															thumbnails[7570844] = clik.newPhoto({"id":7570844,"src":"kathryn_desforges_artist_printmaker_of_walls_pavements_and_shadows_thumb.jpg","galleries_id":410597,"server_id":5,"link":"photo_7570844.html","width":130,"caption":"","height":130});
															thumbnails[7570845] = clik.newPhoto({"id":7570845,"src":"kathryn_desforges_artist_printmaker_of_walls_pavements_and_shadows3_thumb.jpg","galleries_id":410597,"server_id":5,"link":"photo_7570845.html","width":130,"caption":"","height":130});
															thumbnails[7570846] = clik.newPhoto({"id":7570846,"src":"kathryn_desforges_artist_printmaker_of_walls_pavements_and_shadows4_thumb.jpg","galleries_id":410597,"server_id":5,"link":"photo_7570846.html","width":130,"caption":"","height":130});
															thumbnails[7571808] = clik.newPhoto({"id":7571808,"src":"Website40_thumb.jpg","galleries_id":410642,"server_id":5,"link":"photo_7571808.html","width":130,"caption":"","height":130});
															thumbnails[7571818] = clik.newPhoto({"id":7571818,"src":"Website39_thumb.jpg","galleries_id":410642,"server_id":5,"link":"photo_7571818.html","width":128,"caption":"","height":130});
															thumbnails[7571825] = clik.newPhoto({"id":7571825,"src":"Website41_thumb.jpg","galleries_id":410642,"server_id":5,"link":"photo_7571825.html","width":130,"caption":"","height":130});
															thumbnails[7571832] = clik.newPhoto({"id":7571832,"src":"Website43_thumb.jpg","galleries_id":410642,"server_id":5,"link":"photo_7571832.html","width":130,"caption":"","height":130});
															thumbnails[5510391] = clik.newPhoto({"id":5510391,"src":"Website121_thumb.jpg","galleries_id":444241,"server_id":5,"link":"photo_5510391.html","width":130,"caption":"","height":130});
															thumbnails[7550154] = clik.newPhoto({"id":7550154,"src":"Website271_thumb.jpg","galleries_id":444235,"server_id":5,"link":"photo_7550154.html","width":130,"caption":"","height":130});
															thumbnails[8650486] = clik.newPhoto({"id":8650486,"src":"kathryn_desforges_artist_printmaker_shadow_drawing1_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650486.html","width":130,"caption":"","height":130});
															thumbnails[8814117] = clik.newPhoto({"id":8814117,"src":"Website89_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814117.html","width":130,"caption":"","height":130});
															thumbnails[8814144] = clik.newPhoto({"id":8814144,"src":"Website94_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814144.html","width":130,"caption":"","height":128});
															thumbnails[5348543] = clik.newPhoto({"id":5348543,"src":"Untitled93_thumb.jpg","galleries_id":444234,"server_id":5,"link":"photo_5348543.html","width":130,"caption":"","height":130});
															thumbnails[5510450] = clik.newPhoto({"id":5510450,"src":"Website14_thumb.jpg","galleries_id":444241,"server_id":5,"link":"photo_5510450.html","width":130,"caption":"","height":130});
															thumbnails[7550152] = clik.newPhoto({"id":7550152,"src":"Website26_thumb.jpg","galleries_id":444235,"server_id":5,"link":"photo_7550152.html","width":130,"caption":"","height":130});
															thumbnails[8650505] = clik.newPhoto({"id":8650505,"src":"kathryn_desforges_artist_printmaker_shadow_drawing1_detail_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650505.html","width":130,"caption":"","height":130});
															thumbnails[8814161] = clik.newPhoto({"id":8814161,"src":"Website901_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814161.html","width":130,"caption":"","height":130});
															thumbnails[8814166] = clik.newPhoto({"id":8814166,"src":"Website95_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814166.html","width":130,"caption":"","height":130});
															thumbnails[5348473] = clik.newPhoto({"id":5348473,"src":"website81_thumb.jpg","galleries_id":444234,"server_id":5,"link":"photo_5348473.html","width":130,"caption":"","height":130});
															thumbnails[5786207] = clik.newPhoto({"id":5786207,"src":"Collection_of_Moments_21_thumb.jpg","galleries_id":410640,"server_id":5,"link":"photo_5786207.html","width":130,"caption":"","height":130});
															thumbnails[7550157] = clik.newPhoto({"id":7550157,"src":"Website28_thumb.jpg","galleries_id":444235,"server_id":5,"link":"photo_7550157.html","width":130,"caption":"","height":130});
															thumbnails[8650533] = clik.newPhoto({"id":8650533,"src":"kathryn_desforges_artist_printmaker_shadow_drawing2_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650533.html","width":130,"caption":"","height":130});
															thumbnails[8814163] = clik.newPhoto({"id":8814163,"src":"Website911_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814163.html","width":130,"caption":"","height":130});
															thumbnails[8814168] = clik.newPhoto({"id":8814168,"src":"Website96_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814168.html","width":130,"caption":"","height":128});
															thumbnails[5786196] = clik.newPhoto({"id":5786196,"src":"Collection_of_Moments_52_thumb.jpg","galleries_id":410640,"server_id":5,"link":"photo_5786196.html","width":130,"caption":"","height":130});
															thumbnails[8372162] = clik.newPhoto({"id":8372162,"src":"Website76_thumb.jpg","galleries_id":444235,"server_id":5,"link":"photo_8372162.html","width":130,"caption":"","height":130});
															thumbnails[8650534] = clik.newPhoto({"id":8650534,"src":"kathryn_desforges_artist_printmaker_shadow_drawing2_detail_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650534.html","width":130,"caption":"","height":130});
															thumbnails[8814164] = clik.newPhoto({"id":8814164,"src":"Website921_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814164.html","width":130,"caption":"","height":130});
															thumbnails[8814169] = clik.newPhoto({"id":8814169,"src":"Website97_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814169.html","width":130,"caption":"","height":130});
															thumbnails[8650597] = clik.newPhoto({"id":8650597,"src":"kathryn_desforges_artist_printmaker_shadow_drawing3_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650597.html","width":130,"caption":"","height":130});
															thumbnails[8814165] = clik.newPhoto({"id":8814165,"src":"Website931_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814165.html","width":130,"caption":"","height":130});
															thumbnails[8814170] = clik.newPhoto({"id":8814170,"src":"Website98_thumb.jpg","galleries_id":463997,"server_id":5,"link":"photo_8814170.html","width":130,"caption":"","height":130});
															thumbnails[8650600] = clik.newPhoto({"id":8650600,"src":"kathryn_desforges_artist_printmaker_shadow_drawing4_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650600.html","width":130,"caption":"","height":130});
															thumbnails[8650626] = clik.newPhoto({"id":8650626,"src":"kathryn_desforges_artist_printmaker_shadow_drawing5_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650626.html","width":130,"caption":"","height":130});
															thumbnails[8650629] = clik.newPhoto({"id":8650629,"src":"kathryn_desforges_artist_printmaker_shadow_drawing6_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650629.html","width":130,"caption":"","height":130});
															thumbnails[8650631] = clik.newPhoto({"id":8650631,"src":"kathryn_desforges_artist_printmaker_shadow_drawing7_thumb.jpg","galleries_id":292567,"server_id":5,"link":"photo_8650631.html","width":130,"caption":"","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[444234] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'After They Were Famous' Series","link":"gallery_444234.html","maxRecords":0.0,"photoIDs":[5348556.0,5348543.0,5348473.0],"skipIndex":0,"section_code":"gallery","featured_images":"5348556,5348543,5348473","id":444234,"singleSection":false});				  						galleries[444235] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'Cast Shadows' Series","link":"gallery_444235.html","maxRecords":0.0,"photoIDs":[7550154.0,7550152.0,7550157.0,8372162.0],"skipIndex":0,"section_code":"gallery","featured_images":"8372162,7550157,7550154,7550152","id":444235,"singleSection":false});				  						galleries[463997] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'Selected, Contained' series","link":"gallery_463997.html","maxRecords":0.0,"photoIDs":[8814117.0,8814144.0,8814161.0,8814166.0,8814163.0,8814168.0,8814164.0,8814169.0,8814165.0,8814170.0],"skipIndex":0,"section_code":"gallery","featured_images":"8814170,8814169,8814168,8814166,8814165,8814164,8814163,8814161,8814144,8814117","id":463997,"singleSection":false});				  						galleries[444241] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'Sightings'","link":"gallery_444241.html","maxRecords":0.0,"photoIDs":[5510391.0,5510450.0],"skipIndex":0,"section_code":"gallery","featured_images":"5510450,5510391","id":444241,"singleSection":false});				  						galleries[444243] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'Tea Strainer'","link":"gallery_444243.html","maxRecords":0.0,"photoIDs":[7401795.0],"skipIndex":0,"section_code":"gallery","featured_images":7401795.0,"id":444243,"singleSection":false});				  						galleries[444242] = clik.newGallery({"parentGallery":292568,"usePopups":false,"title":"'The Holes Don't Show...'","link":"gallery_444242.html","maxRecords":0.0,"photoIDs":[5348340.0],"skipIndex":0,"section_code":"gallery","featured_images":5348340.0,"id":444242,"singleSection":false});				  						galleries[410584] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Book Works","link":"gallery_410584.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"7571832,7571825,7571818,7571808,7570846,7570845,7570844,7570841,7570716,7570711","id":410584,"singleSection":false});				  						galleries[410597] = clik.newGallery({"parentGallery":410584,"usePopups":false,"title":"'...Of Walls, Pavements and Shadows'","link":"gallery_410597.html","maxRecords":0.0,"photoIDs":[7570841.0,7570844.0,7570845.0,7570846.0],"skipIndex":0,"section_code":"gallery","featured_images":"7570846,7570845,7570844,7570841","id":410597,"singleSection":false});				  						galleries[292567] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Works on Paper","link":"gallery_292567.html","maxRecords":0.0,"photoIDs":[5348286.0,5348413.0,8650486.0,8650505.0,8650533.0,8650534.0,8650597.0,8650600.0,8650626.0,8650629.0,8650631.0],"skipIndex":0,"section_code":"gallery","featured_images":"8650631,8650629,8650626,8650600,8650597,8650534,8650533,8650505,8650486,5348413","id":292567,"singleSection":false});				  						galleries[410596] = clik.newGallery({"parentGallery":410584,"usePopups":false,"title":"'Corners'","link":"gallery_410596.html","maxRecords":0.0,"photoIDs":[7570705.0,7570709.0,7570711.0,7570716.0],"skipIndex":0,"section_code":"gallery","featured_images":"7570716,7570711,7570709,7570705","id":410596,"singleSection":false});				  						galleries[292568] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Prints","link":"gallery_292568.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"8814170,8814169,8814168,8814166,8814165,8814164,8814163,8814161,8814144,8814117","id":292568,"singleSection":false});				  						galleries[410640] = clik.newGallery({"parentGallery":410584,"usePopups":false,"title":"'A Collection of Moments'","link":"gallery_410640.html","maxRecords":0.0,"photoIDs":[5786207.0,5786196.0],"skipIndex":0,"section_code":"gallery","featured_images":"5786207,5786196","id":410640,"singleSection":false});				  						galleries[410642] = clik.newGallery({"parentGallery":410584,"usePopups":false,"title":"'Peephole'","link":"gallery_410642.html","maxRecords":0.0,"photoIDs":[7571808.0,7571818.0,7571825.0,7571832.0],"skipIndex":0,"section_code":"gallery","featured_images":"7571832,7571825,7571818,7571808","id":410642,"singleSection":false});				  						galleries[292594] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Short Films \/ Animations","link":"gallery_292594.html","maxRecords":0.0,"photoIDs":[5348716.0,5356451.0,5356568.0],"skipIndex":0,"section_code":"gallery","featured_images":"5356568,5356451,5348716","id":292594,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '5348413,5348286,5805542,5510450,5786196';
imageSets[3] = '7570716,7570711,7570709,7570705';
imageSets[245744] = '8650664';
imageSets[240887] = '7570716,7570711,7570709,7570705';
imageSets[244492] = '7550154,7550152,7550157,8372162';
imageSets[244493] = '5348556,5348543,5348473';
imageSets[244494] = '5348340';
imageSets[244495] = '5510391';
imageSets[240888] = '7570846,7570845,7570844,7570841';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/katieeggy/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/katieeggy/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Kathryn Desforges Artist / Printmaker: ' + 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 !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

