var mmenus=new Array("Discover","Services","Get Involved","Resources","Publications","Home");
var smenus=new Array();
smenus[0]=new Array("About YAT","Breaking News","Recent Projects","Support Us","Staff","Jobs");
smenus[1]=new Array("Field Services","Finds Research","Conservation","Archaeological Wood Centre","Human Osteology","Graphics & Publication","Finds Research & Curation","IT Development","Picture Library","Exhibitions","Education","Contact Us");
smenus[2]=new Array("Training","Lifelong Learning","Lectures","Community Archaeology","Archaeology Live!","Friends of YAT","Calendar of Events");
smenus[3]=new Array("On-line Resources","On-line Publications","Schools Resources","Picture Library","Web Diary");
smenus[4]=new Array("New Titles","Full Catalogue","YAT magazine","Web Publications");
smenus[5]=new Array("Archaeology pages","JORVIK Homepage","DIG pages");
var lmmenus=new Array("","../services1.htm","../participate1.htm","../resource1.htm","../booksale.htm","../index.htm");
var lsmenus=new Array();
lsmenus[0]=new Array("../aboutyat.htm","../news.htm","../recent.htm","../support.htm","../yatstaff1.htm","../jobs.htm");
lsmenus[1]=new Array("../excav1.htm","../research1.htm","../conserv1.htm","../wood2.htm","../osteology1.htm","../publish2.htm","../research1.htm","../itdev.htm","http://www.iadb.co.uk/piclib/photos.php","../exhibit1.htm","../educate1.htm","../contact.htm");
lsmenus[2]=new Array("../training1.htm","../lifelong1.htm","../lectures.htm","../community.htm","../live1.htm","../support.htm#friends","http://www.jorvik-viking-centre.co.uk/events1.htm");
lsmenus[3]=new Array("../resource2.htm","../ayw.htm","http://www.jorvik-viking-centre.co.uk/visit/school4.htm","http://www.yorkarchaeology.co.uk/piclib/photos.php","http://www.iadb.co.uk/live2005/liveframeset2.htm");
lsmenus[4]=new Array("../booksale.htm","http://www.iadb.co.uk/pubs/pubs.php","../yatmag.htm","../ayw.htm");
lsmenus[5]=new Array("../index.htm","http://www.jorvik-viking-centre.co.uk/index2.htm","http://www.digyork.co.uk/");
var InSMenu=false;

function setMenus() {
  var txt="<DIV style='position:absolute;left:5;top:80;visibility:visible'>";
  txt=txt+"<TABLE WIDTH=750 CELLSPACING=0 CELLPADDING=0 BORDER=0>";
  txt=txt+"<TR><TD ID='mbar' BGCOLOR=Black STYLE='border:1px solid black'>&nbsp;</TD></TR>";
  txt=txt+"</TABLE></DIV>";
  txt=txt+"<DIV ID='submenu' style='position:absolute;left:16;top:104;visibility:hidden'>";
  txt=txt+"<TABLE WIDTH=150 CELLSPACING=0 CELLPADDING=0 BORDER=0>";
  txt=txt+"<TR><TD ID='smenu' BGCOLOR=White STYLE='border:1px solid black'>&nbsp;</TD></TR>";
  txt=txt+"</TABLE></DIV>";
  document.getElementById("menus").innerHTML=txt;
  var txt="<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0><TR>";
  for (var i=0;i<mmenus.length;i++) {
    txt=txt+"<TD ID='m"+(i+1)+"' WIDTH=110 ALIGN=CENTER NOWRAP STYLE='border-top:1px solid white' onmouseover='showMenu("+i+")' onmouseout='hideSMenu()'>"
    txt=txt+"<A HREF='javascript:showPage(-1,"+i+")' STYLE='font:bold 8pt Arial;text-decoration:none;color:white'>&nbsp;"+mmenus[i]+"&nbsp;</A></TD>";
  }
  txt=txt+"<TD WIDTH=100% STYLE='border-top:1px solid white'>&nbsp;</TD></TR></TABLE>";
  document.getElementById("mbar").innerHTML=txt;
}
function showMenu(x) {
  for (var i=0;i<mmenus.length;i++) {
    document.getElementById("m"+(i+1)).style.backgroundColor=((x==i)?"gray":"black");
  }
  if (x>=0) 
    setMenu(x);
  else
    hideSMenu();
}
function setMenu(x) {
  var txt="<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>";
  for (var i=0;i<smenus[x].length;i++) {
    txt=txt+"<TR><TD ID='sm"+(i+1)+"' onmouseover='showSMenu("+x+","+i+")' onmouseout='hideSMenu()'>"
    txt=txt+"<A HREF='javascript:showPage("+x+","+i+")' STYLE='font:bold 8pt Arial;text-decoration:none;color:black'>"+smenus[x][i]+"</A></TD></TR>";
  }
  txt=txt+"</TABLE>";
  document.getElementById("smenu").innerHTML=txt;
  document.getElementById("submenu").style.left=(10+(x*110));
  document.getElementById("submenu").style.visibility="visible";
  InSMenu=true;
}
function hideMenu() {
  if (InSMenu==false) {
    document.getElementById("submenu").style.visibility="hidden";
    for (var i=0;i<mmenus.length;i++) {
      document.getElementById("m"+(i+1)).style.backgroundColor="black";
    }
  }
}
function showSMenu(x,y) {
  InSMenu=true;
  for (var i=0;i<smenus[x].length;i++) {
    document.getElementById("sm"+(i+1)).style.backgroundColor=((y==i)?"silver":"white");
  }
}
function hideSMenu() {
  InSMenu=false;
  setTimeout("hideMenu()",250);
}
function showPage(x,y) {
  if (x==-1)
    var p=lmmenus[y];
  else
    var p=lsmenus[x][y];
  if (p!="") document.location=p;
}
function MM_preloadImages() {
  return "";
}


