function insertMenu(n,p) {
document.write("<div id='menu"+n+"' class='"+p+"Menu'><!-- menu "+n+" -->"
+"<div id='label"+n+"1' class='mLabel'>Home</div>"
+"<div id='box"+n+"1' class='mBox'>"
+"  <a class='m' href='/roger/index.html'>Roger's Intro</a>"
+"</div>"
+"<div id='label"+n+"2' class='mLabel'>Weddings</div>"
+"<div id='box"+n+"2' class='mBox'>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=546f6e792057656464696e67'>Tony Brannon</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=54696d2057656464696e67'>Tim Tinsley</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4b61726c2057656464696e67'>Karl Booth</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=416e64792057656464696e67'>Andrew Renton</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4e69636b2057656464696e67'>Nick Sunley</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=416c2057656464696e67'>Alun Williams</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4d617274696e2057656464696e67'>Martin Hope</a>"
+"</div>"
+"<div id='label"+n+"3' class='mLabel'>Holidays</div>"
+"<div id='box"+n+"3' class='mBox'>"
+"  <a class='m' href='/roger/route66/index.html'>Route 66 in May 2005</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=526f6d6520536570203035'>Rome in September 2005</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=437265746520417072696c203038'>Crete in April 2008</a>"
+"</div>"
+"<div id='label"+n+"4' class='mLabel'>Gaylord Tours</div>"
+"<div id='box"+n+"4' class='mBox'>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=50726167756520466562203034'>Prague in February 2004</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=42617263656c6f6e61204a616e203035'>Barcelona in February 2005</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=48616d62757267204d6179203036'>Hamburg in May 2006</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4275646170657374204d6179203037'>Budapest in May 2007</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4b72616b6f77204d6179203038'>Krakow in May 2008</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4265726c696e204d6179203039'>Berlin in May 2009</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=42656e69646f726d20417072203130'>Benidorm in May 2010</a>"
+"  <a class='m' href='/photo/photo_thumb.php?dir=4272757373656c73204d6179203131'>Brussels in May 2011</a>"
+"</div>"
+"<div id='label"+n+"5' class='mLabel'>Links</div>"
+"<div id='box"+n+"5' class='mBox'>"
+"  <a class='m' href='/roger/linx.html'>Web Links</a>"
+"  <a class='m' href='/roger/mtech.html'>M Technology</a>"
+"  <a class='m' href='/roger/local.html'>Local Links</a>"
+"</div>"
+"<div id='label"+n+"6' class='mLabel'>Serendipity</div>"
+"<div id='box"+n+"6' class='mBox'>"
+"  <a class='m' href='/roger/stump.html'>The Glorious Stump</a>"
+"  <hr>"
+"  <a class='m' href='/roger/about.html'>About Me</a>"
+"  <hr>"
+"  <a class='m' href='/roger/credits.html'>Site Credits</a>"
+"</div>"
+"</div><!-- end menu"+n+" -->"
); // end document.write()
} // end insertMenu()

function adjustLayout()
{
  // Get natural heights
  var cHeight = xHeight("centre");
  var lHeight = xHeight("leftcontent");
  var rHeight = xHeight("rightcontent");

  // Find the maximum height
  var maxHeight =
    Math.max(cHeight, Math.max(lHeight, rHeight));

  // Assign maximum height to all columns
  xHeight("centre", maxHeight);
  xHeight("left", maxHeight + xHeight("top") + 100);
  xHeight("right", maxHeight + xHeight("top") + 100);

  // Show the footer
  xShow("footer");
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=740,left = 50,top = 40');");
}

function DrawMorphMenu()
{
  xAddEventListener(window, "resize",
  adjustLayout, false);
  adjustLayout();
  var menu1;
  menu1 = new xMenu2(
        true, false, false,         // absolute, horizontal, floating,
        2, 268, 6,                    // menuX, menuY, menuZ
        0, [110,110,110,110,110,110], 20,       // lblOffset, lblWidthsArray, lblHeight,
        [100,100,170,170,100,130],          // boxWidthsArray,
        '#000000', '#333333',       // activeColor, inactiveColor,
        '#cccc99', '#cccc99',       // activeBkgnd, inactiveBkgnd
        '#cccc99'                   // boxBkgnd
  );
  scrollListener(); // initial slide
  xAddEventListener(document, "mousemove", menuHideListener, false);
  xAddEventListener(window, "resize", resizeListener, false);
  xAddEventListener(window, "scroll", scrollListener, false);
 }

