window.thumbnails = {};
															thumbnails[387991] = clik.newPhoto({"id":387991,"src":"Your name2_thumb.jpg","galleries_id":"","server_id":15,"link":"#","width":130,"caption":"","height":92});
															thumbnails[406456] = clik.newPhoto({"id":406456,"src":"sophieframeweb2_thumb.jpg","galleries_id":31424,"server_id":15,"link":"photo_406456.html","width":130,"caption":"","height":98});
															thumbnails[406461] = clik.newPhoto({"id":406461,"src":"rowanframeweb_thumb.jpg","galleries_id":31376,"server_id":15,"link":"photo_406461.html","width":130,"caption":"","height":98});
															thumbnails[406462] = clik.newPhoto({"id":406462,"src":"millyframeweb_thumb.jpg","galleries_id":31424,"server_id":15,"link":"photo_406462.html","width":130,"caption":"","height":98});
															thumbnails[406464] = clik.newPhoto({"id":406464,"src":"frame_thumb.jpg","galleries_id":31376,"server_id":15,"link":"photo_406464.html","width":130,"caption":"","height":98});
															thumbnails[406465] = clik.newPhoto({"id":406465,"src":"imogenframeweb_thumb.jpg","galleries_id":31424,"server_id":15,"link":"photo_406465.html","width":130,"caption":"","height":98});
															thumbnails[406466] = clik.newPhoto({"id":406466,"src":"harryframeweb_thumb.jpg","galleries_id":31376,"server_id":15,"link":"photo_406466.html","width":130,"caption":"","height":98});
															thumbnails[406467] = clik.newPhoto({"id":406467,"src":"billyframeweb_thumb.jpg","galleries_id":31376,"server_id":15,"link":"photo_406467.html","width":130,"caption":"","height":98});
															thumbnails[406468] = clik.newPhoto({"id":406468,"src":"chloeframeweb_thumb.jpg","galleries_id":31424,"server_id":15,"link":"photo_406468.html","width":130,"caption":"","height":98});
															thumbnails[408089] = clik.newPhoto({"id":408089,"src":"butterfly_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_408089.html","width":130,"caption":"Butterfly","height":140});
															thumbnails[409521] = clik.newPhoto({"id":409521,"src":"bear_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409521.html","width":130,"caption":"Teddy Bear","height":159});
															thumbnails[409523] = clik.newPhoto({"id":409523,"src":"cat_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409523.html","width":130,"caption":"Kitten","height":115});
															thumbnails[409526] = clik.newPhoto({"id":409526,"src":"spaceship=stars_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409526.html","width":130,"caption":"Spaceship","height":103});
															thumbnails[409539] = clik.newPhoto({"id":409539,"src":"girl_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409539.html","width":130,"caption":"Little girl sitting","height":137});
															thumbnails[409542] = clik.newPhoto({"id":409542,"src":"mermaid_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409542.html","width":130,"caption":"Mermaid","height":142});
															thumbnails[409544] = clik.newPhoto({"id":409544,"src":"alien_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409544.html","width":130,"caption":"Alien","height":93});
															thumbnails[409546] = clik.newPhoto({"id":409546,"src":"bats_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409546.html","width":130,"caption":"Bats","height":102});
															thumbnails[409547] = clik.newPhoto({"id":409547,"src":"girly_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409547.html","width":130,"caption":"Little girl","height":154});
															thumbnails[409548] = clik.newPhoto({"id":409548,"src":"pirate1_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409548.html","width":130,"caption":"Pirate","height":169});
															thumbnails[409549] = clik.newPhoto({"id":409549,"src":"butterfly2_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409549.html","width":130,"caption":"Blue butterfly","height":114});
															thumbnails[409552] = clik.newPhoto({"id":409552,"src":"ladybird_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_409552.html","width":130,"caption":"Ladybird","height":104});
															thumbnails[421671] = clik.newPhoto({"id":421671,"src":"Dinosaur_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_421671.html","width":130,"caption":"Dinosaur","height":94});
															thumbnails[421672] = clik.newPhoto({"id":421672,"src":"Footy_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_421672.html","width":130,"caption":"Footy","height":234});
															thumbnails[421674] = clik.newPhoto({"id":421674,"src":"puppy cuddle_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_421674.html","width":130,"caption":"Cuddle","height":137});
															thumbnails[422835] = clik.newPhoto({"id":422835,"src":"words_thumb.jpg","galleries_id":33790,"server_id":15,"link":"photo_422835.html","width":130,"caption":"","height":143});
															thumbnails[422846] = clik.newPhoto({"id":422846,"src":"k boydetail_thumb.jpg","galleries_id":33790,"server_id":15,"link":"photo_422846.html","width":130,"caption":"","height":215});
															thumbnails[422858] = clik.newPhoto({"id":422858,"src":"g girl_thumb.jpg","galleries_id":33790,"server_id":15,"link":"photo_422858.html","width":130,"caption":"","height":230});
															thumbnails[422863] = clik.newPhoto({"id":422863,"src":"done_thumb.jpg","galleries_id":33790,"server_id":15,"link":"photo_422863.html","width":130,"caption":"","height":161});
															thumbnails[422927] = clik.newPhoto({"id":422927,"src":"yournameweb_thumb.jpg","galleries_id":31376,"server_id":15,"link":"photo_422927.html","width":130,"caption":"","height":98});
															thumbnails[422931] = clik.newPhoto({"id":422931,"src":"yournameweb2_thumb.jpg","galleries_id":31424,"server_id":15,"link":"photo_422931.html","width":130,"caption":"","height":98});
															thumbnails[488392] = clik.newPhoto({"id":488392,"src":"girl & Teddy_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_488392.html","width":130,"caption":"Girl & Teddy","height":217});
															thumbnails[2716455] = clik.newPhoto({"id":2716455,"src":"green fairy_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_2716455.html","width":130,"caption":"Green Fairy","height":196});
															thumbnails[2716457] = clik.newPhoto({"id":2716457,"src":"pink fairy4_thumb.jpg","galleries_id":32778,"server_id":15,"link":"photo_2716457.html","width":130,"caption":"Pink Fairy","height":111});
															thumbnails[439428] = clik.newPhoto({"id":439428,"src":"garden_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_439428.html","width":130,"caption":"","height":86});
															thumbnails[439443] = clik.newPhoto({"id":439443,"src":"snowman2_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_439443.html","width":130,"caption":"","height":127});
															thumbnails[439445] = clik.newPhoto({"id":439445,"src":"toadstool2_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_439445.html","width":130,"caption":"","height":147});
															thumbnails[439447] = clik.newPhoto({"id":439447,"src":"book3b_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_439447.html","width":130,"caption":"","height":49});
															thumbnails[829128] = clik.newPhoto({"id":829128,"src":"humpty-wall_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_829128.html","width":130,"caption":"","height":192});
															thumbnails[829135] = clik.newPhoto({"id":829135,"src":"border copy2_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_829135.html","width":130,"caption":"","height":59});
															thumbnails[829240] = clik.newPhoto({"id":829240,"src":"book5a_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_829240.html","width":130,"caption":"","height":50});
															thumbnails[439446] = clik.newPhoto({"id":439446,"src":"post2_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_439446.html","width":130,"caption":"","height":94});
															thumbnails[829242] = clik.newPhoto({"id":829242,"src":"humptyfall_thumb.jpg","galleries_id":35013,"server_id":15,"link":"photo_829242.html","width":130,"caption":"","height":98});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[35013] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Illustrations","link":"section55392.html","maxRecords":0.0,"photoIDs":[439428.0,439443.0,439445.0,439447.0,829128.0,829135.0,829240.0,439446.0,829242.0],"skipIndex":0,"section_code":"section55392","featured_images":"829242,829240,829135,829128,439447,439446,439445,439443,439428","id":35013,"singleSection":false});				  						galleries[31376] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Boys","link":"gallery_31376.html","maxRecords":0.0,"photoIDs":[406461.0,406464.0,406466.0,406467.0,422927.0],"skipIndex":0,"section_code":"gallery","featured_images":"422927,406467,406466,406464,406461","id":31376,"singleSection":false});				  						galleries[31424] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Girls","link":"gallery_31424.html","maxRecords":0.0,"photoIDs":[406456.0,406462.0,406465.0,406468.0,422931.0],"skipIndex":0,"section_code":"gallery","featured_images":"422931,406468,406465,406462,406456","id":31424,"singleSection":false});				  						galleries[33790] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Close-up details","link":"gallery_33790.html","maxRecords":0.0,"photoIDs":[422835.0,422846.0,422858.0,422863.0],"skipIndex":0,"section_code":"gallery","featured_images":"422863,422858,422846,422835","id":33790,"singleSection":false});				  						galleries[32778] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Your choice of extras","link":"gallery_32778.html","maxRecords":0.0,"photoIDs":[408089.0,409521.0,409523.0,409526.0,409539.0,409542.0,409544.0,409546.0,409547.0,409548.0,409549.0,409552.0,421671.0,421672.0,421674.0,488392.0,2716455.0,2716457.0],"skipIndex":0,"section_code":"gallery","featured_images":"2716457,2716455,488392,421674,421672,421671,409552,409549,409548,409547","id":32778,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '387991';
imageSets[3] = '2716457,2716455,829242,829240,829135,829128,488392,439447,439446,439445,439443,439428,422931,422927,422863,422858,422846,422835,421674,421672,421671,409552,409549,409548,409547,409546,409544,409542,409539,409526,409523,409521,408089,406468,406467,406466,406465,406464,406462,406461,406456,387991';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://admin2.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 33:
		val = 'http://www8.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/jackndanni/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/jackndanni/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 = 'JacknDanni : ' + 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>Order a custom picture</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="nic.duckworth@ntlworld.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="nic.duckworth@ntlworld.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({					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 += '<a href="' + galleries[i].section_code + '_' + galleries[i].id + '.html">' + galleries[i].title + '</a>';
							}
		}
		document.all.galleryLinks.innerHTML = 'Other galleries: ' + temp;
	}
}

			

