window.thumbnails = {};
															thumbnails[8044346] = clik.newPhoto({"id":8044346,"src":"holiday_scotland_june_18th_2011_006_thumb.jpg","galleries_id":418895,"server_id":18,"link":"photo_8044346.html","width":130,"caption":"Lost in Whitby","height":182});
															thumbnails[7746872] = clik.newPhoto({"id":7746872,"src":"new_paintings_193_cropped_thumb.jpg","galleries_id":116589,"server_id":18,"link":"photo_7746872.html","width":130,"caption":"just purr-fect","height":108});
															thumbnails[6224217] = clik.newPhoto({"id":6224217,"src":"The_essence_of_Venice_thumb.jpg","galleries_id":116320,"server_id":18,"link":"photo_6224217.html","width":130,"caption":"Essance of Venice","height":131});
															thumbnails[4987013] = clik.newPhoto({"id":4987013,"src":"pictures_034_thumb.jpg","galleries_id":116320,"server_id":18,"link":"photo_4987013.html","width":130,"caption":"Deathly desire","height":103});
															thumbnails[4160667] = clik.newPhoto({"id":4160667,"src":"paris_and_tyler_thumb.jpg","galleries_id":136214,"server_id":18,"link":"photo_4160667.html","width":130,"caption":"Paris and Tyler","height":131});
															thumbnails[3698910] = clik.newPhoto({"id":3698910,"src":"venican_masks_red_000_thumb.jpg","galleries_id":116320,"server_id":18,"link":"photo_3698910.html","width":130,"caption":"The Red Cloak","height":131});
															thumbnails[3698916] = clik.newPhoto({"id":3698916,"src":"studley_family_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_3698916.html","width":130,"caption":"The family","height":58});
															thumbnails[1734773] = clik.newPhoto({"id":1734773,"src":"3 masked faces_thumb.jpg.jpg","galleries_id":116320,"server_id":18,"link":"photo_1734773.html","width":130,"caption":"Having a good time","height":130});
															thumbnails[1734808] = clik.newPhoto({"id":1734808,"src":"royalty at fountains 024_thumb.jpg","galleries_id":116320,"server_id":18,"link":"photo_1734808.html","width":130,"caption":"The Mask","height":130});
															thumbnails[1734842] = clik.newPhoto({"id":1734842,"src":"july 07  holmfirth 028 cropped_thumb.jpg","galleries_id":116589,"server_id":18,"link":"photo_1734842.html","width":130,"caption":"Bruno","height":129});
															thumbnails[1734850] = clik.newPhoto({"id":1734850,"src":"dog painting _thumb. C . Hutton 006 cropped.jpg","galleries_id":116589,"server_id":18,"link":"photo_1734850.html","width":130,"caption":"Happy","height":135});
															thumbnails[8837951] = clik.newPhoto({"id":8837951,"src":"sheltered_housing_A5E0697C-1EC9-D45B-1C682A25A785AF7A_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_8837951.html","width":130,"caption":"sheltered Housing","height":105});
															thumbnails[7422523] = clik.newPhoto({"id":7422523,"src":"new_paintings_197_thumb.jpg","galleries_id":418895,"server_id":18,"link":"photo_7422523.html","width":130,"caption":"Montpellier Hill ","height":162});
															thumbnails[3121472] = clik.newPhoto({"id":3121472,"src":"new_paintings_136_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_3121472.html","width":130,"caption":"Early learning","height":65});
															thumbnails[3707937] = clik.newPhoto({"id":3707937,"src":"new_paintings_026_thumb.jpg","galleries_id":136213,"server_id":18,"link":"photo_3707937.html","width":130,"caption":"View from Almcliffe Cragg","height":104});
															thumbnails[1735002] = clik.newPhoto({"id":1735002,"src":"sunny sunday 034_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_1735002.html","width":130,"caption":"southern shores","height":122});
															thumbnails[2828422] = clik.newPhoto({"id":2828422,"src":"bathing in magic dark_thumb.jpg","galleries_id":418894,"server_id":18,"link":"photo_2828422.html","width":130,"caption":"Bathing in Magic","height":133});
															thumbnails[8044334] = clik.newPhoto({"id":8044334,"src":"Darley__thursday_2nd_june_009_2_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_8044334.html","width":130,"caption":"The Lady in Red","height":181});
															thumbnails[7747024] = clik.newPhoto({"id":7747024,"src":"new_paintings_217_2_thumb.jpg","galleries_id":418894,"server_id":18,"link":"photo_7747024.html","width":130,"caption":"Planet Harewood","height":182});
															thumbnails[4444947] = clik.newPhoto({"id":4444947,"src":"lost_again_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_4444947.html","width":130,"caption":"Lost again","height":158});
															thumbnails[8408899] = clik.newPhoto({"id":8408899,"src":"thorsby_sept_2011_002_thumb.jpg","galleries_id":418894,"server_id":18,"link":"photo_8408899.html","width":130,"caption":" signs of conflict at Bambrough castle","height":171});
															thumbnails[6291596] = clik.newPhoto({"id":6291596,"src":"Catch_of_the_Day_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_6291596.html","width":130,"caption":"Whitby Harbour","height":169});
															thumbnails[4679640] = clik.newPhoto({"id":4679640,"src":"no_comb_and_no_toothbrush_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_4679640.html","width":130,"caption":"No comb and no toothbrush  ( traverling light)","height":128});
															thumbnails[6936003] = clik.newPhoto({"id":6936003,"src":"the_boat_house_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_6936003.html","width":130,"caption":"The Boathouse (whitby)","height":93});
															thumbnails[2032769] = clik.newPhoto({"id":2032769,"src":"new_pictures_004_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_2032769.html","width":130,"caption":"Tree House","height":129});
															thumbnails[6958603] = clik.newPhoto({"id":6958603,"src":"the_red_boart_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_6958603.html","width":130,"caption":"The Red Boat","height":93});
															thumbnails[5821762] = clik.newPhoto({"id":5821762,"src":"fun_in_the_sun_thumb.jpg","galleries_id":136214,"server_id":18,"link":"photo_5821762.html","width":130,"caption":"Fun in the sun","height":125});
															thumbnails[1734913] = clik.newPhoto({"id":1734913,"src":"piggy painting_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_1734913.html","width":130,"caption":"Prisoner Cell block H","height":130});
															thumbnails[7422524] = clik.newPhoto({"id":7422524,"src":"new_paintings_189_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_7422524.html","width":130,"caption":"whitby harbour \"The other direction\"","height":98});
															thumbnails[1734883] = clik.newPhoto({"id":1734883,"src":"The_Thief_105_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_1734883.html","width":130,"caption":"The Thief","height":129});
															thumbnails[8621282] = clik.newPhoto({"id":8621282,"src":"robin_hoods_bay_2_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_8621282.html","width":130,"caption":"Almost the truth ( Robin Hoods Bay)","height":92});
															thumbnails[2292758] = clik.newPhoto({"id":2292758,"src":"peeping tom 003sq_thumb.jpg","galleries_id":116593,"server_id":18,"link":"photo_2292758.html","width":130,"caption":"Peeping Tom","height":128});
															thumbnails[8044350] = clik.newPhoto({"id":8044350,"src":"holiday_scotland_june_18th_2011_008_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_8044350.html","width":130,"caption":"Idilic little coastal town","height":92});
															thumbnails[8293795] = clik.newPhoto({"id":8293795,"src":"new_paintings_220_crail_thumb.jpg","galleries_id":116599,"server_id":18,"link":"photo_8293795.html","width":130,"caption":"putting out the flags (crail harbour)","height":102});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[116589] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"animal portraits","link":"gallery_116589.html","maxRecords":0.0,"photoIDs":[7746872.0,1734842.0,1734850.0],"skipIndex":0,"section_code":"gallery","featured_images":"7746872,1734850,1734842","id":116589,"singleSection":false});				  						galleries[116593] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Animals","link":"gallery_116593.html","maxRecords":0.0,"photoIDs":[3698916.0,8837951.0,3121472.0,4444947.0,4679640.0,2032769.0,1734913.0,1734883.0,2292758.0],"skipIndex":0,"section_code":"gallery","featured_images":"8837951,4679640,4444947,3698916,3121472,2292758,2032769,1734913,1734883","id":116593,"singleSection":false});				  						galleries[418894] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fantasy","link":"gallery_418894.html","maxRecords":0.0,"photoIDs":[2828422.0,7747024.0,8408899.0],"skipIndex":0,"section_code":"gallery","featured_images":"8408899,7747024,2828422","id":418894,"singleSection":false});				  						galleries[136213] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Landscape","link":"gallery_136213.html","maxRecords":0.0,"photoIDs":[3707937.0],"skipIndex":0,"section_code":"gallery","featured_images":3707937.0,"id":136213,"singleSection":false});				  						galleries[136214] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"People","link":"gallery_136214.html","maxRecords":0.0,"photoIDs":[4160667.0,5821762.0],"skipIndex":0,"section_code":"gallery","featured_images":"5821762,4160667","id":136214,"singleSection":false});				  						galleries[116599] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Seascapes","link":"gallery_116599.html","maxRecords":0.0,"photoIDs":[1735002.0,8044334.0,6291596.0,6936003.0,6958603.0,7422524.0,8621282.0,8044350.0,8293795.0],"skipIndex":0,"section_code":"gallery","featured_images":"8621282,8293795,8044350,8044334,7422524,6958603,6936003,6291596,1735002","id":116599,"singleSection":false});				  						galleries[418895] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"town and city scapes","link":"gallery_418895.html","maxRecords":0.0,"photoIDs":[8044346.0,7422523.0],"skipIndex":0,"section_code":"gallery","featured_images":"8044346,7422523","id":418895,"singleSection":false});				  						galleries[116320] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Venice","link":"gallery_116320.html","maxRecords":0.0,"photoIDs":[6224217.0,4987013.0,3698910.0,1734773.0,1734808.0],"skipIndex":0,"section_code":"gallery","featured_images":"6224217,4987013,3698910,1734808,1734773","id":116320,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '6224217,1734808,1734773,3121472,6291596,2032769,1734913,1734883,2292758';
imageSets[3] = '8837951,8621282,8408899,8293795,8044350,8044346,8044334,7747024,7746872,7422524,7422523,6958603,6936003,6291596,6224217,5821762,4987013,4679640,4444947,4160667,3707937,3698916,3698910,3121472,2828422,2292758,2032769,1735002,1734913,1734883,1734850,1734842,1734808,1734773';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/SheilaVcreatingdreams/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/SheilaVcreatingdreams/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 || photos || {})[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 = ' Sheila V artist: ' + 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.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;
	}
}

			

