window.thumbnails = new Object();
												thumbnails[3978947] = new thumbnail(3978947,'240776','Side one','Auguries_of_Innocence_TM_1_thumb.jpg',130, 87,15,'photo_3978947.html');
												thumbnails[3978954] = new thumbnail(3978954,'240776','Side two','Auguries_of_Innocence_TM_2_thumb.jpg',130, 87,15,'photo_3978954.html');
												thumbnails[3982323] = new thumbnail(3982323,'240777','','Outside_In_TM_1_thumb.jpg',130, 87,15,'photo_3982323.html');
												thumbnails[4000175] = new thumbnail(4000175,'240793','','Yellow_Blue_GH_1_thumb.jpg',130, 87,15,'photo_4000175.html');
												thumbnails[4000224] = new thumbnail(4000224,'240774','Gallery view','Unnatural_Naturally_TM_1_thumb.jpg',130, 87,15,'photo_4000224.html');
												thumbnails[4000385] = new thumbnail(4000385,'240772','Side one','Unity_TM_2_thumb.jpg',130, 87,15,'photo_4000385.html');
												thumbnails[4000393] = new thumbnail(4000393,'240772','Side two','Unity_TM_1_thumb.jpg',130, 87,15,'photo_4000393.html');
												thumbnails[4000399] = new thumbnail(4000399,'240779','Group shot','Treasure_TM_1_thumb.jpg',130, 87,15,'photo_4000399.html');
												thumbnails[4000400] = new thumbnail(4000400,'240778','Close up view','Slow_Explosions_TM_1_thumb.jpg',130, 87,15,'photo_4000400.html');
												thumbnails[4000409] = new thumbnail(4000409,'240775','Gallery view','Reflections_on_Transformations_GM_1_thumb.jpg',130, 87,15,'photo_4000409.html');
												thumbnails[4000420] = new thumbnail(4000420,'240775','Gallery view (detail)','Reflections_on_Transformations_detail_GM_4_thumb.jpg',130, 87,15,'photo_4000420.html');
												thumbnails[4000426] = new thumbnail(4000426,'240775','Gallery view (detail)','Reflections_on_Transformations_detail_GM_3_thumb.jpg',130, 87,15,'photo_4000426.html');
												thumbnails[4000462] = new thumbnail(4000462,'240775','Gallery view (detail)','Reflections_on_Transformations_detail_GM_2_thumb.jpg',130, 87,15,'photo_4000462.html');
												thumbnails[4000465] = new thumbnail(4000465,'240775','Gallery view','Reflections_on_Transformation_TM_1_thumb.jpg',130, 87,15,'photo_4000465.html');
												thumbnails[4000467] = new thumbnail(4000467,'240775','In situ ','Reflections_on_Transformation_TM_2_thumb.jpg',130, 87,15,'photo_4000467.html');
												thumbnails[4000832] = new thumbnail(4000832,'240792','','Red_Green_GH_1_thumb.jpg',130, 87,15,'photo_4000832.html');
												thumbnails[4000835] = new thumbnail(4000835,'240794','','Quilt_GH_1_thumb.jpg',130, 87,15,'photo_4000835.html');
												thumbnails[4000840] = new thumbnail(4000840,'240773','Gallery view ','Interdependence_TM_2_thumb.jpg',130, 87,15,'photo_4000840.html');
												thumbnails[4000841] = new thumbnail(4000841,'240773','Gallery view','Interdependence_TM_1_thumb.jpg',130, 87,15,'photo_4000841.html');
												thumbnails[4000842] = new thumbnail(4000842,'240780','','Hold_Still_TM_1_thumb.jpg',130, 87,15,'photo_4000842.html');
												thumbnails[4000843] = new thumbnail(4000843,'240790','Installation view','Edge_of_Chaos_GMcS_1_thumb.jpg',130, 87,15,'photo_4000843.html');
												thumbnails[4000846] = new thumbnail(4000846,'240790','Detail of Glass','Edge_of_Chaos_detail_TM_2_thumb.jpg',130, 87,15,'photo_4000846.html');
												thumbnails[4000849] = new thumbnail(4000849,'240791','','Blue_half_Blue_GM_1_thumb.jpg',130, 87,15,'photo_4000849.html');
												thumbnails[4001008] = new thumbnail(4001008,'240796','Side one','5x5_GH_2_thumb.jpg',130, 87,15,'photo_4001008.html');
												thumbnails[4001245] = new thumbnail(4001245,'240796','Side two','5x5_GH_1_thumb.jpg',130, 87,15,'photo_4001245.html');
												thumbnails[4001625] = new thumbnail(4001625,'240795','Side one','3x4_GH_2_thumb.jpg',130, 87,15,'photo_4001625.html');
												thumbnails[4001630] = new thumbnail(4001630,'240795','Side two','3x4_GH_1_thumb.jpg',130, 87,15,'photo_4001630.html');
												thumbnails[4001664] = new thumbnail(4001664,'240782','','Donut_TM_1_thumb.jpg',87, 130,15,'photo_4001664.html');
												thumbnails[4001704] = new thumbnail(4001704,'240790','View from outside installation','Edge_of_Chaos_GMcS_2_thumb.jpg',87, 130,15,'photo_4001704.html');
												thumbnails[4001722] = new thumbnail(4001722,'240790','detail of glass','Edge_of_Chaos_TM_3_thumb.jpg',87, 130,15,'photo_4001722.html');
												thumbnails[4001728] = new thumbnail(4001728,'240790','Installation view','Edge_of_Chaos_TM_4_thumb.jpg',87, 130,15,'photo_4001728.html');
												thumbnails[4001736] = new thumbnail(4001736,'240783','Gallery view 1, Pembroke Dock Library','In_Chaos_TM_1_thumb.jpg',87, 130,15,'photo_4001736.html');
												thumbnails[4001750] = new thumbnail(4001750,'240783','Gallery view 2, Pembroke Dock Library','In_Chaos_TM_2_thumb.jpg',87, 130,15,'photo_4001750.html');
												thumbnails[4001752] = new thumbnail(4001752,'240783','Close up view','In_Chaos_TM_3_thumb.jpg',87, 130,15,'photo_4001752.html');
												thumbnails[4001759] = new thumbnail(4001759,'240773','In situ','Interdependence_TM_3_thumb.jpg',87, 130,15,'photo_4001759.html');
												thumbnails[4001761] = new thumbnail(4001761,'240789','Detail','Make_umake_GMcS_2_thumb.jpg',87, 130,15,'photo_4001761.html');
												thumbnails[4001767] = new thumbnail(4001767,'240789','Gallery view','Make_Unmake_TM_1_thumb.jpg',50, 130,15,'photo_4001767.html');
												thumbnails[4001773] = new thumbnail(4001773,'240785','','Ring_Bling_TM_1_thumb.jpg',87, 130,15,'photo_4001773.html');
												thumbnails[4001778] = new thumbnail(4001778,'240786','','Silver_n_bronze_up_a_tree_TM_1_thumb.jpg',87, 130,15,'photo_4001778.html');
												thumbnails[4001780] = new thumbnail(4001780,'240787','','Triquetra_TM_1_thumb.jpg',87, 130,15,'photo_4001780.html');
												thumbnails[4001804] = new thumbnail(4001804,'240774','In situ','Unnatural_naturally_TM_2_thumb.jpg',87, 130,15,'photo_4001804.html');
												thumbnails[4001817] = new thumbnail(4001817,'240788','Gallery view','Untitled_TM_1_thumb.jpg',87, 130,15,'photo_4001817.html');
												thumbnails[7150061] = new thumbnail(7150061,'386477','','Sustenance_2010_Cast_Iron_Hawthorn_2_thumb.jpg',130, 93,15,'photo_7150061.html');
												thumbnails[7294989] = new thumbnail(7294989,'386478','','DSC000591_thumb.JPG',98, 130,15,'photo_7294989.html');
												thumbnails[7294991] = new thumbnail(7294991,'386478','','DSC00061_thumb.JPG',98, 130,15,'photo_7294991.html');
												thumbnails[7295002] = new thumbnail(7295002,'386478','','DSC00060_thumb.JPG',98, 130,15,'photo_7295002.html');
												thumbnails[7294886] = new thumbnail(7294886,'394617','Samantha B Walker','DSCN5142_thumb.jpg',130, 130,15,'photo_7294886.html');
												thumbnails[7294887] = new thumbnail(7294887,'394617','Samantha B Walker','DSCN5171_thumb.jpg',110, 130,15,'photo_7294887.html');
												thumbnails[7294888] = new thumbnail(7294888,'394617','Samantha B Walker','DSCN5173_thumb.jpg',106, 130,15,'photo_7294888.html');
												thumbnails[7294892] = new thumbnail(7294892,'394617','Andy Mc Ginn ','DSCN5145_thumb.jpg',110, 130,15,'photo_7294892.html');
												thumbnails[7294894] = new thumbnail(7294894,'394617','Andy Mc Ginn ','DSCN5168_thumb.jpg',114, 130,15,'photo_7294894.html');
												thumbnails[7294895] = new thumbnail(7294895,'394617','Andy Mc Ginn ','DSCN5169_thumb.jpg',106, 130,15,'photo_7294895.html');
												thumbnails[7294897] = new thumbnail(7294897,'394617','Danielle O Reilly ','DSCN5147_thumb.jpg',130, 110,15,'photo_7294897.html');
												thumbnails[7294899] = new thumbnail(7294899,'394617','Danielle O Reilly ','DSCN5174_thumb.jpg',106, 130,15,'photo_7294899.html');
												thumbnails[7294900] = new thumbnail(7294900,'394617','Danielle O Reilly ','DSCN5175_thumb.jpg',106, 130,15,'photo_7294900.html');
												thumbnails[7294901] = new thumbnail(7294901,'394617','Sean Hodgins ','DSCN5149_thumb.jpg',130, 110,15,'photo_7294901.html');
												thumbnails[7294903] = new thumbnail(7294903,'394617','Sean Hodgins ','DSCN5164_thumb.jpg',106, 130,15,'photo_7294903.html');
												thumbnails[7294904] = new thumbnail(7294904,'394617','Sean Hodgins ','DSCN5167_thumb.jpg',106, 130,15,'photo_7294904.html');
												thumbnails[7294905] = new thumbnail(7294905,'394617','James Lynch','DSCN5154_thumb.jpg',106, 130,15,'photo_7294905.html');
												thumbnails[7294908] = new thumbnail(7294908,'394617','James Lynch','DSCN5161_thumb.jpg',102, 130,15,'photo_7294908.html');
												thumbnails[7294909] = new thumbnail(7294909,'394617','James Lynch','DSCN5162_thumb.jpg',106, 130,15,'photo_7294909.html');
												thumbnails[7294910] = new thumbnail(7294910,'394617','Kecia Mc Cash','DSCN5159_thumb.jpg',102, 130,15,'photo_7294910.html');
												thumbnails[7294912] = new thumbnail(7294912,'394617','Kecia Mc Cash','DSCN5177_thumb.jpg',102, 130,15,'photo_7294912.html');
												thumbnails[7294914] = new thumbnail(7294914,'394617','Kecia Mc Cash','DSCN51791_thumb.jpg',114, 130,15,'photo_7294914.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[240795] = new gallery(240795,'4001630,4001625','3 X 4','gallery',[4001625,4001630],0, 0, '240771', 'gallery_240795.html',0,0);
				  					galleries[240796] = new gallery(240796,'4001245,4001008','5 X 5','gallery',[4001008,4001245],0, 0, '240771', 'gallery_240796.html',0,0);
				  					galleries[240776] = new gallery(240776,'3978954,3978947','Auguries of Innocence','gallery',[3978947,3978954],0, 0, '240683', 'gallery_240776.html',0,0);
				  					galleries[240791] = new gallery(240791,'4000849','Blue half blue','gallery',[4000849],0, 0, '240771', 'gallery_240791.html',0,0);
				  					galleries[394617] = new gallery(394617,'7294914,7294912,7294910,7294909,7294908,7294905,7294904,7294903,7294901,7294900,7294899,7294897,7294895,7294894,7294892,7294888,7294887,7294886','CSI 2011','section469393',[7294886,7294887,7294888,7294892,7294894,7294895,7294897,7294899,7294900,7294901,7294903,7294904,7294905,7294908,7294909,7294910,7294912,7294914],0, 0, '394618', 'section469393_394617.html',0,1);
				  					galleries[240782] = new gallery(240782,'4001664','Donut','gallery',[4001664],0, 0, '240683', 'gallery_240782.html',0,0);
				  					galleries[240790] = new gallery(240790,'4001728,4001722,4001704,4000846,4000843','Edge of Chaos','gallery',[4000843,4000846,4001704,4001722,4001728],0, 0, '240771', 'gallery_240790.html',0,0);
				  					galleries[240780] = new gallery(240780,'4000842','Hold Still','gallery',[4000842],0, 0, '240683', 'gallery_240780.html',0,0);
				  					galleries[240783] = new gallery(240783,'4001752,4001750,4001736','In Chaos','gallery',[4001736,4001750,4001752],0, 0, '240683', 'gallery_240783.html',0,0);
				  					galleries[240773] = new gallery(240773,'4001759,4000841,4000840','Interdependence','gallery',[4000840,4000841,4001759],0, 0, '240682', 'gallery_240773.html',0,0);
				  					galleries[240789] = new gallery(240789,'4001767,4001761','Make unmake','gallery',[4001761,4001767],0, 0, '240771', 'gallery_240789.html',0,0);
				  					galleries[240777] = new gallery(240777,'3982323','Outside In','gallery',[3982323],0, 0, '240683', 'gallery_240777.html',0,0);
				  					galleries[386478] = new gallery(386478,'7295002,7294991,7294989','Protective Limits','gallery',[7294989,7294991,7295002],0, 0, '240771', 'gallery_386478.html',0,0);
				  					galleries[240794] = new gallery(240794,'4000835','Quilt','gallery',[4000835],0, 0, '240771', 'gallery_240794.html',0,0);
				  					galleries[240792] = new gallery(240792,'4000832','Red Green','gallery',[4000832],0, 0, '240771', 'gallery_240792.html',0,0);
				  					galleries[240775] = new gallery(240775,'4000467,4000465,4000462,4000426,4000420,4000409','Reflections on Transformation','gallery',[4000409,4000420,4000426,4000462,4000465,4000467],0, 0, '240682', 'gallery_240775.html',0,0);
				  					galleries[240785] = new gallery(240785,'4001773','Ring Bling','gallery',[4001773],0, 0, '240683', 'gallery_240785.html',0,0);
				  					galleries[240786] = new gallery(240786,'4001778','Silver n bronze up a tree....,','gallery',[4001778],0, 0, '240683', 'gallery_240786.html',0,0);
				  					galleries[240778] = new gallery(240778,'4000400','Slow Explosions','gallery',[4000400],0, 0, '240683', 'gallery_240778.html',0,0);
				  					galleries[386477] = new gallery(386477,'7150061','Sustenance','gallery',[7150061],0, 0, '386475', 'gallery_386477.html',0,0);
				  					galleries[240779] = new gallery(240779,'4000399','Treasure','gallery',[4000399],0, 0, '240683', 'gallery_240779.html',0,0);
				  					galleries[240787] = new gallery(240787,'4001780','Triquetra','gallery',[4001780],0, 0, '240683', 'gallery_240787.html',0,0);
				  					galleries[240772] = new gallery(240772,'4000393,4000385','Unity','gallery',[4000385,4000393],0, 0, '240682', 'gallery_240772.html',0,0);
				  					galleries[240774] = new gallery(240774,'4001804,4000224','Unnatural, Naturally','gallery',[4000224,4001804],0, 0, '240682', 'gallery_240774.html',0,0);
				  					galleries[240788] = new gallery(240788,'4001817','Untitled','gallery',[4001817],0, 0, '240683', 'gallery_240788.html',0,0);
				  					galleries[240793] = new gallery(240793,'4000175','Yellow Blue','gallery',[4000175],0, 0, '240771', 'gallery_240793.html',0,0);
				  					galleries[240682] = new gallery(240682,'4001804,4001759,4000841,4000840,4000467,4000465,4000462,4000426,4000420,4000409','2007','gallery',[],0, 0, '', 'gallery_240682.html',0,0);
				  					galleries[394618] = new gallery(394618,'7294914,7294912,7294910,7294909,7294908,7294905,7294904,7294903,7294901,7294900,7294899,7294897,7294895,7294894,7294892,7294888,7294887,7294886','DYD Art Classes','section469393',[],0, 0, '', 'section469393_394618.html',0,1);
				  					galleries[240683] = new gallery(240683,'4001817,4001780,4001778,4001773,4001752,4001750,4001736,4001664,4000842,4000400','2008','gallery',[],0, 0, '', 'gallery_240683.html',0,0);
				  					galleries[240771] = new gallery(240771,'7295002,7294991,7294989,4001767,4001761,4001728,4001722,4001704,4001630,4001625','2009','gallery',[],0, 0, '', 'gallery_240771.html',0,0);
				  					galleries[386475] = new gallery(386475,'7150061','2010','gallery',[],0, 0, '', 'gallery_386475.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7295002,7294991,7294989,7150061,4001817,4001804,4001780,4001778,4001773,4001767,4001761,4001759,4001752,4001750,4001736,4001728,4001722,4001704,4001664,4001630,4001625,4001245,4001008,4000849,4000846,4000843,4000842,4000841,4000840,4000835,4000832,4000467,4000465,4000462,4000426,4000420,4000409,4000400,4000399,4000385,4000224,4000175,3982323,3978954,3978947';
imageSets[2] = '7294914,7294912,7294910,7294909,7294908,7294905,7294904,7294903,7294901,7294900,7294899,7294897,7294895,7294894,7294892,7294888,7294887,7294886';
imageSets[3] = '7294914,7294912,7294910,7294909,7294908,7294905,7294904,7294903,7294901,7294900,7294899,7294897,7294895,7294894,7294892,7294888,7294887,7294886';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/trishamoore/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/trishamoore/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:'',
                    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 (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    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));		  $('body').trigger('clikUpdate');		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Trisha Moore Sculptural Artist: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));      $('body').trigger('clikUpdate');    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			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').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = 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 = 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({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* 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 + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

