window.thumbnails = {};
															thumbnails[8912667] = clik.newPhoto({"id":8912667,"src":"DSC_2166-x-800_FF7E382E-1EC9-DFB6-09DC972F796213E2_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912667.html","width":130,"caption":"Purple Haze","height":52});
															thumbnails[8912684] = clik.newPhoto({"id":8912684,"src":"DSC_0545pano-x-800_FFABD643-1EC9-DFB6-097E6C352205D450_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912684.html","width":130,"caption":"Bluebell Impressions","height":52});
															thumbnails[8912695] = clik.newPhoto({"id":8912695,"src":"DSC_7737pano-x-800_FFD016B2-1EC9-DFB6-0979C7753E95D8E3_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912695.html","width":130,"caption":"Loch Shiel","height":52});
															thumbnails[8912701] = clik.newPhoto({"id":8912701,"src":"DSC_8014pano1-x-800_FFE02DFB-1EC9-DFB6-09D5279E6E7A8FB1_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912701.html","width":130,"caption":"Autumn Canopy","height":52});
															thumbnails[8912710] = clik.newPhoto({"id":8912710,"src":"DSC_8348-x-800_000D380C-1EC9-DFB6-091C30514F60FAA3_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912710.html","width":130,"caption":"Mersey Mist","height":52});
															thumbnails[8912716] = clik.newPhoto({"id":8912716,"src":"DSC_8697pano1-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912716.html","width":130,"caption":"Formby Dunes","height":52});
															thumbnails[8912761] = clik.newPhoto({"id":8912761,"src":"DSC_0485_tonemapped_filtere_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912761.html","width":130,"caption":"Salthouse Dock","height":87});
															thumbnails[8912762] = clik.newPhoto({"id":8912762,"src":"DSC_0542-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912762.html","width":130,"caption":"Bluebell Impressions","height":87});
															thumbnails[8912770] = clik.newPhoto({"id":8912770,"src":"DSC_0840-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912770.html","width":130,"caption":"Tree Tops","height":87});
															thumbnails[8912775] = clik.newPhoto({"id":8912775,"src":"DSC_0928-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912775.html","width":130,"caption":"Red Slate","height":87});
															thumbnails[8912779] = clik.newPhoto({"id":8912779,"src":"DSC_0938-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912779.html","width":130,"caption":"Everyday is like Sunday","height":87});
															thumbnails[8912781] = clik.newPhoto({"id":8912781,"src":"DSC_1427-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912781.html","width":130,"caption":"Mosaic","height":87});
															thumbnails[8912788] = clik.newPhoto({"id":8912788,"src":"DSC_1616-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912788.html","width":130,"caption":"Coastal Lichens","height":87});
															thumbnails[8912796] = clik.newPhoto({"id":8912796,"src":"DSC_1677-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912796.html","width":130,"caption":"Llanddwyn Lighthouse","height":87});
															thumbnails[8912800] = clik.newPhoto({"id":8912800,"src":"DSC_1728pp-textured-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912800.html","width":130,"caption":"Sade","height":87});
															thumbnails[8912806] = clik.newPhoto({"id":8912806,"src":"DSC_1860-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912806.html","width":130,"caption":"Afon Gwynant","height":87});
															thumbnails[8912809] = clik.newPhoto({"id":8912809,"src":"DSC_2024-01-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912809.html","width":130,"caption":"Feel Lucky Punk","height":87});
															thumbnails[8912810] = clik.newPhoto({"id":8912810,"src":"DSC_2150pp-x-800_01D0A112-1EC9-DFB6-09BCDB32AE8AECC9_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912810.html","width":130,"caption":"Moody Blues","height":87});
															thumbnails[8912864] = clik.newPhoto({"id":8912864,"src":"DSC_2209-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912864.html","width":130,"caption":"Borrowdale View","height":87});
															thumbnails[8912877] = clik.newPhoto({"id":8912877,"src":"DSC_2237-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912877.html","width":130,"caption":"Grasmere","height":87});
															thumbnails[8912958] = clik.newPhoto({"id":8912958,"src":"DSC_2260-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912958.html","width":130,"caption":"Under the Oak","height":87});
															thumbnails[8912967] = clik.newPhoto({"id":8912967,"src":"DSC_3569-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912967.html","width":130,"caption":"Jump","height":87});
															thumbnails[8912969] = clik.newPhoto({"id":8912969,"src":"DSC_4019-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912969.html","width":130,"caption":"A Room With A View ","height":87});
															thumbnails[8912975] = clik.newPhoto({"id":8912975,"src":"DSC_4059-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912975.html","width":130,"caption":"Buttermere Tree","height":87});
															thumbnails[8912981] = clik.newPhoto({"id":8912981,"src":"DSC_5947--x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912981.html","width":130,"caption":"East Float Dock","height":87});
															thumbnails[8912982] = clik.newPhoto({"id":8912982,"src":"DSC_7388-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912982.html","width":130,"caption":"River Dee","height":87});
															thumbnails[8912984] = clik.newPhoto({"id":8912984,"src":"DSC_7449-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912984.html","width":130,"caption":"Eastham Wood","height":87});
															thumbnails[8912987] = clik.newPhoto({"id":8912987,"src":"DSC_7709-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912987.html","width":130,"caption":"Loch Awe Pines","height":87});
															thumbnails[8912988] = clik.newPhoto({"id":8912988,"src":"DSC_7732-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912988.html","width":130,"caption":"River Callop","height":87});
															thumbnails[8912990] = clik.newPhoto({"id":8912990,"src":"DSC_7797-01-heron-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912990.html","width":130,"caption":"Llanddulas Heron","height":87});
															thumbnails[8912995] = clik.newPhoto({"id":8912995,"src":"DSC_8181-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912995.html","width":130,"caption":"Llyn Cregennan","height":87});
															thumbnails[8912997] = clik.newPhoto({"id":8912997,"src":"DSC_8377-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8912997.html","width":130,"caption":"Frosted Oak","height":87});
															thumbnails[8913001] = clik.newPhoto({"id":8913001,"src":"DSC_8392-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913001.html","width":130,"caption":"Sugar Coated","height":87});
															thumbnails[8913004] = clik.newPhoto({"id":8913004,"src":"DSC_8697-01-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913004.html","width":130,"caption":"Barn Owl","height":87});
															thumbnails[8913006] = clik.newPhoto({"id":8913006,"src":"DSC_8711-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913006.html","width":130,"caption":"Formby Point","height":87});
															thumbnails[8913009] = clik.newPhoto({"id":8913009,"src":"DSC_8782-01-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913009.html","width":130,"caption":"European Eagle Owl","height":87});
															thumbnails[8913011] = clik.newPhoto({"id":8913011,"src":"DSC_8804-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913011.html","width":130,"caption":"Rock Art","height":87});
															thumbnails[8913015] = clik.newPhoto({"id":8913015,"src":"DSC_8955-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913015.html","width":130,"caption":"Trio","height":87});
															thumbnails[8913017] = clik.newPhoto({"id":8913017,"src":"DSC_9468sky-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913017.html","width":130,"caption":"Malham Moor","height":87});
															thumbnails[8913062] = clik.newPhoto({"id":8913062,"src":"DSC_9485-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_8913062.html","width":130,"caption":"Malham Hawthorn","height":87});
															thumbnails[9078610] = clik.newPhoto({"id":9078610,"src":"DSC_2010pp-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_9078610.html","width":130,"caption":"Gwydir Forest","height":87});
															thumbnails[9078614] = clik.newPhoto({"id":9078614,"src":"DSC_3291-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_9078614.html","width":130,"caption":"Red Rocks","height":87});
															thumbnails[9078616] = clik.newPhoto({"id":9078616,"src":"DSC_2171-x-800_thumb.jpg","galleries_id":468784,"server_id":18,"link":"photo_9078616.html","width":130,"caption":"Lavender Blue","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[468784] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Gallery ","link":"section268645.html","maxRecords":0.0,"photoIDs":[8912667.0,8912684.0,8912695.0,8912701.0,8912710.0,8912716.0,8912761.0,8912762.0,8912770.0,8912775.0,8912779.0,8912781.0,8912788.0,8912796.0,8912800.0,8912806.0,8912809.0,8912810.0,8912864.0,8912877.0,8912958.0,8912967.0,8912969.0,8912975.0,8912981.0,8912982.0,8912984.0,8912987.0,8912988.0,8912990.0,8912995.0,8912997.0,8913001.0,8913004.0,8913006.0,8913009.0,8913011.0,8913015.0,8913017.0,8913062.0,9078610.0,9078614.0,9078616.0],"skipIndex":0,"section_code":"section268645","featured_images":"9078616,9078614,9078610,8913062,8913017,8913015,8913011,8913009,8913006,8913004","id":468784,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9078614,8912981,8912958,8912810,8912806,8912788,8912761,8912667';
imageSets[3] = '9078616,9078614,9078610,8913062,8913017,8913015,8913011,8913009,8913006,8913004,8913001,8912997,8912995,8912990,8912988,8912987,8912984,8912982,8912981,8912975,8912969,8912967,8912958,8912877,8912864,8912810,8912809,8912806,8912800,8912796,8912788,8912781,8912779,8912775,8912770,8912762,8912761,8912716,8912710,8912701,8912695,8912684,8912667';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/garymcghee/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/garymcghee/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 += 'section268645.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 && 'section268645' != '') {
					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 = 'gary mcghee photography: ' + 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>Photographer: </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> &pound;' + (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.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		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 += '<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;
	}
}

			

