window.thumbnails = new Object();
												thumbnails[273633] = new thumbnail(273633,'','','Gary_bike_thumb.jpg',130, 89,15,'															#');
												thumbnails[273712] = new thumbnail(273712,'','','eos1n_thumb.jpg',130, 101,15,'															#');
												thumbnails[260092] = new thumbnail(260092,'23276','A lovely Bruges square at dusk','Bruges,-Jan-2006__018_thumb.jpg',130, 87,15,'																			photo_260092.html');
												thumbnails[260099] = new thumbnail(260099,'23276','A time exposure of Dijver canal with the Markt belfry in the background','Bruges,-Jan-2006__178-cropp_thumb.jpg',130, 83,15,'																			photo_260099.html');
												thumbnails[260103] = new thumbnail(260103,'23276','The Markt square on a crisp January day','Bruges,-Jan-2006__120_thumb.jpg',130, 195,15,'																			photo_260103.html');
												thumbnails[260967] = new thumbnail(260967,'23276','The Groenerei canal looking east','Bruges,-Jan-2006__207_thumb.jpg',130, 87,15,'																			photo_260967.html');
												thumbnails[260972] = new thumbnail(260972,'23276','The view from the Belfry on a misty January morning','Bruges,-Jan-2006__042_thumb.jpg',130, 87,15,'																			photo_260972.html');
												thumbnails[261681] = new thumbnail(261681,'23276','Onze Lieve Vrouwekerk (\'The Church of Our Lady\')','Bruges,-Jan-2006__088_thumb.jpg',130, 195,15,'																			photo_261681.html');
												thumbnails[261747] = new thumbnail(261747,'23276','Dijver, south of Markt','Bruges,-Jan-2006__122_thumb.jpg',130, 87,15,'																			photo_261747.html');
												thumbnails[270899] = new thumbnail(270899,'24100','A typical Greek cat - always hungry, or not moving very quickly!','Kitten_thumb.jpg',130, 203,15,'																			photo_270899.html');
												thumbnails[270911] = new thumbnail(270911,'24100','The Greek island of Ydra (or Hydra) - a beautiful retreat with no motor vehicles whatsoever.','Portfolio0007_thumb.jpg',130, 203,15,'																			photo_270911.html');
												thumbnails[271938] = new thumbnail(271938,'24118','The kasbar at Ait Benhaddou, Ouzarzate','Benhaddou_thumb.jpg',130, 86,15,'																			photo_271938.html');
												thumbnails[271996] = new thumbnail(271996,'24143','Central Rome near the Palatine Hill','Rome_steps_thumb.jpg',130, 203,15,'																			photo_271996.html');
												thumbnails[273246] = new thumbnail(273246,'23276','Beautiful architecture abounds - this is in the Begijnhof area','Bruges_wall_thumb.jpg',130, 195,15,'																			photo_273246.html');
												thumbnails[274668] = new thumbnail(274668,'24143','The Spanish Steps on a glorious spring day.','Spanish_steps_thumb.jpg',130, 83,15,'																			photo_274668.html');
												thumbnails[274710] = new thumbnail(274710,'24385','Moscow State Circus','Dancer_thumb.jpg',130, 83,15,'																			photo_274710.html');
												thumbnails[700393] = new thumbnail(700393,'53817','The Holocaust memorial in Potsdammer Platz','Holocaust_thumb.jpg',130, 195,15,'																			photo_700393.html');
												thumbnails[832137] = new thumbnail(832137,'64317','Vila Nova da Gaia in Porto, centre of the port industry','Portugal_060_thumb.jpg',130, 87,15,'																			photo_832137.html');
												thumbnails[259836] = new thumbnail(259836,'23266','Mount Teide, Tenerife','Tenerife-2005-Easter_1311_thumb.jpg',130, 87,15,'																			photo_259836.html');
												thumbnails[262093] = new thumbnail(262093,'23284','No caption needed, really','California-2001_022_thumb.jpg',130, 98,15,'																			photo_262093.html');
												thumbnails[259813] = new thumbnail(259813,'23266','Mirador del Tabonal Negro','Tenerife-2005-Easter_306_thumb.jpg',130, 87,15,'																			photo_259813.html');
												thumbnails[260124] = new thumbnail(260124,'23284','A relatively level street in downtown San Francisco','Slope_thumb.jpg',130, 85,15,'																			photo_260124.html');
												thumbnails[260981] = new thumbnail(260981,'23266','Mount Teide, 3715 metres above sea level','Tenerife-2005-Easter_185_thumb.jpg',130, 87,15,'																			photo_260981.html');
												thumbnails[260978] = new thumbnail(260978,'23266','Roques de Garcia','Tenerife-2005-Easter_237-b&_thumb.jpg',130, 87,15,'																			photo_260978.html');
												thumbnails[259841] = new thumbnail(259841,'23266','La Casa del Pintor, Arona','Tenerife-2005-Easter_4492_thumb.jpg',130, 87,15,'																			photo_259841.html');
												thumbnails[260983] = new thumbnail(260983,'23266','Weathered ash and ancient basaltic lava flows in the National Park. ','Tenerife-2005-Easter_211_thumb.jpg',130, 87,15,'																			photo_260983.html');
												thumbnails[260748] = new thumbnail(260748,'23287','Students in Covent Garden','CG_girls_thumb.jpg',130, 83,15,'																			photo_260748.html');
												thumbnails[262107] = new thumbnail(262107,'23284','Tall Trees Grove, Sequoia National Park','California-2001_225_thumb.jpg',130, 98,15,'																			photo_262107.html');
												thumbnails[273955] = new thumbnail(273955,'23287','Applying make-up (Covent Garden)','CG_makeup_thumb.jpg',130, 83,15,'																			photo_273955.html');
												thumbnails[273963] = new thumbnail(273963,'23287','Man in Kew Gardens','man_kew_thumb.jpg',130, 83,15,'																			photo_273963.html');
												thumbnails[262034] = new thumbnail(262034,'23266','Approaching the Parque Nacional del Teide','Tenerife-2005-Easter_080_thumb.jpg',130, 87,15,'																			photo_262034.html');
												thumbnails[273968] = new thumbnail(273968,'23287','A girl, taken during Chinese New Year. ','chinese_girl_thumb.jpg',130, 83,15,'																			photo_273968.html');
												thumbnails[262050] = new thumbnail(262050,'23266','Llano de Uncanca','Tenerife-2005-Easter_439_thumb.jpg',130, 87,15,'																			photo_262050.html');
												thumbnails[270221] = new thumbnail(270221,'23287','Tower Bridge, looking south from near the Tower Hotel ','Tower-Bridge_thumb.jpg',130, 76,15,'																			photo_270221.html');
												thumbnails[274601] = new thumbnail(274601,'24178','A stormy day in late spring.','coldfront_thumb.jpg',130, 87,15,'																			photo_274601.html');
												thumbnails[260755] = new thumbnail(260755,'23287','Kite flying on Hampstead Heath','Hampstead-walk,-Aug-2005_011_thumb.jpg',130, 87,15,'																			photo_260755.html');
												thumbnails[270924] = new thumbnail(270924,'23287','Lee Valley Regional Park, London, close to site of 2012 Olympics','Tottenham-Lock_thumb.jpg',130, 83,15,'																			photo_270924.html');
												thumbnails[261607] = new thumbnail(261607,'23287','The site of Winchester Palace','Tate-Modern,-April-2006__00_thumb.jpg',130, 87,15,'																			photo_261607.html');
												thumbnails[269267] = new thumbnail(269267,'23287','The Reading Room, British Museum','Reading-room_thumb.jpg',130, 87,15,'																			photo_269267.html');
												thumbnails[260163] = new thumbnail(260163,'23287','\'Alison Lapper, pregnant\'. A controversial statue in Trafalgar Square (frankly, I think it\'s beautiful)','lapper-cropped_thumb.jpg',130, 207,15,'																			photo_260163.html');
												thumbnails[270411] = new thumbnail(270411,'23287','The Tate Modern art gallery','TateModern_thumb.jpg',130, 98,15,'																			photo_270411.html');
												thumbnails[262198] = new thumbnail(262198,'23287','Tate Modern again. This time it\'s white plastic cubes...','Tate-Modern,-April-2006__01_thumb.jpg',130, 195,15,'																			photo_262198.html');
												thumbnails[260147] = new thumbnail(260147,'23287','Monocyclist in front of St.Paul\'s Church, Covent Garden ','T4-06_08_thumb.jpg',130, 203,15,'																			photo_260147.html');
												thumbnails[261606] = new thumbnail(261606,'23287','The Great Court of the British Museum','British-Museum,-May-2006__0_thumb.jpg',130, 195,15,'																			photo_261606.html');
												thumbnails[265347] = new thumbnail(265347,'23394','The Roman El Djem amphitheatre, almost as big as the Coliseum in Rome.','El Djem_thumb.jpg',130, 87,15,'																			photo_265347.html');
												thumbnails[271920] = new thumbnail(271920,'24118','Dry lake, Middle Atlas Mountains, Ouzazarte','Lake_thumb.jpg',130, 173,15,'																			photo_271920.html');
												thumbnails[272265] = new thumbnail(272265,'24178','Blue Tit','Blue_tit_thumb.jpg',130, 89,15,'																			photo_272265.html');
												thumbnails[415375] = new thumbnail(415375,'33363','Livestone pavement at Malham Cove, North Yorkshire','yorkshire1_thumb.jpg',130, 87,15,'																			photo_415375.html');
												thumbnails[265334] = new thumbnail(265334,'23394','The Chott al Jered salt lake','Chott El Jered_thumb.jpg',130, 83,15,'																			photo_265334.html');
												thumbnails[272266] = new thumbnail(272266,'24178','Grey squirrel','Squirrel_thumb.jpg',130, 86,15,'																			photo_272266.html');
												thumbnails[265369] = new thumbnail(265369,'23394','The causeway across the Chott al Jered','Tozeur_thumb.jpg',130, 83,15,'																			photo_265369.html');
												thumbnails[272283] = new thumbnail(272283,'24178','Common frog, Rana temporaria','frog_thumb.jpg',130, 83,15,'																			photo_272283.html');
												thumbnails[265386] = new thumbnail(265386,'23394','A market in Gafza','Market_thumb.jpg',130, 85,15,'																			photo_265386.html');
												thumbnails[272472] = new thumbnail(272472,'24178','A climbing amaryllis','Amaryllis_thumb.jpg',130, 87,15,'																			photo_272472.html');
												thumbnails[382412] = new thumbnail(382412,'31049','Botanical candles, handmade by artisans in Portugal','candles_thumb.jpg',130, 78,15,'																			photo_382412.html');
												thumbnails[700342] = new thumbnail(700342,'31049','Sara at Battle Abbey','Sara_thumb.jpg',130, 89,15,'																			photo_700342.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[64317] = new gallery(64317,'832137','Portugal','section40929',[832137],0, 0, '', '																																																																																																							section40929_64317.html',0,0);
				  					galleries[31049] = new gallery(31049,'700342,382412','Sara\'s artwork and craft products','section50658',[382412,700342],0, 0, '', '																																																																																																																																	section50658.html',0,1);
				  					galleries[23276] = new gallery(23276,'261747,260092','Bruges','section40929',[260092,260099,260103,260967,260972,261681,261747,273246],0, 0, '', '																																																																																																							section40929_23276.html',0,0);
				  					galleries[24178] = new gallery(24178,'272283','My Garden','section40929',[274601,272265,272266,272283,272472],0, 0, '24177', '																																																																																																							section40929_24178.html',0,0);
				  					galleries[33363] = new gallery(33363,'415375','Yorkshire, England','section40929',[415375],0, 0, '', '																																																																																																							section40929_33363.html',0,0);
				  					galleries[23266] = new gallery(23266,'259841','Tenerife','section40929',[259836,259813,260981,260978,259841,260983,262034,262050],0, 0, '', '																																																																																																							section40929_23266.html',0,0);
				  					galleries[23287] = new gallery(23287,'260748','London','section40929',[260748,273955,273963,273968,270221,260755,270924,261607,269267,260163,270411,262198,260147,261606],0, 0, '', '																																																																																																							section40929_23287.html',0,0);
				  					galleries[23394] = new gallery(23394,'265334','Tunisia','section40929',[265347,265334,265369,265386],0, 0, '', '																																																																																																							section40929_23394.html',0,0);
				  					galleries[23284] = new gallery(23284,'262093','California','section40929',[262093,260124,262107],0, 0, '', '																																																																																																							section40929_23284.html',0,0);
				  					galleries[24100] = new gallery(24100,'270899','Greece','section40929',[270899,270911],0, 0, '', '																																																																																																							section40929_24100.html',0,0);
				  					galleries[24118] = new gallery(24118,'271920','Morocco','section40929',[271938,271920],0, 0, '', '																																																																																																							section40929_24118.html',0,0);
				  					galleries[24143] = new gallery(24143,'274668,271996','Rome','section40929',[271996,274668],0, 0, '', '																																																																																																							section40929_24143.html',0,0);
				  					galleries[24385] = new gallery(24385,'274710','Russia','section40929',[274710],0, 0, '', '																																																																																																							section40929_24385.html',0,0);
				  					galleries[53817] = new gallery(53817,'700393','Berlin','section40929',[700393],0, 0, '', '																																																																																																							section40929_53817.html',0,0);
				  					galleries[24177] = new gallery(24177,'272283','Miscellaneous','section40929',[],0, 0, '', '																																																																																																							section40929_24177.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '700342,272283,265347,260748,260099,259841,259836';
imageSets[2] = '274710,274668,272283,271996,271920,270899,265334,262093,261747,260748,260092,259841';
imageSets[3] = '832137,700393,700342,415375,382412,274710,274668,274601,273968,273963,273955,273712,273633,273246,272472,272283,272266,272265,271996,271938,271920,270924,270911,270899,270411,270221,269267,265386,265369,265347,265334,262198,262107,262093,262050,262034,261747,261681,261607,261606,260983,260981,260978,260972,260967,260755,260748,260163,260147,260124';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/gwhitegeog/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/gwhitegeog/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 += 'section40929.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 && 'section40929' != '') {
					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 = 'Gary White, Travel Photographer: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {photoinfominwidth:200};	    		options.photoinfoadjacent = true;			      	      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="gary@gw1.demon.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="gary@gw1.demon.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;
	}
}

			

