window.thumbnails = new Object();
												thumbnails[524583] = new thumbnail(524583,'40541','Mary','andy 034 copy_thumb.jpg',130, 178,1,'photo_524583.html');
												thumbnails[524585] = new thumbnail(524585,'40527','Frosty Quadrant','frosty quadrant copy 500001_thumb.jpg',130, 130,1,'photo_524585.html');
												thumbnails[524586] = new thumbnail(524586,'40527','Lamb','IMG_1656_thumb.jpg',130, 122,1,'photo_524586.html');
												thumbnails[524588] = new thumbnail(524588,'40527','Jairus\'s Daughter IV','Jairus 4_thumb.jpg',130, 129,1,'photo_524588.html');
												thumbnails[524589] = new thumbnail(524589,'40527','Stealth','one copy stealth_thumb.jpg',130, 173,1,'photo_524589.html');
												thumbnails[524592] = new thumbnail(524592,'40527','Studio Dream','Untitled-1_thumb.jpg',130, 116,1,'photo_524592.html');
												thumbnails[524604] = new thumbnail(524604,'40541','Jairus\'s Daughter I','andy 041 copy_thumb.jpg',130, 130,1,'photo_524604.html');
												thumbnails[524605] = new thumbnail(524605,'40541','Looking for You','andy 042_thumb.jpg',130, 129,1,'photo_524605.html');
												thumbnails[524607] = new thumbnail(524607,'40541','Self Portrait','andy 0431_thumb.jpg',130, 131,1,'photo_524607.html');
												thumbnails[524608] = new thumbnail(524608,'40541','Dream of Lazarus III','andy 054 copy_thumb.jpg',130, 132,1,'photo_524608.html');
												thumbnails[524609] = new thumbnail(524609,'40541','Jairus\'s Daughter II','andy 055 copy_thumb.jpg',130, 128,1,'photo_524609.html');
												thumbnails[524611] = new thumbnail(524611,'40542','Candlemass','candlemass_thumb.jpg',130, 129,1,'photo_524611.html');
												thumbnails[524612] = new thumbnail(524612,'40542','Silver Birch Dreaming II','i 1864 web_thumb.jpg',130, 129,1,'photo_524612.html');
												thumbnails[524613] = new thumbnail(524613,'40542','Silver Birch Dreaming I','Img_1401 copy_thumb.jpg',130, 127,1,'photo_524613.html');
												thumbnails[524615] = new thumbnail(524615,'40542','Looking for Pearls','Looking for pearls_thumb.jpg',130, 128,1,'photo_524615.html');
												thumbnails[524616] = new thumbnail(524616,'40542','Redmires','Redmires_thumb.jpg',130, 129,1,'photo_524616.html');
												thumbnails[524617] = new thumbnail(524617,'40542','Silver Birch Dreaming III','Silver Birch Web_thumb.jpg',130, 122,1,'photo_524617.html');
												thumbnails[524619] = new thumbnail(524619,'40542','First Snow Flurry','snow flurry 77 by 77 cms_thumb.jpg',130, 127,1,'photo_524619.html');
												thumbnails[626726] = new thumbnail(626726,'47905','Light over Redmires','hils 009_thumb.jpg',130, 93,1,'photo_626726.html');
												thumbnails[626727] = new thumbnail(626727,'47905','Jairus\'s Daughter','hils 012_thumb.jpg',130, 102,1,'photo_626727.html');
												thumbnails[626728] = new thumbnail(626728,'47905','','hils 013_thumb.jpg',130, 102,1,'photo_626728.html');
												thumbnails[626729] = new thumbnail(626729,'47905','Dreaming Heads','hils 026_thumb.jpg',130, 93,1,'photo_626729.html');
												thumbnails[626730] = new thumbnail(626730,'47905','Triptych','hils 031_thumb.jpg',130, 133,1,'photo_626730.html');
												thumbnails[626731] = new thumbnail(626731,'47905','Deposition','hils 033_thumb.jpg',130, 108,1,'photo_626731.html');
												thumbnails[626732] = new thumbnail(626732,'47905','Dream of Lazarus','hils 036_thumb.jpg',130, 98,1,'photo_626732.html');
												thumbnails[626733] = new thumbnail(626733,'47905','','hils 051_thumb.jpg',130, 111,1,'photo_626733.html');
												thumbnails[626734] = new thumbnail(626734,'47905','','hils 053_thumb.jpg',130, 92,1,'photo_626734.html');
												thumbnails[626735] = new thumbnail(626735,'47905','Looking for You','hils 055_thumb.jpg',130, 97,1,'photo_626735.html');
												thumbnails[626736] = new thumbnail(626736,'47905','','hils 059_thumb.jpg',130, 102,1,'photo_626736.html');
												thumbnails[626737] = new thumbnail(626737,'47905','','hils 060_thumb.jpg',130, 74,1,'photo_626737.html');
												thumbnails[2362912] = new thumbnail(2362912,'153787','maximillian-and-lamb','Maximillian and lamb_thumb.jpg',130, 132,1,'photo_2362912.html');
												thumbnails[2362922] = new thumbnail(2362922,'270804','merle','curwen_merle_copy_thumb.jpg',130, 98,1,'photo_2362922.html');
												thumbnails[2362923] = new thumbnail(2362923,'153787','Fallen','Fallen_thumb.jpg',130, 130,1,'photo_2362923.html');
												thumbnails[2362924] = new thumbnail(2362924,'153787','touched','Touched_thumb.jpg',130, 110,1,'photo_2362924.html');
												thumbnails[2362925] = new thumbnail(2362925,'153787','Mercy','Mercy_thumb.jpg',130, 158,1,'photo_2362925.html');
												thumbnails[2362926] = new thumbnail(2362926,'153787','Visitation-II','visitation 2 copy_thumb.jpg',130, 130,1,'photo_2362926.html');
												thumbnails[2362928] = new thumbnail(2362928,'153787','It-began-to-dawn','It began to dawn copy_thumb.jpg',130, 137,1,'photo_2362928.html');
												thumbnails[2364915] = new thumbnail(2364915,'153787','Marshal-Ney','Ney_thumb.jpg',130, 121,1,'photo_2364915.html');
												thumbnails[2364925] = new thumbnail(2364925,'153787','Prodigal-Daughter','SNV80761 copy_thumb.jpg',130, 130,1,'photo_2364925.html');
												thumbnails[2364945] = new thumbnail(2364945,'153787','Mercy-II','Mercy II_thumb.jpg',130, 147,1,'photo_2364945.html');
												thumbnails[2364951] = new thumbnail(2364951,'153787','Thoughtfox-III','thoughtfox 3 copy_thumb.jpg',130, 129,1,'photo_2364951.html');
												thumbnails[2364988] = new thumbnail(2364988,'153787','New-Day','New Day_thumb.jpg',130, 132,1,'photo_2364988.html');
												thumbnails[2366511] = new thumbnail(2366511,'153787','After-Manet-II','after manet II_thumb.jpg',130, 101,1,'photo_2366511.html');
												thumbnails[2366514] = new thumbnail(2366514,'270804','three lambs','1_three_lambs_copy1_thumb.jpg',130, 141,1,'photo_2366514.html');
												thumbnails[2366515] = new thumbnail(2366515,'270804','Floating free 33','2_333_copy_thumb.jpg',130, 111,1,'photo_2366515.html');
												thumbnails[4710434] = new thumbnail(4710434,'270804','steal away','6_you_stole_mine_too_copy12_thumb.jpg',130, 134,1,'photo_4710434.html');
												thumbnails[4710440] = new thumbnail(4710440,'270804','whitely dance','9_wyming_light_copy1_thumb.jpg',130, 104,1,'photo_4710440.html');
												thumbnails[4710447] = new thumbnail(4710447,'270804','wyming shadow','8_wyming_shadow_copy_thumb.jpg',130, 98,1,'photo_4710447.html');
												thumbnails[4710477] = new thumbnail(4710477,'40527','wyoming!','b_wyoming_1_thumb.jpg',130, 98,1,'photo_4710477.html');
												thumbnails[4710505] = new thumbnail(4710505,'40527','prayer flags hangingwater','a_tai_chi_copy_thumb.jpg',130, 98,1,'photo_4710505.html');
												thumbnails[4710739] = new thumbnail(4710739,'40527','limb vally','a_limb_thumb.jpg',130, 110,1,'photo_4710739.html');
												thumbnails[4710745] = new thumbnail(4710745,'40527','whirlow','a_whilow_3_thumb.jpg',130, 98,1,'photo_4710745.html');
												thumbnails[4710765] = new thumbnail(4710765,'40541','stepping out','stepping_out_thumb.jpg',130, 129,1,'photo_4710765.html');
												thumbnails[4713262] = new thumbnail(4713262,'270908','derby 07','195_cannon_011_copy_thumb.jpg',130, 98,1,'photo_4713262.html');
												thumbnails[4713264] = new thumbnail(4713264,'270908','birch devas derby','195_cannon_015_copy_thumb.jpg',130, 98,1,'photo_4713264.html');
												thumbnails[4713267] = new thumbnail(4713267,'270908','wall derby','195_cannon_017_copy_thumb.jpg',130, 98,1,'photo_4713267.html');
												thumbnails[4713272] = new thumbnail(4713272,'40527','hawthorn','hawthorn_wintry_copy_thumb.jpg',130, 173,1,'photo_4713272.html');
												thumbnails[4713276] = new thumbnail(4713276,'270908','','broke_again_163_copy_2_thumb.jpg',130, 130,1,'photo_4713276.html');
												thumbnails[4713278] = new thumbnail(4713278,'270908','birch and lambswool','broke_again_171_copy_thumb.jpg',130, 132,1,'photo_4713278.html');
												thumbnails[4713279] = new thumbnail(4713279,'270908','re lara','re_Lara_copy_thumb.jpg',130, 128,1,'photo_4713279.html');
												thumbnails[4713283] = new thumbnail(4713283,'270908','whitely','Whitely_copy_thumb.jpg',130, 133,1,'photo_4713283.html');
												thumbnails[4713285] = new thumbnail(4713285,'270908','cupola','img_55_candle_heron_copy_thumb.jpg',130, 96,1,'photo_4713285.html');
												thumbnails[5015357] = new thumbnail(5015357,'270804','you and me babe','you_and_me_babe_thumb.jpg',130, 159,1,'photo_5015357.html');
												thumbnails[5015386] = new thumbnail(5015386,'270804','sky boys','sky_boys_thumb.jpg',130, 135,1,'photo_5015386.html');
												thumbnails[5233405] = new thumbnail(5233405,'270908','icy redmires','fav_allot_038_copy_thumb.jpg',130, 129,1,'photo_5233405.html');
												thumbnails[6973417] = new thumbnail(6973417,'377970','pentecost : in the Methodist Collection','pic34_untitled_pentecost_thumb.jpg',130, 131,1,'photo_6973417.html');
												thumbnails[7399568] = new thumbnail(7399568,'270908','Beside You','Beside_you_thumb.jpg',130, 131,1,'photo_7399568.html');
												thumbnails[7399589] = new thumbnail(7399589,'270908','dreaming Deep','dreaming_d_copy_2_thumb.jpg',130, 87,1,'photo_7399589.html');
												thumbnails[7399595] = new thumbnail(7399595,'270908','wiremill dreams','1_w_copy_thumb.jpg',130, 97,1,'photo_7399595.html');
												thumbnails[7399612] = new thumbnail(7399612,'270908','feathery touch','2_ww_copy1_thumb.jpg',130, 129,1,'photo_7399612.html');
												thumbnails[7399633] = new thumbnail(7399633,'270908','rivery moment','8_ww_copy_thumb.jpg',130, 129,1,'photo_7399633.html');
												thumbnails[524591] = new thumbnail(524591,'40527','Wintry Spirit','Untitled-1 copy_thumb.jpg',130, 128,1,'photo_524591.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[270908] = new gallery(270908,'7399633,7399612,7399595,7399589,7399568,5233405,4713285,4713283,4713279,4713278','further out there','gallery',[4713262,4713264,4713267,4713276,4713278,4713279,4713283,4713285,5233405,7399568,7399589,7399595,7399612,7399633],0, 0, '', 'gallery_270908.html',0,0);
				  					galleries[40541] = new gallery(40541,'524605','Looking for You','gallery',[524583,524604,524605,524607,524608,524609,4710765],0, 0, '', 'gallery_40541.html',0,0);
				  					galleries[40542] = new gallery(40542,'524619,524617,524616,524615,524613,524612,524611','Out There','gallery',[524611,524612,524613,524615,524616,524617,524619],0, 0, '', 'gallery_40542.html',0,0);
				  					galleries[47905] = new gallery(47905,'626737,626736,626735,626734,626733,626732,626731,626730,626729,626728,626727,626726','Cathedral Exhibition','gallery',[626726,626727,626728,626729,626730,626731,626732,626733,626734,626735,626736,626737],0, 0, '', 'gallery_47905.html',0,0);
				  					galleries[377970] = new gallery(377970,'6973417','pentecost','gallery',[6973417],0, 0, '', 'gallery_377970.html',0,0);
				  					galleries[153787] = new gallery(153787,'2366511,2364988,2364951,2364945,2364925,2364915,2362928,2362926,2362925,2362924','from cathedral 08','gallery',[2362912,2362923,2362924,2362925,2362926,2362928,2364915,2364925,2364945,2364951,2364988,2366511],0, 0, '', 'gallery_153787.html',0,0);
				  					galleries[270804] = new gallery(270804,'5015386,5015357,4710447,4710440,4710434,2366515,2366514,2362922','a medley','gallery',[2362922,2366514,2366515,4710434,4710440,4710447,5015357,5015386],0, 0, '', 'gallery_270804.html',0,0);
				  					galleries[40527] = new gallery(40527,'524591,524585','Digital Images','gallery',[524585,524586,524588,524589,524592,4710477,4710505,4710739,4710745,4713272,524591],0, 0, '', 'gallery_40527.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '2366515,2366514,2366511,2364988,2364951,2364915,2362926,2362925,2362924,2362923,2362922,626735,626733,626726,524619,524617,524616,524615,524613,524612,524611,524609,524608,524607,524605,524604,524592,524591,524589,524588,524586,524585';
imageSets[2] = '626737,626736,626735,626734,626733,626732,626731,626730,626729,626728,626727,626726,524605,524591,524585';
imageSets[3] = '7399633,7399612,7399595,7399589,7399568,6973417,5233405,5015386,5015357,4713285,4713283,4713279,4713278,4713276,4713272,4713267,4713264,4713262,4710765,4710745,4710739,4710505,4710477,4710447,4710440,4710434,2366515,2366514,2366511,2364988,2364951,2364945,2364925,2364915,2362928,2362926,2362925,2362924,2362923,2362922,2362912,626737,626736,626735,626734,626733,626732,626731,626730,626729';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jmbrokenshire/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jmbrokenshire/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 = 'John Brokenshire : Painter: ' + 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;
	}
}

			

