window.thumbnails = new Object();
												thumbnails[3096621] = new thumbnail(3096621,'382599','','Charlotte & Adam Wedding  (8) Medium Web view_thumb.jpg',130, 196,32,'photo_3096621.html');
												thumbnails[3096655] = new thumbnail(3096655,'382599','','Matt And Sarah 241 Large Web view_thumb.jpg',130, 86,32,'photo_3096655.html');
												thumbnails[3900285] = new thumbnail(3900285,'382599','','Amy--Tom-Wedding-378-copy_thumb.jpg',130, 87,32,'photo_3900285.html');
												thumbnails[3900571] = new thumbnail(3900571,'382599','','Gemma--Graham-0205-3_thumb.jpg',130, 85,32,'photo_3900571.html');
												thumbnails[6278327] = new thumbnail(6278327,'382599','','Ellie--Daniel-wedding-751_thumb.jpg',130, 87,32,'photo_6278327.html');
												thumbnails[6278378] = new thumbnail(6278378,'382599','','Rebecca--William--154123_thumb.jpg',130, 195,32,'photo_6278378.html');
												thumbnails[6280493] = new thumbnail(6280493,'382599','','Rebecca--William--531_thumb.jpg',130, 87,32,'photo_6280493.html');
												thumbnails[6280494] = new thumbnail(6280494,'382599','','David--Yvonne-2511_thumb.jpg',130, 195,32,'photo_6280494.html');
												thumbnails[6280495] = new thumbnail(6280495,'382599','','Kelly--Kate-177-copy1_thumb.jpg',130, 87,32,'photo_6280495.html');
												thumbnails[6280496] = new thumbnail(6280496,'382599','','carla--James-3381_thumb.jpg',130, 195,32,'photo_6280496.html');
												thumbnails[6280524] = new thumbnail(6280524,'382599','','Sarah--David-544_thumb.jpg',130, 86,32,'photo_6280524.html');
												thumbnails[6280526] = new thumbnail(6280526,'382599','','Sarah--David-97_thumb.jpg',130, 115,32,'photo_6280526.html');
												thumbnails[6280527] = new thumbnail(6280527,'382599','','Rebecca--William--147_thumb.jpg',130, 87,32,'photo_6280527.html');
												thumbnails[6280528] = new thumbnail(6280528,'382599','','Louise--Dean-304_thumb.jpg',130, 183,32,'photo_6280528.html');
												thumbnails[6280529] = new thumbnail(6280529,'382599','','IMG_0298_thumb.jpg',130, 87,32,'photo_6280529.html');
												thumbnails[6280531] = new thumbnail(6280531,'382599','','carla--James-227ps_thumb.jpg',130, 87,32,'photo_6280531.html');
												thumbnails[6280532] = new thumbnail(6280532,'382599','','Amy--Bob-Wedding-214_thumb.jpg',130, 110,32,'photo_6280532.html');
												thumbnails[6280544] = new thumbnail(6280544,'382599','','Sarah--David-495_thumb.jpg',130, 86,32,'photo_6280544.html');
												thumbnails[6280546] = new thumbnail(6280546,'382599','','Sara--Ian-090_thumb.jpg',130, 87,32,'photo_6280546.html');
												thumbnails[6280547] = new thumbnail(6280547,'382599','','Nicole--Marc-Day-211_thumb.jpg',130, 87,32,'photo_6280547.html');
												thumbnails[6280549] = new thumbnail(6280549,'382599','','Louise--Dean-141_thumb.jpg',130, 195,32,'photo_6280549.html');
												thumbnails[6280551] = new thumbnail(6280551,'382599','','IMG_0019-copy_thumb.jpg',130, 195,32,'photo_6280551.html');
												thumbnails[6280646] = new thumbnail(6280646,'382599','','Sarah--David-489_thumb.jpg',130, 196,32,'photo_6280646.html');
												thumbnails[6280648] = new thumbnail(6280648,'382599','','Sarah--David-272_thumb.jpg',130, 87,32,'photo_6280648.html');
												thumbnails[6280649] = new thumbnail(6280649,'382599','','Sarah--David-268_thumb.jpg',130, 195,32,'photo_6280649.html');
												thumbnails[6280650] = new thumbnail(6280650,'382599','','Sarah--David-228_thumb.jpg',130, 195,32,'photo_6280650.html');
												thumbnails[6280654] = new thumbnail(6280654,'382599','','Leigh--Natalie-184_thumb.jpg',130, 195,32,'photo_6280654.html');
												thumbnails[6280657] = new thumbnail(6280657,'382599','','Kelly--Kate-035_thumb.jpg',130, 95,32,'photo_6280657.html');
												thumbnails[6280659] = new thumbnail(6280659,'382599','','David--Yvonne-684_thumb.jpg',130, 86,32,'photo_6280659.html');
												thumbnails[6280660] = new thumbnail(6280660,'382599','','Amy--Bob-Wedding-299_thumb.jpg',130, 87,32,'photo_6280660.html');
												thumbnails[6288361] = new thumbnail(6288361,'382599','','Zoe--Mark-Wedding-157_thumb.jpg',130, 87,32,'photo_6288361.html');
												thumbnails[6288363] = new thumbnail(6288363,'382599','','Sarah--David-516_thumb.jpg',130, 105,32,'photo_6288363.html');
												thumbnails[6288370] = new thumbnail(6288370,'382599','','Sarah--David-425_thumb.jpg',130, 87,32,'photo_6288370.html');
												thumbnails[6288372] = new thumbnail(6288372,'382599','','Sara--Ian-137_thumb.jpg',130, 87,32,'photo_6288372.html');
												thumbnails[6288374] = new thumbnail(6288374,'382599','','Sarah--David-237_thumb.jpg',130, 195,32,'photo_6288374.html');
												thumbnails[6288375] = new thumbnail(6288375,'382599','','IMG_0202-copy2_thumb.jpg',130, 87,32,'photo_6288375.html');
												thumbnails[6288377] = new thumbnail(6288377,'382599','','Ellie--Daniel-wedding-139_thumb.jpg',130, 195,32,'photo_6288377.html');
												thumbnails[6288381] = new thumbnail(6288381,'382599','','David--Yvonne-350-copy_thumb.jpg',130, 195,32,'photo_6288381.html');
												thumbnails[6288459] = new thumbnail(6288459,'382599','','Sarah--David-532_thumb.jpg',130, 196,32,'photo_6288459.html');
												thumbnails[6288462] = new thumbnail(6288462,'382599','','Sarah--David-498_thumb.jpg',130, 196,32,'photo_6288462.html');
												thumbnails[6288463] = new thumbnail(6288463,'382599','','Sarah--David-424_thumb.jpg',130, 195,32,'photo_6288463.html');
												thumbnails[6288465] = new thumbnail(6288465,'382599','','Sarah--David-111_thumb.jpg',130, 87,32,'photo_6288465.html');
												thumbnails[6288466] = new thumbnail(6288466,'382599','','Kelly--Kate-043_thumb.jpg',130, 87,32,'photo_6288466.html');
												thumbnails[6288468] = new thumbnail(6288468,'382599','','Ellie--Daniel-wedding-202_thumb.jpg',130, 87,32,'photo_6288468.html');
												thumbnails[6288470] = new thumbnail(6288470,'382599','','Louise--Dean-299_thumb.jpg',130, 195,32,'photo_6288470.html');
												thumbnails[6364150] = new thumbnail(6364150,'382958','','Amber-Background-003_thumb.jpg',130, 98,32,'photo_6364150.html');
												thumbnails[6364151] = new thumbnail(6364151,'382958','','Chilly-3_thumb.jpg',130, 89,32,'photo_6364151.html');
												thumbnails[6364152] = new thumbnail(6364152,'382958','','Chilly-4_thumb.jpg',130, 195,32,'photo_6364152.html');
												thumbnails[6364153] = new thumbnail(6364153,'382958','','Glenfield-Shoot--36_thumb.jpg',130, 87,32,'photo_6364153.html');
												thumbnails[6364154] = new thumbnail(6364154,'382958','','Glenfield-Shoot--41_thumb.jpg',130, 87,32,'photo_6364154.html');
												thumbnails[6364155] = new thumbnail(6364155,'382958','','Glenfield-Shoot--71_thumb.jpg',130, 87,32,'photo_6364155.html');
												thumbnails[6364156] = new thumbnail(6364156,'382958','','Glenfield-Shoot--76_thumb.jpg',130, 195,32,'photo_6364156.html');
												thumbnails[6364157] = new thumbnail(6364157,'382958','','Glenfield-Shoot--77_thumb.jpg',130, 195,32,'photo_6364157.html');
												thumbnails[6364159] = new thumbnail(6364159,'382958','','Glenfield-Shoot--84_thumb.jpg',130, 195,32,'photo_6364159.html');
												thumbnails[6364160] = new thumbnail(6364160,'382958','','Glenfield-Shoot--117_thumb.jpg',130, 87,32,'photo_6364160.html');
												thumbnails[6364161] = new thumbnail(6364161,'382958','','Glenfield-Shoot--134_thumb.jpg',130, 87,32,'photo_6364161.html');
												thumbnails[6364162] = new thumbnail(6364162,'382958','','Glenfield-Shoot--165_thumb.jpg',130, 87,32,'photo_6364162.html');
												thumbnails[6364163] = new thumbnail(6364163,'382958','','Glenfield-Shoot--206_thumb.jpg',130, 87,32,'photo_6364163.html');
												thumbnails[6364165] = new thumbnail(6364165,'382958','','Glenfield-Shoot--275_thumb.jpg',130, 87,32,'photo_6364165.html');
												thumbnails[6364166] = new thumbnail(6364166,'382958','','Glenfield-Shoot--288_thumb.jpg',130, 96,32,'photo_6364166.html');
												thumbnails[6364167] = new thumbnail(6364167,'382958','','Glenfield-Shoot--396_thumb.jpg',130, 195,32,'photo_6364167.html');
												thumbnails[6364168] = new thumbnail(6364168,'382958','','Glenfield-Shoot--406_thumb.jpg',130, 195,32,'photo_6364168.html');
												thumbnails[6364169] = new thumbnail(6364169,'382958','','Kelly-10_thumb.jpg',130, 195,32,'photo_6364169.html');
												thumbnails[6364170] = new thumbnail(6364170,'382958','','Photo-Shoot-001-2_thumb.jpg',130, 198,32,'photo_6364170.html');
												thumbnails[6364173] = new thumbnail(6364173,'382958','','Photo-Shoot-001-9_thumb.jpg',130, 87,32,'photo_6364173.html');
												thumbnails[6364174] = new thumbnail(6364174,'382958','','Photo-Shoot-001-11_thumb.jpg',130, 195,32,'photo_6364174.html');
												thumbnails[6364175] = new thumbnail(6364175,'382958','','Photo-Shoot-001-32_thumb.jpg',130, 195,32,'photo_6364175.html');
												thumbnails[6364179] = new thumbnail(6364179,'382958','','Photo-Shoot-001-87_thumb.jpg',130, 195,32,'photo_6364179.html');
												thumbnails[6364181] = new thumbnail(6364181,'382958','','Photo-Shoot-029_thumb.jpg',130, 207,32,'photo_6364181.html');
												thumbnails[6364182] = new thumbnail(6364182,'382958','','Photo-Shoot-030_thumb.jpg',130, 87,32,'photo_6364182.html');
												thumbnails[6364184] = new thumbnail(6364184,'382958','','Photo-Shoot-046_thumb.jpg',130, 87,32,'photo_6364184.html');
												thumbnails[6364186] = new thumbnail(6364186,'382958','','Photo-Shoot-047_thumb.jpg',130, 87,32,'photo_6364186.html');
												thumbnails[6364187] = new thumbnail(6364187,'382958','','Photo-Shoot-054_thumb.jpg',130, 87,32,'photo_6364187.html');
												thumbnails[6364189] = new thumbnail(6364189,'382958','','Photo-Shoot-060_thumb.jpg',130, 87,32,'photo_6364189.html');
												thumbnails[6364191] = new thumbnail(6364191,'382958','','Photo-Shoot-169_thumb.jpg',130, 90,32,'photo_6364191.html');
												thumbnails[6364192] = new thumbnail(6364192,'382958','','Photo-Shoot-204_thumb.jpg',130, 88,32,'photo_6364192.html');
												thumbnails[6364193] = new thumbnail(6364193,'382958','','Photo-Shoot-232_thumb.jpg',130, 195,32,'photo_6364193.html');
												thumbnails[6364194] = new thumbnail(6364194,'382958','','Photo-Shoot-291_thumb.jpg',130, 184,32,'photo_6364194.html');
												thumbnails[6364195] = new thumbnail(6364195,'382958','','Photo-Shoot-300_thumb.jpg',130, 195,32,'photo_6364195.html');
												thumbnails[6364197] = new thumbnail(6364197,'382958','','Photo-Shoot-321_thumb.jpg',130, 190,32,'photo_6364197.html');
												thumbnails[6364198] = new thumbnail(6364198,'382958','','Photo-Shoot-516_thumb.jpg',130, 87,32,'photo_6364198.html');
												thumbnails[6364200] = new thumbnail(6364200,'382958','','Photo-Shoot-5431_thumb.jpg',130, 94,32,'photo_6364200.html');
												thumbnails[6364201] = new thumbnail(6364201,'382958','','Photo-Shoot-748_thumb.jpg',130, 114,32,'photo_6364201.html');
												thumbnails[6364202] = new thumbnail(6364202,'382958','','Photo-Shoot-770_thumb.jpg',130, 63,32,'photo_6364202.html');
												thumbnails[6364203] = new thumbnail(6364203,'382958','','Photo-Shoot-931_thumb.jpg',130, 174,32,'photo_6364203.html');
												thumbnails[6364204] = new thumbnail(6364204,'382958','','Sally-Shoot-076_thumb.jpg',130, 98,32,'photo_6364204.html');
												thumbnails[7183239] = new thumbnail(7183239,'382599','','Erica--Scott-101web_thumb.gif',130, 195,32,'photo_7183239.html');
												thumbnails[7183282] = new thumbnail(7183282,'382599','','Erica--Scott-115_thumb.gif',130, 87,32,'photo_7183282.html');
												thumbnails[7183317] = new thumbnail(7183317,'382599','','Erica--Scott-1561_thumb.gif',130, 87,32,'photo_7183317.html');
												thumbnails[7183320] = new thumbnail(7183320,'382599','','Erica--Scott-168_thumb.gif',130, 195,32,'photo_7183320.html');
												thumbnails[7184175] = new thumbnail(7184175,'382599','','Erica--Scott-233_thumb.gif',130, 87,32,'photo_7184175.html');
												thumbnails[7184178] = new thumbnail(7184178,'382599','','Erica--Scott-280_thumb.gif',130, 87,32,'photo_7184178.html');
												thumbnails[7345916] = new thumbnail(7345916,'382599','','Erica--Scott-33_thumb.gif',130, 195,32,'photo_7345916.html');
												thumbnails[7345941] = new thumbnail(7345941,'382599','','Nicole--Stephen-463_thumb.jpg',130, 87,32,'photo_7345941.html');
												thumbnails[7345945] = new thumbnail(7345945,'382599','','Erica--Scott-260_thumb.jpg',130, 195,32,'photo_7345945.html');
												thumbnails[7345947] = new thumbnail(7345947,'382599','','Nicole--Stephen-338_thumb.jpg',130, 87,32,'photo_7345947.html');
												thumbnails[7345949] = new thumbnail(7345949,'382599','','Nicole--Stephen-397_thumb.jpg',130, 195,32,'photo_7345949.html');
												thumbnails[7345950] = new thumbnail(7345950,'382599','','Nicole--Stephen-505_thumb.jpg',130, 87,32,'photo_7345950.html');
												thumbnails[7345952] = new thumbnail(7345952,'382599','','Nicole--Stephen-500_thumb.jpg',130, 195,32,'photo_7345952.html');
												thumbnails[7345955] = new thumbnail(7345955,'382599','','Nicole--Stephen-479_thumb.jpg',130, 195,32,'photo_7345955.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[382958] = new gallery(382958,'6364204,6364203,6364202,6364201,6364200,6364198,6364197,6364195,6364194,6364193','Photo Shoot','section455109',[6364150,6364151,6364152,6364153,6364154,6364155,6364156,6364157,6364159,6364160,6364161,6364162,6364163,6364165,6364166,6364167,6364168,6364169,6364170,6364173,6364174,6364175,6364179,6364181,6364182,6364184,6364186,6364187,6364189,6364191,6364192,6364193,6364194,6364195,6364197,6364198,6364200,6364201,6364202,6364203,6364204],0, 1, '', 'section455109_382958.html',0,0);
				  					galleries[382599] = new gallery(382599,'7345955,7345952,7345950,7345949,7345947,7345945,7345941,7345916,7184178,7184175','Wedding','section455109',[3096621,3096655,3900285,3900571,6278327,6278378,6280493,6280494,6280495,6280496,6280524,6280526,6280527,6280528,6280529,6280531,6280532,6280544,6280546,6280547,6280549,6280551,6280646,6280648,6280649,6280650,6280654,6280657,6280659,6280660,6288361,6288363,6288370,6288372,6288374,6288375,6288377,6288381,6288459,6288462,6288463,6288465,6288466,6288468,6288470,7183239,7183282,7183317,7183320,7184175,7184178,7345916,7345941,7345945,7345947,7345949,7345950,7345952,7345955],0, 1, '', 'section455109_382599.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6288470,6288377,6288375,6280654,6280648,6280527,6280493,6278327,3900285,3096621';
imageSets[3] = '7345955,7345952,7345950,7345949,7345947,7345945,7345941,7345916,7184178,7184175,7183320,7183317,7183282,7183239,6364204,6364203,6364202,6364201,6364200,6364198,6364197,6364195,6364194,6364193,6364192,6364191,6364189,6364187,6364186,6364184,6364182,6364181,6364179,6364175,6364174,6364173,6364170,6364169,6364168,6364167,6364166,6364165,6364163,6364162,6364161,6364160,6364159,6364157,6364156,6364155';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kelly_snaps/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kelly_snaps/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 += 'section455109.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 && 'section455109' != '') {
					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 = 'kellysnaps: ' + 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 == undefined) {
    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;
	}
}

			

