window.thumbnails = {};
															thumbnails[3416898] = clik.newPhoto({"id":3416898,"src":"cv_web_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":58,"caption":"","height":130});
															thumbnails[3416993] = clik.newPhoto({"id":3416993,"src":"untitled1_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":140});
															thumbnails[3677037] = clik.newPhoto({"id":3677037,"src":"flyer51_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":93});
															thumbnails[4711298] = clik.newPhoto({"id":4711298,"src":"posterloopflyer_11_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":92,"caption":"","height":130});
															thumbnails[4711487] = clik.newPhoto({"id":4711487,"src":"eco_09_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":123,"caption":"","height":130});
															thumbnails[5604493] = clik.newPhoto({"id":5604493,"src":"Catalogue_number_9906753_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":89});
															thumbnails[7737909] = clik.newPhoto({"id":7737909,"src":"Ben_Rowe_invite-3_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":92});
															thumbnails[3906448] = clik.newPhoto({"id":3906448,"src":"Temporary_Monument_XXVIII_thumb.jpg","galleries_id":208856,"server_id":15,"link":"photo_3906448.html","width":130,"caption":"Temporary Monument XXVIII","height":130});
															thumbnails[8044912] = clik.newPhoto({"id":8044912,"src":"PROGRAM_USER_thumb.jpg","galleries_id":431585,"server_id":15,"link":"photo_8044912.html","width":130,"caption":"PROGRAM\/USER","height":130});
															thumbnails[3417127] = clik.newPhoto({"id":3417127,"src":"Wanna-be3_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3417127.html","width":130,"caption":"Wanna-Be","height":130});
															thumbnails[3417346] = clik.newPhoto({"id":3417346,"src":"Temporary Monument XIX_thumb.jpg","galleries_id":208856,"server_id":15,"link":"photo_3417346.html","width":130,"caption":"Temporary Monument XIX","height":130});
															thumbnails[3417678] = clik.newPhoto({"id":3417678,"src":"Abide_thumb.jpg","galleries_id":208875,"server_id":15,"link":"photo_3417678.html","width":130,"caption":"Abide","height":130});
															thumbnails[3906646] = clik.newPhoto({"id":3906646,"src":"This_is_it_dont_get_scared_now_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_3906646.html","width":130,"caption":"This is it, Don't get scared now","height":130});
															thumbnails[5604598] = clik.newPhoto({"id":5604598,"src":"Catalogue_number_9906753_2_thumb.jpg","galleries_id":317863,"server_id":15,"link":"photo_5604598.html","width":130,"caption":"Catalogue number: 9906753","height":130});
															thumbnails[5794004] = clik.newPhoto({"id":5794004,"src":"5_years_to_go_thumb.jpg","galleries_id":430858,"server_id":15,"link":"photo_5794004.html","width":130,"caption":"Five years to go (2010) ","height":130});
															thumbnails[3417280] = clik.newPhoto({"id":3417280,"src":"Temporary Monument XII_thumb.jpg","galleries_id":208856,"server_id":15,"link":"photo_3417280.html","width":130,"caption":"Temporary Monument XII","height":130});
															thumbnails[3417189] = clik.newPhoto({"id":3417189,"src":"Temporary Monument XI_thumb.jpg","galleries_id":208856,"server_id":15,"link":"photo_3417189.html","width":130,"caption":"Temporary Monument XI","height":130});
															thumbnails[3417552] = clik.newPhoto({"id":3417552,"src":"Suit Carcass_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3417552.html","width":130,"caption":"Suit Carcass","height":130});
															thumbnails[3906685] = clik.newPhoto({"id":3906685,"src":"This_is_it_dont_get_scared_now2_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_3906685.html","width":130,"caption":"This is it, Don't get scared now","height":130});
															thumbnails[5604661] = clik.newPhoto({"id":5604661,"src":"Catalogue_number_9906753_3_thumb.jpg","galleries_id":317863,"server_id":15,"link":"photo_5604661.html","width":130,"caption":"Catalogue number: 9906753","height":130});
															thumbnails[5794008] = clik.newPhoto({"id":5794008,"src":"5_years_to_go_back_thumb.jpg","galleries_id":430858,"server_id":15,"link":"photo_5794008.html","width":130,"caption":"Five years to go (2010) ","height":130});
															thumbnails[3417398] = clik.newPhoto({"id":3417398,"src":"Temporary Monument VII_thumb.jpg","galleries_id":208856,"server_id":15,"link":"photo_3417398.html","width":130,"caption":"Temporary Monument VII","height":130});
															thumbnails[3417500] = clik.newPhoto({"id":3417500,"src":"Flight of the Navigator_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3417500.html","width":130,"caption":"Flight of the Navigator","height":130});
															thumbnails[3906504] = clik.newPhoto({"id":3906504,"src":"Parted_in_Time_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_3906504.html","width":130,"caption":"Parted in Time","height":130});
															thumbnails[8022296] = clik.newPhoto({"id":8022296,"src":"Four_years_to_go_thumb.jpg","galleries_id":430858,"server_id":15,"link":"photo_8022296.html","width":130,"caption":"Four years to go (2011) ","height":130});
															thumbnails[3417577] = clik.newPhoto({"id":3417577,"src":"Vivienne_thumb.jpg","galleries_id":208875,"server_id":15,"link":"photo_3417577.html","width":130,"caption":"Vivienne","height":130});
															thumbnails[3417515] = clik.newPhoto({"id":3417515,"src":"Flight of the Navigator detail_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3417515.html","width":130,"caption":"Flight of The Navigator (detail)","height":130});
															thumbnails[3906551] = clik.newPhoto({"id":3906551,"src":"Parted_in_Time_detail_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_3906551.html","width":130,"caption":"Parted in Time (detail)","height":130});
															thumbnails[4806107] = clik.newPhoto({"id":4806107,"src":"Batteries_not_included_front_view_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_4806107.html","width":130,"caption":"Batteries not Included*","height":130});
															thumbnails[8022301] = clik.newPhoto({"id":8022301,"src":"Four_years_to_go_back_thumb.jpg","galleries_id":430858,"server_id":15,"link":"photo_8022301.html","width":130,"caption":"Four years to go (2011) ","height":130});
															thumbnails[8044684] = clik.newPhoto({"id":8044684,"src":"Under_the_Rainbow_thumb.jpg","galleries_id":317863,"server_id":15,"link":"photo_8044684.html","width":130,"caption":"Under the Rainbow ","height":130});
															thumbnails[3417683] = clik.newPhoto({"id":3417683,"src":"Caliburn_thumb.jpg","galleries_id":208875,"server_id":15,"link":"photo_3417683.html","width":130,"caption":"Caliburn","height":130});
															thumbnails[3417692] = clik.newPhoto({"id":3417692,"src":"Gauche_thumb.jpg","galleries_id":208875,"server_id":15,"link":"photo_3417692.html","width":130,"caption":"Gauche","height":130});
															thumbnails[3421535] = clik.newPhoto({"id":3421535,"src":"Splint3_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3421535.html","width":130,"caption":"Splint","height":130});
															thumbnails[4806109] = clik.newPhoto({"id":4806109,"src":"Batteries_not_included_rear_view_thumb.jpg","galleries_id":237280,"server_id":15,"link":"photo_4806109.html","width":130,"caption":"Batteries not Included*","height":130});
															thumbnails[3417697] = clik.newPhoto({"id":3417697,"src":"Martyr_thumb.jpg","galleries_id":208875,"server_id":15,"link":"photo_3417697.html","width":130,"caption":"Martyr","height":130});
															thumbnails[3453413] = clik.newPhoto({"id":3453413,"src":"Gulliver Pain_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3453413.html","width":130,"caption":"Gulliver Pain","height":130});
															thumbnails[8044840] = clik.newPhoto({"id":8044840,"src":"Hold_your_Breath_Make_a_Wish_Count_to_Three1234_thumb.jpg","galleries_id":317863,"server_id":15,"link":"photo_8044840.html","width":130,"caption":"Hold your Breath, Make a Wish, Count to Three","height":130});
															thumbnails[3453642] = clik.newPhoto({"id":3453642,"src":"gp21_thumb.jpg","galleries_id":208874,"server_id":15,"link":"photo_3453642.html","width":107,"caption":"Gulliver Pain (detail)","height":130});
															thumbnails[8044531] = clik.newPhoto({"id":8044531,"src":"In_a_Constant_State_of_Bogus_Flux_thumb.jpg","galleries_id":317863,"server_id":15,"link":"photo_8044531.html","width":130,"caption":"In a Constant State of Bogus Flux","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[208875] = clik.newGallery({"parentGallery":"","usePopups":false,"title":2007.0,"link":"gallery_208875.html","maxRecords":0.0,"photoIDs":[3417678.0,3417577.0,3417683.0,3417692.0,3417697.0],"skipIndex":0,"section_code":"gallery","featured_images":3417678.0,"id":208875,"singleSection":false});				  						galleries[208874] = clik.newGallery({"parentGallery":"","usePopups":false,"title":2008.0,"link":"gallery_208874.html","maxRecords":0.0,"photoIDs":[3417127.0,3417552.0,3417500.0,3417515.0,3421535.0,3453413.0,3453642.0],"skipIndex":0,"section_code":"gallery","featured_images":3417127.0,"id":208874,"singleSection":false});				  						galleries[237280] = clik.newGallery({"parentGallery":"","usePopups":false,"title":2009.0,"link":"gallery_237280.html","maxRecords":0.0,"photoIDs":[3906646.0,3906685.0,3906504.0,3906551.0,4806107.0,4806109.0],"skipIndex":0,"section_code":"gallery","featured_images":4806107.0,"id":237280,"singleSection":false});				  						galleries[317863] = clik.newGallery({"parentGallery":"","usePopups":false,"title":2010.0,"link":"gallery_317863.html","maxRecords":0.0,"photoIDs":[5604598.0,5604661.0,8044684.0,8044840.0,8044531.0],"skipIndex":0,"section_code":"gallery","featured_images":5604598.0,"id":317863,"singleSection":false});				  						galleries[431585] = clik.newGallery({"parentGallery":"","usePopups":false,"title":2011.0,"link":"gallery_431585.html","maxRecords":0.0,"photoIDs":[8044912.0],"skipIndex":0,"section_code":"gallery","featured_images":8044912.0,"id":431585,"singleSection":false});				  						galleries[430858] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Hoverboard Series ","link":"gallery_430858.html","maxRecords":0.0,"photoIDs":[5794004.0,5794008.0,8022296.0,8022301.0],"skipIndex":0,"section_code":"gallery","featured_images":5794004.0,"id":430858,"singleSection":false});				  						galleries[208856] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Temporary Monument Series","link":"gallery_208856.html","maxRecords":0.0,"photoIDs":[3906448.0,3417346.0,3417280.0,3417189.0,3417398.0],"skipIndex":0,"section_code":"gallery","featured_images":3417346.0,"id":208856,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8044912';
imageSets[2] = '8044912,3417678,3417346,3417127,5794004,5604598,4806107';
imageSets[3] = '8044912,8044840,8044684,8044531,8022301,8022296,7737909,5794008,5794004,5604661,5604598,5604493,4806109,4806107,4711487,4711298,3906685,3906646,3906551,3906504,3906448,3677037,3453642,3453413,3421535,3417697,3417692,3417683,3417678,3417577,3417552,3417515,3417500,3417398,3417346,3417280,3417189,3417127,3416993,3416898';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/benrowe/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/benrowe/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/benrowe/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/benrowe/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/benrowe/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/benrowe/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/benrowe/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 = 'Ben Rowe: ' + 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;
	}
}

			

