window.thumbnails = {};
															thumbnails[9096686] = clik.newPhoto({"id":9096686,"src":"iPad_H_TEMP600w400h_test_2_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":102});
															thumbnails[5690161] = clik.newPhoto({"id":5690161,"src":"DSC_7540_3603_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690161.html","width":130,"caption":"Wedding Photographer Doncaster","height":89});
															thumbnails[5751518] = clik.newPhoto({"id":5751518,"src":"DSC_7536_3599_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5751518.html","width":130,"caption":"Bride Photography Doncaster","height":196});
															thumbnails[6160344] = clik.newPhoto({"id":6160344,"src":"DSC_8739_web_3B5F1601-1D09-001F-99793F67883C5D3B_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160344.html","width":130,"caption":"","height":184});
															thumbnails[6160355] = clik.newPhoto({"id":6160355,"src":"DSC_8729_web_2_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160355.html","width":130,"caption":"","height":86});
															thumbnails[5690162] = clik.newPhoto({"id":5690162,"src":"DSC_7551_3614_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690162.html","width":130,"caption":"Wedding photographer Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":86});
															thumbnails[5751519] = clik.newPhoto({"id":5751519,"src":"DSC_7609_3724_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5751519.html","width":130,"caption":"Bride and Groom Wedding Album Doncaster and South Yorkshire","height":73});
															thumbnails[6160330] = clik.newPhoto({"id":6160330,"src":"DSC_7641_3756web_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160330.html","width":130,"caption":"","height":86});
															thumbnails[6160345] = clik.newPhoto({"id":6160345,"src":"DSC_8746_web_3B5F17C7-1D09-001F-99D1DB3EEFCED832_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160345.html","width":130,"caption":"","height":196});
															thumbnails[6160346] = clik.newPhoto({"id":6160346,"src":"DSC_8821_web_3B5F198C-1D09-001F-99748934A49CD930_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160346.html","width":130,"caption":"","height":196});
															thumbnails[5690164] = clik.newPhoto({"id":5690164,"src":"DSC_7587_3702_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690164.html","width":130,"caption":"Wedding photographer Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":85});
															thumbnails[5690196] = clik.newPhoto({"id":5690196,"src":"DSC_7654_3769_8FB01865-1EC9-D45B-1C825B29734167AD_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690196.html","width":130,"caption":"Wedding photographer Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":109});
															thumbnails[6160347] = clik.newPhoto({"id":6160347,"src":"DSC_8831_web_3B5F1B51-1D09-001F-9964D41302450AD8_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160347.html","width":130,"caption":"","height":194});
															thumbnails[5690165] = clik.newPhoto({"id":5690165,"src":"DSC_7591_3706_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690165.html","width":130,"caption":"Wedding photographer Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":105});
															thumbnails[6160333] = clik.newPhoto({"id":6160333,"src":"DSC_8744_web_3B5A3279-1D09-001F-99703B5E697E6FD3_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_6160333.html","width":130,"caption":"","height":102});
															thumbnails[5690170] = clik.newPhoto({"id":5690170,"src":"DSC_7659_3774_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690170.html","width":130,"caption":"Wedding photography Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":99});
															thumbnails[5690171] = clik.newPhoto({"id":5690171,"src":"DSC_7687_3802_thumb.jpg","galleries_id":322293,"server_id":32,"link":"photo_5690171.html","width":130,"caption":"Wedding photography Doncaster, Sheffield, Hull, Leeds, Pontefract, Selby","height":86});
															thumbnails[5535977] = clik.newPhoto({"id":5535977,"src":"Portrait_F032C491-1D09-001F-99A19178AF773CC5_thumb.jpg","galleries_id":254873,"server_id":32,"link":"photo_5535977.html","width":130,"caption":"Portrait","height":86});
															thumbnails[5535990] = clik.newPhoto({"id":5535990,"src":"Studio_Photographer_thumb.jpg","galleries_id":254873,"server_id":32,"link":"photo_5535990.html","width":130,"caption":"Studio Photographer","height":106});
															thumbnails[5535991] = clik.newPhoto({"id":5535991,"src":"Studio_Photography_Session_thumb.jpg","galleries_id":254873,"server_id":32,"link":"photo_5535991.html","width":130,"caption":"Studio Photography Session","height":85});
															thumbnails[5535992] = clik.newPhoto({"id":5535992,"src":"Studio_Photography_thumb.jpg","galleries_id":254873,"server_id":32,"link":"photo_5535992.html","width":130,"caption":"Studio Photography","height":86});
															thumbnails[5535491] = clik.newPhoto({"id":5535491,"src":"Baby_Photography_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535491.html","width":130,"caption":"Baby Photography","height":86});
															thumbnails[5535501] = clik.newPhoto({"id":5535501,"src":"Funky_Family_Photography_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535501.html","width":130,"caption":"Funky Family Photography","height":85});
															thumbnails[5690049] = clik.newPhoto({"id":5690049,"src":"DSC_7515_3681_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690049.html","width":130,"caption":"Photography","height":80});
															thumbnails[5690054] = clik.newPhoto({"id":5690054,"src":"DSC_7775_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690054.html","width":130,"caption":"Living Life Photography","height":86});
															thumbnails[5818853] = clik.newPhoto({"id":5818853,"src":"DSC_8562_copy_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5818853.html","width":130,"caption":"Location Photographer","height":72});
															thumbnails[5535492] = clik.newPhoto({"id":5535492,"src":"Family_Photography_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535492.html","width":130,"caption":"Family Photography","height":86});
															thumbnails[5535502] = clik.newPhoto({"id":5535502,"src":"Funky_Fun_Portrait_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535502.html","width":130,"caption":"Funky Fun Portrait","height":99});
															thumbnails[5535554] = clik.newPhoto({"id":5535554,"src":"New_Family_Photography_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535554.html","width":130,"caption":"New Family Photography","height":102});
															thumbnails[5690050] = clik.newPhoto({"id":5690050,"src":"DSC_7521_3687_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690050.html","width":130,"caption":"Out Door Photography","height":86});
															thumbnails[5690055] = clik.newPhoto({"id":5690055,"src":"tesyrt_copy_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690055.html","width":130,"caption":"Studio Photography","height":89});
															thumbnails[5818854] = clik.newPhoto({"id":5818854,"src":"DSC_8609_copy_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5818854.html","width":130,"caption":"Location Photography","height":91});
															thumbnails[5535493] = clik.newPhoto({"id":5535493,"src":"Family_Portrait_Photographer_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535493.html","width":130,"caption":"Family Portrait Photographer","height":125});
															thumbnails[5535555] = clik.newPhoto({"id":5535555,"src":"Photography_Studio_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535555.html","width":130,"caption":"Photography Studio","height":86});
															thumbnails[5690051] = clik.newPhoto({"id":5690051,"src":"DSC_7525_3691_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690051.html","width":130,"caption":"Life Photography","height":196});
															thumbnails[5535494] = clik.newPhoto({"id":5535494,"src":"Family_Portratit_Photography_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535494.html","width":130,"caption":"Family Portratit Photography","height":86});
															thumbnails[5690052] = clik.newPhoto({"id":5690052,"src":"DSC_7533_3699_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5690052.html","width":130,"caption":"Art Photography","height":90});
															thumbnails[5535495] = clik.newPhoto({"id":5535495,"src":"Fun_Family_Portrait_thumb.jpg","galleries_id":254872,"server_id":32,"link":"photo_5535495.html","width":130,"caption":"Fun Family Portrait","height":88});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[254872] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Family Photography","link":"gallery.html","maxRecords":0.0,"photoIDs":[5535491.0,5535501.0,5690049.0,5690054.0,5818853.0,5535492.0,5535502.0,5535554.0,5690050.0,5690055.0,5818854.0,5535493.0,5535555.0,5690051.0,5535494.0,5690052.0,5535495.0],"skipIndex":0,"section_code":"gallery","featured_images":"5818854,5818853,5535555,5535554,5535502,5535501,5535495,5535494,5535493,5535492,5535491","id":254872,"singleSection":true});				  						galleries[254873] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Studio Photography","link":"section375683.html","maxRecords":0.0,"photoIDs":[5535977.0,5535990.0,5535991.0,5535992.0],"skipIndex":0,"section_code":"section375683","featured_images":"5535992,5535991,5535990,5535977","id":254873,"singleSection":true});				  						galleries[322293] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Wedding Photography","link":"section386678.html","maxRecords":0.0,"photoIDs":[5690161.0,5751518.0,6160344.0,6160355.0,5690162.0,5751519.0,6160330.0,6160345.0,6160346.0,5690164.0,5690196.0,6160347.0,5690165.0,6160333.0,5690170.0,5690171.0],"skipIndex":0,"section_code":"section386678","featured_images":"6160355,6160347,6160346,6160345,6160344,6160333,6160330,5751519,5751518","id":322293,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '9096686,6160355,6160344,5690161,5690054,5690049,5535990,5535501,6160345,5690055,5690050,5690051,5690052,5535494,5535495,5690170,5690171';
imageSets[2] = '6160355,6160344,5818853,5751518,5535990,5535977,5535501,5535491,6160345,6160330,5818854,5751519,5535991,5535554,5535502,5535492,6160346,5535992,5535555,5535493,6160347,5535494,6160333,5535495';
imageSets[3] = '9096686,6160355,6160347,6160346,6160345,6160344,6160333,6160330,5818854,5818853,5751519,5751518,5690196,5690171,5690170,5690165,5690164,5690162,5690161,5690055,5690054,5690052,5690051,5690050,5690049,5535992,5535991,5535990,5535977,5535555,5535554,5535502,5535501,5535495,5535494,5535493,5535492,5535491';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/Merlin70/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/Merlin70/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 += 'section386678.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 && 'section386678' != '') {
					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 = 'Studio & Wedding Photographer Doncacaster: ' + 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="updateCartValue($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value); if(divShowing(\'paymentConfirm\')){fadeOut(\'paymentConfirm\', 3)};">';
		
		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">';
			temp += '	<input type="hidden" name="item_option" value="' + item_option + '">';
			temp += '	<input type="hidden" name="site" value="MERLIN70">';
			temp += '	<input type="hidden" name="item_number" value="'+ this.id +'">';
			temp += '	<input type="hidden" name="quantity" value="1">';
						temp += '	<input value="Add to cart" id="paymentAddButton" class="button" onmouseover="this.className=\'buttonHi\'\;" onmouseout="this.className=\'button\'\;" type="Button">';
							temp += '	<input value="View cart" id="paymentViewButton" class="button" onmouseover="this.className=\'buttonHi\';" onmouseout="this.className=\'button\';" type="Button" onclick="javascript:window.location=\'cart.html\'">';
			temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
			temp += '<div id="confirmContainer">';
			temp += '<div id="paymentConfirm">Item added to cart</div>';
			temp += '</div>';
			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;
	}
}

		

