window.thumbnails = {};
															thumbnails[5490083] = clik.newPhoto({"id":5490083,"src":"morning_glory_final_800x600_thumb.jpg","galleries_id":254772,"server_id":18,"link":"photo_5490083.html","width":130,"caption":"Morning Glory abstract","height":132});
															thumbnails[5957917] = clik.newPhoto({"id":5957917,"src":"_Poppy_Medley_Final_800x600_thumb.jpg","galleries_id":352662,"server_id":18,"link":"photo_5957917.html","width":130,"caption":"Poppy Medley","height":127});
															thumbnails[9067802] = clik.newPhoto({"id":9067802,"src":"white_slipper_orchid_1600x1200_thumb_D859E7F9-1EC9-D45B-1C60670405FFBAC2.jpg","galleries_id":254725,"server_id":18,"link":"photo_9067802.html","width":130,"caption":"White Slipper Orchid in oils","height":132});
															thumbnails[4325827] = clik.newPhoto({"id":4325827,"src":"Vases_reflections_640x480_thumb.jpg","galleries_id":254726,"server_id":18,"link":"photo_4325827.html","width":130,"caption":"Reflections","height":162});
															thumbnails[8609895] = clik.newPhoto({"id":8609895,"src":"Rose_Trio_in_oil_1024x768_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_8609895.html","width":130,"caption":"Rose Trio in oils","height":106});
															thumbnails[8861470] = clik.newPhoto({"id":8861470,"src":"Amarylis_1024x768_702C51BB-1EC9-D45B-1C680A428F1BF74E_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_8861470.html","width":130,"caption":"Red and White Amarylis Macro Painting","height":131});
															thumbnails[4325572] = clik.newPhoto({"id":4325572,"src":"Orchid_crowd_May_09_1024x768_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4325572.html","width":130,"caption":"Cymbidium Crowd","height":108});
															thumbnails[4325490] = clik.newPhoto({"id":4325490,"src":"Apples_om_blue_cloth_640x480_thumb.jpg","galleries_id":254726,"server_id":18,"link":"photo_4325490.html","width":130,"caption":"Apples on Blue Cloth","height":101});
															thumbnails[4325580] = clik.newPhoto({"id":4325580,"src":"fuchsias_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4325580.html","width":130,"caption":"Dancing Fuchsias","height":109});
															thumbnails[4325986] = clik.newPhoto({"id":4325986,"src":"parrot_tulip_final_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4325986.html","width":130,"caption":"Parrot Tulip Dance pastel painting. ","height":98});
															thumbnails[7924075] = clik.newPhoto({"id":7924075,"src":"Magnolias_arrangement_final_800x600_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_7924075.html","width":130,"caption":"Magnolia and Vase Floral Still Life","height":131});
															thumbnails[4325801] = clik.newPhoto({"id":4325801,"src":"Sunflowers_final_June_2009_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4325801.html","width":130,"caption":"Sunshine","height":159});
															thumbnails[6966027] = clik.newPhoto({"id":6966027,"src":"_final_Magnolia_Grandiflora_800x600_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_6966027.html","width":130,"caption":"Last of the summer magnolias","height":126});
															thumbnails[4325612] = clik.newPhoto({"id":4325612,"src":"Pink_Rose_40x40_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4325612.html","width":130,"caption":"Pink Rose","height":129});
															thumbnails[5944884] = clik.newPhoto({"id":5944884,"src":"White_jonquils_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_5944884.html","width":130,"caption":"White Jonquils oil pastel painting.","height":105});
															thumbnails[7182674] = clik.newPhoto({"id":7182674,"src":"californian_poppy_field_640x480_thumb.JPG","galleries_id":279998,"server_id":18,"link":"photo_7182674.html","width":130,"caption":"Californian Poppy Field Landscape Painting","height":103});
															thumbnails[6159900] = clik.newPhoto({"id":6159900,"src":"Datura_9_640x480_thumb.JPG","galleries_id":254725,"server_id":18,"link":"photo_6159900.html","width":130,"caption":"Swinging Daturas","height":173});
															thumbnails[5944873] = clik.newPhoto({"id":5944873,"src":"Adenium_final_640x480_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_5944873.html","width":130,"caption":"Adenium Oil Pastel Painting","height":100});
															thumbnails[4827446] = clik.newPhoto({"id":4827446,"src":"tworosesweb_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_4827446.html","width":130,"caption":"Two roses for Clara","height":131});
															thumbnails[4325639] = clik.newPhoto({"id":4325639,"src":"Poppy_640x480_thumb.jpg","galleries_id":352662,"server_id":18,"link":"photo_4325639.html","width":130,"caption":"Red Poppy","height":125});
															thumbnails[4325881] = clik.newPhoto({"id":4325881,"src":"lemons_bowl_640x480_thumb.JPG","galleries_id":254726,"server_id":18,"link":"photo_4325881.html","width":130,"caption":"Lemons in Glass Bowl","height":115});
															thumbnails[6372505] = clik.newPhoto({"id":6372505,"src":"Red_Poppies_on_black_640x480_thumb.jpg","galleries_id":352662,"server_id":18,"link":"photo_6372505.html","width":130,"caption":"Red poppies on black","height":97});
															thumbnails[4325885] = clik.newPhoto({"id":4325885,"src":"strawberries_on_blue_plate__640x480_thumb.JPG","galleries_id":254726,"server_id":18,"link":"photo_4325885.html","width":130,"caption":"Strawberries on a blue glass plate","height":99});
															thumbnails[4925454] = clik.newPhoto({"id":4925454,"src":"Fieldoftulipsweb_800x600_thumb.jpg","galleries_id":254772,"server_id":18,"link":"photo_4925454.html","width":130,"caption":"Field of Tulips Abstract","height":129});
															thumbnails[5385060] = clik.newPhoto({"id":5385060,"src":"Liquoric_Allsorts_Final_800x600_thumb.jpg","galleries_id":254726,"server_id":18,"link":"photo_5385060.html","width":130,"caption":"Sweet treats","height":129});
															thumbnails[6372491] = clik.newPhoto({"id":6372491,"src":"_fianl_Orange_glory_640x480_thumb.jpg","galleries_id":352662,"server_id":18,"link":"photo_6372491.html","width":130,"caption":"Orange Glory","height":186});
															thumbnails[4325701] = clik.newPhoto({"id":4325701,"src":"Spring_Freesias_4_640x480_thumb.JPG","galleries_id":254725,"server_id":18,"link":"photo_4325701.html","width":130,"caption":"Spring Freesias ","height":98});
															thumbnails[4325908] = clik.newPhoto({"id":4325908,"src":"Serenity_finished_640x480_thumb.jpg","galleries_id":254735,"server_id":18,"link":"photo_4325908.html","width":130,"caption":"Serenity","height":173});
															thumbnails[4914971] = clik.newPhoto({"id":4914971,"src":"Rudbeckiasweb_thumb.jpg","galleries_id":279998,"server_id":18,"link":"photo_4914971.html","width":130,"caption":"Rudbeckia Purpura","height":126});
															thumbnails[4325809] = clik.newPhoto({"id":4325809,"src":"White_antheriums_final_640x480_thumb.JPG","galleries_id":254725,"server_id":18,"link":"photo_4325809.html","width":130,"caption":"White Anthuriums in soft pastels","height":107});
															thumbnails[5036648] = clik.newPhoto({"id":5036648,"src":"Farniente_1_640x480_thumb.jpg","galleries_id":254726,"server_id":18,"link":"photo_5036648.html","width":130,"caption":"Fariente (subtitled Lazy Days)","height":172});
															thumbnails[4914988] = clik.newPhoto({"id":4914988,"src":"Mimosaweb_thumb.jpg","galleries_id":279998,"server_id":18,"link":"photo_4914988.html","width":130,"caption":"Mimosa","height":133});
															thumbnails[5036101] = clik.newPhoto({"id":5036101,"src":"Irises_final_800x600_thumb.jpg","galleries_id":254725,"server_id":18,"link":"photo_5036101.html","width":130,"caption":"Spring Irises","height":134});
															thumbnails[8609926] = clik.newPhoto({"id":8609926,"src":"Goodby_summer_hello_fall_800x600_thumb.jpg","galleries_id":254735,"server_id":18,"link":"photo_8609926.html","width":130,"caption":"Goodbye summer, Hello Fall","height":100});
															thumbnails[4325895] = clik.newPhoto({"id":4325895,"src":"bluebell-wood_thumb.jpg","galleries_id":254735,"server_id":18,"link":"photo_4325895.html","width":130,"caption":"Bluebell Woods soft pastel painting","height":103});
															thumbnails[4914905] = clik.newPhoto({"id":4914905,"src":"Calm_at_the_Lake_12_640x480_thumb.JPG","galleries_id":254735,"server_id":18,"link":"photo_4914905.html","width":130,"caption":"Calm at the lake pastel painting","height":96});
															thumbnails[5036425] = clik.newPhoto({"id":5036425,"src":"Hedgerow_800x600_2_thumb.jpg","galleries_id":254735,"server_id":18,"link":"photo_5036425.html","width":130,"caption":"English Hedgerow","height":130});
															thumbnails[8212483] = clik.newPhoto({"id":8212483,"src":"Hydrangeas_800x600_thumb.jpg","galleries_id":438038,"server_id":18,"link":"photo_8212483.html","width":130,"caption":"Hydrangeas at my back door","height":91});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[254725] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Florals","link":"gallery_254725.html","maxRecords":0.0,"photoIDs":[9067802.0,8609895.0,8861470.0,4325572.0,4325580.0,4325986.0,7924075.0,4325801.0,6966027.0,4325612.0,5944884.0,6159900.0,5944873.0,4827446.0,4325701.0,4325809.0,5036101.0],"skipIndex":0,"section_code":"gallery","featured_images":"9067802,8609895","id":254725,"singleSection":false});				  						galleries[352662] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Poppies","link":"gallery_352662.html","maxRecords":0.0,"photoIDs":[5957917.0,4325639.0,6372505.0,6372491.0],"skipIndex":0,"section_code":"gallery","featured_images":"6372505,6372491,5957917,4325639","id":352662,"singleSection":false});				  						galleries[254726] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Still Life paintings","link":"gallery_254726.html","maxRecords":0.0,"photoIDs":[4325827.0,4325490.0,4325881.0,4325885.0,5385060.0,5036648.0],"skipIndex":0,"section_code":"gallery","featured_images":5385060.0,"id":254726,"singleSection":false});				  						galleries[254735] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Landscape paintings","link":"gallery_254735.html","maxRecords":0.0,"photoIDs":[4325908.0,8609926.0,4325895.0,4914905.0,5036425.0],"skipIndex":0,"section_code":"gallery","featured_images":8609926.0,"id":254735,"singleSection":false});				  						galleries[254772] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Abstract Paintings","link":"gallery_254772.html","maxRecords":0.0,"photoIDs":[5490083.0,4925454.0],"skipIndex":0,"section_code":"gallery","featured_images":"5490083,4925454","id":254772,"singleSection":false});				  						galleries[438038] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Daily Paintings","link":"section526026.html","maxRecords":0.0,"photoIDs":[8212483.0],"skipIndex":0,"section_code":"section526026","featured_images":8212483.0,"id":438038,"singleSection":true});				  						galleries[279998] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"Flower Studies","link":"gallery_279998.html","maxRecords":0.0,"photoIDs":[7182674.0,4914971.0,4914988.0],"skipIndex":0,"section_code":"gallery","featured_images":4914971.0,"id":279998,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9067802';
imageSets[2] = '9067802,8609895,5385060,4914971,8609926';
imageSets[3] = '9067802,8861470,8609926,8609895,8212483,7924075,7182674,6966027,6372505,6372491,6159900,5957917,5944884,5944873,5490083,5385060,5036648,5036425,5036101,4925454,4914988,4914971,4914905,4827446,4325986,4325908,4325895,4325885,4325881,4325827,4325809,4325801,4325701,4325639,4325612,4325580,4325572,4325490';
imageSets[234249] = '4325827';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/marionh/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/marionh/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/marionh/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 || photos || {})[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:'',$detailContainer:'',
                    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 (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'ArtbyMarion - Fine art by Marion Hedger: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		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.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			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', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Artist </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &euro;' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
		else {
		
	}
	if (this.item_price !== '') {
																		temp += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			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 += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="niceholidayrentals@orange.fr">';
					temp += '<input type="hidden" name="currency_code" value="EUR">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="niceholidayrentals@orange.fr">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* 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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

