window.thumbnails = new Object();
												thumbnails[3770841] = new thumbnail(3770841,'230041','One-man show at The Ropewalk Gallery. Feb/March 09.','Ropewalk2_thumb.jpg',130, 87,15,'							photo_3770841.html');
												thumbnails[3770845] = new thumbnail(3770845,'230041','One -man show at The Ropewalk Gallery.','ropewalk_panorama_thumb.jpg',130, 65,15,'							photo_3770845.html');
												thumbnails[4528448] = new thumbnail(4528448,'','Woldforms 6','_MG_5158Woldforms4phase2_thumb.jpg',130, 130,15,'							photo_4528448.html');
												thumbnails[4537197] = new thumbnail(4537197,'','Ears-on-The-Wolds','_MG_5134Wheatears_thumb.jpg',130, 130,15,'							photo_4537197.html');
												thumbnails[4504416] = new thumbnail(4504416,'225788','Gala Belisha','_MG_5402gala_belisha_thumb.jpg',130, 130,15,'							photo_4504416.html');
												thumbnails[3723313] = new thumbnail(3723313,'225788','No Parking','NoParking_thumb.jpg',130, 130,15,'							photo_3723313.html');
												thumbnails[3723662] = new thumbnail(3723662,'225788','Liquid Gold','LiquidGold_thumb.jpg',130, 130,15,'							photo_3723662.html');
												thumbnails[3723926] = new thumbnail(3723926,'225788','Waterlines','waterlines_thumb.jpg',130, 130,15,'							photo_3723926.html');
												thumbnails[3723929] = new thumbnail(3723929,'225788','Floorlight','floorlight_thumb.jpg',130, 130,15,'							photo_3723929.html');
												thumbnails[3723945] = new thumbnail(3723945,'225788','Fence Teeth','Fenceteeth_thumb.jpg',130, 130,15,'							photo_3723945.html');
												thumbnails[3723980] = new thumbnail(3723980,'225788','Lock Light','Locklight_thumb.jpg',130, 130,15,'							photo_3723980.html');
												thumbnails[3723993] = new thumbnail(3723993,'225788','Ripple','Ripple_thumb.jpg',130, 130,15,'							photo_3723993.html');
												thumbnails[3771376] = new thumbnail(3771376,'225788','Beachbend','Beach_Bend_thumb.jpg',130, 130,15,'							photo_3771376.html');
												thumbnails[3772504] = new thumbnail(3772504,'225788','Tiles and Timber','Tiles_and_Timber_square4print_thumb.jpg',130, 130,15,'							photo_3772504.html');
												thumbnails[3801402] = new thumbnail(3801402,'225788','Red Slide','Red_Slide4print_thumb.jpg',130, 130,15,'							photo_3801402.html');
												thumbnails[3939195] = new thumbnail(3939195,'225788','Grate Angles','Grate_Angle4print_thumb.jpg',130, 130,15,'							photo_3939195.html');
												thumbnails[3999973] = new thumbnail(3999973,'225788','Reflecting Windows','Mondrian_Windows_thumb.jpg',130, 130,15,'							photo_3999973.html');
												thumbnails[3999993] = new thumbnail(3999993,'225788','Mondrian Light?','Mondrian_Light_thumb.jpg',130, 130,15,'							photo_3999993.html');
												thumbnails[4000094] = new thumbnail(4000094,'225788','Mondrian at ','Mondrian_at_The_Deep4print_thumb.jpg',130, 130,15,'							photo_4000094.html');
												thumbnails[4506544] = new thumbnail(4506544,'225788','Meshgreen 2','_MG_5000meshgreen2phase2_thumb.jpg',130, 130,15,'							photo_4506544.html');
												thumbnails[5127489] = new thumbnail(5127489,'225788','Prop Yellow','_MG_6497Prop_Yellow_thumb.jpg',130, 130,15,'							photo_5127489.html');
												thumbnails[5159815] = new thumbnail(5159815,'225788','Stepcurve','_MG_6151Stepcurve_thumb.jpg',130, 130,15,'							photo_5159815.html');
												thumbnails[7072545] = new thumbnail(7072545,'225788','Blue With Drops','_MG_59571_thumb.Blue_With_Drops.jpg',130, 130,37,'							photo_7072545.html');
												thumbnails[7072550] = new thumbnail(7072550,'225788','Torn Red','_MG_61451.Torn_Red_thumb.jpg',130, 130,15,'							photo_7072550.html');
												thumbnails[7072715] = new thumbnail(7072715,'225788','Blue With Drops','_MG_595712.Blue_With_Drops_thumb.jpg',130, 130,15,'							photo_7072715.html');
												thumbnails[7078086] = new thumbnail(7078086,'225788','','_MG_9245.Lights_In_Space_v2_thumb.jpg',130, 130,15,'							photo_7078086.html');
												thumbnails[7078087] = new thumbnail(7078087,'225788','Yellow','_MG_3078.Form_Nš3.yellow.Reducenoise_thumb.jpg',130, 130,15,'							photo_7078087.html');
												thumbnails[7072539] = new thumbnail(7072539,'225788','Red Risers','_MG_6244.Risers1_thumb.jpg',130, 130,15,'							photo_7072539.html');
												thumbnails[7072542] = new thumbnail(7072542,'225788','Seaside Yellow','_MG_62541.Seaside_Yellow_Nš_1_thumb.jpg',130, 130,15,'							photo_7072542.html');
												thumbnails[3724136] = new thumbnail(3724136,'225789','Lightposts','Lighthouse_postsre-touch_thumb.jpg',130, 196,15,'							photo_3724136.html');
												thumbnails[3724154] = new thumbnail(3724154,'225789','Morning Mist','Morning_Mist_4print_thumb.jpg',130, 65,15,'							photo_3724154.html');
												thumbnails[3724159] = new thumbnail(3724159,'225789','Yachtscape','yachtscape11309_thumb.jpg',130, 87,15,'							photo_3724159.html');
												thumbnails[3724179] = new thumbnail(3724179,'225789','Swan Lake','SwanLake_thumb.jpg',130, 87,15,'							photo_3724179.html');
												thumbnails[3724422] = new thumbnail(3724422,'225789','Balloonglow','balloonglow_thumb.jpg',130, 87,15,'							photo_3724422.html');
												thumbnails[3729531] = new thumbnail(3729531,'225789','Peninsula Beach','2EO9931_thumb.jpg',130, 195,15,'							photo_3729531.html');
												thumbnails[3772481] = new thumbnail(3772481,'225789','Beverley Minster sunset','Beverley_Minster_Sunset_thumb.jpg',130, 195,15,'							photo_3772481.html');
												thumbnails[3772497] = new thumbnail(3772497,'225789','Westwood Tree','Westwood_treeMk2SQ_thumb.jpg',130, 130,15,'							photo_3772497.html');
												thumbnails[3807017] = new thumbnail(3807017,'225789','Morning Mist','Morning_Mist_Holderness_thumb.jpg',130, 96,15,'							photo_3807017.html');
												thumbnails[3999980] = new thumbnail(3999980,'225789','Reflective Perspective','Mondrian_Perspective_Nš2_thumb.jpg',130, 130,15,'							photo_3999980.html');
												thumbnails[3724141] = new thumbnail(3724141,'233588','Figures In The Mist','Bridge_Figures_4RPS_thumb.jpg',130, 87,15,'							photo_3724141.html');
												thumbnails[3724418] = new thumbnail(3724418,'233588','Bridge Mist Shadow with Gull','Bridge_Shadow_11309_thumb.jpg',130, 87,15,'							photo_3724418.html');
												thumbnails[3729528] = new thumbnail(3729528,'233588','Dawn at The Humber Bridge','Humber_ridgeDawn_thumb.jpg',130, 87,15,'							photo_3729528.html');
												thumbnails[3849733] = new thumbnail(3849733,'233588','The Bridge.','the_bridge_thumb.jpg',130, 195,15,'							photo_3849733.html');
												thumbnails[4218786] = new thumbnail(4218786,'233588','Bridge Mist ','Bridge_Mist26309_thumb.jpg',130, 130,15,'							photo_4218786.html');
												thumbnails[4218806] = new thumbnail(4218806,'233588','Bridge with Gull Nš 2','Humber_Bridge_Shadow__Gull4print_thumb.jpg',130, 87,15,'							photo_4218806.html');
												thumbnails[4218808] = new thumbnail(4218808,'233588','Bridge with Gull','Bridgeshadow5_thumb.jpg',130, 130,15,'							photo_4218808.html');
												thumbnails[4000026] = new thumbnail(4000026,'291434','Men at work','Levels_of_Men_Nš3_thumb.jpg',130, 260,15,'							photo_4000026.html');
												thumbnails[3723665] = new thumbnail(3723665,'291434','Floor Dots','FloorDots_thumb.jpg',130, 130,15,'							photo_3723665.html');
												thumbnails[3724144] = new thumbnail(3724144,'291434','Walking The Dog','Walking_The_Dog_thumb.jpg',130, 130,15,'							photo_3724144.html');
												thumbnails[5159770] = new thumbnail(5159770,'291434','Evening Solace','_MG_7405Evening_thumb.jpg',130, 65,15,'							photo_5159770.html');
												thumbnails[5159776] = new thumbnail(5159776,'291434','A Dog\'s Day Out at Blackpool','_MG_7614Dogs_Day_at_Blackpool_thumb.jpg',130, 87,15,'							photo_5159776.html');
												thumbnails[5159785] = new thumbnail(5159785,'291434','The Spitfire','_MG_6488The_Spitfire_thumb.jpg',130, 87,15,'							photo_5159785.html');
												thumbnails[5159788] = new thumbnail(5159788,'291434','The Pose','_MG_7618The_Pose_thumb.jpg',130, 130,15,'							photo_5159788.html');
												thumbnails[5159795] = new thumbnail(5159795,'291434','Watch Office','_MG_6400Watch_Office_thumb.jpg',130, 130,15,'							photo_5159795.html');
												thumbnails[5159799] = new thumbnail(5159799,'291434','Window Lather','_MG_7538Window_Lather_2C18F05E-2219-B5B5-4C7C9CA74B0D2316_thumb.jpg',130, 130,15,'							photo_5159799.html');
												thumbnails[5159805] = new thumbnail(5159805,'291434','Sea People','_MG_6978Sea_People_thumb.jpg',130, 130,15,'							photo_5159805.html');
												thumbnails[5159812] = new thumbnail(5159812,'291434','Strolling Past Blackpool tower','_MG_7542Strolling_Past_Blackpool_Tower_thumb.jpg',130, 130,15,'							photo_5159812.html');
												thumbnails[5191424] = new thumbnail(5191424,'291434','Visitors','_MG_6341visitors_thumb.jpg',130, 87,15,'							photo_5191424.html');
												thumbnails[7072508] = new thumbnail(7072508,'291434','Ecclesiastical Gathering.','_MG_6018_Ely_Gathering_Mk2_print_thumb.jpg',130, 195,15,'							photo_7072508.html');
												thumbnails[3730457] = new thumbnail(3730457,'227450','Piglets','piglets3_thumb.jpg',130, 148,15,'							photo_3730457.html');
												thumbnails[3730467] = new thumbnail(3730467,'227450','Management Portrait','IMG_1117_thumb.jpg',130, 176,15,'							photo_3730467.html');
												thumbnails[3730474] = new thumbnail(3730474,'227450','Pigs','Pigs_comp-2-7499_thumb.jpg',130, 105,15,'							photo_3730474.html');
												thumbnails[3730486] = new thumbnail(3730486,'227450','Free Range Poultry','_2EO7996_thumb.jpg',130, 87,15,'							photo_3730486.html');
												thumbnails[3730492] = new thumbnail(3730492,'227450','Packshot','regpackshot2shadow_thumb.jpg',130, 170,15,'							photo_3730492.html');
												thumbnails[3730498] = new thumbnail(3730498,'227450','Horse Minerals','Norvite_Horse_Packs_thumb.jpg',130, 113,15,'							photo_3730498.html');
												thumbnails[3730505] = new thumbnail(3730505,'227450','Building Manufacture','PremIntlinkPics19508_189_thumb.jpg',130, 195,15,'							photo_3730505.html');
												thumbnails[3730514] = new thumbnail(3730514,'227450','Childrens\' Centre','Premier_Interlink_Wakefield_Childrens_Centres_6_thumb.jpg',130, 87,15,'							photo_3730514.html');
												thumbnails[3770922] = new thumbnail(3770922,'227450','College building. ','Richard_Rose_Academy_Carlisle_65pan_thumb.jpg',130, 56,15,'							photo_3770922.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[230041] = new gallery(230041,'3770845','Latest developments','gallery',[3770841,3770845],0, 0, '', '																																																																																																							gallery_230041.html',0,0);
				  					galleries[225788] = new gallery(225788,'7078087,7078086,7072715,7072550,7072545,7072542,7072539,5159815,5127489,4506544','Abstractions. Christopher Harland ARPS','gallery',[4504416,3723313,3723662,3723926,3723929,3723945,3723980,3723993,3771376,3772504,3801402,3939195,3999973,3999993,4000094,4506544,5127489,5159815,7072545,7072550,7072715,7078086,7078087,7072539,7072542],0, 0, '', '																																																																																																							gallery_225788.html',0,0);
				  					galleries[225789] = new gallery(225789,'3999980','Landscape photographs by Christopher Harland ARPS','gallery',[3724136,3724154,3724159,3724179,3724422,3729531,3772481,3772497,3807017,3999980],0, 0, '', '																																																																																																							gallery_225789.html',0,0);
				  					galleries[233588] = new gallery(233588,'3724141','The Humber Bridge by Christopher Harland ARPS','gallery',[3724141,3724418,3729528,3849733,4218786,4218806,4218808],0, 0, '', '																																																																																																							gallery_233588.html',0,0);
				  					galleries[291434] = new gallery(291434,'7072508,5191424,5159812,5159805,5159799,5159795,5159788,5159785,5159776,5159770','People and Places','gallery',[4000026,3723665,3724144,5159770,5159776,5159785,5159788,5159795,5159799,5159805,5159812,5191424,7072508],0, 0, '', '																																																																																																							gallery_291434.html',0,0);
				  					galleries[227450] = new gallery(227450,'3730514,3730505,3730498,3730474,3730457','Commercial photography by Christopher Harland ARPS','gallery',[3730457,3730467,3730474,3730486,3730492,3730498,3730505,3730514,3770922],0, 0, '', '																																																																																																							gallery_227450.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[206502] = '4506544';
imageSets[1] = '7072542,7072539,4000094,4000026,3999993,3807017,3801402,3730486,3730474,3729531,3729528,3724422,3724418,3724179,3724159,3724154,3724144,3724141,3724136,3723993,3723980,3723945,3723929,3723926,3723665,3723662,3723313';
imageSets[2] = '3999980,3770845,3730514,3730505,3730498,3730474,3730457,3724141';
imageSets[3] = '7078087,7078086,7072715,7072550,7072545,7072542,7072539,7072508,5191424,5159815,5159812,5159805,5159799,5159795,5159788,5159785,5159776,5159770,5127489,4537197,4528448,4506544,4504416,4218808,4218806,4218786,4000094,4000026,3999993,3999980,3999973,3939195,3849733,3807017,3801402,3772504,3772497,3772481,3771376,3770922,3770845,3770841,3730514,3730505,3730498,3730492,3730486,3730474,3730467,3730457';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/HenryB/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://www.clikchurch.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/HenryB/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/HenryB/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/HenryB/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/HenryB/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/HenryB/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));		}, 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 = 'www.christopherharland.com: ' + 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));    }        
    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>';
	}
					
	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="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="service@paypal.co.uk">';
	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="service@paypal.co.uk">';
	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;
	}
}

		

