window.thumbnails = new Object();
												thumbnails[1991091] = new thumbnail(1991091,'','Square Dance Rug','SquareDance_thumb.jpg',130, 166,32,'#');
												thumbnails[1991103] = new thumbnail(1991103,'','Let\'s Dance Screen','Let\'s Dance screen_thumb.jpg',130, 166,32,'#');
												thumbnails[1991104] = new thumbnail(1991104,'','Mosaic Arch','mosaic arch_thumb.jpg',130, 162,32,'#');
												thumbnails[1991110] = new thumbnail(1991110,'','Dance With Me ','Dance With Me mosaic vase_thumb.jpg',130, 166,32,'#');
												thumbnails[1991111] = new thumbnail(1991111,'','Shore Cabinet','Shore Cabinet_thumb.jpg',130, 241,32,'#');
												thumbnails[1991113] = new thumbnail(1991113,'','Star Table','Star Table_thumb.jpg',130, 106,32,'#');
												thumbnails[1991114] = new thumbnail(1991114,'','That Lucky Old Moon','That Lucky Old Moon_thumb.jpg',130, 98,32,'#');
												thumbnails[1991115] = new thumbnail(1991115,'','The Optimist\'s Chair','The Optimist\'s Chair_thumb.jpg',130, 253,32,'#');
												thumbnails[1991116] = new thumbnail(1991116,'','Well Red','Well Red_thumb.jpg',130, 166,32,'#');
												thumbnails[1991149] = new thumbnail(1991149,'','Stained Glass','stained glass_thumb.jpg',130, 195,32,'#');
												thumbnails[1991150] = new thumbnail(1991150,'','Stained Glass Detail','stained glass detail1_thumb.jpg',130, 98,32,'#');
												thumbnails[1991152] = new thumbnail(1991152,'','White Rug','white rug_thumb.jpg',130, 166,32,'#');
												thumbnails[5754311] = new thumbnail(5754311,'133362','River Moon sculpture','River_Moon_thumb.jpg',130, 173,32,'photo_5754311.html');
												thumbnails[5754332] = new thumbnail(5754332,'133362','River Moon detail','River_Moon_Detail1_thumb.jpg',130, 173,32,'photo_5754332.html');
												thumbnails[5754458] = new thumbnail(5754458,'163856','Client\'s roof garden','web_thumb.jpg',130, 98,32,'photo_5754458.html');
												thumbnails[3148676] = new thumbnail(3148676,'133362','Sculpture Cluster - these are my latest sculptures','Sculpture Cluster_thumb.jpg',130, 173,32,'photo_3148676.html');
												thumbnails[3148651] = new thumbnail(3148651,'133362','Sculpture Cluster - bases','Cluster bases_thumb.jpg',130, 98,32,'photo_3148651.html');
												thumbnails[3148653] = new thumbnail(3148653,'133362','Sculpture Cluster - close-up','Cluster close-up_thumb.jpg',130, 98,32,'photo_3148653.html');
												thumbnails[3148654] = new thumbnail(3148654,'133362','Detail of Sculpture Cluster','Detail of Cluster_thumb.jpg',130, 173,32,'photo_3148654.html');
												thumbnails[3148677] = new thumbnail(3148677,'133362','Sculpture - Green','Sculpture Green_thumb.jpg',130, 173,32,'photo_3148677.html');
												thumbnails[2705668] = new thumbnail(2705668,'133362','Standing Wave - full view','Standing Wave 2_thumb.jpg',130, 195,32,'photo_2705668.html');
												thumbnails[2705672] = new thumbnail(2705672,'133362','Standing Wave - detail','Standing Wave 8_thumb.jpg',130, 195,32,'photo_2705672.html');
												thumbnails[2705677] = new thumbnail(2705677,'133362','Standing Wave - full view','Standing Wave 9_thumb.jpg',130, 195,32,'photo_2705677.html');
												thumbnails[2705684] = new thumbnail(2705684,'133362','Standing Wave - detail','Standing Wave 10_thumb.jpg',130, 195,32,'photo_2705684.html');
												thumbnails[1991130] = new thumbnail(1991130,'133362','Horizon Disc','horizon disc_thumb.jpg',130, 87,32,'photo_1991130.html');
												thumbnails[1991131] = new thumbnail(1991131,'133362','Colour Flash','horizontal colour_thumb.jpg',130, 98,32,'photo_1991131.html');
												thumbnails[1991132] = new thumbnail(1991132,'133362','Colour Flash Detail','horizontal detail_thumb.jpg',130, 173,32,'photo_1991132.html');
												thumbnails[1991133] = new thumbnail(1991133,'133362','Vitrine','vitrine_thumb.jpg',130, 87,32,'photo_1991133.html');
												thumbnails[1991136] = new thumbnail(1991136,'133362','Vitrine Detail','vitrine detail_thumb.jpg',130, 195,32,'photo_1991136.html');
												thumbnails[1991137] = new thumbnail(1991137,'133362','Nail Painting','8 - Nail Painting - 2007_thumb.jpg',130, 87,32,'photo_1991137.html');
												thumbnails[1991142] = new thumbnail(1991142,'133362','Sea Loop','14 - Sea Loop - 2003_thumb.jpg',130, 87,32,'photo_1991142.html');
												thumbnails[1991146] = new thumbnail(1991146,'133362','What R Knew Best','curly and blobs_thumb.jpg',130, 195,32,'photo_1991146.html');
												thumbnails[1991148] = new thumbnail(1991148,'133362','Pink Neon Cloud','pink neon cloud_thumb.jpg',130, 98,32,'photo_1991148.html');
												thumbnails[2566740] = new thumbnail(2566740,'163856','Aerial view of Garden','Aerial view_thumb.jpg',130, 195,32,'photo_2566740.html');
												thumbnails[2566743] = new thumbnail(2566743,'163856','Garden View','Garden1_thumb.jpg',130, 87,32,'photo_2566743.html');
												thumbnails[2566746] = new thumbnail(2566746,'163856','Garden View','Garden 2_thumb.jpg',130, 87,32,'photo_2566746.html');
												thumbnails[2566748] = new thumbnail(2566748,'163856','Garden View','Garden 3_thumb.jpg',130, 195,32,'photo_2566748.html');
												thumbnails[2566749] = new thumbnail(2566749,'163856','Garden Border','Garden Border_thumb.jpg',130, 195,32,'photo_2566749.html');
												thumbnails[2566750] = new thumbnail(2566750,'163856','Gazebo designed and built by Malcolm Temple','Gazebo_thumb.jpg',130, 87,32,'photo_2566750.html');
												thumbnails[2566751] = new thumbnail(2566751,'163856','Mosaic Table','Mosaic Table_thumb.jpg',130, 87,32,'photo_2566751.html');
												thumbnails[2566753] = new thumbnail(2566753,'163856','Summer House','Summer House_thumb.jpg',130, 87,32,'photo_2566753.html');
												thumbnails[2566754] = new thumbnail(2566754,'163856','Summer House closer','Summer House closer_thumb.jpg',130, 87,32,'photo_2566754.html');
												thumbnails[2566755] = new thumbnail(2566755,'163856','Detail of roof of Summer House','Summer House detail_thumb.jpg',130, 195,32,'photo_2566755.html');
												thumbnails[2566759] = new thumbnail(2566759,'163856','Summer House interior','Summer House Interior_thumb.jpg',130, 87,32,'photo_2566759.html');
												thumbnails[2566769] = new thumbnail(2566769,'163856','Summer House Interior Back View','Summer House Interior Back_thumb.jpg',130, 87,32,'photo_2566769.html');
												thumbnails[2567156] = new thumbnail(2567156,'163856','Gazebo close-up','gazebo close up_thumb.jpg',130, 195,32,'photo_2567156.html');
												thumbnails[2567157] = new thumbnail(2567157,'163856','Gazebo close-up','gazebo close up1_thumb.jpg',130, 195,32,'photo_2567157.html');
												thumbnails[7957888] = new thumbnail(7957888,'133362','Detail, gouache on paper','DSC_0011_thumb.jpg',130, 87,32,'photo_7957888.html');
												thumbnails[8072159] = new thumbnail(8072159,'432558','Gouache on paper','DSC_0003_thumb.jpg',130, 87,32,'photo_8072159.html');
												thumbnails[8072163] = new thumbnail(8072163,'432558','Gouache on paper','DSC_0005_thumb.jpg',130, 87,32,'photo_8072163.html');
												thumbnails[8072234] = new thumbnail(8072234,'432558','Gouache on paper','DSC_0007_thumb.jpg',130, 87,32,'photo_8072234.html');
												thumbnails[8072238] = new thumbnail(8072238,'432558','Gouache on paper, detail','DSC_0009_thumb.jpg',130, 87,32,'photo_8072238.html');
												thumbnails[8072242] = new thumbnail(8072242,'432558','Gouache on paper, detail','DSC_0012_thumb.jpg',130, 87,32,'photo_8072242.html');
												thumbnails[8072246] = new thumbnail(8072246,'432558','Gouache on paper, detail','DSC_0011_F0966EB9-1EC9-D45B-1C7C0596FF5067EE_thumb.jpg',130, 87,32,'photo_8072246.html');
												thumbnails[8072249] = new thumbnail(8072249,'432558','Painting.  Gouache on paper.','DSC_0016_thumb.jpg',130, 87,32,'photo_8072249.html');
												thumbnails[8072255] = new thumbnail(8072255,'432558','Painting.  Gouache on paper, detail.','DSC_0015_thumb.jpg',130, 87,32,'photo_8072255.html');
												thumbnails[8072273] = new thumbnail(8072273,'432558','Painting.  Gouache on paper.','DSC_0018_thumb.jpg',130, 87,32,'photo_8072273.html');
												thumbnails[8072279] = new thumbnail(8072279,'432558','Painting.  Gouache on paper, detail.','DSC_0019_thumb.jpg',130, 87,32,'photo_8072279.html');
												thumbnails[8072293] = new thumbnail(8072293,'432558','Painting.  Gouache on paper.','DSC_0047_thumb.jpg',130, 87,32,'photo_8072293.html');
												thumbnails[8072298] = new thumbnail(8072298,'432558','Painting.  Gouache on paper, detail.','DSC_0050_thumb.jpg',130, 87,32,'photo_8072298.html');
												thumbnails[8072304] = new thumbnail(8072304,'432558','Painting.  Gouache on paper.','DSC_0051_thumb.jpg',130, 87,32,'photo_8072304.html');
												thumbnails[8072310] = new thumbnail(8072310,'432558','Painting.  Gouache on paper, detail.','DSC_0054_thumb.jpg',130, 87,32,'photo_8072310.html');
												thumbnails[8072312] = new thumbnail(8072312,'432558','Painting.  Gouache on paper.','DSC_0056_thumb.jpg',130, 87,32,'photo_8072312.html');
												thumbnails[8072313] = new thumbnail(8072313,'432558','Painting.  Gouache on paper, detail.','DSC_0059_thumb.jpg',130, 87,32,'photo_8072313.html');
												thumbnails[8072325] = new thumbnail(8072325,'432558','Painting.  Gouache on paper.','DSC_0060_thumb.jpg',130, 87,32,'photo_8072325.html');
												thumbnails[8072329] = new thumbnail(8072329,'432558','Gouache on paper, detail','DSC_0063_thumb.jpg',130, 87,32,'photo_8072329.html');

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  					galleries[432558] = new gallery(432558,'8072329,8072325,8072313,8072312,8072310,8072304,8072298,8072293,8072279,8072273','Exhibition June 2011','gallery',[8072159,8072163,8072234,8072238,8072242,8072246,8072249,8072255,8072273,8072279,8072293,8072298,8072304,8072310,8072312,8072313,8072325,8072329],0, 0, '', 'gallery_432558.html',0,0);
				  					galleries[133362] = new gallery(133362,'3148676','Gallery 2 - Current Art (1990s to present)','gallery',[5754311,5754332,3148676,3148651,3148653,3148654,3148677,2705668,2705672,2705677,2705684,1991130,1991131,1991132,1991133,1991136,1991137,1991142,1991146,1991148,7957888],0, 0, '', 'gallery_133362.html',0,0);
				  					galleries[163856] = new gallery(163856,'2566753,2566751,2566750,2566749,2566748,2566743','Gallery 3 - Garden Design / Garden Architecture','gallery',[5754458,2566740,2566743,2566746,2566748,2566749,2566750,2566751,2566753,2566754,2566755,2566759,2566769,2567156,2567157],0, 0, '', 'gallery_163856.html',0,0);
/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = new Object();
imageSets[1] = '3148676';
imageSets[2] = '3148676,2566753,2566751,2566750,2566749,2566748,2566743,1991149,1991110,1991103';
imageSets[3] = '8072329,8072325,8072313,8072312,8072310,8072304,8072298,8072293,8072279,8072273,8072255,8072249,8072246,8072242,8072238,8072234,8072163,8072159,7957888,5754458,5754332,5754311,3148677,3148676,3148654,3148653,3148651,2705684,2705677,2705672,2705668,2567157,2567156,2566769,2566759,2566755,2566754,2566753,2566751,2566750,2566749,2566748,2566746,2566743,2566740,1991152,1991150,1991149,1991148,1991146';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/malcolmt/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/malcolmt/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 = 'Malcolm Temple Art: ' + 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 == undefined) {
    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;
	}
}

			

