window.thumbnails = {};
															thumbnails[3425036] = clik.newPhoto({"id":3425036,"src":"My head shot_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":130,"caption":"","height":195});
															thumbnails[7495584] = clik.newPhoto({"id":7495584,"src":"Mike_and_framed_print_thumb.jpg","galleries_id":"","server_id":32,"link":"#","width":160,"caption":"","height":105});
															thumbnails[3182778] = clik.newPhoto({"id":3182778,"src":"Copy of Delia_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_3182778.html","width":130,"caption":"","height":89});
															thumbnails[3401475] = clik.newPhoto({"id":3401475,"src":"Bathroom 2_thumb.jpg","galleries_id":188358,"server_id":32,"link":"photo_3401475.html","width":130,"caption":"","height":195});
															thumbnails[3401482] = clik.newPhoto({"id":3401482,"src":"Hall HDR1 Monkstown_thumb.jpg","galleries_id":188358,"server_id":32,"link":"photo_3401482.html","width":130,"caption":"","height":195});
															thumbnails[3411003] = clik.newPhoto({"id":3411003,"src":"Bedroom SBDC 0094b_thumb.jpg","galleries_id":188358,"server_id":32,"link":"photo_3411003.html","width":130,"caption":"","height":107});
															thumbnails[3429215] = clik.newPhoto({"id":3429215,"src":"Drawing room_thumb.jpg","galleries_id":188358,"server_id":32,"link":"photo_3429215.html","width":130,"caption":"","height":184});
															thumbnails[3545401] = clik.newPhoto({"id":3545401,"src":"Howth_Harbour_Lighthouse_Glow1_thumb.jpg","galleries_id":217125,"server_id":32,"link":"photo_3545401.html","width":130,"caption":"Howth harbour Light house.","height":41});
															thumbnails[7139371] = clik.newPhoto({"id":7139371,"src":"mk1_sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139371.html","width":160,"caption":"","height":56});
															thumbnails[7139488] = clik.newPhoto({"id":7139488,"src":"mk2sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139488.html","width":160,"caption":"","height":56});
															thumbnails[7139541] = clik.newPhoto({"id":7139541,"src":"mk3sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139541.html","width":160,"caption":"","height":57});
															thumbnails[7139546] = clik.newPhoto({"id":7139546,"src":"mk4sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139546.html","width":160,"caption":"","height":56});
															thumbnails[7139583] = clik.newPhoto({"id":7139583,"src":"mk6sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139583.html","width":160,"caption":"","height":56});
															thumbnails[7139586] = clik.newPhoto({"id":7139586,"src":"mk7sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7139586.html","width":160,"caption":"","height":56});
															thumbnails[7139591] = clik.newPhoto({"id":7139591,"src":"IMG_0101-2351-Edit-3_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7139591.html","width":160,"caption":"","height":96});
															thumbnails[7399100] = clik.newPhoto({"id":7399100,"src":"ws5_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7399100.html","width":160,"caption":"","height":80});
															thumbnails[7399104] = clik.newPhoto({"id":7399104,"src":"ws4_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7399104.html","width":160,"caption":"","height":80});
															thumbnails[7494919] = clik.newPhoto({"id":7494919,"src":"_MG_1610_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7494919.html","width":160,"caption":"","height":161});
															thumbnails[7494921] = clik.newPhoto({"id":7494921,"src":"_MG_1686_7_8_thumb.jpg","galleries_id":406349,"server_id":32,"link":"photo_7494921.html","width":160,"caption":"St. Annes Park, Dublin.","height":106});
															thumbnails[7494957] = clik.newPhoto({"id":7494957,"src":"_MG_3668_69_70_71_72_thumb.jpg","galleries_id":406349,"server_id":32,"link":"photo_7494957.html","width":160,"caption":"Early morning Singapore","height":94});
															thumbnails[7494965] = clik.newPhoto({"id":7494965,"src":"_MG_0167_8-Edit_thumb.jpg","galleries_id":406349,"server_id":32,"link":"photo_7494965.html","width":160,"caption":"Sydney Twilight, Australia.","height":71});
															thumbnails[7495744] = clik.newPhoto({"id":7495744,"src":"snow_scene_thumb.jpg","galleries_id":406349,"server_id":32,"link":"photo_7495744.html","width":160,"caption":"Memorial Park, Dublin.","height":98});
															thumbnails[7495770] = clik.newPhoto({"id":7495770,"src":"triptych_thumb.jpg","galleries_id":406349,"server_id":32,"link":"photo_7495770.html","width":160,"caption":"Memorial Park, Dublin.","height":109});
															thumbnails[7496467] = clik.newPhoto({"id":7496467,"src":"Paul_and_Eibhs_wedding-186-212_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7496467.html","width":107,"caption":"","height":160});
															thumbnails[7496471] = clik.newPhoto({"id":7496471,"src":"Paul_and_Eibhs_wedding-0911_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7496471.html","width":99,"caption":"","height":160});
															thumbnails[7496475] = clik.newPhoto({"id":7496475,"src":"Wendy__Keith_wedding-4381_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7496475.html","width":107,"caption":"","height":160});
															thumbnails[7499286] = clik.newPhoto({"id":7499286,"src":"wedding_sample_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7499286.html","width":160,"caption":"","height":113});
															thumbnails[7525061] = clik.newPhoto({"id":7525061,"src":"_MG_0736_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7525061.html","width":160,"caption":"","height":160});
															thumbnails[7525064] = clik.newPhoto({"id":7525064,"src":"AoibheannLynda_and_Dec_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7525064.html","width":160,"caption":"","height":68});
															thumbnails[7525099] = clik.newPhoto({"id":7525099,"src":"Paddy_final_print_psd-Edit-Edit-Edit_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7525099.html","width":160,"caption":"","height":29});
															thumbnails[7525100] = clik.newPhoto({"id":7525100,"src":"_MG_0060_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7525100.html","width":160,"caption":"","height":160});
															thumbnails[7557184] = clik.newPhoto({"id":7557184,"src":"_MG_2036-Edit_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7557184.html","width":140,"caption":"","height":160});
															thumbnails[7557285] = clik.newPhoto({"id":7557285,"src":"_MG_2008-Edit_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7557285.html","width":107,"caption":"","height":160});
															thumbnails[7737654] = clik.newPhoto({"id":7737654,"src":"_MG_2170_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7737654.html","width":160,"caption":"","height":90});
															thumbnails[7737662] = clik.newPhoto({"id":7737662,"src":"_MG_2193-Edit1_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7737662.html","width":160,"caption":"","height":107});
															thumbnails[7737671] = clik.newPhoto({"id":7737671,"src":"_MG_2319_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7737671.html","width":160,"caption":"","height":107});
															thumbnails[7749854] = clik.newPhoto({"id":7749854,"src":"_MG_1603_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7749854.html","width":160,"caption":"","height":115});
															thumbnails[7809992] = clik.newPhoto({"id":7809992,"src":"_MG_22072_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_7809992.html","width":160,"caption":"","height":115});
															thumbnails[8095459] = clik.newPhoto({"id":8095459,"src":"_MG_5783-Edit_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_8095459.html","width":160,"caption":"","height":115});
															thumbnails[8095462] = clik.newPhoto({"id":8095462,"src":"_MG_5802-Edit1-2_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_8095462.html","width":110,"caption":"","height":160});
															thumbnails[8095510] = clik.newPhoto({"id":8095510,"src":"_MG_5879_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_8095510.html","width":110,"caption":"","height":160});
															thumbnails[7397919] = clik.newPhoto({"id":7397919,"src":"Hillarys_wedding-1-Edit-4-Edit_thumb.jpg","galleries_id":385940,"server_id":32,"link":"photo_7397919.html","width":160,"caption":"","height":102});
															thumbnails[3417849] = clik.newPhoto({"id":3417849,"src":"Sarah-head-shot2_thumb.jpg","galleries_id":188359,"server_id":32,"link":"photo_3417849.html","width":130,"caption":"","height":140});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[385940] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding Photography","link":"gallery_385940.html","maxRecords":0.0,"photoIDs":[7139371.0,7139488.0,7139541.0,7139546.0,7139583.0,7139586.0,7399100.0,7399104.0,7494919.0,7496467.0,7496471.0,7496475.0,7499286.0,7749854.0,7397919.0],"skipIndex":0,"section_code":"gallery","featured_images":"7749854,7499286,7496475,7496471,7496467,7494919,7399104,7399100,7397919,7139586","id":385940,"singleSection":false});				  						galleries[406349] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Travel \/ Landscape","link":"gallery_406349.html","maxRecords":0.0,"photoIDs":[7494921.0,7494957.0,7494965.0,7495744.0,7495770.0],"skipIndex":0,"section_code":"gallery","featured_images":7494957.0,"id":406349,"singleSection":false});				  						galleries[188358] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Interior Images","link":"gallery_188358.html","maxRecords":0.0,"photoIDs":[3401475.0,3401482.0,3411003.0,3429215.0],"skipIndex":0,"section_code":"gallery","featured_images":3401482.0,"id":188358,"singleSection":false});				  						galleries[188359] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lifestyle portraiture","link":"gallery_188359.html","maxRecords":0.0,"photoIDs":[3182778.0,7139591.0,7525061.0,7525064.0,7525099.0,7525100.0,7557184.0,7557285.0,7737654.0,7737662.0,7737671.0,7809992.0,8095459.0,8095462.0,8095510.0,3417849.0],"skipIndex":0,"section_code":"gallery","featured_images":3182778.0,"id":188359,"singleSection":false});				  						galleries[217125] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"By The Sea","link":"gallery_217125.html","maxRecords":0.0,"photoIDs":[3545401.0],"skipIndex":0,"section_code":"gallery","featured_images":3545401.0,"id":217125,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8095459,7809992,7737654,7557184,7494957,7139591,3182778,7397919,3417849';
imageSets[2] = '7494957,3401482,3182778';
imageSets[3] = '8095510,8095462,8095459,7809992,7749854,7737671,7737662,7737654,7557285,7557184,7525100,7525099,7525064,7525061,7499286,7496475,7496471,7496467,7495770,7495744,7495584,7494965,7494957,7494921,7494919,7399104,7399100,7397919,7139591,7139586,7139583,7139546,7139541,7139488,7139371,3545401,3429215,3425036,3417849,3411003,3401482,3401475,3182778';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mikemcnally/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mikemcnally/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:'',$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 = '                           MikeMcNally 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> ' + (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;
	}
}

			

