g_fPlayMode = 0;
g_iimg = 0;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}

function Update(){
document.all._Ath_Slide.src = g_ImageTable[g_iimg][0];
document.all._Ath_FileName.innerHTML = g_ImageTable[g_iimg][1];
document.all._Ath_Img_X.innerHTML = g_iimg + 1;
document.all._Ath_Img_N.innerHTML = g_imax;
}


function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
btnPrev.disabled = btnNext.disabled = true;
Next();
}
else 
{
btnPrev.disabled = btnNext.disabled = false;

}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}
function Tick() 
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}
function main()
{

Update();
}

////configure below variables/////////////////////////////

//configure the below images and description to your own. 
g_ImageTable[g_imax++] = new Array ("gfx/tour/cathcartston.jpg", "<B>Cathcartston Centre</B><BR><BR>This building was constructed in 1744, probably as weavers' cottages, when the weaving trade occupied a large part of the village's population. In 1985 it was refurbished as a museum and heritage centre.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/square.jpg", "<B>The Square</B><BR><BR>As we approach the Square.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/doontavern.jpg", "<B>Doon Tavern</B><BR><BR>This was originally the Royal Bank built in the 19th Century. You can see how the height of the road has changed as the front step is below the level of the road.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/dalinn.jpg", "<B>Dalmellington Inn</B><BR><BR>Formerly the Railway Hotel, the Inn occupies ground occupied by one of the town's two wool-spinning mills in the late 18th/early 19th Century. If you look inside, it still has the original low ceilings.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/castlehouse.jpg", "<B>Ye Olde Castle House</B><BR><BR>is on the site of an earlier house that was said to have been built of masonry taken from the legendary Dame Helen's Castle. There is also claimed to be a stone dated from 1003.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/blackbull.jpg", "<B>Black Bull</B><BR><BR>The date 1895 on the façade refers to the date the hotel was remodelled. It is much older than this and was a coaching inn offering a stopping place for coaches travelling between Ayr and Dumfries.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/midton.jpg", "<B>Midton</B><BR><BR>Midton is one of the oldest surviving houses in the town. It was formerly a steading with stables and a byre behind. The date 1744 is inscribed on one of the outbuildings, but the house is much older than this. Beside the front door is a carving depicting a mason's tools. It is constructed of granite with stone infill.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/mcadam.jpg", "<B>Old graveyard</B><BR><BR>The old graveyard originated in pre-Reformation times and the original parish church stood nearby. The oldest surviving headstone is dated 1662. There are memorials to Dalmellington's blacksmith-poet Robert Hetrick, philanthropist John Gaa and local Covenanters. The large structure in the middle is the mausoleum of the McAdam family, who for many generations were the principal landowners in the area.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/hettrick.jpg", "<B>Robert Hetrick</B><BR><BR>Robert Hetrick (the name is variously spelled) was born in 1769 and began his working life as a weaver before turning to the trade of blacksmith. He wrote verses on local lairds and lassies, politics and nature. His notebooks contain lines of poetry or passing thoughts intermingled with his blacksmith's accounts and sketches. Although his poems are not of a high standard they give the flavour of his time. Poems and Songs of Robert Hetrick, his only book, was published in Ayr in 1826 and was reprinted in 1898. He died in 1849.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/johngaa.jpg", "<B>The headstone of John Gaa</B><BR><BR>John Gaa was born near Dalmellington in 1757 and in adult life owned a draper's shop in the town. He was self-educated and a great lover of books. As he prospered he acquired a good deal of property in the town and died rich in 1834. Having no children, he left his estate for charitable purposes. In his Will he directed that a Reading Room and Library be established, with his own collection of books and journals providing its foundation. The Reading Room was the town library until the local authority assumed responsibility for this service in the 20th century.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/covenanter.jpg", "<B>Covenanter Memorial</B><BR><BR>(in old graveyard) This was erected in 1929 and is dedicated to the people of these parts who upheld the Presbyterian faith in a time of persecution and bloodshed.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/townhead.jpg", "<B>Gas Brae</B><BR><BR>Officially 'Townhead', but to all townspeople this is the Gas Brae. It takes its name from a gas works that stood at the top in times past. This was once the main road into the town from the south ( ... and if you take the time 'to stand and stare' you can imagine the pack horses bringing goods from Dumfries to the people of the village.) The road was originally lined with small thatched cottages like the one at the top ... original, that is, except for its slated roof. Turn left at the top into Castle Croft and left again for the Motte ...");
g_ImageTable[g_imax++] = new Array ("gfx/tour/Dal_Mote.jpg", "<B>Motte</B><BR><BR>Originally Mottes were fortified sites on which timber castles would sit. Wooden castles preceded stone-built castles such as Doon Castle and date back to the Anglo-Norman period around the late 11th and early 12th centuries. The Dalmellington Mote has now been classed as an Ancient Monument which will aid its preservation. Round the Motte is a path which leads to the New Road, the B7013. Cross the road and take the Hospital Footbridge.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/hospital.jpg", "<B>Hospital</B><BR><BR>On the other side of the bridge is a small house which was the original hospital. The route from here goes up The Path to Church Hill.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/churchhall.jpg", "<B>Church Hall</B><BR><BR>The church hall was originally Dalmellington's second parish church and was built in 1766 to replace the ancient pre-Reformation church (which stood near the present library). The new church was built by James Armour, mason, of Mauchline. It was not popular with the congregation as it was cold and too small. When it was replaced in 1846 by the church at the top of the hill it became a lodging house. Towards the end of the 19th century it was refurbished as a hall.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/corbie.jpg", "<B>Corbie</B><BR><BR>To the right of the Hall, up the hill, can be seen a stone built house with fine examples of Corbie (or crow) stepped gables.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/parishchurch.jpg", "<B>Parish Church</B><BR><BR>Overlooking the town is the Parish Church (Formerly the Kirk o' the Covenant). It was built in 1846 and made use of local Dunaskin sandstone. It has some excellent examples of stained glass. The red doors are said to symbolise the blood of the Covenanters. Walking down the road towards the Square, you will pass on your left ...");
g_ImageTable[g_imax++] = new Array ("gfx/tour/merrickhall.jpg", "<B>Merrick Hall</B><BR><BR>This was a popular setting for dances and other entertainments until the 1950s, when it was superseded by the Community Centre on Ayr Road. Turning right you will see on your left ...");
g_ImageTable[g_imax++] = new Array ("gfx/tour/bandhall.jpg", "<B>The Old Band Hall</B><BR><BR>Dalmellington Band have a new hall, but the original was built in the early 1800s as a stable and brew house for a local inn. Since 1946 until 2003 it was home to the famous Dalmellington Silver Band, who used the upper floor as a bandroom. It has the last cobbled yard left in the town. Further along on your right ...");
g_ImageTable[g_imax++] = new Array ("gfx/tour/scouthall.jpg", "<B>Scout Hall</B><BR><BR>Now home to the 33rd Ayrshire Scouts, the hall was originally the Lamloch Church (Free Church). It opened in 1851, replacing an earlier and smaller church on the Dalmellington-Carsphairn Road.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/eglintonhotel.jpg", "<B>Eglinton Hotel</B><BR><BR>This hotel was built in the mid 19th century to capitalize on the growing tourist trade that followed the opening of the railway station just across the road. On the façade you will notice there is the symbol of the Cyclists' Touring Club.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/cyclelogo.jpg", "<B>Cycle Logo</B><BR><BR>In the days when cycling was a mass movement the CTC gave these as a seal of approval to hostelries offering good accommodation and service to cyclists.  Going down to the end of the road and turn right....");
g_ImageTable[g_imax++] = new Array ("gfx/tour/policeplaque.jpg", "<B>Old Police Station</B><BR><BR>In the Second World War it was the headquarters of the local Home Guard unit. It is now a private home, but above the door can be seen quite clearly this sandstone plaque. Return up into Dalmellington, past Main Street keeping on the A713 you will see... ");
g_ImageTable[g_imax++] = new Array ("gfx/tour/warmemorial.jpg", "<B>War Memorial</B><BR><BR>Dedicated in 1922, the War Memorial commemorates men of the town who fell in the 1914-18 war. Further names were added after the Second World War.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/minersmem.jpg", "<B>Miners' Memorial</B><BR><BR>The memorial to the mineworkers of the Doon Valley was dedicated on Saturday 30th March 1996.");
g_ImageTable[g_imax++] = new Array ("gfx/tour/Stanley_Sarsfield.jpg", "<B>Stanley Sarsfield</B><BR><BR>Town trail originally prepared by Stanley Sarsfield, Museum Officer, East Ayrshire Council.");
//extend the above list as desired
g_dwTimeOutSec=2

////End configuration/////////////////////////////



window.onload=Play
