menuadds="";
menuadds+="Home>Introduction=intro.html+Events=events.html+Message Board=messageboard.html+Citations=citetemp.html" + "|";
menuadds+="History>The Beginning=beginning.html+The Middle Years=middle.html+Modern Era=modern.html" + "|";
menuadds+="Learn>Solar System=solarsys.html+Telescopes=telescopes.html+Test your knowlegde=cgi-bin/quiz.pl" + "|";
menuadds+="Resources>Programs=programs.html+Herschel 400=herschel.html+Messier 110=messier.html+Constellation Abbriviations=constell.html" + "|";
menuadds+="Gallery>Galaxies=galaxies.html+Nebulae=nebulae.html+Stars=stars.html+Planets=planets.html+Moon=moon.html" + "|";
menuadds+="Links>Purchase Equipment=links.html#purchase+Database=links.html#database+General Info=links.html#general+Books and Magazines=links.html#book" + "|";
menuadds+="Contact>Email Us=emailus.html";


//-----------------------
//-----------------------
if (document.all)    {n=0;ie=1;fshow="visible";fhide="hidden";}
if (document.layers) {n=1;ie=0;fshow="show";   fhide="hide";}

function menu(menutext) {
	menus = new Array(); menus = menutext.split("|");
	htmlcode="";
	var temp=new Array();
	if(ie) {
		htmlcode+="<div id='mainmenu' style='position:relative' visibility='visible'>\n";
		htmlcode+="<table width='100%' class=menutie><tr>\n";
		for( var c=0; c < menus.length; c++) {
			temp = menus[c].split(">", 2);
			htmlcode+="<td class=border><a name='" + temp[0] + "' class=menuie onmouseover=\"see('" + temp[0] + "')\">" + temp[0] + "</a></td>\n";
		}
		htmlcode+="</tr></table>\n";
		htmlcode+="</div>\n";
		htmlcode+="\n";
		for( var c=0; c < menus.length; c++) {
			temp = menus[c].split(">", 2);
			subie(temp[0], temp[1]);
		}
	}
	if(n) {
		htmlcode+="<layer bgcolor=black name='mainmenu' visibility='visible'>\n";
		htmlcode+="<table width='100%' class=menutn ><tr>\n";
		for( var c=0; c < menus.length; c++) {
			temp = menus[c].split(">", 2);
			htmlcode+="<td class= border><ilayer name='" + temp[0] + "'><a href=\"javascript: see('" + temp[0] + "')\" class=menun onmouseover=\"see('" + temp[0] + "')\">" + temp[0] + "</a></ilayer></td>\n";
		}
		htmlcode+="</tr></table>\n";
		htmlcode+="</layer>\n";
		htmlcode+="\n";
		for( var c=0; c < menus.length; c++) {
			temp = menus[c].split(">", 2);
			subn(temp[0], temp[1]);
		}
		htmlcode+="";
	}	
	document.writeln(htmlcode);
	if(n) { document.writeln("<table cellpadding=0 cellspacing=0 border=0 width='100%' height='"+document.layers['mainmenu'].clip.height+"'><tr><td> </td></tr></table>\n");}
}

function subie(parent, subs) {
	subtemp = new Array(); subtemp = subs.split("+");
	temptemp = new Array();
	htmlcode += "<div id='"+parent+"submenu' style='position:absolute; visibility: hidden; top: -300;'>\n";
	htmlcode += "<table class=submenutie>\n";
	for (var c=0; c < subtemp.length; c++) {
		temptemp = subtemp[c].split("=",2);
		htmlcode+="<tr><td><a class=submenuie href='"+temptemp[1]+"'>"+temptemp[0]+"</a></td></tr>\n";
	}
	htmlcode += "</table>\n";
	htmlcode += "</div>\n\n";
}

function subn(parent, subs) {
	subtemp = new Array(); subtemp = subs.split("+");
	temptemp = new Array();
	htmlcode += "<layer id='"+parent+"submenu' visibility='hide'>\n";
	htmlcode += "<table border=0 cellpadding=0 cellspacing=0 class=submenutn>\n";
	for (var c=0; c < subtemp.length; c++) {
		temptemp = subtemp[c].split("=",2);
		htmlcode+="<tr><td><a class=submenun href='"+temptemp[1]+"'>"+temptemp[0]+"</a></td></tr>\n";
	}
	htmlcode += "</table>\n";
	htmlcode += "</layer>\n\n";
}

function see(subitem) {
	var menu; var submenu;
	if (ie) {
		menu = eval(subitem);
		submenu = eval(subitem+"submenu.style");
		submenu.left = menu.offsetParent.offsetLeft;
		submenu.top  = document.all["mainmenu"].style.posTop + 
			document.all["mainmenu"].offsetHeight;
		submenu.visibility = fshow;
		if (laston != null && laston != submenu) hideAll();

		leftX  = document.all[subitem+"submenu"].style.posLeft;
		rightX = leftX + document.all[subitem+"submenu"].offsetWidth;
		topY  = document.all["mainmenu"].offsetHeight;
		bottomY = topY + document.all[subitem+"submenu"].offsetHeight;
	}
	if (n) {
		submenu = document.layers[subitem+"submenu"];
		if (laston != null && laston != submenu) hideAll();
		submenu.left = document.layers['mainmenu'].document.layers[subitem].pageX;
		submenu.top  = document.layers['mainmenu'].document.layers[subitem].pageY +
			document.layers["mainmenu"].clip.height;
		submenu.visibility = fshow;

		leftX  = document.layers[subitem+"submenu"].left;
		rightX = leftX + document.layers[subitem+"submenu"].clip.width;
		topY  = document.layers[subitem+"submenu"].top;
		bottomY = topY + document.layers[subitem+"submenu"].clip.height;
	}
	laston = submenu;
}

function hideAll()
{
	if (laston != null) {laston.visibility = fhide;laston.left = 0;}
}

function updateIt(e)
{
	var x = 0; var y = 0;
	if (ie)	{ x = window.event.clientX; y = window.event.clientY;}
	if (n) { x = e.pageX; y = e.pageY;}

	if (x > rightX || x < leftX) hideAll();
	else if (y > bottomY) hideAll();
}

if (document.all)
{
	document.body.onclick=hideAll;
	document.body.onscroll=hideAll;
	document.body.onmousemove=updateIt;
}
if (document.layers)
{
	document.onmousedown=hideAll;
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=updateIt;
}



//-------------------------------------
// execute
topY = 0;
rightX = 0;
bottomY = 0;
leftX = 0;
laston = null;
menu(menuadds);


function UpdateIt(){
if (document.all){
document.all["mainmenu"].style.top = document.body.scrollTop;
setTimeout("UpdateIt()", 200);
}
if (document.layers){
document.layers["mainmenu"].top = window.pageYOffset;
setTimeout("UpdateIt()", 200);
}
}
UpdateIt();