window.thumbnails = {};
															thumbnails[4635480] = clik.newPhoto({"id":4635480,"src":"1-1374-Red_kite-2008_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635480.html","width":130,"caption":"Red kite","height":91});
															thumbnails[4635664] = clik.newPhoto({"id":4635664,"src":"2-1388-Bearded_tit-2008_copy1_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635664.html","width":130,"caption":"Bearded tit","height":91});
															thumbnails[4635665] = clik.newPhoto({"id":4635665,"src":"3-1282-Red_kite-20081_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635665.html","width":130,"caption":"Red kite","height":91});
															thumbnails[4635667] = clik.newPhoto({"id":4635667,"src":"4-1531-Kestrel-2008_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635667.html","width":130,"caption":"Kestrel","height":91});
															thumbnails[4635668] = clik.newPhoto({"id":4635668,"src":"5-0437-Barn_owl-20041_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635668.html","width":130,"caption":"Barn owl","height":91});
															thumbnails[4635669] = clik.newPhoto({"id":4635669,"src":"6-2963-long_tailed_tit-20091_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635669.html","width":130,"caption":"Long tailed tit","height":91});
															thumbnails[4635674] = clik.newPhoto({"id":4635674,"src":"7-2151-nuthatch-2007_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635674.html","width":130,"caption":"Nuthatch","height":91});
															thumbnails[4635701] = clik.newPhoto({"id":4635701,"src":"10-2342-chough-2008_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4635701.html","width":130,"caption":"Chough","height":90});
															thumbnails[4642757] = clik.newPhoto({"id":4642757,"src":"8-0662-Puffin-2006_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4642757.html","width":130,"caption":"Puffin","height":91});
															thumbnails[4642764] = clik.newPhoto({"id":4642764,"src":"9-2348-lapwing-2008_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4642764.html","width":130,"caption":"Lapwing","height":91});
															thumbnails[4643768] = clik.newPhoto({"id":4643768,"src":"12-2300-peregrine-2008_copy_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4643768.html","width":130,"caption":"Peregrine ","height":91});
															thumbnails[4643850] = clik.newPhoto({"id":4643850,"src":"13-4032-Common_tern-2009_copy1_thumb.jpg","galleries_id":266420,"server_id":15,"link":"photo_4643850.html","width":130,"caption":"Common tern","height":91});
															thumbnails[4626388] = clik.newPhoto({"id":4626388,"src":"2-0074-Common_seal-2003_copy_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626388.html","width":130,"caption":"Two  Grey Seals","height":91});
															thumbnails[4626434] = clik.newPhoto({"id":4626434,"src":"6-1446-Glis_glis-20071_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626434.html","width":130,"caption":"Fat Dormouse<br>\r\n","height":91});
															thumbnails[4626436] = clik.newPhoto({"id":4626436,"src":"3-0179-Wolfs-2004_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626436.html","width":130,"caption":"Wolf","height":91});
															thumbnails[4626439] = clik.newPhoto({"id":4626439,"src":"5-0201-Fox-2004_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626439.html","width":130,"caption":"Fox & cub","height":91});
															thumbnails[4626503] = clik.newPhoto({"id":4626503,"src":"7-2167-fox-2008_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626503.html","width":130,"caption":"Fox","height":91});
															thumbnails[4626508] = clik.newPhoto({"id":4626508,"src":"14-2896-water_vole-20091_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626508.html","width":130,"caption":"Water vole","height":91});
															thumbnails[4626513] = clik.newPhoto({"id":4626513,"src":"10-2403-stoat-2008_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626513.html","width":130,"caption":"Stoat","height":91});
															thumbnails[4626541] = clik.newPhoto({"id":4626541,"src":"8-2196-house_mouse-20061_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626541.html","width":130,"caption":"House mouse","height":91});
															thumbnails[4626548] = clik.newPhoto({"id":4626548,"src":"15-2904-water_vole-20091_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626548.html","width":130,"caption":"Water vole","height":91});
															thumbnails[4626554] = clik.newPhoto({"id":4626554,"src":"11-2633-grey_seal-20081_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626554.html","width":130,"caption":"Grey  Seal","height":91});
															thumbnails[4626590] = clik.newPhoto({"id":4626590,"src":"1-0054-Red_deer-20031_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626590.html","width":130,"caption":"Red deer","height":91});
															thumbnails[4626613] = clik.newPhoto({"id":4626613,"src":"12-2703-grey_seal-20081_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626613.html","width":130,"caption":"Grey seal with pup","height":91});
															thumbnails[4626617] = clik.newPhoto({"id":4626617,"src":"13-2713-grey_seal-20081_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626617.html","width":130,"caption":" Two Grey seal","height":91});
															thumbnails[4626635] = clik.newPhoto({"id":4626635,"src":"4-0182-Wolfs-2004_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626635.html","width":130,"caption":"Wolf","height":91});
															thumbnails[4626640] = clik.newPhoto({"id":4626640,"src":"9-2247-ground_squirrel-20061_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4626640.html","width":130,"caption":"Ground squirrel","height":91});
															thumbnails[4643645] = clik.newPhoto({"id":4643645,"src":"3349-raccon-2009_copy1_thumb.jpg","galleries_id":266422,"server_id":15,"link":"photo_4643645.html","width":130,"caption":"Raccon","height":91});
															thumbnails[4614296] = clik.newPhoto({"id":4614296,"src":"17-3626-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614296.html","width":130,"caption":"Gannet flying","height":91});
															thumbnails[4614307] = clik.newPhoto({"id":4614307,"src":"4-3505-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614307.html","width":130,"caption":"Gannet at sea","height":91});
															thumbnails[4614309] = clik.newPhoto({"id":4614309,"src":"5-3515-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614309.html","width":130,"caption":"Gannet","height":91});
															thumbnails[4614310] = clik.newPhoto({"id":4614310,"src":"8-3558-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614310.html","width":130,"caption":"Gannet close up","height":91});
															thumbnails[4614311] = clik.newPhoto({"id":4614311,"src":"14-3767-Bass_rock-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614311.html","width":130,"caption":"Lighthouse on Bass Rock","height":88});
															thumbnails[4614313] = clik.newPhoto({"id":4614313,"src":"13-3761-Gannet_on_bass_rock-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614313.html","width":130,"caption":"View of Bass Rock","height":85});
															thumbnails[4614469] = clik.newPhoto({"id":4614469,"src":"9-3577-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614469.html","width":130,"caption":"Gannet feeding chick","height":91});
															thumbnails[4614477] = clik.newPhoto({"id":4614477,"src":"18-3655-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614477.html","width":130,"caption":"Young Gannet flying","height":91});
															thumbnails[4614670] = clik.newPhoto({"id":4614670,"src":"12-3749-Gannet_on_bass_rock-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614670.html","width":130,"caption":"Gannets on Bass ","height":91});
															thumbnails[4614735] = clik.newPhoto({"id":4614735,"src":"11-3624-Gannet-2009_copy1_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614735.html","width":130,"caption":"Gannet on nest","height":91});
															thumbnails[4614775] = clik.newPhoto({"id":4614775,"src":"10-3598-Gannet-2009_copy1_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614775.html","width":130,"caption":"Gannet stretching its wings","height":91});
															thumbnails[4614777] = clik.newPhoto({"id":4614777,"src":"15-3694-Gannet-2009_copy1_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4614777.html","width":130,"caption":"pair of Gannets","height":92});
															thumbnails[4615279] = clik.newPhoto({"id":4615279,"src":"1-3447-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4615279.html","width":130,"caption":"Gannet flying","height":91});
															thumbnails[4615309] = clik.newPhoto({"id":4615309,"src":"6-3519-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4615309.html","width":130,"caption":"Gull with fish","height":91});
															thumbnails[4615366] = clik.newPhoto({"id":4615366,"src":"7-3521-Gannet-2009_copy_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4615366.html","width":130,"caption":"Gannet with Fish","height":89});
															thumbnails[4643661] = clik.newPhoto({"id":4643661,"src":"3685-Gannet-2009_copy1_thumb.jpg","galleries_id":266817,"server_id":15,"link":"photo_4643661.html","width":130,"caption":"Gannet flying","height":91});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[266420] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Birds","link":"gallery_266420.html","maxRecords":0.0,"photoIDs":[4635480.0,4635664.0,4635665.0,4635667.0,4635668.0,4635669.0,4635674.0,4635701.0,4642757.0,4642764.0,4643768.0,4643850.0],"skipIndex":0,"section_code":"gallery","featured_images":4635480.0,"id":266420,"singleSection":false});				  						galleries[266422] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Mammals","link":"gallery_266422.html","maxRecords":0.0,"photoIDs":[4626388.0,4626434.0,4626436.0,4626439.0,4626503.0,4626508.0,4626513.0,4626541.0,4626548.0,4626554.0,4626590.0,4626613.0,4626617.0,4626635.0,4626640.0,4643645.0],"skipIndex":0,"section_code":"gallery","featured_images":4626503.0,"id":266422,"singleSection":false});				  						galleries[266817] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Latest images Bass Rock","link":"gallery_266817.html","maxRecords":0.0,"photoIDs":[4614296.0,4614307.0,4614309.0,4614310.0,4614311.0,4614313.0,4614469.0,4614477.0,4614670.0,4614735.0,4614775.0,4614777.0,4615279.0,4615309.0,4615366.0,4643661.0],"skipIndex":0,"section_code":"gallery","featured_images":4614310.0,"id":266817,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '4643645';
imageSets[2] = '4635480,4626503,4614310';
imageSets[3] = '4643850,4643768,4643661,4643645,4642764,4642757,4635701,4635674,4635669,4635668,4635667,4635665,4635664,4635480,4626640,4626635,4626617,4626613,4626590,4626554,4626548,4626541,4626513,4626508,4626503,4626439,4626436,4626434,4626388,4615366,4615309,4615279,4614777,4614775,4614735,4614670,4614477,4614469,4614313,4614311,4614310,4614309,4614307,4614296';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'www12.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/ronworkman/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/ronworkman/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 = 'Ronworkmanimages.com   : ' + 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>';
	}
				
				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>Order this print:</p>';
				temp += '<div class="imageinfo" id="imagePrice"><strong>' + this.purchase_instruction + '</strong> ' + (this.item_price).toFixed(2) + '</div>';
		var item_name  = this.purchase_instruction;
		var amount = (this.item_price).toFixed(2);
		var item_option  = 0;
	}
	else if (this.payment_groups_id !== '') {
		temp += '<p>Buy this print online:</p>';
				temp += '<form id="paymentOptions" style="margin:0px;border:0px;" name="paymentOptions">';
											temp += '<select class="paymentlink" name="payment_options_id" onchange="updateItemValues($(this.form).next(\'#paymentForm\')[0],this.form.payment_options_id.options[this.form.payment_options_id.options.selectedIndex].value);">';
		
		temp += getPaymentOptions(this.payment_groups_id);
		temp += '</select>';
		temp += '</form>';
				var item_option  = paymentGroups[this.payment_groups_id].options[0];
		if(paymentOptions[item_option]){
			var item_name  = paymentOptions[item_option].payment_option;
			var amount =  paymentOptions[item_option].price;
		}
			}
	else {
		
	}
	if (this.item_price !== '' || this.payment_groups_id !== '') {
			temp += '<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;
	}
}

			

