window.thumbnails = new Object();
												thumbnails[5812995] = new thumbnail(5812995,'328945','Avebury at dawn','Dave_1_of_95_thumb.jpg',130, 68,32,'																			photo_5812995.html');
												thumbnails[5812998] = new thumbnail(5812998,'328946','\"Party fun\"','Dave_2_of_95_thumb.jpg',130, 101,32,'																			photo_5812998.html');
												thumbnails[5813001] = new thumbnail(5813001,'328957','Poppy','Dave_3_of_95_thumb.jpg',130, 86,32,'																			photo_5813001.html');
												thumbnails[5813006] = new thumbnail(5813006,'328945','Sunset on the south coast','Dave_4_of_95_thumb.jpg',130, 66,32,'																			photo_5813006.html');
												thumbnails[5813008] = new thumbnail(5813008,'328945','Durdle Dor','Dave_5_of_95_thumb.jpg',130, 50,32,'																			photo_5813008.html');
												thumbnails[5813011] = new thumbnail(5813011,'328945','Salisbury Cathedral','Dave_6_of_95_thumb.jpg',130, 195,32,'																			photo_5813011.html');
												thumbnails[5813012] = new thumbnail(5813012,'328945','Scottish Islands','Dave_7_of_95_thumb.jpg',130, 46,32,'																			photo_5813012.html');
												thumbnails[5813014] = new thumbnail(5813014,'328945','Scottish Islands','Dave_8_of_95_thumb.jpg',130, 66,32,'																			photo_5813014.html');
												thumbnails[5813015] = new thumbnail(5813015,'328945','Fishing cottages, Scotland','Dave_9_of_95_thumb.jpg',130, 86,32,'																			photo_5813015.html');
												thumbnails[5813017] = new thumbnail(5813017,'329059','Sports','Dave_10_of_95_thumb.jpg',130, 212,32,'																			photo_5813017.html');
												thumbnails[5813019] = new thumbnail(5813019,'328945','Stonehenge','Dave_11_of_95_thumb.jpg',130, 149,32,'																			photo_5813019.html');
												thumbnails[5813020] = new thumbnail(5813020,'328946','Cute!','Dave_12_of_95_thumb.jpg',130, 195,32,'																			photo_5813020.html');
												thumbnails[5813021] = new thumbnail(5813021,'328957','Trees, Wiltshire','Dave_13_of_95_thumb.jpg',130, 148,32,'																			photo_5813021.html');
												thumbnails[5813022] = new thumbnail(5813022,'328946','Sisters','Dave_14_of_95_thumb.jpg',130, 122,32,'																			photo_5813022.html');
												thumbnails[5813023] = new thumbnail(5813023,'328946','Cheeky smile','Dave_15_of_95_thumb.jpg',130, 97,32,'																			photo_5813023.html');
												thumbnails[5813025] = new thumbnail(5813025,'329059','Lampost','Dave_16_of_95_thumb.jpg',130, 184,32,'																			photo_5813025.html');
												thumbnails[5813026] = new thumbnail(5813026,'328957','Egret','Dave_17_of_95_thumb.jpg',130, 130,32,'																			photo_5813026.html');
												thumbnails[5813028] = new thumbnail(5813028,'329059','Cross country','Dave_18_of_95_thumb.jpg',130, 148,32,'																			photo_5813028.html');
												thumbnails[5813030] = new thumbnail(5813030,'328957','Orange','Dave_19_of_95_thumb.jpg',130, 87,32,'																			photo_5813030.html');
												thumbnails[5813031] = new thumbnail(5813031,'329059','Military aircraft','Dave_20_of_95_thumb.jpg',130, 87,32,'																			photo_5813031.html');
												thumbnails[5813033] = new thumbnail(5813033,'328957','Flower','Dave_21_of_95_thumb.jpg',130, 194,32,'																			photo_5813033.html');
												thumbnails[5813034] = new thumbnail(5813034,'328957','Kitten !','Dave_22_of_95_thumb.jpg',130, 79,32,'																			photo_5813034.html');
												thumbnails[5813036] = new thumbnail(5813036,'328946','Studio glamour','Dave_23_of_95_thumb.jpg',130, 194,32,'																			photo_5813036.html');
												thumbnails[5813038] = new thumbnail(5813038,'328946','Studio portrait','Dave_24_of_95_thumb.jpg',130, 194,32,'																			photo_5813038.html');
												thumbnails[5813039] = new thumbnail(5813039,'328957','Bluebell woods','Dave_25_of_95_thumb.jpg',130, 194,32,'																			photo_5813039.html');
												thumbnails[5813040] = new thumbnail(5813040,'328957','Rape field','Dave_26_of_95_thumb.jpg',130, 87,32,'																			photo_5813040.html');
												thumbnails[5813041] = new thumbnail(5813041,'328946','Girls in the wood','Dave_27_of_95_thumb.jpg',130, 194,32,'																			photo_5813041.html');
												thumbnails[5813043] = new thumbnail(5813043,'328956','Blue building','Dave_28_of_95_thumb.jpg',130, 195,32,'																			photo_5813043.html');
												thumbnails[5813044] = new thumbnail(5813044,'328946','\"Jump\"','Dave_29_of_95_thumb.jpg',130, 241,32,'																			photo_5813044.html');
												thumbnails[5813045] = new thumbnail(5813045,'328945','The Burj, Dubai','Dave_30_of_95_thumb.jpg',130, 211,32,'																			photo_5813045.html');
												thumbnails[5813046] = new thumbnail(5813046,'328945','Winter....','Dave_31_of_95_thumb.jpg',130, 87,32,'																			photo_5813046.html');
												thumbnails[5813047] = new thumbnail(5813047,'328946','Informal portrait','Dave_32_of_95_thumb.jpg',130, 163,32,'																			photo_5813047.html');
												thumbnails[5813048] = new thumbnail(5813048,'329059','Red Arrows','Dave_33_of_95_thumb.jpg',130, 91,32,'																			photo_5813048.html');
												thumbnails[5813049] = new thumbnail(5813049,'328957','A bloodied fox','Dave_34_of_95_thumb.jpg',130, 76,32,'																			photo_5813049.html');
												thumbnails[5813050] = new thumbnail(5813050,'328945','Seaside groynes','Dave_35_of_95_thumb.jpg',130, 207,32,'																			photo_5813050.html');
												thumbnails[5813052] = new thumbnail(5813052,'328957','Grey Heron','Dave_36_of_95_thumb.jpg',130, 86,32,'																			photo_5813052.html');
												thumbnails[5813053] = new thumbnail(5813053,'328956','Pensive','Dave_37_of_95_thumb.jpg',130, 176,32,'																			photo_5813053.html');
												thumbnails[5813054] = new thumbnail(5813054,'328956','Re - training','Dave_38_of_95_thumb.jpg',130, 96,32,'																			photo_5813054.html');
												thumbnails[5813055] = new thumbnail(5813055,'328956','Drugs support programme','Dave_39_of_95_thumb.jpg',130, 179,32,'																			photo_5813055.html');
												thumbnails[5813056] = new thumbnail(5813056,'328956','Dining','Dave_40_of_95_thumb.jpg',130, 114,32,'																			photo_5813056.html');
												thumbnails[5813057] = new thumbnail(5813057,'328956','The Passage, drop in centre','Dave_41_of_95_thumb.jpg',130, 87,32,'																			photo_5813057.html');
												thumbnails[5813058] = new thumbnail(5813058,'328956','Homeless','Dave_42_of_95_thumb.jpg',130, 98,32,'																			photo_5813058.html');
												thumbnails[5813059] = new thumbnail(5813059,'328956','Warm food','Dave_43_of_95_thumb.jpg',130, 95,32,'																			photo_5813059.html');
												thumbnails[5813060] = new thumbnail(5813060,'328956','Fundraising','Dave_44_of_95_thumb.jpg',130, 108,32,'																			photo_5813060.html');
												thumbnails[5813062] = new thumbnail(5813062,'328956','Fundraising gala','Dave_45_of_95_thumb.jpg',130, 150,32,'																			photo_5813062.html');
												thumbnails[5813064] = new thumbnail(5813064,'328956','Gala event','Dave_46_of_95_thumb.jpg',130, 87,32,'																			photo_5813064.html');
												thumbnails[5813065] = new thumbnail(5813065,'328956','Fundraising gala','Dave_47_of_95_thumb.jpg',130, 87,32,'																			photo_5813065.html');
												thumbnails[5813090] = new thumbnail(5813090,'328956','Fundraising gala','Dave_51_of_95_thumb.jpg',130, 168,32,'																			photo_5813090.html');
												thumbnails[5813094] = new thumbnail(5813094,'328956','Sleeping rough','Dave_52_of_95_thumb.jpg',130, 56,32,'																			photo_5813094.html');
												thumbnails[5813096] = new thumbnail(5813096,'328945','Derbyshire','Dave_53_of_95_thumb.jpg',130, 73,32,'																			photo_5813096.html');
												thumbnails[5813098] = new thumbnail(5813098,'328957','Camel','Dave_55_of_95_thumb.jpg',130, 61,32,'																			photo_5813098.html');
												thumbnails[5813100] = new thumbnail(5813100,'328957','Bird of Prey','Dave_61_of_95_thumb.jpg',130, 92,32,'																			photo_5813100.html');
												thumbnails[5813102] = new thumbnail(5813102,'328957','Autumn...','Dave_65_of_95_thumb.jpg',130, 194,32,'																			photo_5813102.html');
												thumbnails[5813103] = new thumbnail(5813103,'328957','Autumn leaves','Dave_67_of_95_thumb.jpg',130, 70,32,'																			photo_5813103.html');
												thumbnails[5813104] = new thumbnail(5813104,'328957','The cat','Dave_70_of_95_thumb.jpg',130, 91,32,'																			photo_5813104.html');
												thumbnails[5813107] = new thumbnail(5813107,'328946','Laughter','Dave_73_of_95_thumb.jpg',130, 170,32,'																			photo_5813107.html');
												thumbnails[5813108] = new thumbnail(5813108,'328946','Child','Dave_75_of_95_thumb.jpg',130, 184,32,'																			photo_5813108.html');
												thumbnails[5813110] = new thumbnail(5813110,'328946','Studio portrait','Dave_78_of_95_thumb.jpg',130, 87,32,'																			photo_5813110.html');
												thumbnails[5813111] = new thumbnail(5813111,'328946','Happy','Dave_80_of_95_thumb.jpg',130, 173,32,'																			photo_5813111.html');
												thumbnails[5813114] = new thumbnail(5813114,'328946','Baby','Dave_88_of_95_thumb.jpg',130, 67,32,'																			photo_5813114.html');
												thumbnails[5813130] = new thumbnail(5813130,'328946','Sports Day!','Dave_91_of_95_thumb.jpg',130, 165,32,'																			photo_5813130.html');
												thumbnails[5813133] = new thumbnail(5813133,'328946','Baby','Dave_94_of_95_thumb.jpg',130, 86,32,'																			photo_5813133.html');
												thumbnails[5813139] = new thumbnail(5813139,'328946','Happy!','Dave_95_of_95_thumb.jpg',130, 86,32,'																			photo_5813139.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[328946] = new gallery(328946,'5813139,5813133,5813130,5813114,5813111,5813110,5813108,5813107,5813047,5813044','Portrait','gallery',[5812998,5813020,5813022,5813023,5813036,5813038,5813041,5813044,5813047,5813107,5813108,5813110,5813111,5813114,5813130,5813133,5813139],0, 0, '', '																																																																																																							gallery_328946.html',0,0);
				  					galleries[328945] = new gallery(328945,'5813096,5813050,5813046,5813045,5813019,5813015,5813014,5813012,5813011,5813008','Landscape','gallery',[5812995,5813006,5813008,5813011,5813012,5813014,5813015,5813019,5813045,5813046,5813050,5813096],0, 0, '', '																																																																																																							gallery_328945.html',0,0);
				  					galleries[328956] = new gallery(328956,'5813094,5813090,5813065,5813064,5813062,5813060,5813059,5813058,5813057,5813056','Commercial','gallery',[5813043,5813053,5813054,5813055,5813056,5813057,5813058,5813059,5813060,5813062,5813064,5813065,5813090,5813094],0, 0, '', '																																																																																																							gallery_328956.html',0,0);
				  					galleries[328957] = new gallery(328957,'5813104,5813103,5813102,5813100,5813098,5813052,5813049,5813040,5813039,5813034','Nature','gallery',[5813001,5813021,5813026,5813030,5813033,5813034,5813039,5813040,5813049,5813052,5813098,5813100,5813102,5813103,5813104],0, 0, '', '																																																																																																							gallery_328957.html',0,0);
				  					galleries[329059] = new gallery(329059,'5813048,5813031,5813028,5813025,5813017','Mixed bag','gallery',[5813017,5813025,5813028,5813031,5813048],0, 0, '', '																																																																																																							gallery_329059.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '5813139,5813133,5813130,5813114,5813111,5813110,5813108,5813107,5813104,5813103,5813102,5813100,5813098,5813096,5813094,5813090,5813065,5813064,5813062,5813060,5813059,5813058,5813057,5813056,5813055,5813054,5813053,5813052,5813050,5813049,5813048,5813047,5813046,5813045,5813044,5813043,5813041,5813040,5813039,5813038,5813036,5813034,5813033,5813031,5813030,5813028,5813026,5813025,5813023,5813022';
imageSets[3] = '5813139,5813133,5813130,5813114,5813111,5813110,5813108,5813107,5813104,5813103,5813102,5813100,5813098,5813096,5813094,5813090,5813065,5813064,5813062,5813060,5813059,5813058,5813057,5813056,5813055,5813054,5813053,5813052,5813050,5813049,5813048,5813047,5813046,5813045,5813044,5813043,5813041,5813040,5813039,5813038,5813036,5813034,5813033,5813031,5813030,5813028,5813026,5813025,5813023,5813022';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/davidhughes999/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/davidhughes999/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {

	imageID = randomListVal('');
		if (!basic) {
	img.src = photos[imageID].src;
	img.width = photos[imageID].width;
	img.height = photos[imageID].height;
  img.parentNode.title = img.alt = photos[imageID].caption;
	}
	else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
				
	}
			}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}
/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
  var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
		if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
    
  updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
  var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
      op = $.extend({},defaults,options),
      html = '', temp = '',
      photoId = op.nextPhoto.id,
      photoCaption = op.nextPhoto.caption,
      photoSrc = op.nextPhoto.src;
		
		if (!basic) {
    if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
    }
				
    if (op.$photo.length > 0) {
      html = $('<img/>',{
        'class': 'mainphoto photo',
        src: photoSrc,
        id: 'mainPic',
        name: 'mainPic',
        width: op.nextPhoto.width,
        height: op.nextPhoto.height,
        alt: photoCaption,
        css: op.css || {}
      });
      if (op.href) {
      	if (op.href.match(/<a/)) {
      	  html = $(op.href).append(html);
      	} else {
		  html = $('<a/>', {
			href: op.href,
			title: photoCaption
		  }).append(html);
	    }
      } else {
      	html = $('<a/>', {
			title: photoCaption
		  }).append(html);
      }
      if (op.speed == 0) {        op.$photo.html(html);        if (op.onBefore) {          op.onBefore.apply(op.$photo);        }        if (op.onAfter) {          op.onAfter.apply(op.$photo);        }      } else {        op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){            if (op.onAfter) {		    op.onAfter.apply(this);          }		  clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));		}, op.onBefore);
      }    }
    	if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'D Hughes Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
	    var options = {};	    	      	      resizePhotoInfo(options);
        if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(backgrounds);
  	    } else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
  	      toggleAddToCartConfirm(photos);
  	    }
	    });
    }
        if (!op.speed) {      clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));    }        
    return html;			}
	else {
				
		window.location = 'photo_' + nextPhoto.id + '.html';
	}
		
}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array){
  if (typeof(array) !== 'object') {
    array = photos;
  }
	if($('#paymentConfirm').length > 0){
		$('#paymentConfirm').hide();
		$('#paymentAddButton')
		.unbind()
		.click(function(){
						form = document.getElementById('paymentForm');
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm').text('Item added to cart').show();}
				else{
					$('#paymentConfirm').text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm').text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}
/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp = temp +  '<p id="imageDescription">' + this.description + '</p>';
	}
		if (this.photo_ref != '') {
		temp = temp + '<p class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</p>';
	}
		if (this.takendate != '') {
				
		temp = temp + '<p class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</p>';
	}
	
	if (this.location != '') {
				
		temp = temp + '<p class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</p>';
	}
	
	if (this.photographer != '') {
				
		temp = temp + '<p class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</p>';
	}
					
				if (temp != '') {
		temp = temp + '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
photo.prototype.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp = temp + '<p>Order this print:</p>';
				temp = temp + '<p class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> 							' + (this.item_price).toFixed(2) + '</p>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp = temp + '<p>Buy this print online:</p>';
				temp = temp + '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp = temp + '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues(document.forms.paymentForm,this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
				
		temp = temp + getPaymentOptions(this.payment_groups_id);
		temp = temp + '</select>';
		temp = temp + '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
				
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp = temp + '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
		
	if(img){
	      if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
        imageID = imageID[1];
      } else {
			  imageID = randomListVal(galleries[gallery_id].featured_images);
      }
							
			if (imageID != 0) {
				img.src = thumbnails[imageID].src;
				img.width = thumbnails[imageID].width;
				img.height = thumbnails[imageID].height;
				img.alt = galleries[gallery_id].title;
        if (updateLink) {
          $(img).parent().attr({            href: thumbnails[imageID].fnGalleryLink(gallery_id),            title: galleries[gallery_id].title          });
        }
							}
										}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp = temp + ' | ';
				}
				temp = temp + '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
			}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

