window.thumbnails = {};
															thumbnails[2688834] = clik.newPhoto({"id":2688834,"src":"P8250005_thumb.JPG","galleries_id":"","server_id":2,"link":"#","width":130,"caption":"Small Blue","height":98});
															thumbnails[1300780] = clik.newPhoto({"id":1300780,"src":"Cricket_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Cricket","height":98});
															thumbnails[1300781] = clik.newPhoto({"id":1300781,"src":"Fish_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Hiding","height":98});
															thumbnails[1300782] = clik.newPhoto({"id":1300782,"src":"GalicianCoast_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Silver Sea","height":98});
															thumbnails[1300783] = clik.newPhoto({"id":1300783,"src":"Iggy_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Iggy","height":98});
															thumbnails[1300784] = clik.newPhoto({"id":1300784,"src":"Orchid_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Orchid","height":98});
															thumbnails[1300785] = clik.newPhoto({"id":1300785,"src":"Teixido_thumb.JPG","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Teixido","height":98});
															thumbnails[2298700] = clik.newPhoto({"id":2298700,"src":"Dsc_0081_e_rs_s_thumb.jpg","galleries_id":90488,"server_id":2,"link":"photo_2298700.html","width":130,"caption":"Heart","height":87});
															thumbnails[2298659] = clik.newPhoto({"id":2298659,"src":"DSC_0051_e_c_rs_thumb.jpg","galleries_id":90485,"server_id":2,"link":"photo_2298659.html","width":130,"caption":"Dressing","height":178});
															thumbnails[2298669] = clik.newPhoto({"id":2298669,"src":"DSC_0013_e2_bw_c_rs_thumb.jpg","galleries_id":90488,"server_id":2,"link":"photo_2298669.html","width":130,"caption":"Wishing","height":181});
															thumbnails[2298693] = clik.newPhoto({"id":2298693,"src":"DSC_0051_e2_rs_thumb.jpg","galleries_id":90060,"server_id":2,"link":"photo_2298693.html","width":130,"caption":"Hair Raising","height":102});
															thumbnails[1287502] = clik.newPhoto({"id":1287502,"src":"doorway_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1287502.html","width":130,"caption":"Dan","height":174});
															thumbnails[1292487] = clik.newPhoto({"id":1292487,"src":"AreYouOK_thumb.JPG","galleries_id":90488,"server_id":1,"link":"photo_1292487.html","width":130,"caption":"Dan?...are you OK?","height":87});
															thumbnails[1292492] = clik.newPhoto({"id":1292492,"src":"CarlaandLog_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292492.html","width":130,"caption":"Romantic","height":173});
															thumbnails[1292495] = clik.newPhoto({"id":1292495,"src":"CarlaDress_thumb.JPG","galleries_id":90488,"server_id":1,"link":"photo_1292495.html","width":130,"caption":"Carla in that Dress","height":173});
															thumbnails[1292497] = clik.newPhoto({"id":1292497,"src":"CityLife_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292497.html","width":130,"caption":"City Life","height":94});
															thumbnails[1292499] = clik.newPhoto({"id":1292499,"src":"HannahandFang_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292499.html","width":130,"caption":"Walking the Dog","height":173});
															thumbnails[1292500] = clik.newPhoto({"id":1292500,"src":"HannahBack_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292500.html","width":130,"caption":"Tattoo","height":173});
															thumbnails[1292502] = clik.newPhoto({"id":1292502,"src":"HannahMask_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292502.html","width":130,"caption":"The Mask","height":173});
															thumbnails[1292503] = clik.newPhoto({"id":1292503,"src":"HannahStars_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292503.html","width":130,"caption":"Stars","height":173});
															thumbnails[1292504] = clik.newPhoto({"id":1292504,"src":"MarvinMask_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292504.html","width":130,"caption":"Gladiator","height":173});
															thumbnails[1292506] = clik.newPhoto({"id":1292506,"src":"Shoe0fDeath_thumb.jpg","galleries_id":90488,"server_id":1,"link":"photo_1292506.html","width":130,"caption":"Dressed to Kill","height":87});
															thumbnails[1298185] = clik.newPhoto({"id":1298185,"src":"BacktoBack_thumb.JPG","galleries_id":91633,"server_id":1,"link":"photo_1298185.html","width":130,"caption":"Back to Back","height":98});
															thumbnails[1298186] = clik.newPhoto({"id":1298186,"src":"Enola_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298186.html","width":130,"caption":"Bubbles","height":173});
															thumbnails[1298187] = clik.newPhoto({"id":1298187,"src":"Latessa_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298187.html","width":130,"caption":"Seated","height":173});
															thumbnails[1298190] = clik.newPhoto({"id":1298190,"src":"LeanneDress_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298190.html","width":130,"caption":"Little Silk Dress","height":173});
															thumbnails[1298191] = clik.newPhoto({"id":1298191,"src":"Marvin_thumb.JPG","galleries_id":91633,"server_id":1,"link":"photo_1298191.html","width":130,"caption":"Relaxed","height":98});
															thumbnails[1298192] = clik.newPhoto({"id":1298192,"src":"MarvinLeap_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298192.html","width":130,"caption":"Jump for Joy","height":193});
															thumbnails[1298193] = clik.newPhoto({"id":1298193,"src":"NatashaChampers_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298193.html","width":130,"caption":"Champagne","height":173});
															thumbnails[1298194] = clik.newPhoto({"id":1298194,"src":"NatashaPose_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298194.html","width":130,"caption":"Pose and Poise","height":173});
															thumbnails[1298195] = clik.newPhoto({"id":1298195,"src":"YoucefandNat_thumb.jpg","galleries_id":91633,"server_id":1,"link":"photo_1298195.html","width":130,"caption":"Monochrome","height":173});
															thumbnails[1298197] = clik.newPhoto({"id":1298197,"src":"DanSpecs_thumb.JPG","galleries_id":90060,"server_id":1,"link":"photo_1298197.html","width":130,"caption":"Specs","height":173});
															thumbnails[1298198] = clik.newPhoto({"id":1298198,"src":"Hannah_thumb.JPG","galleries_id":90060,"server_id":1,"link":"photo_1298198.html","width":130,"caption":"Hannah","height":98});
															thumbnails[1298199] = clik.newPhoto({"id":1298199,"src":"LeannePortrait_thumb.jpg","galleries_id":90060,"server_id":1,"link":"photo_1298199.html","width":130,"caption":"Leanne","height":173});
															thumbnails[1298200] = clik.newPhoto({"id":1298200,"src":"Lucy_thumb.jpg","galleries_id":90060,"server_id":1,"link":"photo_1298200.html","width":130,"caption":"Lucy","height":164});
															thumbnails[1298201] = clik.newPhoto({"id":1298201,"src":"SophieLeigh_thumb.jpg","galleries_id":90060,"server_id":1,"link":"photo_1298201.html","width":130,"caption":"Sophie-Leigh","height":173});
															thumbnails[1300776] = clik.newPhoto({"id":1300776,"src":"KatyGold_thumb.jpg","galleries_id":90485,"server_id":1,"link":"photo_1300776.html","width":130,"caption":"Liquid Gold","height":173});
															thumbnails[1300777] = clik.newPhoto({"id":1300777,"src":"KatyManequin_thumb.JPG","galleries_id":90485,"server_id":1,"link":"photo_1300777.html","width":130,"caption":"Mother and Daughter","height":173});
															thumbnails[1300778] = clik.newPhoto({"id":1300778,"src":"KatyStars_thumb.jpg","galleries_id":90485,"server_id":1,"link":"photo_1300778.html","width":130,"caption":"Celestial","height":173});
															thumbnails[1300779] = clik.newPhoto({"id":1300779,"src":"YoucefMirror_thumb.jpg","galleries_id":90060,"server_id":1,"link":"photo_1300779.html","width":130,"caption":"Mirror Image","height":98});
															thumbnails[1292510] = clik.newPhoto({"id":1292510,"src":"MoreTrouble_thumb.jpg","galleries_id":90485,"server_id":1,"link":"photo_1292510.html","width":130,"caption":"Double Trouble","height":173});
															thumbnails[1292508] = clik.newPhoto({"id":1292508,"src":"DoubleTrouble_thumb.jpg","galleries_id":90485,"server_id":1,"link":"photo_1292508.html","width":130,"caption":"More Trouble","height":173});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[90060] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portraits","link":"gallery_90060.html","maxRecords":0.0,"photoIDs":[2298693.0,1298197.0,1298198.0,1298199.0,1298200.0,1298201.0,1300779.0],"skipIndex":0,"section_code":"gallery","featured_images":"2298693,1300779,1298201,1298200,1298199,1298198,1298197","id":90060,"singleSection":false});				  						galleries[90488] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Creative","link":"gallery_90488.html","maxRecords":0.0,"photoIDs":[2298700.0,2298669.0,1287502.0,1292487.0,1292492.0,1292495.0,1292497.0,1292499.0,1292500.0,1292502.0,1292503.0,1292504.0,1292506.0],"skipIndex":0,"section_code":"gallery","featured_images":"2298700,2298669","id":90488,"singleSection":false});				  						galleries[91633] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Fashion","link":"gallery_91633.html","maxRecords":0.0,"photoIDs":[1298185.0,1298186.0,1298187.0,1298190.0,1298191.0,1298192.0,1298193.0,1298194.0,1298195.0],"skipIndex":0,"section_code":"gallery","featured_images":"1298195,1298194,1298193,1298192,1298191,1298190,1298187,1298186,1298185","id":91633,"singleSection":false});				  						galleries[90485] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Portfolios","link":"gallery_90485.html","maxRecords":0.0,"photoIDs":[2298659.0,1300776.0,1300777.0,1300778.0,1292510.0,1292508.0],"skipIndex":0,"section_code":"gallery","featured_images":2298659.0,"id":90485,"singleSection":false});				  						galleries[455430] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Product","link":"gallery_455430.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"gallery","featured_images":"","id":455430,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '2298669,2298659';
imageSets[2] = '2298700,2298669,2298659';
imageSets[3] = '2688834,2298700,2298693,2298669,2298659,1300785,1300784,1300783,1300782,1300781,1300780,1300779,1300778,1300777,1300776,1298201,1298200,1298199,1298198,1298197,1298195,1298194,1298193,1298192,1298191,1298190,1298187,1298186,1298185,1292510,1292508,1292506,1292504,1292503,1292502,1292500,1292499,1292497,1292495,1292492,1292487,1287502';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/zapphoto/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/zapphoto/images';
		break;
	}
		return val;
}

/***************************************************************************
* img = reference to image object in which to show image                   *
***************************************************************************/
function showHomeImage(img) {
	imageID = randomListVal('');
	if (!basic) {
		img.src = photos[imageID].src;
		img.width = photos[imageID].width;
		img.height = photos[imageID].height;
		img.parentNode.title = img.alt = photos[imageID].caption;
	} else {
		newImage = new Image(photos[imageID].width,photos[imageID].height);
		newImage.src = photos[imageID].src;
		document.images[img.name] = newImage;
		
	}
}

function getHomeImageLink(imageID) {
  	var href='', photo = backgrounds && backgrounds[imageID];
	if(photo){
		if (photo && photo.galleries_id != '') {
  			href = photo.fnGalleryLink();
  		}
  		  		else {
  				href += 'gallery.html';
  	  		}
	}
    return href;
}

/***************************************************************************
* Show a random image on home page from featured images                    *
***************************************************************************/
function showHomeImageInline(el, image_sets_id, href) {
	
	var css = {}, imageID,
	    imageSetsId = 1;
	if(image_sets_id){
		imageSetsId = image_sets_id;
	}
	imageID = randomListVal(imageSets[imageSetsId]);
	if (href == null && 'gallery' != '') {
					href = getHomeImageLink(imageID);
	}
	
	updateImage({nextPhoto: backgrounds[imageID], img:el.find('img')[0],
                $photo:el, $title:$('#homeimageTitleContainer'), $detail:$('#homeimageDetailsContainer'),                speed:0, href:href, css:css, onAfter: function(){                  this.closest('.contentsection').doManualAlign({				    inner: 'img',				    crop: 'a'				  });                }              });
}

/***************************************************************************
* Set 'img' to be a new image given its photo() object                     *
***************************************************************************/
function updateImage (options) {
	var defaults = {nextPhoto:'',field:'',img:'',$photo:'',$title:'',$detail:'',$detailContainer:'',
                    updateDocumentTitle:false,speed:0,href:false,css:false,updateHash:false,onAfter:null,onBefore:null},
		op = $.extend({},defaults,options),
		html = '', temp = '',
		photoId = op.nextPhoto.id,
		photoCaption = ''+op.nextPhoto.caption,
		photoSrc = op.nextPhoto.src;
	
	if (op.updateHash && clik.getIDInUrl(location.href,'photo') != op.nextPhoto.id) {
		clik.changeHash('photos_id=' + op.nextPhoto.id, true);
	}
		
	    if (op.$title.length > 0) {
  		op.$title.fadeGalleryDetails(photoCaption, op.speed);
    }
        if (op.updateDocumentTitle) {
						  document.title = 'Zap Photography: ' + photoCaption;
			    }
        if (op.$detail.length > 0) {
      	temp = op.nextPhoto.fnGetImageDetails();
	    op.$detail.fadeGalleryDetails(temp, op.speed, function(){
			if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
				toggleAddToCartConfirm(backgrounds, op.$detail);
			} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
				toggleAddToCartConfirm(photos, op.$detail);
			}
			$('body').trigger('clikUpdate.popup');
	    });
    }
        $(op.$detailContainer).find('.replaceable[class*=replaceable_photo-]').each(function(){
    	var field = clik.getPrefixedClass(this.className, 'replaceable_photo-');
    	if (field in op.nextPhoto) {
    		$(this).fadeGalleryDetails(op.nextPhoto[field], op.speed);
    	}
    }).end().find('.replaceable.photoPayment').fadeGalleryDetails(op.nextPhoto.fnGetPaymentInfo(), op.speed, function(){
		if (typeof(backgrounds) != 'undefined' && op.nextPhoto == backgrounds[op.nextPhoto.id]) {
			toggleAddToCartConfirm(backgrounds, op.$detailContainer);
		} else if (typeof(photos) != 'undefined' && op.nextPhoto == photos[op.nextPhoto.id]) {
			toggleAddToCartConfirm(photos, op.$detailContainer);
		}
		$('body').trigger('clikUpdate.popup');
	});
		if (op.$photo.length > 0) {
		html = $('<img/>',{
			'class': 'mainphoto photo',
			src: photoSrc,
			id: 'mainPic',
			name: 'mainPic',
			width: op.nextPhoto.width,
			height: op.nextPhoto.height,
			alt: photoCaption,
			css: op.css || {}
		});
		if (op.href) {
			if (op.href.match(/<a/)) {
				html = $(op.href).append(html);
			} else {
				html = $('<a/>', {
					href: op.href,
					title: photoCaption
				}).append(html);
			}
		} else {
			html = $('<a/>', {
				title: photoCaption
			}).append(html);
		}
		if (op.speed == 0) {			op.$photo.html(html);			if (op.onBefore) {			  	op.onBefore.apply(op.$photo);			}			if (op.onAfter) {			  	op.onAfter.apply(op.$photo);			}		} else {			op.$photo.stop(true,true).fadeReplaceWith(html,op.speed,'',function(){  				if (op.onAfter) {				  	op.onAfter.apply(this);				}				clik.doColumnResize(false, $(this).add(op.$detail).add(op.$title));			}, op.onBefore);
		}	}
    if (op.field) {
		op.field.value = photoId;
	} else {
		op.$photo.data('image_id', photoId);
    }
        if (!op.speed) {
      	clik.doColumnResize(false, op.$photo.add(op.$detail).add(op.$title));
    }
        
    return html;
	}

/***************************************************************************
* Toggle add to cart confirmation element and set up the click event for   *
* the 'Add to cart' button.                                                *
***************************************************************************/
function toggleAddToCartConfirm(array, root){
	if (typeof(array) !== 'object' || array === null) {
	  	array = photos;
	}
	if (!$(root).length) {		root = $('body');	}	if($('#paymentConfirm', root).length > 0){
		$('#paymentConfirm', root).hide();
		$('#paymentAddButton', root)
		.unbind()
		.click(function(){
						form = $('#paymentForm', root)[0];
			option_id = 0;
			if(form.item_option.value){
				option_id = form.item_option.value;
			}
			if(addItemToBasket(form.item_number.value,array,form.site.value,parseInt(form.quantity.value, 10),option_id)){
				if($.browser.msie){$('#paymentConfirm', root).text('Item added to cart').show();}
				else{
					$('#paymentConfirm', root).text('Item added to cart').fadeIn();
					dspOrderDetails(form.site.value);
				}
			}
			else{
				$('#paymentConfirm', root).text('Item not added - check cookies are enabled in your browser.').fadeIn();
			}
		});
	}
}

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetImageDetails = function(){
	var temp = '';
	if (this.description != '') {
		temp +=  '<div id="imageDescription">' + this.description + '</div>';
	}
		if (this.photo_ref != '') {
		temp += '<div class="imageinfo" id="imageRef"><strong>Ref: </strong>' + this.photo_ref + '</div>';
	}
		if (this.takendate != '') {
		
		temp += '<div class="imageinfo" id="imageDate"><strong>Date: </strong>' + this.takendate + '</div>';
	}
	
	if (this.location != '') {
		
		temp += '<div class="imageinfo" id="imageLocation"><strong>Location: </strong>' +  this.location + '</div>';
	}
	
	if (this.photographer != '') {
		
		temp += '<div class="imageinfo" id="imagePhotographer"><strong>Photographer: </strong>' + this.photographer + '</div>';
	}
				
				if (temp != '') {
		temp += '<div class="spacer"></div>';
	}
	return temp;
};

/***************************************************************************
* Get payment info for image - add as 'method' to photo object             *
***************************************************************************/
clik.photo.fnGetPaymentInfo = function(){
	var temp = '';
	if (this.item_price !== '') {
				temp += '<p>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					title: galleries[gallery_id].title				}).filter(function(){return this.href;}).attr({					href: thumbnails[imageID].fnGalleryLink(gallery_id)				});
			}
		}
	}
}

/***************************************************************************
* If we have dynamic HTML, replace the galleries link with a list that     *
* doesn't include thecurrent gallery                                       *
***************************************************************************/
function showGalleries(gallery_id) {
		
	
	if (!basic) {
		temp = '';
		for (i = 0; i < galleries.length; i++) {
						
			
			if (galleries[i].id != gallery_id) {
								
				if (temp != '') {
					temp += ' | ';
				}
								temp += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

