window.thumbnails = new Object();
												thumbnails[3474209] = new thumbnail(3474209,'173121','','_MG_2151edit8x10_thumb.jpg',70, 87,32,'photo_3474209.html');
												thumbnails[4332707] = new thumbnail(4332707,'173121','','Alistair1_thumb.jpg',58, 87,32,'photo_4332707.html');
												thumbnails[4332715] = new thumbnail(4332715,'173121','','lesley5_thumb.jpg',58, 87,32,'photo_4332715.html');
												thumbnails[4332738] = new thumbnail(4332738,'173121','','dawn2_thumb.jpg',58, 87,32,'photo_4332738.html');
												thumbnails[4332750] = new thumbnail(4332750,'173121','','Arlene3_thumb.jpg',58, 87,32,'photo_4332750.html');
												thumbnails[4332755] = new thumbnail(4332755,'173121','','Jane3_thumb.jpg',58, 87,32,'photo_4332755.html');
												thumbnails[4332757] = new thumbnail(4332757,'173121','','Ian1_thumb.jpg',58, 87,32,'photo_4332757.html');
												thumbnails[4332762] = new thumbnail(4332762,'173121','','Harry4_thumb.jpg',130, 87,32,'photo_4332762.html');
												thumbnails[4748455] = new thumbnail(4748455,'272342','','_MG_5617_zoehairdown_screen_thumb.jpg',58, 87,32,'photo_4748455.html');
												thumbnails[4748456] = new thumbnail(4748456,'175201','','_MG_5923_zoestreet3_screen_thumb.jpg',58, 87,32,'photo_4748456.html');
												thumbnails[4748457] = new thumbnail(4748457,'175201','','_MG_5970_zoestreet5_screen_thumb.jpg',58, 87,32,'photo_4748457.html');
												thumbnails[4748458] = new thumbnail(4748458,'272342','','_MG_6007_horse_screen_thumb.jpg',130, 87,32,'photo_4748458.html');
												thumbnails[4748460] = new thumbnail(4748460,'272342','','_MG_6235_zoedress2_screen_thumb.jpg',130, 87,32,'photo_4748460.html');
												thumbnails[4748461] = new thumbnail(4748461,'272342','','_MG_6259_zoetree1_screen_thumb.jpg',58, 87,32,'photo_4748461.html');
												thumbnails[4748463] = new thumbnail(4748463,'272342','','_MG_6266_zoetrees_screen_thumb.jpg',58, 87,32,'photo_4748463.html');
												thumbnails[4748465] = new thumbnail(4748465,'173121','','Drew2_thumb.jpg',130, 87,32,'photo_4748465.html');
												thumbnails[4827074] = new thumbnail(4827074,'173121','','_MG_8409_screen_thumb.jpg',130, 87,32,'photo_4827074.html');
												thumbnails[4827077] = new thumbnail(4827077,'175201','','_MG_8648_screen_thumb.jpg',58, 87,32,'photo_4827077.html');
												thumbnails[4913940] = new thumbnail(4913940,'173121','','_MG_5285_companypic_screen_thumb.jpg',130, 87,32,'photo_4913940.html');
												thumbnails[4947980] = new thumbnail(4947980,'175209','','_MG_2101_17thcentury_thumb.jpg',130, 87,32,'photo_4947980.html');
												thumbnails[4947990] = new thumbnail(4947990,'175201','','_MG_1503joshscreen_thumb.jpg',58, 87,32,'photo_4947990.html');
												thumbnails[4947996] = new thumbnail(4947996,'175201','','_MG_1554joshscreen_thumb.jpg',130, 87,32,'photo_4947996.html');
												thumbnails[4947999] = new thumbnail(4947999,'175201','','_MG_2772screen_thumb.jpg',58, 87,32,'photo_4947999.html');
												thumbnails[4948004] = new thumbnail(4948004,'175201','','_MG_2812screen_thumb.jpg',130, 87,32,'photo_4948004.html');
												thumbnails[5670041] = new thumbnail(5670041,'175201','','_MG_2742_screen_thumb.jpg',58, 87,32,'photo_5670041.html');
												thumbnails[5670042] = new thumbnail(5670042,'175201','','_MG_2926_screen_thumb.jpg',58, 87,32,'photo_5670042.html');
												thumbnails[5670043] = new thumbnail(5670043,'175201','','_MG_4752_screen_thumb.jpg',130, 87,32,'photo_5670043.html');
												thumbnails[5670044] = new thumbnail(5670044,'175201','','_MG_6011_kevinscreen_bw_thumb.jpg',58, 87,32,'photo_5670044.html');
												thumbnails[5670045] = new thumbnail(5670045,'175201','','_MG_6487_screen_thumb.jpg',130, 87,32,'photo_5670045.html');
												thumbnails[5670046] = new thumbnail(5670046,'175201','','_MG_6517_screen_thumb.jpg',58, 87,32,'photo_5670046.html');
												thumbnails[5670047] = new thumbnail(5670047,'175201','','_MG_6723_groupprintscreen8x10_thumb.jpg',70, 87,32,'photo_5670047.html');
												thumbnails[5670049] = new thumbnail(5670049,'175201','','_MG_6932_colourscreen_thumb.jpg',58, 87,32,'photo_5670049.html');
												thumbnails[5670051] = new thumbnail(5670051,'175201','','_MG_6984colourscreen_thumb.jpg',58, 87,32,'photo_5670051.html');
												thumbnails[5688699] = new thumbnail(5688699,'175209','','_MG_0885_holymountain_thumb.jpg',130, 87,32,'photo_5688699.html');
												thumbnails[5874541] = new thumbnail(5874541,'175209','Wounded Knee, Glasgow University Campus, 2010','_MG_5509_screen_woundedknee_thumb.jpg',59, 87,32,'photo_5874541.html');
												thumbnails[6170368] = new thumbnail(6170368,'344894','','edit_MG_7605bp2_thumb.jpg',58, 87,32,'photo_6170368.html');
												thumbnails[6170471] = new thumbnail(6170471,'344894','','edit_MG_7449bp_thumb.jpg',130, 87,32,'photo_6170471.html');
												thumbnails[6170475] = new thumbnail(6170475,'344894','','edit_MG_7623bp2_thumb.jpg',130, 87,32,'photo_6170475.html');
												thumbnails[6170477] = new thumbnail(6170477,'344894','','edit_MG_7444bp_thumb.jpg',58, 87,32,'photo_6170477.html');
												thumbnails[6170480] = new thumbnail(6170480,'344894','','edit_MG_7368bp_thumb.jpg',130, 87,32,'photo_6170480.html');
												thumbnails[6170481] = new thumbnail(6170481,'344894','','edit_MG_7428bp_thumb.jpg',130, 87,32,'photo_6170481.html');
												thumbnails[6170543] = new thumbnail(6170543,'344894','','edit_MG_7637bp2_thumb.jpg',130, 87,32,'photo_6170543.html');
												thumbnails[6170562] = new thumbnail(6170562,'344894','','edit_MG_7509bp_thumb.jpg',58, 87,32,'photo_6170562.html');
												thumbnails[6170659] = new thumbnail(6170659,'344894','','edit_MG_7648bp2_thumb.jpg',130, 87,32,'photo_6170659.html');
												thumbnails[6170661] = new thumbnail(6170661,'344894','','edit_MG_7477bp_thumb.jpg',130, 87,32,'photo_6170661.html');
												thumbnails[6170664] = new thumbnail(6170664,'344894','','edit_MG_7478bp_thumb.jpg',130, 87,32,'photo_6170664.html');
												thumbnails[6170665] = new thumbnail(6170665,'344894','','edit_MG_7687bp2_thumb.jpg',130, 87,32,'photo_6170665.html');
												thumbnails[6170666] = new thumbnail(6170666,'344894','','edit_MG_7695bp2_thumb.jpg',130, 87,32,'photo_6170666.html');
												thumbnails[6170667] = new thumbnail(6170667,'344894','','edit_MG_7662bp2_thumb.jpg',130, 87,32,'photo_6170667.html');
												thumbnails[6170670] = new thumbnail(6170670,'344894','','edit_MG_7738bp2_thumb.jpg',130, 87,32,'photo_6170670.html');
												thumbnails[6170672] = new thumbnail(6170672,'344894','','edit_MG_7512bp_thumb.jpg',130, 87,32,'photo_6170672.html');
												thumbnails[6170674] = new thumbnail(6170674,'344894','','edit_MG_7757bp2_thumb.jpg',130, 87,32,'photo_6170674.html');
												thumbnails[6170677] = new thumbnail(6170677,'344894','','edit_MG_7670bp_thumb.jpg',130, 87,32,'photo_6170677.html');
												thumbnails[6170680] = new thumbnail(6170680,'344894','','edit_MG_7773bp2_thumb.jpg',130, 87,32,'photo_6170680.html');
												thumbnails[6170683] = new thumbnail(6170683,'344894','','edit_MG_7820bp2_thumb.jpg',58, 87,32,'photo_6170683.html');
												thumbnails[6170684] = new thumbnail(6170684,'344894','','edit_MG_7859bp2_thumb.jpg',130, 87,32,'photo_6170684.html');
												thumbnails[6170685] = new thumbnail(6170685,'344894','','edit_MG_7901mbp_thumb.jpg',130, 87,32,'photo_6170685.html');
												thumbnails[6170686] = new thumbnail(6170686,'344894','','edit_MG_8016mbp_thumb.jpg',130, 87,32,'photo_6170686.html');
												thumbnails[7628267] = new thumbnail(7628267,'413676','','_MG_6259_zoetree1_screen_35BEC85A-1E4F-37DC-71983C652A3B36F7_thumb.jpg',58, 87,32,'photo_7628267.html');
												thumbnails[7628269] = new thumbnail(7628269,'413676','','_MG_6292_zoetrees_screen_thumb.jpg',58, 87,32,'photo_7628269.html');
												thumbnails[7628271] = new thumbnail(7628271,'413676','','_MG_9031_signlight_thumb.jpg',130, 87,32,'photo_7628271.html');
												thumbnails[7628276] = new thumbnail(7628276,'413676','','Suzie__BillySept_27_2009_0039_thumb.jpg',113, 87,32,'photo_7628276.html');
												thumbnails[7628309] = new thumbnail(7628309,'413676','','_MG_8821_groomsmen2_thumb.jpg',130, 87,32,'photo_7628309.html');
												thumbnails[7628336] = new thumbnail(7628336,'173121','','IMG_6736_screen_thumb.jpg',72, 87,32,'photo_7628336.html');
												thumbnails[3949013] = new thumbnail(3949013,'175201','','edit_MG_9299zoe_thumb.jpg',58, 87,32,'photo_3949013.html');
												thumbnails[7628260] = new thumbnail(7628260,'413676','','_MG_5617_zoe_screen_thumb.jpg',66, 87,32,'photo_7628260.html');
												thumbnails[3949005] = new thumbnail(3949005,'175201','','edit_MG_8888zoe_thumb.jpg',130, 87,32,'photo_3949005.html');
												thumbnails[7628264] = new thumbnail(7628264,'413676','','_MG_6233_zoe_dress_thumb.jpg',130, 87,32,'photo_7628264.html');
												thumbnails[3276452] = new thumbnail(3276452,'175201','','martin_MG_9288screen_thumb.jpg',58, 87,32,'photo_3276452.html');
												thumbnails[4115259] = new thumbnail(4115259,'175201','','14th_April_-_Canal20090414_0002_thumb.jpg',70, 87,32,'photo_4115259.html');
												thumbnails[2995193] = new thumbnail(2995193,'175201','','twinsweb1_thumb.jpg',119, 87,32,'photo_2995193.html');
												thumbnails[2995220] = new thumbnail(2995220,'175201','','twins2edit_thumb.jpg',118, 87,32,'photo_2995220.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[413676] = new gallery(413676,'7628267,7628260','Wedding Photography','gallery',[7628267,7628269,7628271,7628276,7628309,7628260,7628264],0, 0, '', 'gallery_413676.html',0,0);
				  					galleries[175201] = new gallery(175201,'3276452','Fashion/Model Tests','gallery',[4748456,4748457,4827077,4947990,4947996,4947999,4948004,5670041,5670042,5670043,5670044,5670045,5670046,5670047,5670049,5670051,3949013,3949005,3276452,4115259,2995193,2995220],0, 0, '', 'gallery_175201.html',0,0);
				  					galleries[173121] = new gallery(173121,'7628336,4332757','Portraits','gallery',[3474209,4332707,4332715,4332738,4332750,4332755,4332757,4332762,4748465,4827074,4913940,7628336],0, 0, '', 'gallery_173121.html',0,0);
				  					galleries[175209] = new gallery(175209,'5874541,5688699,4947980','Music','gallery',[4947980,5688699,5874541],0, 0, '', 'gallery_175209.html',0,0);
				  					galleries[344894] = new gallery(344894,'6170686,6170685,6170684,6170683,6170680,6170677,6170674,6170672,6170670,6170667','Bike Polo - Glasgow 2009','gallery',[6170368,6170471,6170475,6170477,6170480,6170481,6170543,6170562,6170659,6170661,6170664,6170665,6170666,6170667,6170670,6170672,6170674,6170677,6170680,6170683,6170684,6170685,6170686],0, 0, '344893', 'gallery_344894.html',0,0);
				  					galleries[344893] = new gallery(344893,'6170686,6170685,6170684,6170683,6170680,6170677,6170674,6170672,6170670,6170667','Documentary','gallery',[],0, 0, '', 'gallery_344893.html',0,0);
				  					galleries[272342] = new gallery(272342,'4748463,4748461,4748460,4748458,4748455','Bridalwear','gallery',[4748455,4748458,4748460,4748461,4748463],0, 0, '', 'gallery_272342.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '7628336,5670047,5670045,5670044,4947990,4827077,4748461,4748460,4748458,4748456,3474209,3276452';
imageSets[2] = '7628336,7628267,7628260,4332757,3276452';
imageSets[3] = '4332762,4332757,4332755,4332750,4332738,4332715';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/harrisonwreid/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/harrisonwreid/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));		  $('body').trigger('clikUpdate');		}, 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 = 'Harrison Reid - Photographer: ' + 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));      $('body').trigger('clikUpdate');    }        
    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;
	}
}

			

