window.thumbnails = {};
															thumbnails[7376889] = clik.newPhoto({"id":7376889,"src":"Clikpic_bio_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":177});
															thumbnails[8149921] = clik.newPhoto({"id":8149921,"src":"022wed_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":195});
															thumbnails[9101179] = clik.newPhoto({"id":9101179,"src":"01sqhp_1_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101188] = clik.newPhoto({"id":9101188,"src":"02sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101191] = clik.newPhoto({"id":9101191,"src":"03sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101193] = clik.newPhoto({"id":9101193,"src":"04sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101201] = clik.newPhoto({"id":9101201,"src":"06sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101206] = clik.newPhoto({"id":9101206,"src":"07sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101218] = clik.newPhoto({"id":9101218,"src":"08sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101222] = clik.newPhoto({"id":9101222,"src":"05sqhp_1_thumb.jpg","galleries_id":"","server_id":37,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101437] = clik.newPhoto({"id":9101437,"src":"09sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101443] = clik.newPhoto({"id":9101443,"src":"010sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101446] = clik.newPhoto({"id":9101446,"src":"011sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101449] = clik.newPhoto({"id":9101449,"src":"012sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101454] = clik.newPhoto({"id":9101454,"src":"013sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101459] = clik.newPhoto({"id":9101459,"src":"014sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101462] = clik.newPhoto({"id":9101462,"src":"015sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[9101465] = clik.newPhoto({"id":9101465,"src":"016sqhp_1_thumb.jpg","galleries_id":"","server_id":38,"link":"#","width":130,"caption":"","height":130});
															thumbnails[8149773] = clik.newPhoto({"id":8149773,"src":"001wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149773.html","width":130,"caption":"","height":195});
															thumbnails[8149774] = clik.newPhoto({"id":8149774,"src":"002wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149774.html","width":130,"caption":"","height":195});
															thumbnails[8149778] = clik.newPhoto({"id":8149778,"src":"003wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149778.html","width":130,"caption":"","height":195});
															thumbnails[8149781] = clik.newPhoto({"id":8149781,"src":"004wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149781.html","width":130,"caption":"","height":195});
															thumbnails[8149783] = clik.newPhoto({"id":8149783,"src":"005wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149783.html","width":130,"caption":"","height":195});
															thumbnails[8149787] = clik.newPhoto({"id":8149787,"src":"006wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149787.html","width":130,"caption":"","height":195});
															thumbnails[8149791] = clik.newPhoto({"id":8149791,"src":"007wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149791.html","width":130,"caption":"","height":195});
															thumbnails[8149794] = clik.newPhoto({"id":8149794,"src":"008wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149794.html","width":130,"caption":"","height":195});
															thumbnails[8149799] = clik.newPhoto({"id":8149799,"src":"009wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149799.html","width":130,"caption":"","height":195});
															thumbnails[8149802] = clik.newPhoto({"id":8149802,"src":"010wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149802.html","width":130,"caption":"","height":195});
															thumbnails[8149804] = clik.newPhoto({"id":8149804,"src":"011wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149804.html","width":130,"caption":"","height":195});
															thumbnails[8149806] = clik.newPhoto({"id":8149806,"src":"012wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149806.html","width":130,"caption":"","height":194});
															thumbnails[8149835] = clik.newPhoto({"id":8149835,"src":"013wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149835.html","width":130,"caption":"","height":195});
															thumbnails[8149861] = clik.newPhoto({"id":8149861,"src":"014wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149861.html","width":130,"caption":"","height":195});
															thumbnails[8149890] = clik.newPhoto({"id":8149890,"src":"015wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149890.html","width":130,"caption":"","height":195});
															thumbnails[8149894] = clik.newPhoto({"id":8149894,"src":"016wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149894.html","width":130,"caption":"","height":195});
															thumbnails[8149896] = clik.newPhoto({"id":8149896,"src":"017wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149896.html","width":130,"caption":"","height":195});
															thumbnails[8149900] = clik.newPhoto({"id":8149900,"src":"018wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149900.html","width":130,"caption":"","height":195});
															thumbnails[8149903] = clik.newPhoto({"id":8149903,"src":"019wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149903.html","width":130,"caption":"","height":195});
															thumbnails[8149905] = clik.newPhoto({"id":8149905,"src":"020wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149905.html","width":130,"caption":"","height":195});
															thumbnails[8149906] = clik.newPhoto({"id":8149906,"src":"021wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149906.html","width":130,"caption":"","height":195});
															thumbnails[8149975] = clik.newPhoto({"id":8149975,"src":"023wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8149975.html","width":130,"caption":"","height":195});
															thumbnails[8150450] = clik.newPhoto({"id":8150450,"src":"024wed_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_8150450.html","width":130,"caption":"","height":195});
															thumbnails[9015890] = clik.newPhoto({"id":9015890,"src":"_SJ102511_thumb.jpg","galleries_id":58430,"server_id":1,"link":"photo_9015890.html","width":130,"caption":"","height":195});
															thumbnails[9101753] = clik.newPhoto({"id":9101753,"src":"025wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101753.html","width":130,"caption":"","height":87});
															thumbnails[9101754] = clik.newPhoto({"id":9101754,"src":"026wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101754.html","width":130,"caption":"","height":87});
															thumbnails[9101756] = clik.newPhoto({"id":9101756,"src":"027wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101756.html","width":130,"caption":"","height":87});
															thumbnails[9101758] = clik.newPhoto({"id":9101758,"src":"028wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101758.html","width":130,"caption":"","height":87});
															thumbnails[9101760] = clik.newPhoto({"id":9101760,"src":"029wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101760.html","width":130,"caption":"","height":87});
															thumbnails[9101761] = clik.newPhoto({"id":9101761,"src":"030wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101761.html","width":130,"caption":"","height":87});
															thumbnails[9101762] = clik.newPhoto({"id":9101762,"src":"031wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101762.html","width":130,"caption":"","height":87});
															thumbnails[9101764] = clik.newPhoto({"id":9101764,"src":"032wed_1_thumb.jpg","galleries_id":58430,"server_id":38,"link":"photo_9101764.html","width":130,"caption":"","height":87});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[58430] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Weddings","link":"gallery.html","maxRecords":0.0,"photoIDs":[8149773.0,8149774.0,8149778.0,8149781.0,8149783.0,8149787.0,8149791.0,8149794.0,8149799.0,8149802.0,8149804.0,8149806.0,8149835.0,8149861.0,8149890.0,8149894.0,8149896.0,8149900.0,8149903.0,8149905.0,8149906.0,8149975.0,8150450.0,9015890.0,9101753.0,9101754.0,9101756.0,9101758.0,9101760.0,9101761.0,9101762.0,9101764.0],"skipIndex":0,"section_code":"gallery","featured_images":"9101764,9101762,9101761,9101760,9101758,9101756,9101754,9101753,9015890,8150450","id":58430,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[239394] = '7376889';
imageSets[1] = '9101465,9101462,9101459,9101454,9101449,9101446,9101443,9101437,9101222,9101218,9101206,9101201,9101193,9101191,9101188,9101179';
imageSets[3] = '9101764,9101762,9101761,9101760,9101758,9101756,9101754,9101753,9101465,9101462,9101459,9101454,9101449,9101446,9101443,9101437,9101222,9101218,9101206,9101201,9101193,9101191,9101188,9101179,9015890,8150450,8149975,8149921,8149906,8149905,8149903,8149900,8149896,8149894,8149890,8149861,8149835,8149806,8149804,8149802,8149799,8149794,8149791,8149787,8149783,8149781,8149778,8149774,8149773,7376889';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/SJBullock/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/SJBullock/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 = 'Sarah-Jane Bullock 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>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="SJBULLOCK">';
			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;
	}
}

			

