window.thumbnails = new Object();
												thumbnails[3929352] = new thumbnail(3929352,'','The Conversation','Castaway006_thumb.jpg',130, 80,1,'#');
												thumbnails[3933371] = new thumbnail(3933371,'','Lesbian March 80s','lesbian_march001_thumb.jpg',130, 81,1,'#');
												thumbnails[7154661] = new thumbnail(7154661,'','','photo_sleeve_thumb.jpg',130, 185,1,'#');
												thumbnails[5304973] = new thumbnail(5304973,'','Nadja Grid','katie_grid_layers_blurrysml_thumb.jpg',130, 196,1,'#');
												thumbnails[5146828] = new thumbnail(5146828,'','You spin around and around. A circle, no access and you are elsewhere','File326_drawn_cirlesspheresml_thumb.jpg',130, 195,1,'#');
												thumbnails[5328141] = new thumbnail(5328141,'','Something long forgotten','something_long_forgotten_thumb.jpg',130, 104,1,'#');
												thumbnails[5458475] = new thumbnail(5458475,'','Half On Half Off, With Tatty Edges.','Nadja_pic_1sml1_thumb.jpg',130, 130,1,'#');
												thumbnails[5544719] = new thumbnail(5544719,'','The back of a prostitute and text contemplating the nature of those who are full of shame or who seek to shame','you_cannot_fleesml_thumb.jpg',130, 161,1,'#');
												thumbnails[5146837] = new thumbnail(5146837,'','Circle 2','File303_2spinblur_thumb.jpg',130, 206,1,'#');
												thumbnails[5328147] = new thumbnail(5328147,'','Re Member Some Thing','remember_something_bw_thumb.jpg',130, 179,1,'#');
												thumbnails[5303275] = new thumbnail(5303275,'','Cunt face','cunt_face_thumb.jpg',130, 206,1,'#');
												thumbnails[5303391] = new thumbnail(5303391,'','Me hoo','me_hoo_thumb.jpg',130, 150,1,'#');
												thumbnails[3934759] = new thumbnail(3934759,'','Self portrait as blonde','blonde_marilyn1_thumb.jpg',130, 195,1,'#');
												thumbnails[3929441] = new thumbnail(3929441,'','Fence','Heath_no_mans_land_3_thumb.jpg',130, 95,1,'#');
												thumbnails[3929446] = new thumbnail(3929446,'','Sky, water, grass','Heath_no_mans_land_6_thumb.jpg',130, 90,1,'#');
												thumbnails[4116200] = new thumbnail(4116200,'','The wall','The_wall_thumb.jpg',130, 81,1,'#');
												thumbnails[5458628] = new thumbnail(5458628,'','Fill nothingness, substance is past.','Nadjas_diary_2_thumb.jpg',130, 96,1,'#');
												thumbnails[3929047] = new thumbnail(3929047,'','\'Amanda, Oliver and Fire\' <br>\r\n','castaway_011_thumb.jpg',130, 79,1,'#');
												thumbnails[3929451] = new thumbnail(3929451,'','bird on water','Heath_no_mans_land_4_thumb.jpg',130, 90,1,'#');
												thumbnails[3929454] = new thumbnail(3929454,'','Willow and Grass','Heath_no_mans_land_10_thumb.jpg',130, 94,1,'#');
												thumbnails[5328155] = new thumbnail(5328155,'','Nadja and transformation','Nadja_and_the_dream_of_prostitutes_thumb.jpg',130, 87,1,'#');
												thumbnails[3934569] = new thumbnail(3934569,'','The Room','The_Room001_thumb.jpg',130, 87,1,'#');
												thumbnails[3929150] = new thumbnail(3929150,'','Nick Roeg, film director, father, white man','Castaway004_thumb.jpg',130, 79,1,'#');
												thumbnails[5477253] = new thumbnail(5477253,'','Nadja with punter as odalisque','Nadja_Park_w_punter_33_x_50_thumb.jpg',130, 87,1,'#');
												thumbnails[3929338] = new thumbnail(3929338,'','Mandy, Nick and the sea','Castaway005_thumb.jpg',130, 90,1,'#');
												thumbnails[5477368] = new thumbnail(5477368,'','The Sentence','the_sentence_thumb.jpg',130, 93,1,'#');
												thumbnails[3929414] = new thumbnail(3929414,'','Our House','Castaway007_thumb.jpg',130, 80,1,'#');
												thumbnails[3933396] = new thumbnail(3933396,'','Free Nelson Mandela','Anti_Apartied_thumb.jpg',130, 209,1,'#');
												thumbnails[3933657] = new thumbnail(3933657,'','Liverpool 1985','boat_liverpool018_thumb.jpg',130, 79,1,'#');
												thumbnails[3934552] = new thumbnail(3934552,'','The Sea','boat_Liverpool009_thumb.jpg',130, 79,1,'#');
												thumbnails[5555934] = new thumbnail(5555934,'298298','Slip Cover','Slip_cover_thumb.jpg',130, 62,1,'photo_5555934.html');
												thumbnails[7154662] = new thumbnail(7154662,'386727','','photo_sleeve1_thumb.jpg',130, 185,1,'photo_7154662.html');
												thumbnails[7154497] = new thumbnail(7154497,'386727','The Calender','Calender_thumb.jpg',130, 160,1,'photo_7154497.html');
												thumbnails[7154659] = new thumbnail(7154659,'386727','Diary detail','Diary_catholic005_thumb.jpg',130, 102,1,'photo_7154659.html');
												thumbnails[5476352] = new thumbnail(5476352,'303903','No Fear','room002_thumb.jpg',130, 122,1,'photo_5476352.html');
												thumbnails[7154434] = new thumbnail(7154434,'386727','The Annunciation ','Annunciation_w_day_star_sml_thumb.jpg',130, 178,1,'photo_7154434.html');
												thumbnails[4040655] = new thumbnail(4040655,'243432','Two men','Roman_Road_cafe_2_men12_thumb.jpg',130, 84,1,'photo_4040655.html');
												thumbnails[5368073] = new thumbnail(5368073,'304382','The Holy Ghost','mother_daughter_and_the_holy_ghost_thumb.jpg',130, 176,1,'photo_5368073.html');
												thumbnails[7571213] = new thumbnail(7571213,'386727','The Visitation','The_visitation_thumb.jpg',130, 145,1,'photo_7571213.html');
												thumbnails[7154574] = new thumbnail(7154574,'386727','The Nativity','nativity_composite_2_thumb.jpg',130, 155,1,'photo_7154574.html');
												thumbnails[7565593] = new thumbnail(7565593,'386727','The Annunciation to the Shepards','Shepards002_sml_thumb.jpg',130, 65,1,'photo_7565593.html');
												thumbnails[7254928] = new thumbnail(7254928,'386727','The Presentation detail','close_up_mother_and_child_thumb.jpg',130, 134,1,'photo_7254928.html');
												thumbnails[7259648] = new thumbnail(7259648,'386727','Adoration of the Magi','magi_comp_sml_thumb.jpg',130, 130,1,'photo_7259648.html');
												thumbnails[7259695] = new thumbnail(7259695,'386727','Adoration of the Magi detail','magi_small_party002sml_thumb.jpg',130, 129,1,'photo_7259695.html');
												thumbnails[5146462] = new thumbnail(5146462,'314881','Circle 1','I_went_to_a_photographer_of_prostitutessml_thumb.jpg',130, 195,1,'photo_5146462.html');
												thumbnails[5303401] = new thumbnail(5303401,'298394','Nadja\'s room. Plans for installation','Nadjas_Room_p1_of_5_sml_thumb.jpg',130, 184,1,'photo_5303401.html');
												thumbnails[5387299] = new thumbnail(5387299,'303903','There were crashing waves and when they hit the shore, lions and tigers were born out of the spray. ','boat_Liverpool003_thumb.jpg',130, 80,1,'photo_5387299.html');
												thumbnails[5556005] = new thumbnail(5556005,'298298','Girl under the sofa','_MG_2620a_thumb.jpg',130, 188,1,'photo_5556005.html');
												thumbnails[5147959] = new thumbnail(5147959,'314881','Circle 2','B0000443_circlesml_thumb.jpg',130, 195,1,'photo_5147959.html');
												thumbnails[5303225] = new thumbnail(5303225,'298298','Girl in the Wallpaper','In_my_Fathers_House_sml_thumb.jpg',130, 213,1,'photo_5303225.html');
												thumbnails[5303325] = new thumbnail(5303325,'290854','List','list1_thumb.jpg',130, 150,1,'photo_5303325.html');
												thumbnails[5554269] = new thumbnail(5554269,'314881','Struggle','Bacon_polar_sml_thumb.jpg',130, 87,1,'photo_5554269.html');
												thumbnails[5303330] = new thumbnail(5303330,'290854','The Sheet ','the_sheet_can_stand_thumb.jpg',130, 161,1,'photo_5303330.html');
												thumbnails[5304324] = new thumbnail(5304324,'298394','Nadja\'s room with punter','Nadjas_room_with_Punter_thumb.jpg',130, 97,1,'photo_5304324.html');
												thumbnails[5304491] = new thumbnail(5304491,'298394','The bed. ','Nadjas_bed_p2_of_5sml_thumb.jpg',130, 184,1,'photo_5304491.html');
												thumbnails[7242860] = new thumbnail(7242860,'304382','Abu Ghraib - From a film directed and produced by Cordelia Donohoe of a modern opera 2010','Lads_in_their_hundreds0171_thumb.jpg',130, 153,1,'photo_7242860.html');
												thumbnails[4052511] = new thumbnail(4052511,'243432','Blue Boy','blue_boy_thumb.jpg',130, 84,1,'photo_4052511.html');
												thumbnails[5303332] = new thumbnail(5303332,'290854','I See You','I_see_you_thumb.jpg',130, 195,1,'photo_5303332.html');
												thumbnails[5304347] = new thumbnail(5304347,'298394','Plan - behind the bed, a return to childhood.','Nadjas_Room_p5_of_5sml_thumb.jpg',130, 184,1,'photo_5304347.html');
												thumbnails[5493061] = new thumbnail(5493061,'314881','Laid ','Laid_sml_thumb.jpg',130, 87,1,'photo_5493061.html');
												thumbnails[4052460] = new thumbnail(4052460,'243432','The conversation','the_conversation_2_thumb.jpg',130, 88,1,'photo_4052460.html');
												thumbnails[4053220] = new thumbnail(4053220,'243432','Mother and Child','mother_and_child_2_thumb.jpg',130, 87,1,'photo_4053220.html');
												thumbnails[5388165] = new thumbnail(5388165,'303903','Lions and Tigers','boat_Liverpool015_thumb.jpg',130, 79,1,'photo_5388165.html');
												thumbnails[5423906] = new thumbnail(5423906,'304382','Spring of the 21st Century','book1_thumb.jpg',130, 108,1,'photo_5423906.html');
												thumbnails[5514911] = new thumbnail(5514911,'290854','Look Part','look_part_thumb.jpg',130, 192,1,'photo_5514911.html');
												thumbnails[5544660] = new thumbnail(5544660,'304382','Negative city with streetwalker and dissapointment ','city_scans021_thumb.jpg',130, 95,1,'photo_5544660.html');
												thumbnails[4053013] = new thumbnail(4053013,'243432','Squares and zig zags','Roman_Road_cafe_850181_thumb.jpg',130, 83,1,'photo_4053013.html');
												thumbnails[5423893] = new thumbnail(5423893,'298394','Nadja on Hampstead Heath 2006. C print and inked text. ed 5','nadja_pond1_thumb.jpg',130, 101,1,'photo_5423893.html');
												thumbnails[3933605] = new thumbnail(3933605,'303903','You only did what was neccesary','To_the_jetty_thumb.jpg',130, 80,1,'photo_3933605.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[386727] = new gallery(386727,'7154497','The Little Hours','gallery',[7154662,7154497,7154659,7154434,7571213,7154574,7565593,7254928,7259648,7259695],0, 0, '', 'gallery_386727.html',0,0);
				  					galleries[238357] = new gallery(238357,'5556005,5555934,5554269,5514911,5493061,5423893,5304491,5304347,5304324,5303401','Shame, whores and other performances','gallery',[],0, 0, '', 'gallery_238357.html',0,0);
				  					galleries[303903] = new gallery(303903,'5476352,5388165,5387299,3933605','The Voyage','gallery',[5476352,5387299,5388165,3933605],0, 0, '303902', 'gallery_303903.html',0,0);
				  					galleries[290854] = new gallery(290854,'5514911,5303332,5303330,5303325','Text series','gallery',[5303325,5303330,5303332,5514911],0, 0, '238357', 'gallery_290854.html',0,0);
				  					galleries[303965] = new gallery(303965,'','The Sisters','gallery',[],0, 0, '303902', 'gallery_303965.html',0,0);
				  					galleries[298298] = new gallery(298298,'5556005,5555934,5303225','In My Fathers House ','gallery',[5555934,5556005,5303225],0, 0, '238357', 'gallery_298298.html',0,0);
				  					galleries[314881] = new gallery(314881,'5554269,5493061,5147959,5146462','Distortions Through a Pimps Lens','gallery',[5146462,5147959,5554269,5493061],0, 0, '238357', 'gallery_314881.html',0,0);
				  					galleries[298394] = new gallery(298394,'5423893,5304491,5304347,5304324,5303401','Nadja\'s Room - Plans for an installation','gallery',[5303401,5304324,5304491,5304347,5423893],0, 0, '238357', 'gallery_298394.html',0,0);
				  					galleries[304382] = new gallery(304382,'7242860,5544660,5423906,5368073','Single images','gallery',[5368073,7242860,5423906,5544660],0, 0, '', 'gallery_304382.html',0,0);
				  					galleries[303902] = new gallery(303902,'5476352,5388165,5387299,3933605','Fictions','gallery',[],0, 0, '', 'gallery_303902.html',0,0);
				  					galleries[243432] = new gallery(243432,'4053220,4053013,4052511,4052460,4040655','Cafe ','gallery',[4040655,4052511,4052460,4053220,4053013],0, 0, '', 'gallery_243432.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7571213,7565593,7154662,7154661,7154574,7154497,7154434';
imageSets[2] = '7154497,3929047';
imageSets[3] = '7571213,7565593,7259695,7259648,7254928,7242860,7154662,7154661,7154659,7154574,7154497,7154434,5556005,5555934,5554269,5544719,5544660,5514911,5493061,5477368,5477253,5476352,5458628,5458475,5423906,5423893,5388165,5387299,5368073,5328155,5328147,5328141,5304973,5304491,5304347,5304324,5303401,5303391,5303332,5303330,5303325,5303275,5303225,5147959,5146837,5146828,5146462,4116200,4053220,4053013';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/cordelia/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/cordelia/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/cordelia/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/cordelia/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/cordelia/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/cordelia/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 = 'Lifelike Pictures - Cordelia Donohoe: ' + 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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				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>Buy now using PayPal:</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="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		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">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="CORDELIA">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			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;
	}
}

		

