urls = new Array(
 "stgregory/stgregory.html",
 "northfield/northfield.html",
 "libkirk/libkirk.html",
 "klm/klm.html",
 "stcatherine/stcatherine.html",
 "gilmerton/gilmerton.html",
 "stjohnv/stjohnv.html",
 "stbarnabas/stbarnabas.html",
 "tron/tron.html"
)

pics = new Array(
 "pics/StGregory.jpg",
 "pics/Northfield.jpg",
 "pics/LibertonKirk.jpg",
 "pics/KLM.jpg",
 "pics/StCatherines.jpg",
 "pics/Gilmerton.jpg",
 "pics/StJohnV.jpg",
 "pics/StBarnabas.jpg",
 "pics/Tron.jpg"
)

captions = new Array(
"St. Gregory's RC",
"Liberton Northfield C of S",
"Liberton Kirk C of S",
"Kaimes Lockhart Memorial C of S",
"St. Catherine's RC",
"Gilmerton C of S",
"St. John Vianney RC",
"St. Barnabas, Scottish Episcopal",
"Tron Kirk"
)

addresses = new Array(
"Walter Scott Avenue",
"Gilmerton Road",
"Kirkgate",
"Gracemount Drive",
"Gracemount Drive",
"43 Ravenscroft Street",
"40 Fernieside Gardens",
"Moredun Park View",
"Craigour Gardens (off Craigour Drive)"
)

function showPicture(n)
{
  var img = document.getElementById("img-viewer")
  img.src = pics[n]
  var caption = document.getElementById("caption")
  caption.lastChild.nodeValue=captions[n]
  var addr = document.getElementById("address")
  addr.lastChild.nodeValue=addresses[n]
}

var detailsWindow;

function showDetails(n)
{
    if ( detailsWindow && !detailsWindow.closed )
    {
       detailsWindow.close()
    }
    detailsWindow = window.open(urls[n], 'details', 'toolbar=no,location=no,scrollbars=no,width=600,height=450,left=200,top=200' )
}

function openWindow(url)
{
  newWin = window.open(url)
}
