window.thumbnails = {};
															thumbnails[7428416] = clik.newPhoto({"id":7428416,"src":"1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":97});
															thumbnails[7428429] = clik.newPhoto({"id":7428429,"src":"stew2_006web_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":173});
															thumbnails[7428430] = clik.newPhoto({"id":7428430,"src":"2_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":173});
															thumbnails[7428433] = clik.newPhoto({"id":7428433,"src":"3_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":111});
															thumbnails[7428439] = clik.newPhoto({"id":7428439,"src":"4_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":124});
															thumbnails[7428441] = clik.newPhoto({"id":7428441,"src":"5_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":138});
															thumbnails[7428449] = clik.newPhoto({"id":7428449,"src":"6_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":113});
															thumbnails[7620416] = clik.newPhoto({"id":7620416,"src":"caseweb1_thumb.jpg","galleries_id":"","server_id":5,"link":"#","width":130,"caption":"","height":103});
															thumbnails[9005334] = clik.newPhoto({"id":9005334,"src":"silks_031_thumb.jpg","galleries_id":354134,"server_id":5,"link":"photo_9005334.html","width":130,"caption":"push","height":129});
															thumbnails[9005356] = clik.newPhoto({"id":9005356,"src":"silks_027_thumb.jpg","galleries_id":354134,"server_id":5,"link":"photo_9005356.html","width":130,"caption":"clockwise","height":133});
															thumbnails[9005361] = clik.newPhoto({"id":9005361,"src":"silks_022_thumb.jpg","galleries_id":354134,"server_id":5,"link":"photo_9005361.html","width":130,"caption":"elektiv","height":128});
															thumbnails[9005363] = clik.newPhoto({"id":9005363,"src":"silks_006_thumb.jpg","galleries_id":354134,"server_id":5,"link":"photo_9005363.html","width":130,"caption":"left","height":138});
															thumbnails[9005366] = clik.newPhoto({"id":9005366,"src":"silks_001_thumb.jpg","galleries_id":354134,"server_id":5,"link":"photo_9005366.html","width":130,"caption":"stack","height":131});
															thumbnails[8716732] = clik.newPhoto({"id":8716732,"src":"jump21_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8716732.html","width":130,"caption":"","height":105});
															thumbnails[8807500] = clik.newPhoto({"id":8807500,"src":"cow01_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8807500.html","width":130,"caption":"","height":65});
															thumbnails[8927344] = clik.newPhoto({"id":8927344,"src":"frontandsideways_D43902D5-1EC9-D45B-1CF23FE257374583_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927344.html","width":130,"caption":"","height":71});
															thumbnails[8927356] = clik.newPhoto({"id":8927356,"src":"booth_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927356.html","width":130,"caption":"","height":98});
															thumbnails[8927372] = clik.newPhoto({"id":8927372,"src":"IMAG0068_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927372.html","width":130,"caption":"","height":93});
															thumbnails[8927374] = clik.newPhoto({"id":8927374,"src":"movingin_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927374.html","width":130,"caption":"","height":83});
															thumbnails[8927377] = clik.newPhoto({"id":8927377,"src":"plinth1_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927377.html","width":130,"caption":"","height":85});
															thumbnails[8927383] = clik.newPhoto({"id":8927383,"src":"moving_up_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927383.html","width":130,"caption":"","height":81});
															thumbnails[8927389] = clik.newPhoto({"id":8927389,"src":"shipped_D4D30FFA-1EC9-D45B-1CA095B3DC8D77B4_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_8927389.html","width":130,"caption":"","height":78});
															thumbnails[9019799] = clik.newPhoto({"id":9019799,"src":"barrweb_thumb.jpg","galleries_id":412711,"server_id":5,"link":"photo_9019799.html","width":130,"caption":"","height":131});
															thumbnails[8371942] = clik.newPhoto({"id":8371942,"src":"cutz_032_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8371942.html","width":130,"caption":"","height":99});
															thumbnails[8372016] = clik.newPhoto({"id":8372016,"src":"cutz_017web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8372016.html","width":130,"caption":"","height":199});
															thumbnails[8372056] = clik.newPhoto({"id":8372056,"src":"cutz_022_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8372056.html","width":130,"caption":"","height":98});
															thumbnails[8372058] = clik.newPhoto({"id":8372058,"src":"cutz_020web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8372058.html","width":130,"caption":"","height":162});
															thumbnails[8372059] = clik.newPhoto({"id":8372059,"src":"cutz_016web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8372059.html","width":130,"caption":"","height":113});
															thumbnails[8372060] = clik.newPhoto({"id":8372060,"src":"cutz_030web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8372060.html","width":130,"caption":"","height":160});
															thumbnails[8413897] = clik.newPhoto({"id":8413897,"src":"04092011_009web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8413897.html","width":130,"caption":"","height":173});
															thumbnails[8413899] = clik.newPhoto({"id":8413899,"src":"04092011_013web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8413899.html","width":130,"caption":"","height":175});
															thumbnails[8413901] = clik.newPhoto({"id":8413901,"src":"04092011_014web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8413901.html","width":130,"caption":"","height":173});
															thumbnails[8476726] = clik.newPhoto({"id":8476726,"src":"standweb2_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8476726.html","width":130,"caption":"","height":519});
															thumbnails[8502156] = clik.newPhoto({"id":8502156,"src":"21092011_002web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8502156.html","width":130,"caption":"","height":172});
															thumbnails[8502157] = clik.newPhoto({"id":8502157,"src":"drawwallweb_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8502157.html","width":130,"caption":"","height":88});
															thumbnails[8502158] = clik.newPhoto({"id":8502158,"src":"gramweb_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8502158.html","width":130,"caption":"","height":104});
															thumbnails[8562942] = clik.newPhoto({"id":8562942,"src":"02102011_031web1_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8562942.html","width":130,"caption":"","height":96});
															thumbnails[8563028] = clik.newPhoto({"id":8563028,"src":"02102011_008web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8563028.html","width":130,"caption":"","height":194});
															thumbnails[8563036] = clik.newPhoto({"id":8563036,"src":"02102011_018web_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8563036.html","width":130,"caption":"","height":113});
															thumbnails[8745673] = clik.newPhoto({"id":8745673,"src":"shootW_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8745673.html","width":130,"caption":"","height":112});
															thumbnails[8852050] = clik.newPhoto({"id":8852050,"src":"24112011a_026web1_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8852050.html","width":130,"caption":"","height":173});
															thumbnails[8852054] = clik.newPhoto({"id":8852054,"src":"slipweb_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_8852054.html","width":130,"caption":"","height":101});
															thumbnails[9005494] = clik.newPhoto({"id":9005494,"src":"handstand_thumb.jpg","galleries_id":412623,"server_id":5,"link":"photo_9005494.html","width":130,"caption":"handstand","height":178});
															thumbnails[7609655] = clik.newPhoto({"id":7609655,"src":"mikenewmanjpg2website1_thumb.jpg","galleries_id":412696,"server_id":5,"link":"photo_7609655.html","width":130,"caption":"","height":139});
															thumbnails[7608410] = clik.newPhoto({"id":7608410,"src":"scooter1web_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7608410.html","width":130,"caption":"","height":102});
															thumbnails[7620396] = clik.newPhoto({"id":7620396,"src":"caseweb_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620396.html","width":130,"caption":"","height":103});
															thumbnails[7620397] = clik.newPhoto({"id":7620397,"src":"brollyweb_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620397.html","width":130,"caption":"","height":169});
															thumbnails[7620400] = clik.newPhoto({"id":7620400,"src":"scootweb_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620400.html","width":130,"caption":"","height":102});
															thumbnails[7620408] = clik.newPhoto({"id":7620408,"src":"umbrellaweb1_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620408.html","width":130,"caption":"","height":163});
															thumbnails[7620411] = clik.newPhoto({"id":7620411,"src":"scoot1_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620411.html","width":130,"caption":"","height":104});
															thumbnails[7620413] = clik.newPhoto({"id":7620413,"src":"umbrellaweb_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620413.html","width":130,"caption":"","height":161});
															thumbnails[7620414] = clik.newPhoto({"id":7620414,"src":"umbrella1_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7620414.html","width":130,"caption":"","height":162});
															thumbnails[7634254] = clik.newPhoto({"id":7634254,"src":"wishuwereweb_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7634254.html","width":130,"caption":"","height":105});
															thumbnails[7634260] = clik.newPhoto({"id":7634260,"src":"ummater2web_thumb.jpg","galleries_id":412624,"server_id":5,"link":"photo_7634260.html","width":130,"caption":"","height":97});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[412696] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"...","link":"section490954.html","maxRecords":0.0,"photoIDs":[7609655.0],"skipIndex":0,"section_code":"section490954","featured_images":7609655.0,"id":412696,"singleSection":true});				  						galleries[412624] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"...scale, position and process","link":"section493772.html","maxRecords":0.0,"photoIDs":[7608410.0,7620396.0,7620397.0,7620400.0,7620408.0,7620411.0,7620413.0,7620414.0,7634254.0,7634260.0],"skipIndex":0,"section_code":"section493772","featured_images":"7634260,7634254,7620414,7620413,7620411,7620408,7620400,7620397,7620396,7608410","id":412624,"singleSection":true});				  						galleries[412711] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"current ideas","link":"section493844.html","maxRecords":0.0,"photoIDs":[8716732.0,8807500.0,8927344.0,8927356.0,8927372.0,8927374.0,8927377.0,8927383.0,8927389.0,9019799.0],"skipIndex":0,"section_code":"section493844","featured_images":"9019799,8927389,8927383,8927377,8927374,8927372,8927356,8927344,8807500,8716732","id":412711,"singleSection":true});				  						galleries[412623] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Drawing wall","link":"section493768.html","maxRecords":0.0,"photoIDs":[8371942.0,8372016.0,8372056.0,8372058.0,8372059.0,8372060.0,8413897.0,8413899.0,8413901.0,8476726.0,8502156.0,8502157.0,8502158.0,8562942.0,8563028.0,8563036.0,8745673.0,8852050.0,8852054.0,9005494.0],"skipIndex":0,"section_code":"section493768","featured_images":"9005494,8852054,8852050,8745673,8563036,8563028,8562942,8502158,8502157,8502156","id":412623,"singleSection":true});				  						galleries[354134] = clik.newGallery({"parentGallery":"","usePopups":true,"title":"prints and drawings","link":"section422354.html","maxRecords":0.0,"photoIDs":[9005334.0,9005356.0,9005361.0,9005363.0,9005366.0],"skipIndex":0,"section_code":"section422354","featured_images":"9005366,9005363,9005361,9005356,9005334","id":354134,"singleSection":true});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '8413899';
imageSets[3] = '9019799,9005494,9005366,9005363,9005361,9005356,9005334,8927389,8927383,8927377,8927374,8927372,8927356,8927344,8852054,8852050,8807500,8745673,8716732,8563036,8563028,8562942,8502158,8502157,8502156,8476726,8413901,8413899,8413897,8372060,8372059,8372058,8372056,8372016,8371942,7634260,7634254,7620416,7620414,7620413,7620411,7620408,7620400,7620397,7620396,7609655,7608410,7428449,7428441,7428439';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/mikenew/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/mikenew/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/mikenew/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 += 'section422354.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 && 'section422354' != '') {
					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 = 'once upon a line...: ' + 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="mikenewman1st@gmail.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="mikenewman1st@gmail.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;
	}
}

			

