window.thumbnails = {};
															thumbnails[9165862] = clik.newPhoto({"id":9165862,"src":"DSCF8924_1_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_9165862.html","width":130,"caption":"","height":90});
															thumbnails[9081547] = clik.newPhoto({"id":9081547,"src":"Lulu_1CLICK_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_9081547.html","width":130,"caption":"","height":84});
															thumbnails[7547035] = clik.newPhoto({"id":7547035,"src":"DSCF1895_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_7547035.html","width":130,"caption":"","height":100});
															thumbnails[6911630] = clik.newPhoto({"id":6911630,"src":"BRITTA_041_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_6911630.html","width":130,"caption":"","height":97});
															thumbnails[6911628] = clik.newPhoto({"id":6911628,"src":"BRITTA_016_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_6911628.html","width":130,"caption":"","height":106});
															thumbnails[6911627] = clik.newPhoto({"id":6911627,"src":"BRITTA_024_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_6911627.html","width":130,"caption":"","height":98});
															thumbnails[6392637] = clik.newPhoto({"id":6392637,"src":"DSC00542_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_6392637.html","width":130,"caption":"","height":173});
															thumbnails[5972790] = clik.newPhoto({"id":5972790,"src":"DSCF9473_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5972790.html","width":130,"caption":"","height":100});
															thumbnails[5972788] = clik.newPhoto({"id":5972788,"src":"DSCF9366_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5972788.html","width":130,"caption":"","height":96});
															thumbnails[5825324] = clik.newPhoto({"id":5825324,"src":"DSCaF9340_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5825324.html","width":130,"caption":"","height":97});
															thumbnails[5828940] = clik.newPhoto({"id":5828940,"src":"DSCaF9341_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5828940.html","width":130,"caption":"","height":86});
															thumbnails[5723392] = clik.newPhoto({"id":5723392,"src":"DSC08224_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5723392.html","width":130,"caption":"","height":90});
															thumbnails[5420087] = clik.newPhoto({"id":5420087,"src":"Bahrain_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5420087.html","width":130,"caption":"","height":98});
															thumbnails[5420114] = clik.newPhoto({"id":5420114,"src":"DSCF2781_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5420114.html","width":130,"caption":"","height":173});
															thumbnails[5420119] = clik.newPhoto({"id":5420119,"src":"DSC07310_thumb.JPG","galleries_id":167161,"server_id":18,"link":"photo_5420119.html","width":130,"caption":"","height":98});
															thumbnails[5420126] = clik.newPhoto({"id":5420126,"src":"Mabrook_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5420126.html","width":130,"caption":"","height":190});
															thumbnails[5252714] = clik.newPhoto({"id":5252714,"src":"DSC07128_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5252714.html","width":130,"caption":"","height":156});
															thumbnails[5253049] = clik.newPhoto({"id":5253049,"src":"DSCF2361_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5253049.html","width":130,"caption":"","height":173});
															thumbnails[5252728] = clik.newPhoto({"id":5252728,"src":"DSC07123_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5252728.html","width":130,"caption":"","height":156});
															thumbnails[5253039] = clik.newPhoto({"id":5253039,"src":"DSC07126_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5253039.html","width":130,"caption":"","height":173});
															thumbnails[3579011] = clik.newPhoto({"id":3579011,"src":"DSCF3636a_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3579011.html","width":130,"caption":"","height":99});
															thumbnails[3576272] = clik.newPhoto({"id":3576272,"src":"DSCF3602_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3576272.html","width":130,"caption":"","height":98});
															thumbnails[3576268] = clik.newPhoto({"id":3576268,"src":"DSCF3599_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3576268.html","width":130,"caption":"","height":98});
															thumbnails[3576267] = clik.newPhoto({"id":3576267,"src":"DSCF3598_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3576267.html","width":130,"caption":"","height":98});
															thumbnails[3576265] = clik.newPhoto({"id":3576265,"src":"DSCF3591_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3576265.html","width":130,"caption":"","height":98});
															thumbnails[3576262] = clik.newPhoto({"id":3576262,"src":"DSCF3590_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3576262.html","width":130,"caption":"","height":98});
															thumbnails[3587816] = clik.newPhoto({"id":3587816,"src":"DSCF3654_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3587816.html","width":130,"caption":"","height":175});
															thumbnails[3587818] = clik.newPhoto({"id":3587818,"src":"DSCF3652_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3587818.html","width":130,"caption":"","height":173});
															thumbnails[2893780] = clik.newPhoto({"id":2893780,"src":"DSC00055_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2893780.html","width":129,"caption":"","height":96});
															thumbnails[2893789] = clik.newPhoto({"id":2893789,"src":"DSC00048_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2893789.html","width":129,"caption":"","height":173});
															thumbnails[3587820] = clik.newPhoto({"id":3587820,"src":"DSCF3653_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3587820.html","width":130,"caption":"","height":173});
															thumbnails[2893785] = clik.newPhoto({"id":2893785,"src":"DSC00049_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2893785.html","width":129,"caption":"","height":97});
															thumbnails[2893783] = clik.newPhoto({"id":2893783,"src":"DSC00052_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2893783.html","width":129,"caption":"","height":173});
															thumbnails[2639411] = clik.newPhoto({"id":2639411,"src":"clikpic2_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639411.html","width":130,"caption":"","height":97});
															thumbnails[2639412] = clik.newPhoto({"id":2639412,"src":"clikpic5_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639412.html","width":130,"caption":"","height":98});
															thumbnails[2639413] = clik.newPhoto({"id":2639413,"src":"clikpic6_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639413.html","width":130,"caption":"","height":98});
															thumbnails[2750298] = clik.newPhoto({"id":2750298,"src":"DSCF7597_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2750298.html","width":130,"caption":"","height":88});
															thumbnails[2750302] = clik.newPhoto({"id":2750302,"src":"i_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2750302.html","width":130,"caption":"","height":98});
															thumbnails[2750344] = clik.newPhoto({"id":2750344,"src":"DSCF75947aa_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2750344.html","width":130,"caption":"","height":98});
															thumbnails[2639414] = clik.newPhoto({"id":2639414,"src":"clikpic8_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639414.html","width":130,"caption":"","height":94});
															thumbnails[2639406] = clik.newPhoto({"id":2639406,"src":"clikpic_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639406.html","width":130,"caption":"","height":98});
															thumbnails[2112225] = clik.newPhoto({"id":2112225,"src":"website1_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2112225.html","width":130,"caption":"","height":173});
															thumbnails[2112228] = clik.newPhoto({"id":2112228,"src":"website2_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2112228.html","width":130,"caption":"","height":85});
															thumbnails[2639410] = clik.newPhoto({"id":2639410,"src":"clikpic4_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639410.html","width":130,"caption":"","height":94});
															thumbnails[2639409] = clik.newPhoto({"id":2639409,"src":"clikpic3_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_2639409.html","width":130,"caption":"","height":98});
															thumbnails[3588856] = clik.newPhoto({"id":3588856,"src":"DSCF3659_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_3588856.html","width":130,"caption":"","height":98});
															thumbnails[5278491] = clik.newPhoto({"id":5278491,"src":"DSCF2365_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5278491.html","width":130,"caption":"","height":97});
															thumbnails[5278492] = clik.newPhoto({"id":5278492,"src":"DSCF2366_thumb.jpg","galleries_id":167161,"server_id":18,"link":"photo_5278492.html","width":130,"caption":"","height":90});
															thumbnails[353988] = clik.newPhoto({"id":353988,"src":"DSCF2832_thumb.JPG","galleries_id":63717,"server_id":18,"link":"photo_353988.html","width":130,"caption":"","height":102});
															thumbnails[791628] = clik.newPhoto({"id":791628,"src":"DSCF3640_thumb.JPG","galleries_id":63717,"server_id":18,"link":"photo_791628.html","width":130,"caption":"","height":98});
															thumbnails[791640] = clik.newPhoto({"id":791640,"src":"DSCF3663_thumb.JPG","galleries_id":63717,"server_id":18,"link":"photo_791640.html","width":130,"caption":"","height":98});
															thumbnails[1029307] = clik.newPhoto({"id":1029307,"src":"familie1_thumb.JPG","galleries_id":63717,"server_id":18,"link":"photo_1029307.html","width":130,"caption":"","height":85});
															thumbnails[791634] = clik.newPhoto({"id":791634,"src":"SAATCHI4_thumb.jpg","galleries_id":63717,"server_id":18,"link":"photo_791634.html","width":130,"caption":"","height":161});
															thumbnails[791632] = clik.newPhoto({"id":791632,"src":"SAATCHI3_thumb.jpg","galleries_id":63717,"server_id":18,"link":"photo_791632.html","width":130,"caption":"","height":161});
															thumbnails[791630] = clik.newPhoto({"id":791630,"src":"SAATCHI2_thumb.jpg","galleries_id":63717,"server_id":18,"link":"photo_791630.html","width":130,"caption":"","height":164});
															thumbnails[791626] = clik.newPhoto({"id":791626,"src":"Dscf3657_thumb.jpg","galleries_id":63717,"server_id":18,"link":"photo_791626.html","width":130,"caption":"","height":107});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[295845] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Miami","link":"section353685.html","maxRecords":0.0,"photoIDs":[],"skipIndex":0,"section_code":"section353685","featured_images":"","id":295845,"singleSection":true});				  						galleries[167161] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Bahrain Surrealism \/Hoora","link":"section209857.html","maxRecords":0.0,"photoIDs":[9165862.0,9081547.0,7547035.0,6911630.0,6911628.0,6911627.0,6392637.0,5972790.0,5972788.0,5825324.0,5828940.0,5723392.0,5420087.0,5420114.0,5420119.0,5420126.0,5252714.0,5253049.0,5252728.0,5253039.0,3579011.0,3576272.0,3576268.0,3576267.0,3576265.0,3576262.0,3587816.0,3587818.0,2893780.0,2893789.0,3587820.0,2893785.0,2893783.0,2639411.0,2639412.0,2639413.0,2750298.0,2750302.0,2750344.0,2639414.0,2639406.0,2112225.0,2112228.0,2639410.0,2639409.0,3588856.0,5278491.0,5278492.0],"skipIndex":0,"section_code":"section209857","featured_images":"9165862,9081547,7547035,6911630,6911628,6911627,6392637,5972790,5972788,5828940","id":167161,"singleSection":true});				  						galleries[63717] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Pop-Surrealism","link":"section104127.html","maxRecords":0.0,"photoIDs":[353988.0,791628.0,791640.0,1029307.0,791634.0,791632.0,791630.0,791626.0],"skipIndex":0,"section_code":"section104127","featured_images":"1029307,791640,791634,791632,791630,791628,791626,353988","id":63717,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '791632,791630,791626,7547035,5972788,5825324,5723392,5420087,5420114,5420119,5420126,5253049,5252728,5253039,3576272,3576265,3576262,3587818,2893789,3587820,2893783,2639412,2639413,2750298,2750302,2750344';
imageSets[3] = '5252714,3576262';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/thacksy/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/thacksy/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/thacksy/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 += 'section209857.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 && 'section209857' != '') {
					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 = 'Anna Leanda Thackray: ' + 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="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="thacks@btinternet.com">';
					temp += '<input type="hidden" name="currency_code" value="GBP">';
					temp += '<input type="hidden" name="add" value="1">';
													temp += '<input type="hidden" name="amount" value="'+amount+'">';
					temp += '<input type="hidden" name="item_number" value="'+ref+'">';
													temp += '<input type=\"Submit\" value=\"Add to cart\" id=\"paymentAddButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
										temp += '</form>';
										temp += '<form id="paymentCartForm" style="margin:0px;" name="paymentCartForm" target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">';
				temp += '<input type="hidden" name="cmd" value="_cart">';
				temp += '<input type="hidden" name="business" value="thacks@btinternet.com">';
				temp += '<input type="hidden" name="display" value="1">';
				temp += '<input type=\"Submit\" value=\"View cart\" id=\"paymentViewButton\" class=\"button\" onmouseover=\"this.className=\'buttonHi\';\" onmouseout=\"this.className=\'button\';\">';
				temp += '</form>';
						temp += '<div class="clearing">&nbsp;</div>';
	}
	return temp;};

/***************************************************************************
* Pick a photo at random from the featured images of a gallery.            *
* Gallery_id = id of gallery to choose,                                    *
* img = reference to html image in                                         *
* which to show image                                                      *
***************************************************************************/
function showGalleryImage(gallery_id, img, updateLink) {
	
	if(img){
		if (location.hash.match('galleries_id=' + gallery_id) && (imageID = location.hash.match('.*photos_id=(.+)$'))) {
		  	imageID = imageID[1];
		} else {
		  	imageID = randomListVal(galleries[gallery_id].featured_images);
		}
		
		if (imageID != 0) {
			img.src = thumbnails[imageID].src;
			img.width = thumbnails[imageID].width;
			img.height = thumbnails[imageID].height;
			img.alt = galleries[gallery_id].title;
			if (updateLink) {
				$(img).parent().attr({					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;
	}
}

			

