window.thumbnails = new Object();
												thumbnails[6316050] = new thumbnail(6316050,'350281','Human Marks Series 1','KirstyNIcholHumanMarks1_thumb.jpg',130, 87,32,'photo_6316050.html');
												thumbnails[6316055] = new thumbnail(6316055,'350281','Human Marks Series 2','KirstyNicholHumanMarks2_thumb.jpg',130, 87,32,'photo_6316055.html');
												thumbnails[6316056] = new thumbnail(6316056,'350281','Human Marks Series 3','KirstyNIcholHumanMarks3_thumb.jpg',130, 87,32,'photo_6316056.html');
												thumbnails[3478772] = new thumbnail(3478772,'350334','MEDUSA','MedusaKNicholKC72_thumb.jpg',130, 164,32,'photo_3478772.html');
												thumbnails[7674150] = new thumbnail(7674150,'415624','','KNicholCuba7986_thumb.jpg',130, 195,32,'photo_7674150.html');
												thumbnails[7674151] = new thumbnail(7674151,'415624','','KNicholCuba7987_thumb.jpg',130, 195,32,'photo_7674151.html');
												thumbnails[7674154] = new thumbnail(7674154,'415624','','KNicholCuba8007_thumb.jpg',130, 87,32,'photo_7674154.html');
												thumbnails[7674155] = new thumbnail(7674155,'415624','','KNicholCuba8014_thumb.jpg',130, 87,32,'photo_7674155.html');
												thumbnails[7674157] = new thumbnail(7674157,'415624','','KNicholCuba8030_thumb.jpg',130, 87,32,'photo_7674157.html');
												thumbnails[7674159] = new thumbnail(7674159,'415624','','KNicholCuba8038_thumb.jpg',130, 87,32,'photo_7674159.html');
												thumbnails[7674160] = new thumbnail(7674160,'415624','','KNicholCuba8054_thumb.jpg',130, 195,32,'photo_7674160.html');
												thumbnails[7674161] = new thumbnail(7674161,'415624','','KNicholCuba8079_thumb.jpg',130, 195,32,'photo_7674161.html');
												thumbnails[3433310] = new thumbnail(3433310,'350342','CLOSE CAMOUFLAGUE','CloseKNicholKC_thumb.jpg',130, 102,32,'photo_3433310.html');
												thumbnails[3345078] = new thumbnail(3345078,'350354','LIFE','BannerOXYKNicholKC_thumb.jpg',130, 65,32,'photo_3345078.html');
												thumbnails[3478879] = new thumbnail(3478879,'350283','SMOKING SKY','SkyKNicholKC72_thumb.jpg',130, 129,32,'photo_3478879.html');
												thumbnails[6398764] = new thumbnail(6398764,'350284','','KNicholkandusa_thumb.jpg',130, 102,32,'photo_6398764.html');
												thumbnails[3368740] = new thumbnail(3368740,'350335','TUTU','TutuKNicholKC_thumb.jpg',130, 93,32,'photo_3368740.html');
												thumbnails[3478677] = new thumbnail(3478677,'350285','EMBRYO','EmbryoKNicholKC_thumb.jpg',130, 165,32,'photo_3478677.html');
												thumbnails[3458390] = new thumbnail(3458390,'350290','MEMORIES','PharohKNicholKC72_thumb.jpg',130, 130,32,'photo_3458390.html');
												thumbnails[3458395] = new thumbnail(3458395,'350290','MEMORIES','BoatKNicholKC72_thumb.jpg',130, 130,32,'photo_3458395.html');
												thumbnails[3478825] = new thumbnail(3478825,'350290','MEMORIES','LadyKNicholKC72_thumb.jpg',130, 130,32,'photo_3478825.html');
												thumbnails[6317186] = new thumbnail(6317186,'350045','','KNicholAbstractForest1_thumb.jpg',130, 87,32,'photo_6317186.html');
												thumbnails[3345427] = new thumbnail(3345427,'350045','GLEN COE','GlenCoe2KNicholKC_thumb.jpg',130, 87,32,'photo_3345427.html');
												thumbnails[3346158] = new thumbnail(3346158,'350045','RANNOCH','RanSnowKNichol1KC_thumb.jpg',130, 87,32,'photo_3346158.html');
												thumbnails[3347648] = new thumbnail(3347648,'350045','SUNRISE on South Uist','SunriseKNicholKC_thumb.jpg',130, 87,32,'photo_3347648.html');
												thumbnails[3348441] = new thumbnail(3348441,'350045','RANNOCH MOOR','VistaKNicholKC72_thumb.jpg',130, 87,32,'photo_3348441.html');
												thumbnails[3193888] = new thumbnail(3193888,'350045','GLEN MASSAN','FallsKNicholKC_thumb.jpg',130, 92,32,'photo_3193888.html');
												thumbnails[3193881] = new thumbnail(3193881,'350045','GLEN FACE','Falls2KNicholKC1_thumb.jpg',130, 93,32,'photo_3193881.html');
												thumbnails[3345484] = new thumbnail(3345484,'350045','GLEN COE COTTAGE','GlenCoe5KNicholKC_thumb.jpg',130, 87,32,'photo_3345484.html');
												thumbnails[6318998] = new thumbnail(6318998,'350048','','KNicholAbstractForest11_thumb.jpg',130, 131,32,'photo_6318998.html');
												thumbnails[3372490] = new thumbnail(3372490,'350048','','ScotFlagKNicholKC72_thumb.jpg',130, 86,32,'photo_3372490.html');
												thumbnails[6317185] = new thumbnail(6317185,'350048','','KNicholAbstractForest2_thumb.jpg',130, 87,32,'photo_6317185.html');
												thumbnails[3348476] = new thumbnail(3348476,'350048','','Dear4KNicholKC72_thumb.jpg',130, 130,32,'photo_3348476.html');
												thumbnails[3193844] = new thumbnail(3193844,'350048','MONARCH','Stag4KNicholKC72_thumb.jpg',130, 104,32,'photo_3193844.html');
												thumbnails[3193836] = new thumbnail(3193836,'350048','STAG','Stag1KNicholKC_thumb.jpg',130, 92,32,'photo_3193836.html');
												thumbnails[3345823] = new thumbnail(3345823,'350048','STANDING STONE','SStoneKNicholKC_thumb.jpg',130, 126,32,'photo_3345823.html');
												thumbnails[3347623] = new thumbnail(3347623,'350048','SUNSET','SunsetKNicholKC_thumb.jpg',130, 87,32,'photo_3347623.html');
												thumbnails[3193858] = new thumbnail(3193858,'350048','RADIANCE Festival Glasgow 07 ','RadianceKNichol1KC_thumb.jpg',130, 92,32,'photo_3193858.html');
												thumbnails[3193873] = new thumbnail(3193873,'350048','RADIANCE Festival 07','Rad2KNicholKC_thumb.jpg',130, 92,32,'photo_3193873.html');
												thumbnails[3347669] = new thumbnail(3347669,'350048','RADIANCE Festival 07','CATHKNicholKC72_thumb.jpg',130, 184,32,'photo_3347669.html');
												thumbnails[3367358] = new thumbnail(3367358,'350048','ROBERT BURNS','Rabs1KNicholKC72_thumb.jpg',130, 195,32,'photo_3367358.html');
												thumbnails[6317075] = new thumbnail(6317075,'350317','','KirstyNicholGovInspect1_thumb.jpg',130, 195,32,'photo_6317075.html');
												thumbnails[6398780] = new thumbnail(6398780,'350049','','KNicholwedding3_thumb.jpg',130, 107,32,'photo_6398780.html');
												thumbnails[6398765] = new thumbnail(6398765,'350049','','KNicholwedding1_thumb.jpg',130, 181,32,'photo_6398765.html');
												thumbnails[3345909] = new thumbnail(3345909,'350051','','985472_thumb.jpg',130, 195,32,'photo_3345909.html');
												thumbnails[6398782] = new thumbnail(6398782,'350049','','KNicholWedding4_thumb.jpg',130, 119,32,'photo_6398782.html');
												thumbnails[3348492] = new thumbnail(3348492,'350051','','007172_thumb.jpg',130, 195,32,'photo_3348492.html');
												thumbnails[6398770] = new thumbnail(6398770,'350050','','KnIcholWedding2_thumb.jpg',130, 195,32,'photo_6398770.html');
												thumbnails[3345902] = new thumbnail(3345902,'350051','','0261Web_thumb.jpg',130, 195,32,'photo_3345902.html');
												thumbnails[3348515] = new thumbnail(3348515,'350051','','005672_thumb.jpg',130, 195,32,'photo_3348515.html');
												thumbnails[3368318] = new thumbnail(3368318,'350318','','240272_thumb.jpg',130, 87,32,'photo_3368318.html');
												thumbnails[3372269] = new thumbnail(3372269,'350318','','246972_thumb.jpg',130, 87,32,'photo_3372269.html');
												thumbnails[3372276] = new thumbnail(3372276,'350318','','256072_thumb.jpg',130, 93,32,'photo_3372276.html');
												thumbnails[3428064] = new thumbnail(3428064,'350318','','268972_thumb.jpg',130, 87,32,'photo_3428064.html');
												thumbnails[3483476] = new thumbnail(3483476,'350318','','274072_thumb.jpg',130, 195,32,'photo_3483476.html');
												thumbnails[3368341] = new thumbnail(3368341,'350318','','259272_thumb.jpg',130, 196,32,'photo_3368341.html');
												thumbnails[3194158] = new thumbnail(3194158,'350044','SCORPIO','Scorpio1KNicholKC_thumb.jpg',130, 195,32,'photo_3194158.html');
												thumbnails[3194208] = new thumbnail(3194208,'350044','VIRGO','Virgo1KNicholKC_thumb.jpg',130, 184,32,'photo_3194208.html');
												thumbnails[3194043] = new thumbnail(3194043,'350044','TAURUS<br>\r\nMATTADOR','Taurus1KNicholKC_thumb.jpg',130, 184,32,'photo_3194043.html');
												thumbnails[3194078] = new thumbnail(3194078,'350044','LEO','LeoKNicholKC_thumb.jpg',130, 184,32,'photo_3194078.html');
												thumbnails[3194064] = new thumbnail(3194064,'350044','TAURUS THE BULL','Bull1KNicholKC_thumb.jpg',130, 184,32,'photo_3194064.html');
												thumbnails[3345791] = new thumbnail(3345791,'350044','LEO','Leo2KNicholKC_thumb.jpg',130, 184,32,'photo_3345791.html');
												thumbnails[3345765] = new thumbnail(3345765,'350044','PISCES','Pisces1KNicholKC_thumb.jpg',130, 184,32,'photo_3345765.html');
												thumbnails[3345883] = new thumbnail(3345883,'350044','SCORPIO','Scorpio2KNicholKC_thumb.jpg',130, 184,32,'photo_3345883.html');
												thumbnails[3347636] = new thumbnail(3347636,'350053','GFT PROJECTIONIST','ProjctistKNicholKC_thumb.jpg',130, 195,32,'photo_3347636.html');
												thumbnails[3348448] = new thumbnail(3348448,'350053','SADNESS','SadnessKNicholKC_thumb.jpg',130, 195,32,'photo_3348448.html');
												thumbnails[3194439] = new thumbnail(3194439,'350053','John Wayne Glasgow style','JWayneKNicholKC_thumb.jpg',130, 195,32,'photo_3194439.html');
												thumbnails[3193784] = new thumbnail(3193784,'350053','VAMP','Barbie1KNicholKC1_thumb.jpg',130, 184,32,'photo_3193784.html');
												thumbnails[3368281] = new thumbnail(3368281,'350053','MASKED','JessKNicholKC72_thumb.jpg',130, 195,32,'photo_3368281.html');
												thumbnails[3372136] = new thumbnail(3372136,'350053','PLANET NARNIA','NarniaKNicholKC_thumb.jpg',130, 195,32,'photo_3372136.html');
												thumbnails[3368031] = new thumbnail(3368031,'350053','DAME EDNA','EdnaKNicholKC72_thumb.jpg',130, 195,32,'photo_3368031.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[350045] = new gallery(350045,'3347648','Landscape','gallery',[6317186,3345427,3346158,3347648,3348441,3193888,3193881,3345484],0, 0, '', 'gallery_350045.html',0,0);
				  					galleries[350048] = new gallery(350048,'6318998,3347669,3193844','Scottish','gallery',[6318998,3372490,6317185,3348476,3193844,3193836,3345823,3347623,3193858,3193873,3347669,3367358],0, 0, '', 'gallery_350048.html',0,0);
				  					galleries[350044] = new gallery(350044,'3345883,3194208','Zodiac','section488525',[3194158,3194208,3194043,3194078,3194064,3345791,3345765,3345883],0, 0, '', 'section488525_350044.html',0,0);
				  					galleries[350053] = new gallery(350053,'3372136,3368281,3368031,3348448,3347636,3194439,3193784','Portrait','section488525',[3347636,3348448,3194439,3193784,3368281,3372136,3368031],0, 0, '', 'section488525_350053.html',0,0);
				  					galleries[350317] = new gallery(350317,'6317075','Theatre Productions','section488518',[6317075],0, 0, '', 'section488518.html',0,1);
				  					galleries[350049] = new gallery(350049,'6398782','Kristy & Kieran','section417509',[6398780,6398765,6398782],0, 0, '', 'section417509_350049.html',0,0);
				  					galleries[350050] = new gallery(350050,'6398770','Victoria & Graham','section417509',[6398770],0, 0, '', 'section417509_350050.html',0,0);
				  					galleries[350051] = new gallery(350051,'3345902','John & Shona','section417509',[3345909,3348492,3345902,3348515],0, 0, '', 'section417509_350051.html',0,0);
				  					galleries[350318] = new gallery(350318,'3368341','Neil & Laura','section417509',[3368318,3372269,3372276,3428064,3483476,3368341],0, 0, '', 'section417509_350318.html',0,0);
				  					galleries[350281] = new gallery(350281,'6316056,6316055,6316050','Human Marks','section417518',[6316050,6316055,6316056],0, 0, '', 'section417518_350281.html',0,0);
				  					galleries[350334] = new gallery(350334,'3478772','Medusa','section417518',[3478772],0, 0, '', 'section417518_350334.html',0,0);
				  					galleries[415624] = new gallery(415624,'7674161,7674160,7674159,7674157,7674155,7674154,7674151,7674150','Cuba Streetlife','section417518',[7674150,7674151,7674154,7674155,7674157,7674159,7674160,7674161],0, 0, '', 'section417518_415624.html',0,0);
				  					galleries[350342] = new gallery(350342,'3433310','Glasgow','section417518',[3433310],0, 0, '', 'section417518_350342.html',0,0);
				  					galleries[350354] = new gallery(350354,'3345078','Life','section417518',[3345078],0, 0, '', 'section417518_350354.html',0,0);
				  					galleries[350283] = new gallery(350283,'3478879','Nike','section417518',[3478879],0, 0, '', 'section417518_350283.html',0,0);
				  					galleries[350284] = new gallery(350284,'6398764','Female Nude','section417518',[6398764],0, 0, '', 'section417518_350284.html',0,0);
				  					galleries[350335] = new gallery(350335,'3368740','Scottish Ballet Costume','section417518',[3368740],0, 0, '', 'section417518_350335.html',0,0);
				  					galleries[350285] = new gallery(350285,'3478677','Male Nude','section417518',[3478677],0, 0, '', 'section417518_350285.html',0,0);
				  					galleries[350290] = new gallery(350290,'3458390','Memories','section417518',[3458390,3458395,3478825],0, 0, '', 'section417518_350290.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6318998,3478879,3433310,3372490';
imageSets[2] = '6398782,6318998,6317075,3478879,3458390,3433310,3368341,3347669,3347648,3345902,3345883,3194208,3193844';
imageSets[3] = '7674161,7674160,7674159,7674157,7674155,7674154,7674151,7674150,6398782,6398780,6398770,6398765,6398764,6318998,6317186,6317185,6317075,6316056,6316055,6316050,3483476,3478879,3478825,3478772,3478677,3458395,3458390,3433310,3428064,3372490,3372276,3372269,3372136,3368740,3368341,3368318,3368281,3368031,3367358,3348515,3348492,3348476,3348448,3348441,3347669,3347648,3347636,3347623,3346158,3345909';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Kandusa/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Kandusa/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 += 'section417518.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 && 'section417518' != '') {
					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 = 'K a n d u s a   : ' + 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> &pound;' + (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 + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="item_name" value="'+item_name+'">';
								ref = '';
				if(this.photo_ref != ''){
					ref = this.photo_ref+' - '+this.caption;
				}
				else{
					ref = this.id+' - '+this.caption;
				}
				price = amount;					temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="currency_code" value="GBP">';
	temp = temp + '<input type="hidden" name="add" value="1">';
					temp = temp + '<input type="hidden" name="amount" value="'+amount+'">';
	temp = temp + '<input type="hidden" name="item_number" value="'+ref+'">';
					temp = temp + '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
									temp = temp + '</form>';
								temp = temp + '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
	temp = temp + '<input type="hidden" name="cmd" value="_cart">';
	temp = temp + '<input type="hidden" name="business" value="">';
	temp = temp + '<input type="hidden" name="display" value="1">';
	temp = temp + '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
	temp = temp + '</form>';
							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;
	}
}

			

