window.thumbnails = {};
															thumbnails[6880254] = clik.newPhoto({"id":6880254,"src":"finlandia_2_e2nd_copy_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6880254.html","width":130,"caption":"'Finlandia #2' Acrylic & Pen  on Paper","height":130});
															thumbnails[7323262] = clik.newPhoto({"id":7323262,"src":"fossil_w500_thumb.jpg","galleries_id":415492,"server_id":18,"link":"photo_7323262.html","width":130,"caption":"'Fossil' ","height":84});
															thumbnails[8418136] = clik.newPhoto({"id":8418136,"src":"d_thumb.jpg","galleries_id":415492,"server_id":18,"link":"photo_8418136.html","width":130,"caption":"'D.'","height":173});
															thumbnails[9153825] = clik.newPhoto({"id":9153825,"src":"winterblues_1_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_9153825.html","width":130,"caption":"'Winter Blues'","height":131});
															thumbnails[9153869] = clik.newPhoto({"id":9153869,"src":"redweb_1_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_9153869.html","width":130,"caption":"'Red Winter'","height":130});
															thumbnails[7028828] = clik.newPhoto({"id":7028828,"src":"dream_2_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_7028828.html","width":130,"caption":"'Tallis #2' Acrylic and Pen on Paper 39cm x 39cm","height":145});
															thumbnails[6489648] = clik.newPhoto({"id":6489648,"src":"Untitled_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_6489648.html","width":130,"caption":"'Sultry Nights' Acrylic, Oil and crushed glass on canvas 62cm x 62cm","height":133});
															thumbnails[6381075] = clik.newPhoto({"id":6381075,"src":"sultry_nights_detail_a_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_6381075.html","width":130,"caption":"'Sultry Nights' detail","height":195});
															thumbnails[6381079] = clik.newPhoto({"id":6381079,"src":"sultry_nights_details_b_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_6381079.html","width":130,"caption":"'Sultry Nights' detail","height":195});
															thumbnails[6381080] = clik.newPhoto({"id":6381080,"src":"sultry_nights_edge_detail_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_6381080.html","width":130,"caption":"'Sultry Nights' edge detail","height":142});
															thumbnails[5081203] = clik.newPhoto({"id":5081203,"src":"Haptic__thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5081203.html","width":130,"caption":"'Haptic' ","height":158});
															thumbnails[5081312] = clik.newPhoto({"id":5081312,"src":"hapticdetailthree_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5081312.html","width":130,"caption":"detail 'Haptic'","height":99});
															thumbnails[5081227] = clik.newPhoto({"id":5081227,"src":"hapticdetailone_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5081227.html","width":130,"caption":"detail 'Haptic'","height":87});
															thumbnails[5895516] = clik.newPhoto({"id":5895516,"src":"motherchild_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5895516.html","width":130,"caption":"'Sun and Wine' ","height":230});
															thumbnails[5895528] = clik.newPhoto({"id":5895528,"src":"sun7winedetail2_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5895528.html","width":130,"caption":"detail 'Sun and Wine'","height":195});
															thumbnails[5895531] = clik.newPhoto({"id":5895531,"src":"sun7winedetail3jpg_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5895531.html","width":130,"caption":"detail 'Sun and Wine'","height":195});
															thumbnails[8071112] = clik.newPhoto({"id":8071112,"src":"red_ice_scaled_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_8071112.html","width":130,"caption":"'Red Ice'","height":130});
															thumbnails[8071110] = clik.newPhoto({"id":8071110,"src":"zfirestorm_detail_glass_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_8071110.html","width":130,"caption":"","height":87});
															thumbnails[8071198] = clik.newPhoto({"id":8071198,"src":"t_image_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_8071198.html","width":130,"caption":"'Firestorm'","height":136});
															thumbnails[5408936] = clik.newPhoto({"id":5408936,"src":"firestormdetail_thumb.jpg","galleries_id":411123,"server_id":18,"link":"photo_5408936.html","width":130,"caption":"'Firestorm' detail","height":87});
															thumbnails[9096822] = clik.newPhoto({"id":9096822,"src":"numbers_no_4_w_1_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_9096822.html","width":130,"caption":"'Numbers No.4'","height":126});
															thumbnails[9102252] = clik.newPhoto({"id":9102252,"src":"numbersnoone_1_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_9102252.html","width":130,"caption":"'Numbers No. 1'","height":131});
															thumbnails[9102361] = clik.newPhoto({"id":9102361,"src":"silverbullet_1_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_9102361.html","width":130,"caption":"'Silver Bullet'","height":172});
															thumbnails[8780103] = clik.newPhoto({"id":8780103,"src":"distance_disc_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_8780103.html","width":130,"caption":"'Distance'","height":130});
															thumbnails[8824921] = clik.newPhoto({"id":8824921,"src":"distance_no_1w_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_8824921.html","width":130,"caption":"'Distance No. 1'","height":130});
															thumbnails[8824914] = clik.newPhoto({"id":8824914,"src":"distance_no_3_w_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_8824914.html","width":130,"caption":"'Distance No. 3'","height":130});
															thumbnails[9141134] = clik.newPhoto({"id":9141134,"src":"bluecka_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_9141134.html","width":130,"caption":"'Blue'","height":97});
															thumbnails[9141657] = clik.newPhoto({"id":9141657,"src":"think_againoweb_1_thumb.jpg","galleries_id":459165,"server_id":18,"link":"photo_9141657.html","width":130,"caption":"'Think Again'","height":181});
															thumbnails[6381204] = clik.newPhoto({"id":6381204,"src":"deep_blue_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6381204.html","width":130,"caption":"'Deep Blue'","height":128});
															thumbnails[6917905] = clik.newPhoto({"id":6917905,"src":"ronco_disc_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6917905.html","width":130,"caption":"'Ronco' ","height":126});
															thumbnails[6917915] = clik.newPhoto({"id":6917915,"src":"ronco1_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6917915.html","width":130,"caption":"'Ronco #1' ","height":132});
															thumbnails[6917919] = clik.newPhoto({"id":6917919,"src":"ronco_2_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6917919.html","width":130,"caption":"'Ronco #2' ","height":130});
															thumbnails[6592956] = clik.newPhoto({"id":6592956,"src":"fire_and_rain_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6592956.html","width":130,"caption":"'Fire & Rain'","height":130});
															thumbnails[6955176] = clik.newPhoto({"id":6955176,"src":"fire__rain_4_e_thumb.jpg","galleries_id":371708,"server_id":18,"link":"photo_6955176.html","width":130,"caption":"'Fire & Rain #4'","height":130});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[459165] = clik.newGallery({"parentGallery":"","usePopups":false,"title":" Colour Exploration by Lottery ","link":"gallery_459165.html","maxRecords":0.0,"photoIDs":[9096822.0,9102252.0,9102361.0,8780103.0,8824921.0,8824914.0,9141134.0,9141657.0],"skipIndex":0,"section_code":"gallery","featured_images":"9102252,9096822,8824914,8780103","id":459165,"singleSection":false});				  						galleries[371708] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"'Full Circle'","link":"gallery_371708.html","maxRecords":0.0,"photoIDs":[6880254.0,9153825.0,9153869.0,7028828.0,6381204.0,6917905.0,6917915.0,6917919.0,6592956.0,6955176.0],"skipIndex":0,"section_code":"gallery","featured_images":"9153869,6917919,6592956","id":371708,"singleSection":false});				  						galleries[411123] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Abstract","link":"gallery_411123.html","maxRecords":0.0,"photoIDs":[6489648.0,6381075.0,6381079.0,6381080.0,5081203.0,5081312.0,5081227.0,5895516.0,5895528.0,5895531.0,8071112.0,8071110.0,8071198.0,5408936.0],"skipIndex":0,"section_code":"gallery","featured_images":5081203.0,"id":411123,"singleSection":false});				  						galleries[415492] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Figurative","link":"gallery_415492.html","maxRecords":0.0,"photoIDs":[7323262.0,8418136.0],"skipIndex":0,"section_code":"gallery","featured_images":7323262.0,"id":415492,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9153869,8418136,7323262,6880254,6381079,5081203,5895516,5408936,9096822,9102252,8780103,8824914,6381204,6917905,6917919,6917915,6592956,6955176';
imageSets[2] = '9153869,7323262,5081203,9096822,9102252,8780103,8824914,6917919,6592956';
imageSets[3] = '6381075,6381080,5895516,5895531';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Carolkim/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Carolkim/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 = 'Carol Kim Arbuckle: ' + 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>';
	}
				
	temp += this.fnGetPaymentInfo();
				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>Buy now using PayPal:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> &pound;' + (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 += '<form id="paymentForm" style="margin:0px;border:0px;" name="paymentForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
			temp += '<input type="hidden" name="item_name" value="'+item_name+'">';
			ref = '';
			if(this.photo_ref != ''){
				ref = this.photo_ref+' - '+this.caption;
			}
			else{
				ref = this.id+' - '+this.caption;
			}
			price = amount;								temp += '<input type="hidden" name="cmd" value="_cart">';
					temp += '<input type="hidden" name="business" value="carolkimarbuckle@btinternet.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="carolkimarbuckle@btinternet.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						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;
	}
}

			

