window.thumbnails = {};
															thumbnails[5672604] = clik.newPhoto({"id":5672604,"src":"clicpic_my_logo_4_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":107});
															thumbnails[5672617] = clik.newPhoto({"id":5672617,"src":"clicpic_my_logo_41_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5672617.html","width":130,"caption":"","height":107});
															thumbnails[5606293] = clik.newPhoto({"id":5606293,"src":"13_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606293.html","width":130,"caption":"","height":98});
															thumbnails[5609130] = clik.newPhoto({"id":5609130,"src":"7_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609130.html","width":130,"caption":"","height":98});
															thumbnails[5606271] = clik.newPhoto({"id":5606271,"src":"4_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606271.html","width":125,"caption":"","height":400});
															thumbnails[5606278] = clik.newPhoto({"id":5606278,"src":"5_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606278.html","width":130,"caption":"","height":94});
															thumbnails[5606149] = clik.newPhoto({"id":5606149,"src":"2_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606149.html","width":130,"caption":"","height":98});
															thumbnails[5606256] = clik.newPhoto({"id":5606256,"src":"1_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606256.html","width":130,"caption":"","height":195});
															thumbnails[5606314] = clik.newPhoto({"id":5606314,"src":"10_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606314.html","width":130,"caption":"","height":87});
															thumbnails[5609244] = clik.newPhoto({"id":5609244,"src":"11_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609244.html","width":130,"caption":"","height":96});
															thumbnails[5609283] = clik.newPhoto({"id":5609283,"src":"16_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609283.html","width":130,"caption":"","height":129});
															thumbnails[5609117] = clik.newPhoto({"id":5609117,"src":"9_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609117.html","width":130,"caption":"","height":98});
															thumbnails[5609865] = clik.newPhoto({"id":5609865,"src":"single_shoe_1_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609865.html","width":130,"caption":"","height":173});
															thumbnails[5609279] = clik.newPhoto({"id":5609279,"src":"14_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609279.html","width":130,"caption":"","height":104});
															thumbnails[5609292] = clik.newPhoto({"id":5609292,"src":"18_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609292.html","width":130,"caption":"","height":98});
															thumbnails[5606323] = clik.newPhoto({"id":5606323,"src":"6a_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606323.html","width":130,"caption":"","height":98});
															thumbnails[5606368] = clik.newPhoto({"id":5606368,"src":"23_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606368.html","width":130,"caption":"","height":98});
															thumbnails[5606357] = clik.newPhoto({"id":5606357,"src":"NATHAN_AND_BECKY_dvd__cover_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5606357.html","width":130,"caption":"","height":87});
															thumbnails[5608984] = clik.newPhoto({"id":5608984,"src":"3_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5608984.html","width":130,"caption":"","height":104});
															thumbnails[5608987] = clik.newPhoto({"id":5608987,"src":"6b_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5608987.html","width":130,"caption":"","height":104});
															thumbnails[5609233] = clik.newPhoto({"id":5609233,"src":"_MG_3972_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609233.html","width":130,"caption":"","height":87});
															thumbnails[5609240] = clik.newPhoto({"id":5609240,"src":"8_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609240.html","width":130,"caption":"","height":104});
															thumbnails[5609271] = clik.newPhoto({"id":5609271,"src":"12_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609271.html","width":130,"caption":"","height":104});
															thumbnails[5609417] = clik.newPhoto({"id":5609417,"src":"19_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609417.html","width":130,"caption":"","height":104});
															thumbnails[5609242] = clik.newPhoto({"id":5609242,"src":"9a_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609242.html","width":130,"caption":"","height":179});
															thumbnails[5609418] = clik.newPhoto({"id":5609418,"src":"20_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609418.html","width":130,"caption":"","height":104});
															thumbnails[5609736] = clik.newPhoto({"id":5609736,"src":"21_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609736.html","width":130,"caption":"","height":104});
															thumbnails[5609852] = clik.newPhoto({"id":5609852,"src":"24_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609852.html","width":130,"caption":"","height":204});
															thumbnails[5609855] = clik.newPhoto({"id":5609855,"src":"25_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609855.html","width":130,"caption":"","height":98});
															thumbnails[5609859] = clik.newPhoto({"id":5609859,"src":"wed201021_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609859.html","width":130,"caption":"","height":67});
															thumbnails[5609862] = clik.newPhoto({"id":5609862,"src":"wed202711_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5609862.html","width":130,"caption":"","height":87});
															thumbnails[5608991] = clik.newPhoto({"id":5608991,"src":"6C_thumb.jpg","galleries_id":174075,"server_id":1,"link":"photo_5608991.html","width":130,"caption":"","height":195});
															thumbnails[5672325] = clik.newPhoto({"id":5672325,"src":"compo_sam_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672325.html","width":130,"caption":"","height":98});
															thumbnails[5672345] = clik.newPhoto({"id":5672345,"src":"scarlett_bw_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672345.html","width":130,"caption":"","height":98});
															thumbnails[5672358] = clik.newPhoto({"id":5672358,"src":"millie_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672358.html","width":130,"caption":"","height":60});
															thumbnails[5672381] = clik.newPhoto({"id":5672381,"src":"compo_caitlin_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672381.html","width":130,"caption":"","height":87});
															thumbnails[5672422] = clik.newPhoto({"id":5672422,"src":"compo_scarlett_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672422.html","width":130,"caption":"","height":87});
															thumbnails[5672457] = clik.newPhoto({"id":5672457,"src":"sam_and_mum_bw_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672457.html","width":130,"caption":"","height":98});
															thumbnails[5672509] = clik.newPhoto({"id":5672509,"src":"legs_2_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672509.html","width":130,"caption":"","height":136});
															thumbnails[5672536] = clik.newPhoto({"id":5672536,"src":"Ruby_and_Bruce_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672536.html","width":130,"caption":"","height":87});
															thumbnails[5672634] = clik.newPhoto({"id":5672634,"src":"compo_millie_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672634.html","width":130,"caption":"","height":87});
															thumbnails[5672626] = clik.newPhoto({"id":5672626,"src":"compo_alexandra_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672626.html","width":130,"caption":"","height":87});
															thumbnails[5672629] = clik.newPhoto({"id":5672629,"src":"compo_ella_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672629.html","width":130,"caption":"","height":89});
															thumbnails[5672642] = clik.newPhoto({"id":5672642,"src":"Roisin__thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672642.html","width":130,"caption":"","height":190});
															thumbnails[5672631] = clik.newPhoto({"id":5672631,"src":"compo_ella_2_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672631.html","width":130,"caption":"","height":61});
															thumbnails[5672638] = clik.newPhoto({"id":5672638,"src":"compo_tom_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672638.html","width":130,"caption":"","height":65});
															thumbnails[5672320] = clik.newPhoto({"id":5672320,"src":"baby_feet_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672320.html","width":130,"caption":"","height":79});
															thumbnails[5672648] = clik.newPhoto({"id":5672648,"src":"hand_in_hand_bw_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672648.html","width":130,"caption":"","height":87});
															thumbnails[5672653] = clik.newPhoto({"id":5672653,"src":"compo_zahib_thumb.jpg","galleries_id":174307,"server_id":1,"link":"photo_5672653.html","width":130,"caption":"","height":65});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[321985] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"About Us","link":"section123311.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section123311","featured_images":"","id":321985,"singleSection":true});				  						galleries[174307] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Baby It's You !","link":"section217494.html","maxRecords":0.0,"photoIDs":[5672325.0,5672345.0,5672358.0,5672381.0,5672422.0,5672457.0,5672509.0,5672536.0,5672634.0,5672626.0,5672629.0,5672642.0,5672631.0,5672638.0,5672320.0,5672648.0,5672653.0],"skipIndex":0,"section_code":"section217494","featured_images":"5672653,5672648,5672642,5672638,5672634,5672631,5672629,5672626,5672536,5672509","id":174307,"singleSection":true});				  						galleries[174075] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"One Special Day","link":"section172991.html","maxRecords":0.0,"photoIDs":[5672617.0,5606293.0,5609130.0,5606271.0,5606278.0,5606149.0,5606256.0,5606314.0,5609244.0,5609283.0,5609117.0,5609865.0,5609279.0,5609292.0,5606323.0,5606368.0,5606357.0,5608984.0,5608987.0,5609233.0,5609240.0,5609271.0,5609417.0,5609242.0,5609418.0,5609736.0,5609852.0,5609855.0,5609859.0,5609862.0,5608991.0],"skipIndex":0,"section_code":"section172991","featured_images":"5672617,5609865,5609862,5609859,5609855,5609852,5609736,5609418,5609417,5609292","id":174075,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[186737] = '5672325,5672345,5672358,5672381,5672422,5672457,5672509,5672536,5672634,5672626,5672629,5672642,5672631,5672638,5672320,5672648,5672653';
imageSets[1] = '5672617,5606293,5609130,5672325,5606271,5672345,5606278,5606149,5672358,5606256,5672381,5609283,5609244,5672422,5609117,5672457,5672509,5609279,5609292,5672536,5672604';
imageSets[3] = '5672653,5672648,5672642,5672638,5672634,5672631,5672629,5672626,5672617,5672604,5672536,5672509,5672457,5672422,5672381,5672358,5672345,5672325,5672320,5609865,5609862,5609859,5609855,5609852,5609736,5609418,5609417,5609292,5609283,5609279,5609271,5609244,5609242,5609240,5609233,5609130,5609117,5608991,5608987,5608984,5606368,5606357,5606323,5606314,5606293,5606278,5606271,5606256,5606149';
imageSets[186960] = '5606293,5609130,5606271,5606278,5606149,5606256,5609283,5609244,5609865,5609117,5609279,5609292,5606323,5606368,5606357,5608984,5608987,5609233,5609417,5609271,5609240,5609242,5609418,5609736,5609852,5609855,5609859,5609862,5608991';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/rablyle/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/rablyle/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/rablyle/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/rablyle/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/rablyle/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/rablyle/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/rablyle/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 += 'section172991.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 && 'section172991' != '') {
					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 = 'LYLE STYLE 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>';
	}
				
	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>10</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="rabshoose@hotmail.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=\"20\" 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="rabshoose@hotmail.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"30\" 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;
	}
}

			

