      <!-- This contains the scripts required for the menu on each page

      <!-- Preset these in case they are set to normal before being assigned
      var CurrentMenu=document.all.menu1
      var CurrentPopUp=document.all.PopUp1
      var CurrentPopUpItem=document.all.PopUp1_1

      var ShortDelay <!-- the handle for the short delay, used to cancel it
      var LongDelay  <!-- likewise for long delay

      var TempMenu   <!-- temporary stores
      var TempPopUp 

      var absTop
      var absLeft
      var absWidth


      function findPos(thingy)
      { 
        <!-- This looks at the top of an object (which is relative to its parent)
        <!-- and works its way up to the top level, adding the offsets as it goes
        <!-- This gives an absolute offset for the object from the top of the screen 
        absTop = 0
        absLeft = 0
        while (thingy.offsetParent)
        { absTop += thingy.offsetTop
          absLeft +=  thingy.offsetLeft
          thingy = thingy.offsetParent
        }

      }



      function ShortDelayActionMenu()
      {
        <!-- wait 10ms then reset the highlight on the current menu and hide the current popup
        <!-- this action may be cancelled if the cursor moves on to an item in the current popup
        ShortDelay=setTimeout("CurrentMenu.style.color='#000000';" +
                              "CurrentPopUp.style.visibility='hidden'",1)
      }


      function ShortDelayActionPopUp()
      {
        <!-- Remove the highlight from this item on the popup
        CurrentPopUpItem.style.color='#000000'

        <!-- Wait 10ms then remove the highlight from the menu and hide the popup
        <!-- but this may be cancelled if the cursor moves to another item in the popup
        ShortDelay=setTimeout("CurrentMenu.style.color='#000000';CurrentPopUp.style.visibility='hidden'",1)
      }


      function LongDelayAction(thingy,menu,popup)
      { 
        <!-- thingy is the place from which this is called
        <!-- find the absolute position of 'thingy' and set the pop up menu to be at the same distance from
        <!-- the top of the screen so that it will work in all screen sizes
        findPos ( thingy )
        absWidth = thingy.offsetWidth
 
        TempMenu=menu      <!-- Temporary values to give to the delay function
        TempPopUp=popup    <!-- Don't set the real values yet, or it will confuse the current short delay action

        <!-- Wait 20ms then highlight the menu entry and make the pop up visible and on the same level as the
        <!-- entry in the main menu
        LongDelay=setTimeout("TempMenu.style.color='#ffffff';" +
                             "TempPopUp.style.top=absTop;" + 
                             "TempPopUp.style.left=absLeft+absWidth;" + 
                             "TempPopUp.style.visibility='visible';" + 
                             "CurrentMenu=TempMenu;" + 
                             "CurrentPopUp=TempPopUp",2)
       }


      function GoToPage(n)
      {
        <!-- go to another page
        location.href = n 
      }


      function HighlightPopUp(thing)
      {
        CurrentPopUpItem=thing
        Highlight(CurrentPopUpItem)
      }

     function Highlight(thing)
     { thing.style.color="#ffffff"}

     function Normal(thing)
     { thing.style.color="#000000"}


function SetupMenu(thing)
{ <!-- This builds the top line of the page
  <!-- and puts it in the DIV 'search'

  var w1

  w1  = '<TABLE width="100%">'
  w1 += '  <TD STYLE="width: 130"></TD>'
  w1 += '  <TD class=KenHeader align=center>'
  w1 += '    <FONT SIZE=5>'
  w1 += '      <P>ISIS</P>'
  w1 += '      <P>the Intelligent Surfacing Instruction System</P>'
  w1 += '    </FONT>'
  w1 += '  </TD>'
  w1 += '</TABLE>'

  document.all.TopLine.innerHTML = w1

  <!-- This builds up the HTML for the menu and pop up menus in the string w1
  <!-- then puts it into the DIV 'menu' in the current page


  <!-- The main menu  
                <!-- I couldn't find out how to determine, at run time, the position of the menu entry
                <!-- in order to line up the pop up menu, so I've fixed the menu's position
  w1  = '<TABLE id=MainMenu cellspacing=0>' 

  <!-- Home
  w1 += '<TR><TD id=menu1 class="KenMenuTop" onmouseover="Highlight(document.all.menu1)" '
  w1 += 'onmouseout="Normal(document.all.menu1)" onclick=GoToPage("Index.htm")>Home</TD></TR>'

  <!-- Surfacing
  w1 += '<TR><TD id=menu2 class="KenMenu" onmouseover="LongDelayAction(this,document.all.menu2,document.all.PopUp2)" '
  w1 += 'onmouseout="ShortDelayActionMenu()" onclick=GoToPage("Surfacing.htm")>Surfacing</TD></TR>'

  <!-- Web Orders
  w1 += '<TR><TD id=menu2a class="KenMenu" onmouseover="Highlight(document.all.menu2a)" '
  w1 += 'onmouseout="Normal(document.all.menu2a)" onclick=GoToPage("WebOrders.htm")>Web Orders</TD></TR>'

  <!-- Finance
  w1 += '<TR><TD id=menu3 class="KenMenu" onmouseover="LongDelayAction(this,document.all.menu3,document.all.PopUp3)" '
  w1 += 'onmouseout="ShortDelayActionMenu()" onclick=GoToPage("Finance.htm")>Finance</TD></TR>'

  <!-- Utilities
  w1 += '<TR><TD id=menu4 class="KenMenu" onmouseover="LongDelayAction(this,document.all.menu4,document.all.PopUp4)" '
  w1 += 'onmouseout="ShortDelayActionMenu()" onclick=GoToPage("Utilities.htm")>Utilities</TD></TR>'

  <!-- Contact Us
  w1 += '<TR><TD id=menu5 class="KenMenu" onmouseover="Highlight(document.all.menu5)" '
  w1 += 'onmouseout="Normal(document.all.menu5)" onclick=GoToPage("Contact.htm")>Contact Us</TD></TR>'

  <!-- About Us
  w1 += '<TR><TD id=menu6 class="KenMenu" onmouseover="Highlight(document.all.menu6)" '
  w1 += 'onmouseout="Normal(document.all.menu6)" onclick=GoToPage("About.htm")>About Us</TD></TR>'

  <!-- Test web order entry screen
  w1 += '<TR><TD id=menu7 class="KenMenuBottom"  '
  w1 += '></TD></TR>'

  w1 += '</TABLE>'


  <!-- Pop up menus

  w1 += '<TABLE id=PopUp1 STYLE="position:absolute; top:100; left:120; z-index:100; visibility:hidden" '
  w1 += 'width=200 cellSpacing=0>'

  w1 += '</TABLE>'


  <!-- Surfacing pop up

  w1 += '<TABLE id=PopUp2 STYLE="position:absolute; top:110; left:120; z-index:100; visibility:hidden" '
  w1 += 'width=200 cellSpacing=0>'

    <!-- Surface & Glaze
  w1 += '<TR><TD id=PopUp2_1 class=KenMenuTop '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp2_1)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("SurfaceGlaze.htm")>Surface & Glaze</TD></TR>'

  w1 += '<TR><TD id=PopUp2_2 class=KenMenu '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp2_2)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Lenses.htm")>Optimised lenses</TD></TR>'

    <!-- Machine Control
  w1 += '<TR><TD id=PopUp2_3 class=KenMenuBottom '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp2_3)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Machinery.htm")>Machine Control</TD></TR>'

  w1 += '</TABLE>'


  <!-- Finance pop up
  w1 += '<TABLE id=PopUp3 STYLE="position:absolute; top:120; left:120; z-index:100; visibility:hidden" '
  w1 += 'width=200 cellSpacing=0>'

    <!-- Pricing
  w1 += '<TR><TD id=PopUp3_1 class=KenMenuTop '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp3_1)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Pricing.htm")>Pricing</TD></TR>'

    <!-- Dispatch
  w1 += '<TR><TD id=PopUp3_2 class=KenMenu '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp3_2)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Dispatch.htm")>Dispatch</TD></TR>'

    <!-- Invoice
  w1 += '<TR><TD id=PopUp3_3 class=KenMenu '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp3_3)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Invoice.htm")>Invoice</TD></TR>'

    <!-- Accounts
  w1 += '<TR><TD id=PopUp3_4 class=KenMenuBottom '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp3_4)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Accounts.htm")>Accounts</TD></TR>'

  w1 += '</TABLE>'


  <!-- Utilities pop up
  w1 += '<TABLE id=PopUp4 STYLE="position:absolute; top=130; left:120; z-index:100; visibility:hidden" '
  w1 += 'width=200 cellSpacing=0>'

    <!-- Job tracking
  w1 += '<TR><TD id=PopUp4_1 class=KenMenuTop '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp4_1)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Tracking.htm")>Job tracking</TD></TR>'

    <!-- Editors
  w1 += '<TR><TD id=PopUp4_2 class=KenMenu '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp4_2)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Editors.htm")>Editors</TD></TR>'

    <!-- Reports
  w1 += '<TR><TD id=PopUp4_3 class=KenMenuBottom '
  w1 += 'onmouseover="clearTimeout(ShortDelay);HighlightPopUp(document.all.PopUp4_3)" '
  w1 += 'onmouseout="ShortDelayActionPopUp()" onclick=GoToPage("Reports.htm")>Reports</TD></TR>'

  w1 += '</TABLE>'

  document.all.menu.innerHTML=w1

}


<!-- Initialise the menu when the page loads
SetupMenu(document.title)
