window.thumbnails = {};
															thumbnails[9070674] = clik.newPhoto({"id":9070674,"src":"The_Old_Road-1_thumb.jpg","galleries_id":"","server_id":18,"link":"#","width":160,"caption":"The Old Road","height":213});
															thumbnails[1687438] = clik.newPhoto({"id":1687438,"src":"Cuchulainn Stone_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1687438.html","width":130,"caption":"Cuchulian Stone","height":174});
															thumbnails[1687476] = clik.newPhoto({"id":1687476,"src":"Scrabo Tower just outside Newtownards_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1687476.html","width":130,"caption":"Scrabo Tower","height":174});
															thumbnails[1687499] = clik.newPhoto({"id":1687499,"src":"robin_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1687499.html","width":130,"caption":"Robin","height":182});
															thumbnails[1687529] = clik.newPhoto({"id":1687529,"src":"Downpatrick_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_1687529.html","width":130,"caption":"Downpatrick Cathedral","height":195});
															thumbnails[1696098] = clik.newPhoto({"id":1696098,"src":"P1000261_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1696098.html","width":130,"caption":"Sunset at Beaghmore Stone circles","height":182});
															thumbnails[1696161] = clik.newPhoto({"id":1696161,"src":"June,,06_thumb..jpg","galleries_id":114135,"server_id":18,"link":"photo_1696161.html","width":130,"caption":"Errigal Mountain ","height":181});
															thumbnails[1696297] = clik.newPhoto({"id":1696297,"src":"Angea,2,7,06_thumb.jpg","galleries_id":113744,"server_id":18,"link":"photo_1696297.html","width":130,"caption":"Angel in the Clouds","height":173});
															thumbnails[1696382] = clik.newPhoto({"id":1696382,"src":"P1020629_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1696382.html","width":130,"caption":"Setting Sun in Magheroarty","height":87});
															thumbnails[1696509] = clik.newPhoto({"id":1696509,"src":"DSCF0135-4_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1696509.html","width":130,"caption":"What are you looking at","height":173});
															thumbnails[1696565] = clik.newPhoto({"id":1696565,"src":"DSCF0010-69_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1696565.html","width":130,"caption":"Sunset in Co Antrim","height":98});
															thumbnails[1696623] = clik.newPhoto({"id":1696623,"src":"P1030280_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1696623.html","width":130,"caption":"Janas Figure","height":173});
															thumbnails[1696644] = clik.newPhoto({"id":1696644,"src":"P1020715_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1696644.html","width":130,"caption":"Poulnabrone Dolman","height":98});
															thumbnails[1700909] = clik.newPhoto({"id":1700909,"src":"P1030999_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1700909.html","width":130,"caption":"Sailing in the Sunset","height":180});
															thumbnails[1701155] = clik.newPhoto({"id":1701155,"src":"P1020992_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1701155.html","width":130,"caption":"Save Tara at Newgrange","height":87});
															thumbnails[1731077] = clik.newPhoto({"id":1731077,"src":"DSCN1419_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1731077.html","width":130,"caption":"Navan Fort sunset","height":81});
															thumbnails[1740197] = clik.newPhoto({"id":1740197,"src":"100_04781_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740197.html","width":130,"caption":"Aoife","height":192});
															thumbnails[1740202] = clik.newPhoto({"id":1740202,"src":"H5 25 6 04_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740202.html","width":130,"caption":"Aonbarr 2","height":172});
															thumbnails[1740203] = clik.newPhoto({"id":1740203,"src":"H6 25 6 04_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740203.html","width":130,"caption":"The hound of cullan","height":173});
															thumbnails[1740204] = clik.newPhoto({"id":1740204,"src":"H9 25 6 04_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740204.html","width":130,"caption":"Celtic Spirit","height":87});
															thumbnails[1740206] = clik.newPhoto({"id":1740206,"src":"H 25 6 04_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740206.html","width":130,"caption":"Aonbarr","height":86});
															thumbnails[1740215] = clik.newPhoto({"id":1740215,"src":"Cat Art, Reflecton_thumb.jpg","galleries_id":116894,"server_id":18,"link":"photo_1740215.html","width":130,"caption":"Reflection","height":90});
															thumbnails[1743979] = clik.newPhoto({"id":1743979,"src":"P1020778_thumb.JPG","galleries_id":114135,"server_id":18,"link":"photo_1743979.html","width":130,"caption":"I'm watching you","height":87});
															thumbnails[1762196] = clik.newPhoto({"id":1762196,"src":"DSCF0016_thumb.JPG","galleries_id":116894,"server_id":18,"link":"photo_1762196.html","width":130,"caption":"The changing of Fionnuala","height":169});
															thumbnails[1767218] = clik.newPhoto({"id":1767218,"src":"DSCF0018_thumb.JPG","galleries_id":116894,"server_id":18,"link":"photo_1767218.html","width":130,"caption":"Cuchullain agus Emer","height":161});
															thumbnails[1767233] = clik.newPhoto({"id":1767233,"src":"DSCF0021_thumb.JPG","galleries_id":116894,"server_id":18,"link":"photo_1767233.html","width":130,"caption":"Turann","height":164});
															thumbnails[1767236] = clik.newPhoto({"id":1767236,"src":"DSCF0017_thumb.JPG","galleries_id":116894,"server_id":18,"link":"photo_1767236.html","width":130,"caption":"Earth mother","height":188});
															thumbnails[1787870] = clik.newPhoto({"id":1787870,"src":"P1020757_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1787870.html","width":130,"caption":"BallyShannon Estury Sunset","height":98});
															thumbnails[1787893] = clik.newPhoto({"id":1787893,"src":"Lough Neagh Sunset_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1787893.html","width":130,"caption":"Kayaking Sunset","height":98});
															thumbnails[1864432] = clik.newPhoto({"id":1864432,"src":"bullrush sunset_thumb.jpg","galleries_id":113744,"server_id":18,"link":"photo_1864432.html","width":130,"caption":"Bullrush Sunset","height":173});
															thumbnails[1864523] = clik.newPhoto({"id":1864523,"src":"Portaferry Castle_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_1864523.html","width":130,"caption":"Portaferry Castle ","height":173});
															thumbnails[1868479] = clik.newPhoto({"id":1868479,"src":"P1050456_thumb.JPG","galleries_id":113744,"server_id":18,"link":"photo_1868479.html","width":130,"caption":"Bannfoot Sunset","height":98});
															thumbnails[1954464] = clik.newPhoto({"id":1954464,"src":"Lisnamintry Rath_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_1954464.html","width":130,"caption":"Lisnamintry Rath","height":87});
															thumbnails[1954476] = clik.newPhoto({"id":1954476,"src":"Lylo Chapel_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_1954476.html","width":130,"caption":"Irish Chapel","height":87});
															thumbnails[1954486] = clik.newPhoto({"id":1954486,"src":"Lylo Celtic Cross_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_1954486.html","width":130,"caption":"Irish Celtic Cross","height":194});
															thumbnails[2058945] = clik.newPhoto({"id":2058945,"src":"irish bog wood 2_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_2058945.html","width":130,"caption":"Irish Bog Wood","height":196});
															thumbnails[3128094] = clik.newPhoto({"id":3128094,"src":"Rock Solid in Time_thumb.jpg","galleries_id":467624,"server_id":18,"link":"photo_3128094.html","width":130,"caption":"Rock Solid in Time","height":90});
															thumbnails[3128097] = clik.newPhoto({"id":3128097,"src":"nendrum castle copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3128097.html","width":130,"caption":"Nendrum Castle ","height":101});
															thumbnails[3128098] = clik.newPhoto({"id":3128098,"src":"Dreamy Sunset copy_thumb.jpg","galleries_id":113744,"server_id":18,"link":"photo_3128098.html","width":130,"caption":"Dreamy Sunset","height":187});
															thumbnails[3128213] = clik.newPhoto({"id":3128213,"src":"Golden Gateway copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3128213.html","width":130,"caption":"Golden Gateway","height":90});
															thumbnails[3128221] = clik.newPhoto({"id":3128221,"src":"Clonlum Cairn copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3128221.html","width":130,"caption":"Clonlum Cairn","height":91});
															thumbnails[3128226] = clik.newPhoto({"id":3128226,"src":"Long forgotten recently remembered_thumb.tif.jpg","galleries_id":114135,"server_id":18,"link":"photo_3128226.html","width":130,"caption":"Long Forgotten Recently Remembered.","height":87});
															thumbnails[3128228] = clik.newPhoto({"id":3128228,"src":"Loughros Bay Ireland_thumb.jpg","galleries_id":467624,"server_id":18,"link":"photo_3128228.html","width":130,"caption":"Loughros Bay Ireland","height":87});
															thumbnails[3128231] = clik.newPhoto({"id":3128231,"src":"Stone circles_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3128231.html","width":130,"caption":"Stone Circles","height":90});
															thumbnails[3221605] = clik.newPhoto({"id":3221605,"src":"View Down the Glen copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3221605.html","width":130,"caption":"A view down the Glen","height":90});
															thumbnails[3358519] = clik.newPhoto({"id":3358519,"src":"faerie tree folklore copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3358519.html","width":130,"caption":"Faerie Tree Folklore","height":187});
															thumbnails[3358533] = clik.newPhoto({"id":3358533,"src":"Seeking the light copy_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_3358533.html","width":130,"caption":"Seeking the light ","height":179});
															thumbnails[5475055] = clik.newPhoto({"id":5475055,"src":"Church_on_time_copy_with_post_spicify_copy-1_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_5475055.html","width":130,"caption":"Get me to the church on Time","height":97});
															thumbnails[7040125] = clik.newPhoto({"id":7040125,"src":"Book_Cover_thumb.jpg","galleries_id":114135,"server_id":18,"link":"photo_7040125.html","width":130,"caption":"Images of Ireland","height":82});
															thumbnails[8894579] = clik.newPhoto({"id":8894579,"src":"Coastal_Blues_thumb.JPG","galleries_id":467624,"server_id":18,"link":"photo_8894579.html","width":160,"caption":"Coastal Blues","height":90});
															thumbnails[8894599] = clik.newPhoto({"id":8894599,"src":"Heavens_Path-1_thumb.jpg","galleries_id":467626,"server_id":18,"link":"photo_8894599.html","width":160,"caption":"Heavens Path","height":106});
															thumbnails[8898122] = clik.newPhoto({"id":8898122,"src":"Creamy_layers_3_thumb.jpg","galleries_id":467624,"server_id":18,"link":"photo_8898122.html","width":160,"caption":"Streeda's Creamy layers","height":90});
															thumbnails[8921195] = clik.newPhoto({"id":8921195,"src":"Beyond-BW_Edit_3_Square_2_thumb.jpg","galleries_id":467627,"server_id":18,"link":"photo_8921195.html","width":160,"caption":"Beyond","height":165});
															thumbnails[8921201] = clik.newPhoto({"id":8921201,"src":"Delusion_thumb.jpg","galleries_id":467627,"server_id":18,"link":"photo_8921201.html","width":160,"caption":"Delusion","height":117});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  							galleries[467627] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"New works","link":"photo_8921195.html","maxRecords":0.0,"photoIDs":[8921195.0,8921201.0],"skipIndex":true,"section_code":"gallery","featured_images":"8921201,8921195","id":467627,"singleSection":false});				  							galleries[113744] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Irish Sunrise's and Sunset's","link":"photo_1696098.html","maxRecords":0.0,"photoIDs":[1696098.0,1696297.0,1696565.0,1700909.0,1701155.0,1787870.0,1787893.0,1864432.0,1868479.0,3128098.0],"skipIndex":true,"section_code":"gallery","featured_images":3128098.0,"id":113744,"singleSection":false});				  							galleries[467626] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Glorious Mountain Views","link":"photo_8894599.html","maxRecords":0.0,"photoIDs":[8894599.0],"skipIndex":true,"section_code":"gallery","featured_images":8894599.0,"id":467626,"singleSection":false});				  							galleries[467624] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Coastline and Seashore","link":"photo_3128094.html","maxRecords":0.0,"photoIDs":[3128094.0,3128228.0,8894579.0,8898122.0],"skipIndex":true,"section_code":"gallery","featured_images":"3128228,3128094","id":467624,"singleSection":false});				  							galleries[114135] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Images of Ireland","link":"photo_1687438.html","maxRecords":0.0,"photoIDs":[1687438.0,1687476.0,1687499.0,1687529.0,1696161.0,1696382.0,1696509.0,1696623.0,1696644.0,1731077.0,1743979.0,1864523.0,1954464.0,1954476.0,1954486.0,2058945.0,3128097.0,3128213.0,3128221.0,3128226.0,3128231.0,3221605.0,3358519.0,3358533.0,5475055.0,7040125.0],"skipIndex":true,"section_code":"gallery","featured_images":"7040125,5475055,3358533,3358519,3221605,3128231,3128226,3128221,3128213,3128097,2058945,1954464","id":114135,"singleSection":false});				  							galleries[116894] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Cat Art   Celtic Glass Art ","link":"photo_1740197.html","maxRecords":0.0,"photoIDs":[1740197.0,1740202.0,1740203.0,1740204.0,1740206.0,1740215.0,1762196.0,1767218.0,1767233.0,1767236.0],"skipIndex":true,"section_code":"gallery","featured_images":"1767236,1767233,1767218,1762196,1740215,1740206,1740204,1740203,1740202,1740197","id":116894,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '3358533,3358519,3221605,3128231,3128228,3128221,3128094,2058945,1954486,1954476,1954464,1864523,1762196';
imageSets[2] = '7040125,5475055,3358533,3358519,3221605,3128231,3128228,3128226,3128221,3128213,3128098,3128097,3128094,2058945,1954464';
imageSets[3] = '8921201,8921195,7040125,5475055,3358533,3358519,3221605,3128231,3128228,3128226,3128221,3128213,3128098,3128097,3128094,2058945,1954486,1954476,1954464,1868479,1864523,1864432,1787893,1787870,1767236,1767233,1767218,1762196,1743979,1740215,1740206,1740204,1740203,1740202,1740197,1731077,1701155,1700909,1696644,1696623,1696565,1696509,1696382,1696297,1696161,1696098,1687529,1687499,1687476,1687438';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/kimbo1967/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/kimbo1967/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 = 'DoubleVision Images: ' + 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="KIMBO1967">';
			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;
	}
}

			

