window.thumbnails = new Object();
												thumbnails[6427349] = new thumbnail(6427349,'143181','Neena Trehan and Lisa Snowdon','DPP_0001_thumb.JPG',130, 87,5,'photo_6427349.html');
												thumbnails[6427552] = new thumbnail(6427552,'143181','Lisa Snowdon','DPP_0032_thumb.JPG',101, 130,5,'photo_6427552.html');
												thumbnails[4131643] = new thumbnail(4131643,'140970','','011_thumb.JPG',130, 87,5,'photo_4131643.html');
												thumbnails[4131648] = new thumbnail(4131648,'140970','','021_thumb.JPG',130, 87,5,'photo_4131648.html');
												thumbnails[3965261] = new thumbnail(3965261,'140996','','11_thumb.JPG',130, 87,5,'photo_3965261.html');
												thumbnails[3458249] = new thumbnail(3458249,'140995','Duck walking on water','Ducks on the pond border_thumb.jpg',130, 81,5,'photo_3458249.html');
												thumbnails[3423727] = new thumbnail(3423727,'162158','','product-range_thumb.jpg',130, 93,5,'photo_3423727.html');
												thumbnails[3458254] = new thumbnail(3458254,'140970','Corroded tractor','tractor_thumb.jpg',130, 87,5,'photo_3458254.html');
												thumbnails[3458257] = new thumbnail(3458257,'140970','Wave hits rock','wave hits rock_thumb.jpg',130, 87,5,'photo_3458257.html');
												thumbnails[3234793] = new thumbnail(3234793,'162158','','bottles_thumb.jpg',86, 130,5,'photo_3234793.html');
												thumbnails[3088604] = new thumbnail(3088604,'162158','','02_thumb.JPG',87, 130,5,'photo_3088604.html');
												thumbnails[3088614] = new thumbnail(3088614,'162158','','01_thumb.JPG',116, 130,5,'photo_3088614.html');
												thumbnails[2842368] = new thumbnail(2842368,'140996','Second Sense','009_thumb.JPG',87, 130,5,'photo_2842368.html');
												thumbnails[2842372] = new thumbnail(2842372,'140996','Second Sense','010_thumb.JPG',130, 87,5,'photo_2842372.html');
												thumbnails[2730826] = new thumbnail(2730826,'161887','','Bus_thumb.jpg',87, 130,5,'photo_2730826.html');
												thumbnails[2730835] = new thumbnail(2730835,'161887','','Cake1_thumb.jpg',87, 130,5,'photo_2730835.html');
												thumbnails[2730838] = new thumbnail(2730838,'161887','','DJ_thumb.jpg',87, 130,5,'photo_2730838.html');
												thumbnails[2726896] = new thumbnail(2726896,'140996','The Furbelows live','014_thumb.jpg',106, 130,5,'photo_2726896.html');
												thumbnails[2726903] = new thumbnail(2726903,'140996','The Furbelows live','0011_thumb.jpg',92, 130,5,'photo_2726903.html');
												thumbnails[2533090] = new thumbnail(2533090,'140970','Polers on the Delta','polers-on-the-delta_thumb.jpg',130, 87,5,'photo_2533090.html');
												thumbnails[2119528] = new thumbnail(2119528,'140970','','denham_WA_thumb.jpg',130, 104,5,'photo_2119528.html');
												thumbnails[2119541] = new thumbnail(2119541,'140970','Dog on Beach','dog_on_beach_thumb.jpg',97, 130,5,'photo_2119541.html');
												thumbnails[2119547] = new thumbnail(2119547,'140970','Easter Island 1','easter_island_1_thumb.jpg',101, 130,5,'photo_2119547.html');
												thumbnails[2119575] = new thumbnail(2119575,'140970','Gua Gua Pichincha 1, Ecuador','gua_gua_pichincha_1_ecuador_thumb.jpg',130, 125,5,'photo_2119575.html');
												thumbnails[2119615] = new thumbnail(2119615,'140995','Iguana 1','iguana_1_galapagos_thumb.jpg',130, 95,5,'photo_2119615.html');
												thumbnails[2119822] = new thumbnail(2119822,'140996','The Furbelows Live','The_Furbelows_live_1_thumb.jpg',90, 130,5,'photo_2119822.html');
												thumbnails[2120158] = new thumbnail(2120158,'140995','Pelican sat on beach','pelican_1_WA_thumb.jpg',111, 130,5,'photo_2120158.html');
												thumbnails[2120203] = new thumbnail(2120203,'140995','Salty, Arnham Land','salty_armham_land_2_NT_thumb.jpg',46, 130,5,'photo_2120203.html');
												thumbnails[2120246] = new thumbnail(2120246,'140970','Iguazu Falls with rainbow','iguazu_falls_argentina_thumb.jpg',130, 97,5,'photo_2120246.html');
												thumbnails[2120248] = new thumbnail(2120248,'140970','Inca Door Hinge','inca_door_hinge_peru_thumb.jpg',91, 130,5,'photo_2120248.html');
												thumbnails[2120259] = new thumbnail(2120259,'140970','Grazing in Tranquility','patagonia_argentina_thumb.jpg',130, 82,5,'photo_2120259.html');
												thumbnails[2120264] = new thumbnail(2120264,'140970','Sunset Silhouette','pinnicles_WA_thumb.jpg',105, 130,5,'photo_2120264.html');
												thumbnails[2120270] = new thumbnail(2120270,'143181','Sunset on the Rocks','sunset_2_broome_WA_thumb.jpg',130, 78,5,'photo_2120270.html');
												thumbnails[2120273] = new thumbnail(2120273,'140970','Summit of El Misti','volcan_el_misti_1_peru_thumb.jpg',130, 63,5,'photo_2120273.html');
												thumbnails[2120284] = new thumbnail(2120284,'140970','Waves crashing over rocks','waves_crashing_over_rocks_thumb.jpg',130, 68,5,'photo_2120284.html');
												thumbnails[2120303] = new thumbnail(2120303,'140995','Iguanas Sunbathe','iguanas_sunbathe_galapagos_thumb.jpg',130, 48,5,'photo_2120303.html');
												thumbnails[2120306] = new thumbnail(2120306,'140970','Petrol Cans','petrol_cans_thumb.jpg',130, 96,5,'photo_2120306.html');
												thumbnails[2120313] = new thumbnail(2120313,'140970','Silk Waterfall','silk_waterfall_thumb.jpg',130, 96,5,'photo_2120313.html');
												thumbnails[2120317] = new thumbnail(2120317,'140970','Westminster','westminster_thumb.jpg',79, 130,5,'photo_2120317.html');
												thumbnails[2160539] = new thumbnail(2160539,'140970','Morning Mist','Morning_Mist_thumb.jpg',130, 85,5,'photo_2160539.html');
												thumbnails[2160544] = new thumbnail(2160544,'143181','Mother & Child','Mother_and_Child_thumb.jpg',130, 117,5,'photo_2160544.html');
												thumbnails[2160657] = new thumbnail(2160657,'143181','Siblings','Siblings_thumb.jpg',130, 97,5,'photo_2160657.html');
												thumbnails[2189842] = new thumbnail(2189842,'140996','The Furbelows Live','Furbelows_Live_3_thumb.jpg',130, 87,5,'photo_2189842.html');
												thumbnails[2189843] = new thumbnail(2189843,'140996','The Furbelows Live','Furbelows_Live_4_thumb.jpg',130, 87,5,'photo_2189843.html');
												thumbnails[2189848] = new thumbnail(2189848,'140996','The Furbelows Live','Furbelows_Live_6_thumb.jpg',90, 130,5,'photo_2189848.html');
												thumbnails[2527315] = new thumbnail(2527315,'161887','','newly_weds_2_thumb.jpg',130, 122,5,'photo_2527315.html');
												thumbnails[2533069] = new thumbnail(2533069,'140995','Bird of the rainbow','bird-of-the-rainbow_thumb.jpg',130, 87,5,'photo_2533069.html');
												thumbnails[2533073] = new thumbnail(2533073,'140995','Inquisative','inquisative_thumb.jpg',105, 130,5,'photo_2533073.html');
												thumbnails[2533077] = new thumbnail(2533077,'140995','Stand off','stand-off_thumb.jpg',130, 87,5,'photo_2533077.html');
												thumbnails[2552810] = new thumbnail(2552810,'163058','','Spooky_thumb.jpg',130, 92,5,'photo_2552810.html');
												thumbnails[2552930] = new thumbnail(2552930,'163066','Air time 1','2008_07_DH-in-the-Alps065_thumb.jpg',130, 121,5,'photo_2552930.html');
												thumbnails[2552932] = new thumbnail(2552932,'163066','Air time 2','2008_07_DH-in-the-Alps055_thumb.jpg',130, 87,5,'photo_2552932.html');
												thumbnails[2681841] = new thumbnail(2681841,'161887','','001_thumb.jpg',130, 87,5,'photo_2681841.html');
												thumbnails[2681847] = new thumbnail(2681847,'161887','','002_thumb.jpg',130, 87,5,'photo_2681847.html');
												thumbnails[2681851] = new thumbnail(2681851,'161887','','cake_thumb.jpg',130, 87,5,'photo_2681851.html');
												thumbnails[2681852] = new thumbnail(2681852,'161887','','confetti_thumb.jpg',130, 87,5,'photo_2681852.html');
												thumbnails[2681855] = new thumbnail(2681855,'161887','','cutting-the-cake_thumb.jpg',130, 87,5,'photo_2681855.html');
												thumbnails[2682607] = new thumbnail(2682607,'161887','','005_thumb.jpg',130, 87,5,'photo_2682607.html');
												thumbnails[2682710] = new thumbnail(2682710,'161887','','outside-church_thumb.jpg',130, 87,5,'photo_2682710.html');
												thumbnails[2731803] = new thumbnail(2731803,'140995','Harassed Giraffe','Giraffe_thumb.jpg',130, 87,5,'photo_2731803.html');
												thumbnails[2733240] = new thumbnail(2733240,'140995','Blue footed boobie','Blue-footed-boobie_thumb.jpg',86, 130,5,'photo_2733240.html');
												thumbnails[2733247] = new thumbnail(2733247,'143181','Jungle community','Jungle-crew_thumb.jpg',130, 97,5,'photo_2733247.html');
												thumbnails[2733250] = new thumbnail(2733250,'143181','Traditional Peruvian clothing','Peruvian-girl_thumb.jpg',98, 130,5,'photo_2733250.html');
												thumbnails[6427573] = new thumbnail(6427573,'143181','Neena Trehan','07_thumb.jpg',86, 130,5,'photo_6427573.html');
												thumbnails[6427674] = new thumbnail(6427674,'162158','','03_thumb.JPG',130, 87,5,'photo_6427674.html');
												thumbnails[6427690] = new thumbnail(6427690,'162158','','01_1581F9FD-1D09-001F-99EC97CDDF56D1BB_thumb.jpg',130, 114,5,'photo_6427690.html');
												thumbnails[6427838] = new thumbnail(6427838,'163058','','05bw_thumb.jpg',130, 87,5,'photo_6427838.html');
												thumbnails[6427843] = new thumbnail(6427843,'163058','','01snuggs_thumb.jpg',125, 130,5,'photo_6427843.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[163066] = new gallery(163066,'2552930','Action Sports','gallery',[2552930,2552932],0, 0, '', 'gallery_163066.html',0,0);
				  					galleries[162158] = new gallery(162158,'6427690','Commercial','gallery',[3423727,3234793,3088604,3088614,6427674,6427690],0, 0, '', 'gallery_162158.html',0,0);
				  					galleries[163058] = new gallery(163058,'2552810','Domestic','gallery',[2552810,6427838,6427843],0, 0, '', 'gallery_163058.html',0,0);
				  					galleries[140996] = new gallery(140996,'3965261,2842368,2726896','Music','gallery',[3965261,2842368,2842372,2726896,2726903,2119822,2189842,2189843,2189848],0, 0, '', 'gallery_140996.html',0,0);
				  					galleries[140970] = new gallery(140970,'2533090','Outdoor / Travel','gallery',[4131643,4131648,3458254,3458257,2533090,2119528,2119541,2119547,2119575,2120246,2120248,2120259,2120264,2120273,2120284,2120306,2120313,2120317,2160539],0, 0, '', 'gallery_140970.html',0,0);
				  					galleries[143181] = new gallery(143181,'6427552','People','gallery',[6427349,6427552,2120270,2160544,2160657,2733247,2733250,6427573],0, 0, '', 'gallery_143181.html',0,0);
				  					galleries[161887] = new gallery(161887,'2681852','Weddings','gallery',[2730826,2730835,2730838,2527315,2681841,2681847,2681851,2681852,2681855,2682607,2682710],0, 0, '', 'gallery_161887.html',0,0);
				  					galleries[140995] = new gallery(140995,'2120303','Wildlife','gallery',[3458249,2119615,2120158,2120203,2120303,2533069,2533073,2533077,2731803,2733240],0, 0, '', 'gallery_140995.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '6427349';
imageSets[2] = '6427690,6427552,3965261,2842368,2726896,2681852,2552930,2552810,2533090,2120303';
imageSets[3] = '6427690,6427349,4131643,3965261,3458257,3458254,3458249,3423727,3234793,3088604,2842368,2733247,2726896,2681852,2552930,2552810,2533090,2533069,2160539,2120303';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/communicatian/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/communicatian/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/communicatian/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/communicatian/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/communicatian/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/communicatian/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 = 'Ian-Kelleher.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));      $('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>Ian Kelleher </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="ianrkelleher@hotmail.com">';
	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="ianrkelleher@hotmail.com">';
	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;
	}
}

			

