// Set up the image files to be used.
var theImages = new Array()
var theAlts = new Array()
// To add more image files, continue with the
// pattern below, adding to the array.
 
theImages[0] = './Images/NHEheaderbar1.jpg'
theImages[1] = './Images/NHEheaderbar2.jpg'
theImages[2] = './Images/NHEheaderbar3.jpg'
theImages[3] = './Images/NHEheaderbar4.jpg'
theImages[4] = './Images/NHEheaderbar5.jpg'
theImages[5] = './Images/NHEheaderbar6.jpg'
theImages[6] = './Images/NHEheaderbar7.jpg'
theImages[7] = './Images/NHEheaderbar8.jpg'
theImages[8] = './Images/NHEheaderbar9.jpg'
theImages[9] = './Images/NHEheaderbar10.jpg'
 
theAlts[0] = 'left to right: excavations on the site of the Millennium Library, Norwich (NHER 26437), aerial photograph of Overstrand, Iron Age boar figurine from Ashmanhaugh (NHER 36335), aerial photograph of Horsford castle (NHER 8001) and Cley windmill (NHER 12388).'
theAlts[1] = 'left to right: Clippesby mill (NHER 8605), Thwaite church (NHER 6716), a Mesolithic axehead from Beeston St Andrew (NHER 8140), Homersfield bridge (NHER 24371) and Binham priory (NHER 2081).'
theAlts[2] = 'left to right: a Roman military buckle from Ashill (NHER 8712), detail of the decorated rood screen at St Michael&#39;s Church, Barton Turf (NHER 8304), a Roman brooch from Beachamwell (NHER 31126), Baconsthorpe castle (NHER 6561) and St Michael&#39;s Church, Mintlyn (NHER 3410).'
theAlts[3] = 'left to right: Roman ring from Brancaster (NHER 1001), All Saints&#39; Church, Bawdeswell (NHER 7216), a medieval suspension plate from Aylmerton (NHER 31934), aerial photograph of Baconsthorpe castle (NHER 6561) and an AA box at Brancaster (NHER 33409).'
theAlts[4] = 'left to right: Brereton family memorial, Briningham (NHER 3239), aerial photograph of Binham,  Late Saxon belt fitting from Barnham Broom (NHER 25723), an aerial photograph of St Mary&#39;s Augustian priory, Beeston Regis (NHER 6349) and excavation of a Roman kiln at Brockdish (NHER 30591).'
theAlts[5] = 'left to right: a Roman flagon from Burnham Thorpe (NHER 13771), looking for archaeological objects during fieldwalking, a 15th century alabaster figurine from  Burgh Apton (NHER 10438), a Cold War underground bunker in Beetley (NHER 19367) and St Mary&#39;s Church, Burgh St Peter (NHER 10746).'
theAlts[6] = 'left to right: a World War Two Alan Williams turret, Cley-next-the-Sea (NHER 24183), a World War Two pillbox, Brancaster (NHER 15653), a Roman mount from Besthorpe (NHER 29171), aerial photograph of Arminghall henge (NHER 6100) and St Mary&#39;s Church, Bylaugh (NHER 3100).'
theAlts[7] = 'left to right: bronze Age burial urn from Colney (NHER 9335), aerial photograph of Castle Rising (NHER ), a medieval horse harness pendant from Booton (NHER 33767), an aerial photograph of Burgh Castle Roman fort (NHER 10471) and St Mary&#39;s Church, Gayton Thorpe (NHER 1044).'
theAlts[8] = 'left to right: Dilham castle (NHER 8189), Diss mere (NHER 1114), part of an Early Saxon hanging bowl from Brandiston (NHER 30995), a 19th century wheelwright&#39;s oven at East Walton (NHER 17380) and a medieval gilt object from Deopham (NHER 41108).'
theAlts[9] = 'left to right: Dereham water tower (NHER 13813), an aerial photograph of Cromer, a Bronze Age barbed and tanged flint arrowhead from Brundall (NHER 15466), an aerial photograph of Bylaugh Hall (NHER 3006) and the interior of St James&#39;s Church, Castle Acre (NHER 4068).'
 
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));


// To load appropriate headers depending on URL

function showImage(){

var baseURL = window.location.host;
//alert(baseURL);
switch (baseURL)
{
  case "www.nhe.no-ip.org" : 
    document.write('<img style="width: 100%;" src="'+theImages[whichImage]+'"  title="'+theAlts[whichImage]+'" alt="'+theAlts[whichImage]+'">');
    break;
  case "www.heritage.norfolk.gov.uk" : 
    document.write('<img style="width: 100%;" src="'+theImages[whichImage]+'"  title="'+theAlts[whichImage]+'" alt="'+theAlts[whichImage]+'">');
    break;
  case "localhost:4278" :
    document.write('<img style="width: 100%;" src="'+theImages[whichImage]+'"  title="'+theAlts[whichImage]+'" alt="'+theAlts[whichImage]+'">');
//    document.write('<img style="width: 100%;" src="images/GYAMbanner700.jpg"  title="Great Yarmouth Archaeological map images" alt="Great Yarmouth Archaeological map images">');
    break;
  case "www.gyam.org.uk" :
    document.write('<img style="width: 100%;" src="images/GYAMbanner700.jpg"  title="Great Yarmouth Archaeological map images" alt="Great Yarmouth Archaeological map images">');
    break;
  default :
    document.write('<img style="width: 100%;" src="Images/NHEheaderbar1.jpg"  title="Norfolk Heritage Explorer" alt="Norfolk Heritage Explorer logo and images">');
}

//document.write('<img style="width: 100%;" src="'+theImages[whichImage]+'"  title="'+theAlts[whichImage]+'" alt="'+theAlts[whichImage]+'">');
}
