window.thumbnails = new Object();
												thumbnails[7628164] = new thumbnail(7628164,'228844','Neath Abbey','Neath-Abbey-3_thumb.jpg',130, 92,15,'photo_7628164.html');
												thumbnails[7583822] = new thumbnail(7583822,'228843','Male Chaffinch','Male-Chaffinch-2-Brecon-Web_thumb.jpg',130, 92,15,'photo_7583822.html');
												thumbnails[7587932] = new thumbnail(7587932,'228844','Cyfarthfa Castle','Cyfarthfa-Castle-Web_thumb.jpg',130, 92,15,'photo_7587932.html');
												thumbnails[7583815] = new thumbnail(7583815,'228843','Female Chaffinch','Female-Chaffinch-with-Food-Web_thumb.jpg',130, 93,15,'photo_7583815.html');
												thumbnails[7583817] = new thumbnail(7583817,'228843','Great Tit','Great-Tit-Eating-Web_thumb.jpg',130, 92,15,'photo_7583817.html');
												thumbnails[7583824] = new thumbnail(7583824,'228843','Robin','Robin-at-Wetlands-Web_thumb.jpg',130, 92,15,'photo_7583824.html');
												thumbnails[7587943] = new thumbnail(7587943,'228844','Laugharne Castle','Laugharne-Castle-and-Boat-Reflections-Web_thumb.jpg',130, 92,15,'photo_7587943.html');
												thumbnails[7588314] = new thumbnail(7588314,'228844','Dillan Thomas Boathouse','Dylan-Thomas-Boathouse-Web-1_thumb.jpg',130, 92,15,'photo_7588314.html');
												thumbnails[7587885] = new thumbnail(7587885,'228844','Caerphilly Castle','Caerphilly-Castle-HDR-Web-2_thumb.jpg',130, 72,15,'photo_7587885.html');
												thumbnails[7587898] = new thumbnail(7587898,'228844','Castel Coch, (English Red Castle)','Castell-Coch-HDR-1Web_thumb.jpg',130, 92,15,'photo_7587898.html');
												thumbnails[7587914] = new thumbnail(7587914,'228844','Chepstow Castle','Chepstow-Castle-Close-up-cloned-Web-3_thumb.jpg',130, 69,15,'photo_7587914.html');
												thumbnails[7587922] = new thumbnail(7587922,'228844','Caldicot Castle','Coldicot-Castle-2-Web_thumb.jpg',130, 92,15,'photo_7587922.html');
												thumbnails[7588243] = new thumbnail(7588243,'228844','Chepstow Old Bridge','Chepstow-Old-Bridge-and-Castle-2-large-Web_thumb.jpg',130, 92,15,'photo_7588243.html');
												thumbnails[7588327] = new thumbnail(7588327,'228844','Pontneddfechan Waterfall','Pontneddfechan-Waterfall-Web-4_thumb.jpg',130, 186,15,'photo_7588327.html');
												thumbnails[7583813] = new thumbnail(7583813,'228843','Eagle Owl','Eagle-Owl-Web_thumb.jpg',130, 185,15,'photo_7583813.html');
												thumbnails[7588318] = new thumbnail(7588318,'228844','Autumn at Glyncorrwg Ponds','Glyncorrwg-Ponds-Nature-Reserve-2nd-Pond-Web-2_thumb.jpg',130, 90,15,'photo_7588318.html');
												thumbnails[7588330] = new thumbnail(7588330,'228844','Porthcawl Harbour Light','Porthcawl-Lighthouse-with-Big-Stopper-Web-flickr_thumb.jpg',130, 90,15,'photo_7588330.html');
												thumbnails[6393469] = new thumbnail(6393469,'228844','Bryn Coch Waterfall 1','Bryn_Coch_Waterfalls_Neath_Abbey_with_frame1_thumb.jpg',130, 173,15,'photo_6393469.html');
												thumbnails[6393477] = new thumbnail(6393477,'228844','Bryn Coch Waterfall 2','Bryn_Coch_Waterfalls_Neath_Abbey_with_frame3_thumb.jpg',130, 98,15,'photo_6393477.html');
												thumbnails[6332132] = new thumbnail(6332132,'228844','Rest Bay Sunset 1','12-07-2010_Rest_Bay_flickr_thumb.jpg',130, 98,15,'photo_6332132.html');
												thumbnails[6332141] = new thumbnail(6332141,'228844','Rest Bay Sunset 2','Flickr_2_thumb.jpg',130, 98,15,'photo_6332141.html');
												thumbnails[6332142] = new thumbnail(6332142,'228844','Rest Bay Sunset 3','Flickr_3_thumb.jpg',130, 98,15,'photo_6332142.html');
												thumbnails[6332144] = new thumbnail(6332144,'228844','Rest Bay Sunset 4','Flickr_4_thumb.jpg',130, 98,15,'photo_6332144.html');
												thumbnails[6348328] = new thumbnail(6348328,'228844','Rest Bay Sunset 5','Flickr_5_thumb.jpg',130, 98,15,'photo_6348328.html');
												thumbnails[6211379] = new thumbnail(6211379,'228843','Kingfisher','23-06-2010_Kingfisher_Llanelli_Wetlands_flickr_thumb.jpg',130, 93,15,'photo_6211379.html');
												thumbnails[6160218] = new thumbnail(6160218,'228844','Ogmore By Sea Sunset 1','14-06-2010_Ogmore_By_Sea_2_Website_and_Flickr_thumb.jpg',130, 93,15,'photo_6160218.html');
												thumbnails[6161801] = new thumbnail(6161801,'228844','Ogmore by Sea 3','14-06-2010_Ogmore_By_Sea_3_Flickr_thumb.jpg',130, 93,15,'photo_6161801.html');
												thumbnails[6213648] = new thumbnail(6213648,'228844','Gardens at St Fagans Welsh Folk Museum','St_Fagans_Gardens_and_old_Bridge_flickr1_thumb.jpg',130, 93,15,'photo_6213648.html');
												thumbnails[5765427] = new thumbnail(5765427,'228843','Male Greenfinch','Male_Greenfinch_Website_thumb.jpg',130, 183,15,'photo_5765427.html');
												thumbnails[5716114] = new thumbnail(5716114,'228844','Port Eynon Beach Cottages','Port_Eynon__Cottages_Evening_Website_thumb.jpg',130, 92,15,'photo_5716114.html');
												thumbnails[5716207] = new thumbnail(5716207,'228844','Sunset Three Cliffs Bay','Three_Cliffs_Bay_Setting_Sun_Website_thumb.jpg',130, 92,15,'photo_5716207.html');
												thumbnails[5743031] = new thumbnail(5743031,'228844','Swansea Bay and Mumbles Panorama','Swansea_Bay_3_Panorama_thumb.jpg',130, 49,15,'photo_5743031.html');
												thumbnails[5585792] = new thumbnail(5585792,'228844','Craig Goch Dam Reflections, Elan Valley 2','Lake_Reflections_2_Elan_Valley_Website_thumb.jpg',130, 93,15,'photo_5585792.html');
												thumbnails[7588321] = new thumbnail(7588321,'228844','Overton Beach','Overton-Beach-Web-11_thumb.jpg',130, 187,15,'photo_7588321.html');
												thumbnails[5112528] = new thumbnail(5112528,'228843','Orange Lily','Orange_Lily_Flower_for_website_thumb.jpg',130, 183,15,'photo_5112528.html');
												thumbnails[4976580] = new thumbnail(4976580,'228844','Garreg Ddu and Foel Tower Elan Valley','Elan_Valley_Garreg_Ddu_and_Foel_Tower_2_Dams_for_Website_thumb.jpg',130, 93,15,'photo_4976580.html');
												thumbnails[4976602] = new thumbnail(4976602,'228844','Garreg Ddu and Foel Tower 2 Elan Valley','Elan_Valley_Garreg_Ddu_and_Foel_Tower_Dams_for_website_thumb.jpg',130, 93,15,'photo_4976602.html');
												thumbnails[4976637] = new thumbnail(4976637,'228844','Pen Y Garreg Dam Elan Valley','Elan_Valley_Pen-Y-Garreg_2_Dam_fro_website_thumb.jpg',130, 93,15,'photo_4976637.html');
												thumbnails[4976761] = new thumbnail(4976761,'228844','Elan Valley Waterfall','Elan_Valley_Waterfall_3_for_website_thumb.jpg',130, 93,15,'photo_4976761.html');
												thumbnails[4910210] = new thumbnail(4910210,'228844','Autumn in Tintern Wye Valley','Autumn_on_Tintern_River_low_res_image_thumb.jpg',130, 93,15,'photo_4910210.html');
												thumbnails[4735538] = new thumbnail(4735538,'228843','Small Tortoiseshell Butterfly','Small_Tortoiseshell_3_website_thumb.jpg',130, 93,15,'photo_4735538.html');
												thumbnails[4735584] = new thumbnail(4735584,'228843','Nature at its Finest','Flower_2_thumb.jpg',130, 87,15,'photo_4735584.html');
												thumbnails[7588248] = new thumbnail(7588248,'228844','Cwmpark Rhondda Valley','Cwmparc-from-Bwlch-Rhondda-Valley-Web_thumb.jpg',130, 90,15,'photo_7588248.html');
												thumbnails[4492799] = new thumbnail(4492799,'228843','Greenbottle','Greenbottle_Fly_on_Red_Flower_thumb.jpg',130, 93,15,'photo_4492799.html');
												thumbnails[4492818] = new thumbnail(4492818,'228843','Macro shot of Honey Bee on Daisy','Hony_Bee_on_Daisy_Macro_thumb.jpg',130, 93,15,'photo_4492818.html');
												thumbnails[4168004] = new thumbnail(4168004,'228843','Red Kite','Red_Kite_5_thumb.jpg',130, 93,15,'photo_4168004.html');
												thumbnails[4043238] = new thumbnail(4043238,'228844','Summer on the Brecon Beacons','Rain_on_Trecastle_Brecon_B-W_thumb.jpg',130, 93,15,'photo_4043238.html');
												thumbnails[7587951] = new thumbnail(7587951,'228844','Margam Castle','Margam-Castle-and-Steps-Web_thumb.jpg',130, 91,15,'photo_7587951.html');
												thumbnails[3770289] = new thumbnail(3770289,'228844','Bluebell Wood','Bluebell-Wood-Best_thumb.jpg',130, 93,15,'photo_3770289.html');
												thumbnails[3752287] = new thumbnail(3752287,'228843','Macro Flower','Table-top-Photography-Macro_thumb.jpg',130, 87,15,'photo_3752287.html');
												thumbnails[3751073] = new thumbnail(3751073,'228844','Rhossili Bay 2','Rhossili2_thumb.jpg',130, 87,15,'photo_3751073.html');
												thumbnails[3752285] = new thumbnail(3752285,'228843','Prize winning Rose','Red-Rose-with-water-droplet_thumb.jpg',130, 86,15,'photo_3752285.html');
												thumbnails[3750887] = new thumbnail(3750887,'228844','Caldy Island','Caldy_thumb.jpg',130, 87,15,'photo_3750887.html');
												thumbnails[4111674] = new thumbnail(4111674,'228844','Nash Point 4 B/W','Nash_Point_Heritage_Coast_6_B-W_thumb.jpg',130, 93,15,'photo_4111674.html');
												thumbnails[7587956] = new thumbnail(7587956,'228844','Raglan Castle','Raglan-Castle-Web_thumb.jpg',130, 91,15,'photo_7587956.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[228843] = new gallery(228843,'7583824,7583822,7583817,7583815,7583813,6211379,5765427,5112528,4735584,4735538','Nature and Wildlife','gallery',[7583822,7583815,7583817,7583824,7583813,6211379,5765427,5112528,4735538,4735584,4492799,4492818,4168004,3752287,3752285],0, 0, '', 'gallery_228843.html',0,0);
				  					galleries[228844] = new gallery(228844,'7628164,7588330,7588327,7588321,7588318,7588314,7588248,7588243,7587956,7587951','Landscapes Seascapes and Panoramas','gallery',[7628164,7587932,7587943,7588314,7587885,7587898,7587914,7587922,7588243,7588327,7588318,7588330,6393469,6393477,6332132,6332141,6332142,6332144,6348328,6160218,6161801,6213648,5716114,5716207,5743031,5585792,7588321,4976580,4976602,4976637,4976761,4910210,7588248,4043238,7587951,3770289,3751073,3750887,4111674,7587956],0, 0, '', 'gallery_228844.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7628164,7588330,7588327,7588321,7588318,7588314,7588248,7588243,7587956,7587951,7587943,7587932,7587922,7587914,7587898,7587885,7583824,7583822,7583817,7583815,7583813,6393477,6393469,6348328,6332144,6332142,6332141,6332132,6213648,6211379,6161801,6160218,5765427,5743031,5716207,5716114,5585792,5112528,4976761,4976637,4976602,4976580,4910210,4735584,4735538,4492818,4492799,4168004,4111674,4043238,3770289,3752287,3752285,3751073,3750887';
imageSets[3] = '7628164,7588330,7588327,7588321,7588318,7588314,7588248,7588243,7587956,7587951,7587943,7587932,7587922,7587914,7587898,7587885,7583824,7583822,7583817,7583815,7583813,6393477,6393469,6348328,6332144,6332142,6332141,6332132,6213648,6211379,6161801,6160218,5765427,5743031,5716207,5716114,5585792,5112528,4976761,4976637,4976602,4976580,4910210,4735584,4735538,4492818,4492799,4168004,4111674,4043238,3770289,3752287,3752285,3751073,3750887';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/achieverswales/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/achieverswales/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 = 'Captured Moments Photography: ' + 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));      $('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>';
	}
					
	temp = temp + this.fnGetPaymentInfo();
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
																		temp = temp + '<p>Buy now using PayPal:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
		 									temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateCartValue(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
									temp = temp + '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm">';
	temp = temp + '	<input type="hidden" name="item_option" value="' + item_option + '">';
	temp = temp + '	<input type="hidden" name="site" value="ACHIEVERSWALES">';
		temp = temp + '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp = temp + '	<input type="hidden" name="quantity" value="1">';
								temp = temp + '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
			temp = temp + '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
	temp = temp + '</form>';
		temp = temp + '<div class="clearing">&nbsp;</div>';
	temp = temp + '<div id="confirmContainer">';
	temp = temp + '<div id="paymentConfirm">Item added to cart</div>';
	temp = temp + '</div>';
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

