// -----------------------------------------------------------------------------------// // This page coded by Scott Upton// http://www.uptonic.com | http://www.couloir.org//// This work is licensed under a Creative Commons License// Attribution-ShareAlike 2.0// http://creativecommons.org/licenses/by-sa/2.0///// Associated APIs copyright their respective owners//// -----------------------------------------------------------------------------------// --- version date: 11/28/05 --------------------------------------------------------// get current photo id from URLvar thisURL = document.location.href;var splitURL = thisURL.split("#");var photoId = splitURL[1] - 1;// if no photoId supplied then set defaultvar photoId = (!photoId)? 0 : photoId;// CSS border size x 2var borderSize = 10;// Photo directory for this galleryvar photoDir = "photos/01/";// Define each photo's name, height, width, and captionvar photoArray = new Array(	// Source, Width, Height, Caption	new Array("1.jpg", "680", "281", "Rogers Hotel (now the Bay View) as it was c.1904.  The post-office is visible to the left of the porch.  McGarrigle&rsquo;s shop is to the right, at the end of the row.  The two boats are the Horn Head and the St Patrick.<br /><br />Bay View Hotel and Harbour area 1995.  Reclaimed ground covers the old slip and foreshore, while a fish factory to the right has changed the scene dramatically."),	new Array("2.jpg", "680", "281", "View of Town from Terence&rsquo;s Turn, c.1890.  The carpet factory (1900) is not yet in existence.  The complete New Row can be seen as it is not screened by any other building from this position.  To the left of the trees beyond the jetty a single-storey house occupies the site where the Ulster Bank now stands, while the place where the Foresters Hall is to be built, below the gable of the school on the hill, is still vacant.<br /><br />Same View of Town from Terence&rsquo;s Turn c.1995.  Because of the growth of foliage it is not possible to record this scene from the same position as in 1890.  The carpet factory has come and gone.  Having produced hand-made carpets of the highest quality for great houses, parliament buildings, castles all over the world and liners like the Queen Mary and the Queen Elizabeth, it was overtaken by mechanisation in the 1980&rsquo;s and had to close down.  However, recently an effort has been made to renew the making of the same type of carpet, albeit in a smaller way.  The fluid control factory was built in 1993."),		new Array("3.jpg", "680", "281", "View from Site of &lsquo;Wavecrest&rsquo;, c.1907. &lsquo;Wavecrest&rsquo; was built in 1923 by Patrick McGuinness, who was generally known as &lsquo;Singapore&rsquo; because he had worked there in the colonial service until his retirement to Killybegs.  Dr Michael O&rsquo;Boyle, the local GP, lived in this house from about 1945 until his death a few years ago.  It is now the residence of his daughter, Mrs Terri Tully.  The rock in the foreground was known as &lsquo;Rosie&rsquo;s Rock&rsquo;; Rosie was a local lady who sat here quite a lot and did her knitting and crochet in the open air.<br /><br />View from Site of &lsquo;Wavecrest&rsquo;, c.1996. How many thousands of tons of filling did it take to transfom the 1907 landscape into that of 1996?  The old quay, the slip and the sea wall have vanished; a car park and factories have appeared in their place.  The Shore Road and promenade have changed the face of the town.  Apart from easing the flow of heavy traffic through the narrow streets it is now a safe and pleasant place to take a walk."),	new Array("4.jpg", "680", "281", "The Diamond from the West, c.1904.  The Bay View Hotel, on the left, housed the post-office (seen at the edge of the picture), take note of the porch to the front which sported a door on either side, the passerby tended to walk through each door rather than taking the &lsquo;long way around&rsquo;. The large building in the middle distance in Gannons Hotel.  Next to it, on the left, was the grocery shop owned by Mag, Ellie and Patrick Conwell.  The two thatched cottages belonged to Hughie O&rsquo;Donnell (left) and Mary Gillespie (right).  In the shop just beyond where the young boy is standing, John McGarrigle carried on a business as a grocer and dealer in sundries.  Parked side-cars partially hide the &lsquo;Triangle&rsquo;, a structure designed to support the weighing scales which were used on market days, held every Wednesday.<br /><br />The Diamond from the West, 1997. The old Bay View has disappeared and been replaced by a grand new structure built in 1992. A caf&eacute; has been built on the site of the cottages. McGarrigle&rsquo;s has had a varied history. Some time following its closure by John McGarrigle, Mrs John Joe Rodgers took it over as a drapery business. Then it became a grocery shop, the owner being Vincent Mallon. Today it is a butcher&rsquo;s premises; the proprietor is David Ainsworth."),	new Array("5.jpg", "680", "281", "Ulster Bank, c.1900. The Ulster Bank opened at the turn of the century.  On the right, enclosed by the railings, is what was known as Dodd&rsquo;s Garden.  The Coffee House, which was actually a bandstand, is situated at the edge of the picture; at that time a brass band existed in the town and we can imagine recitals being given here to entertain people on warm summer evenings.  The ivy-covered White House in the distanced, with its high walls, was the residence of the local landlord&rsquo;s agent.<br /><br />Ulster Bank, 1995.  An extension was added to the bank in 1989.  A licenced premises, the Pier Bar, has long since been built on the site of Dodd&rsquo;s Garden.  There is now no sign of the &lsquo;White House which was demolished in 1983 to make way for road widening.  Today, the Pier Bar no longer exists, this site is now the location of the Tara Hotel."),	new Array("6.jpg", "680", "281", "Railway Station, c.1900. The beautiful cut-stone station building was erected about 1893.  The railway revolutionised the lives of the people of Killbegs and surrounding district.  Up until then the only means of mass travel was in a horse-drawn open car moving over rough roads, exposed to all kinds of weather.  When the railway arrived how exciting and novel it must have been to sit in comparative luxury in an enclosed carriage.  Trains could carry 100 tons of goods at 20 miles an hour or more instead of the horse-and-cart rate of one ton at four miles an hour.  The railway survived until 1959 when it succumbed to the competition of road transport.<br /><br />Site of the Railway Station, 1996. The only landmarks recognisable from the previous picture are the contour of the hills and the white house in the distance; the station and its surroundings completely disappeared during the 1970&rsquo;s.  Another new pier has been constructed and on it is the building which houses the fish-sales office and the Harbour Master&rsquo;s office."),		new Array("7.jpg", "680", "281", "Station Yard, 1930&rsquo;s. This picture was taken from the station platform.  The metal pipe on the upper right side led from the water reservoir; attached to its end was a movable canvas conduit through which water was directed into the tanks of the engines before they began their journeys.  A railway-bus of the type which came into service in 1931 is on the turn-table, ready to move off.  Open and covered wagons sit near the goods shed to be loaded or unloaded.  On the left is the oil depot where the local oil lorry was replenished before departing to supply petrol to the surrounding area.<br /><br />Station Yard, July 1998. No sign of the Station has survived; it is as if had never existed. A new road replaces the rails and the cars are in abundance instead of wagons. Two features can be recognised. The house in the distance on the left edge of the picture isWavecrest.  The second, at the right edge, is the roof and dormer windows of McGinley&rsquo;s shop.")	);// Number of photos in this galleryvar photoNum = photoArray.length;/*--------------------------------------------------------------------------*/// Additional methods for Element added by SU, CouloirObject.extend(Element, {	getWidth: function(element) {   	element = $(element);   	return element.offsetWidth; 	},	setWidth: function(element,w) {   	element = $(element);    	element.style.width = w +"px";	},	setHeight: function(element,h) {   	element = $(element);    	element.style.height = h +"px";	},	setSrc: function(element,src) {    	element = $(element);    	element.src = src; 	},	setHref: function(element,href) {    	element = $(element);    	element.href = href; 	},	setInnerHTML: function(element,content) {		element = $(element);		element.innerHTML = content;	}});/*--------------------------------------------------------------------------*/var Slideshow = Class.create();Slideshow.prototype = {	initialize: function(photoId) {		this.photoId = photoId;		this.photo = 'Photo';		this.photoBox = 'Container';		this.prevLink = 'PrevLink';		this.nextLink = 'NextLink';		this.captionBox = 'CaptionContainer';		this.caption = 'Caption';		this.counter = 'Counter';		this.loader = 'Loading';	},	getCurrentSize: function() {		// Get current height and width, subtracting CSS border size		this.wCur = Element.getWidth(this.photoBox) - borderSize;		this.hCur = Element.getHeight(this.photoBox) - borderSize;	},	getNewSize: function() {		// Get current height and width		this.wNew = photoArray[photoId][1];		this.hNew = photoArray[photoId][2];	},	getScaleFactor: function() {		this.getCurrentSize();		this.getNewSize();		// Scalars based on change from old to new		this.xScale = (this.wNew / this.wCur) * 100;		this.yScale = (this.hNew / this.hCur) * 100;	},	setNewPhotoParams: function() {		// Set source of new image		Element.setSrc(this.photo,photoDir + photoArray[photoId][0]);		// Set anchor for bookmarking		Element.setHref(this.prevLink, "#" + (photoId+1));		Element.setHref(this.nextLink, "#" + (photoId+1));	},	setPhotoCaption: function() {		// Add caption from gallery array		Element.setInnerHTML(this.caption,photoArray[photoId][3]);		Element.setInnerHTML(this.counter,((photoId+1)+'/'+photoNum));	},	resizePhotoBox: function() {		this.getScaleFactor();		new Effect.Scale(this.photoBox, this.yScale, {scaleX: false, duration: 0.3, queue: 'front'});		new Effect.Scale(this.photoBox, this.xScale, {scaleY: false, delay: 0.5, duration: 0.3});		// Dynamically resize caption box as well		Element.setWidth(this.captionBox,this.wNew-(-borderSize));	},	showPhoto: function(){		new Effect.Fade(this.loader, {delay: 0.5, duration: 0.3});		// Workaround for problems calling object method "afterFinish"		new Effect.Appear(this.photo, {duration: 0.5, queue: 'end', afterFinish: function(){Element.show('CaptionContainer');Element.show('PrevLink');Element.show('NextLink');}});	},	nextPhoto: function(){		// Figure out which photo is next		(photoId == (photoArray.length - 1)) ? photoId = 0 : photoId++;		this.initSwap();	},	prevPhoto: function(){		// Figure out which photo is previous		(photoId == 0) ? photoId = photoArray.length - 1 : photoId--;		this.initSwap();	},	initSwap: function() {		// Begin by hiding main elements		Element.show(this.loader);		Element.hide(this.photo);		Element.hide(this.captionBox);		Element.hide(this.prevLink);		Element.hide(this.nextLink);		// Set new dimensions and source, then resize		this.setNewPhotoParams();		this.resizePhotoBox();		this.setPhotoCaption();	}}/*--------------------------------------------------------------------------*/// Establish CSS-driven events via Behaviour scriptvar myrules = {	'#Photo' : function(element){		element.onload = function(){			var myPhoto = new Slideshow(photoId);			myPhoto.showPhoto();		}	},	'#PrevLink' : function(element){		element.onmouseover = function(){			soundManager.play('beep');		}		element.onclick = function(){			var myPhoto = new Slideshow(photoId);			myPhoto.prevPhoto();			soundManager.play('select');		}	},	'#NextLink' : function(element){		element.onmouseover = function(){			soundManager.play('beep');		}		element.onclick = function(){			var myPhoto = new Slideshow(photoId);			myPhoto.nextPhoto();			soundManager.play('select');		}	},	a : function(element){		element.onfocus = function(){			this.blur();		}	}};// Add window.onload event to initializeBehaviour.addLoadEvent(init);Behaviour.apply();function init() {	var myPhoto = new Slideshow(photoId);	myPhoto.initSwap();	soundManagerInit();}