window.thumbnails = {};
															thumbnails[1908915] = clik.newPhoto({"id":1908915,"src":"Loughcrew Web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Loughcrew burial tombs","height":100});
															thumbnails[5575156] = clik.newPhoto({"id":5575156,"src":"Dangan_Castle_Tree_for_web_colour_corrected2_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":102,"caption":"Lith Print","height":130});
															thumbnails[5590677] = clik.newPhoto({"id":5590677,"src":"Puffin_for_web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":118,"caption":"Puffin","height":130});
															thumbnails[5697181] = clik.newPhoto({"id":5697181,"src":"St_Oliver_Plunketts_House_Web_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":130,"caption":"Sepia Toned Print","height":102});
															thumbnails[1909920] = clik.newPhoto({"id":1909920,"src":"River Boyne & Tree Web600wide_thumb.jpg","galleries_id":"","server_id":1,"link":"#","width":100,"caption":"River Boyne","height":130});
															thumbnails[1908926] = clik.newPhoto({"id":1908926,"src":"Carrickdexter Web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_1908926.html","width":130,"caption":"Carrickdexter Castle","height":146});
															thumbnails[7433894] = clik.newPhoto({"id":7433894,"src":"Pantheon_for_web__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7433894.html","width":102,"caption":"Pantheon, Rome","height":130});
															thumbnails[2318279] = clik.newPhoto({"id":2318279,"src":"River Boyne & Tree2_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2318279.html","width":101,"caption":"River Boyne","height":130});
															thumbnails[7436965] = clik.newPhoto({"id":7436965,"src":"Bettystown_for_web_colour_correctedborder_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7436965.html","width":107,"caption":"Sand Dunes","height":130});
															thumbnails[7437090] = clik.newPhoto({"id":7437090,"src":"Dangan_Castle_Tree_for_web_colour_corrected2_492709C0-1EC9-D45B-1C20927BC33D31A4_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7437090.html","width":102,"caption":"Tree #1","height":130});
															thumbnails[1908936] = clik.newPhoto({"id":1908936,"src":"St_thumb. Oliver Plunkett's Church (untoned) Web.jpg","galleries_id":128352,"server_id":1,"link":"photo_1908936.html","width":130,"caption":"St. Oliver Plunkett's Family Church","height":102});
															thumbnails[7433874] = clik.newPhoto({"id":7433874,"src":"Omeath_Tree_CC_for_web__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7433874.html","width":105,"caption":"Tree #2","height":130});
															thumbnails[2308549] = clik.newPhoto({"id":2308549,"src":"Loughcrew 2_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2308549.html","width":130,"caption":"Loughcrew","height":101});
															thumbnails[7437119] = clik.newPhoto({"id":7437119,"src":"Colosseum_for_web__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7437119.html","width":101,"caption":"Colosseum, Rome","height":130});
															thumbnails[5915634] = clik.newPhoto({"id":5915634,"src":"Moylagh_Castle_for_web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_5915634.html","width":130,"caption":"Moylagh Castle","height":102});
															thumbnails[7742588] = clik.newPhoto({"id":7742588,"src":"Glacier_Norway_for_web_CC__border1_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7742588.html","width":104,"caption":"Briksdalsbreen Glacier, Norway","height":130});
															thumbnails[5934461] = clik.newPhoto({"id":5934461,"src":"Dangan_Castle_for_web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_5934461.html","width":130,"caption":"Dangan Castle","height":100});
															thumbnails[7437149] = clik.newPhoto({"id":7437149,"src":"Cloghleagh_for_web2_CC_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7437149.html","width":106,"caption":"Cloghleagh, Wicklow","height":130});
															thumbnails[2318298] = clik.newPhoto({"id":2318298,"src":"Yellow Steeple (Rollei)_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2318298.html","width":130,"caption":"Yellow Steeple, Trim","height":101});
															thumbnails[7433897] = clik.newPhoto({"id":7433897,"src":"Petra_Pillars_Nature_for_web__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7433897.html","width":112,"caption":"Roman Pillars, Petra, Jordan","height":130});
															thumbnails[2318926] = clik.newPhoto({"id":2318926,"src":"Tremblestown_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2318926.html","width":130,"caption":"Trimblestown Castle","height":101});
															thumbnails[7741806] = clik.newPhoto({"id":7741806,"src":"Slovenia_Waterfall_for_web_CC__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7741806.html","width":90,"caption":"Savica, Slovenia","height":130});
															thumbnails[2836624] = clik.newPhoto({"id":2836624,"src":"Bective Abbey for web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2836624.html","width":130,"caption":"Bective Abbey","height":95});
															thumbnails[7498894] = clik.newPhoto({"id":7498894,"src":"Renaisance_Tomb_Petra_v1.2_for_web__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7498894.html","width":106,"caption":"Renaisance Tomb, Petra, Jordan","height":130});
															thumbnails[5936198] = clik.newPhoto({"id":5936198,"src":"LoughcrewB_for_web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_5936198.html","width":130,"caption":"Loughcrew","height":101});
															thumbnails[7741824] = clik.newPhoto({"id":7741824,"src":"Door_Ljubljana_for_web_CC__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7741824.html","width":106,"caption":"Door, Ljubljana","height":130});
															thumbnails[5936299] = clik.newPhoto({"id":5936299,"src":"Tara_for_web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_5936299.html","width":130,"caption":"Hill of Tara","height":101});
															thumbnails[7436962] = clik.newPhoto({"id":7436962,"src":"Carlingford_Boat_for_webborder_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7436962.html","width":106,"caption":"Old Boat","height":130});
															thumbnails[2308575] = clik.newPhoto({"id":2308575,"src":"White Water on the Boyne_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2308575.html","width":130,"caption":"White Water on the Boyne","height":101});
															thumbnails[7437101] = clik.newPhoto({"id":7437101,"src":"Donegal_Rocks_1border_for_web_contrast_adjusted_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7437101.html","width":130,"caption":"Rocks, Donegal","height":105});
															thumbnails[2160816] = clik.newPhoto({"id":2160816,"src":"Fairy-Ring1200Easythumbs_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_2160816.html","width":130,"caption":"Fairy Ring","height":86});
															thumbnails[7741939] = clik.newPhoto({"id":7741939,"src":"Machu_Picchu_for_web_CC__border_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7741939.html","width":130,"caption":"Machu Picchu, Peru","height":101});
															thumbnails[7852874] = clik.newPhoto({"id":7852874,"src":"Copper_Coast_IR__border_for_web_thumb.jpg","galleries_id":128352,"server_id":1,"link":"photo_7852874.html","width":130,"caption":"Copper Coast, Waterford","height":89});
															thumbnails[7852859] = clik.newPhoto({"id":7852859,"src":"Water_Mill_Alaska_Unibrom__border_for_web_thumb.jpg","galleries_id":403010,"server_id":1,"link":"photo_7852859.html","width":130,"caption":"Water Mill, Alaska","height":104});

/***************************************************************************
* Create the array of Gallery objects                                      *
***************************************************************************/
var galleries = new Object();
				  						galleries[128352] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"B&W Gallery","link":"section167410_128352.html","maxRecords":0.0,"photoIDs":[1908926.0,2318279.0,1908936.0,2308549.0,5915634.0,5934461.0,2318298.0,2318926.0,2836624.0,5936198.0,5936299.0,2308575.0,2160816.0,7852874.0],"skipIndex":0,"section_code":"section167410","featured_images":"7852874,5936299,5936198,5934461,5915634,2836624,2318926,2318298,2318279,2308575","id":128352,"singleSection":false});				  						galleries[403010] = clik.newGallery({"parentGallery":"","usePopups":false,"title":"Lith Gallery","link":"section167410_403010.html","maxRecords":0.0,"photoIDs":[7433894.0,7436965.0,7437090.0,7433874.0,7437119.0,7742588.0,7437149.0,7433897.0,7741806.0,7498894.0,7741824.0,7436962.0,7437101.0,7741939.0,7852859.0],"skipIndex":0,"section_code":"section167410","featured_images":"7852859,7742588,7741939,7741824,7741806,7498894,7437149,7437119,7437101,7437090","id":403010,"singleSection":false});/***************************************************************************
* Create the array of image sets                                           *
***************************************************************************/
var imageSets = {};
imageSets[1] = '1908926,2318279,1908936,2318298,2836624,2308575,2160816';
imageSets[3] = '7852874,7852859,7742588,7741939,7741824,7741806,7498894,7437149,7437119,7437101,7437090,7436965,7436962,7433897,7433894,7433874,5936299,5936198,5934461,5915634,5697181,5590677,5575156,2836624,2318926,2318298,2318279,2308575,2308549,2160816,1909920,1908936,1908926,1908915';
 /***************************************************************************
* Get a server path given an ID                                            *
***************************************************************************/
function getServerPath(server_id) {
	var val = -1;
		switch (server_id) {
		case 51:
		val = 'http://www12.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 0:
		val = 'http://www.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 1:
		val = 'http://www1.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 2:
		val = 'http://admin.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 24:
		val = 'http://tpc15/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 4:
		val = 'http://clikchurch.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 5:
		val = 'http://www2.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 22:
		val = 'http://tpc5/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 23:
		val = 'http://tpc10/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 25:
		val = 'http://tpc16/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 26:
		val = 'http://tpc20/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 40:
		val = 'http://www11.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 42:
		val = 'db2.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 15:
		val = 'http://www3.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 18:
		val = 'http://www4.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 19:
		val = 'http://www5.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 31:
		val = 'http://www7.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 32:
		val = 'http://www8.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 34:
		val = 'http://www9.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 35:
		val = 'http://admin3.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 37:
		val = 'http://admin4.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 38:
		val = 'http://admin5.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 39:
		val = 'http://www10.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 53:
		val = 'http://images.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 52:
		val = 'http://tpc22/clikpic/thefizz/images';
		break;
	}
		switch (server_id) {
		case 21:
		val = 'http://www6.clikpic.com/thefizz/images';
		break;
	}
		switch (server_id) {
		case 50:
		val = '[cliktext value=article.servers_id type=servers_id]/thefizz/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 += 'section167410.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 && 'section167410' != '') {
					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 = 'Monochrome Meath: ' + 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.item_price !== '') {
			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;
	}
}

			

