I used an online menu maker to create the below code to make a menu for my website. My question is, does anyone know a way to create the Menu externally of the pages so that i do not have to create the menu over and over on each page? I know i could use frames but i really didnt want to use frames? anyone have any suggestions?
Thanks in advance. Tom
Thanks in advance. Tom
Code:
<script language="javascript">
window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;
function showLayer(layerName,aa){
var x =document.getElementById(aa);
var tt =findPosX(x);
var ww =findPosY(x)+20;
if (timeOn != null) {
clearTimeout(timeOn);
hideLayer(onLayer);
}
if (IE4) {
var layers = eval('document.all["'+layerName+'"].style');
layers.left = tt;
eval('document.all["'+layerName+'"].style.visibility="visible"');
}
else {
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'visible';
elementRef.style.left = tt;
elementRef.style.top = ww;
}
}
}
onLayer = layerName
}
function hideLayer(layerName){
if (menuActive == 0)
{
if (IE4){
eval('document.all["'+layerName+'"].style.visibility="hidden"');
}
else{
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'hidden';
}
}
}
}
}
function btnTimer() {
timeOn = setTimeout("btnOut()",600)
}
function btnOut(layerName){
if (menuActive == 0){
hideLayer(onLayer)
}
}
var item;
function menuOver(itemName,ocolor){
item=itemName;
itemName.style.backgroundColor = ocolor; //background color change on mouse over
clearTimeout(timeOn);
menuActive = 1
}
function menuOut(itemName,ocolor){
if(item)
itemName.style.backgroundColor = ocolor;
menuActive = 0
timeOn = setTimeout("hideLayer(onLayer)", 100)
}
function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
</script>
<p align="center">
<table valign="top" cellpadding="0" cellspacing="0" width="750" border="0">
<tr><td bgcolor="#000066">
<table align="center" class="tab"><tr>
<td id="0" align="middle" onmouseout="btnTimer()" onmouseover="showLayer("Menu0",'0')" style="COLOR: #ffffff"> <b>Home</b></td>
<td style="COLOR: #ff0000"> || </td><td id="1" align="middle" onmouseout="btnTimer()" onmouseover="showLayer("Menu1",'1')" style="COLOR: #ffffff"> <b>Information</b></td>
<td style="COLOR: #ff0000"> || </td><td id="2" align="middle" onmouseout="btnTimer()" onmouseover="showLayer("Menu2",'2')" style="COLOR: #ffffff"> <b>Lafayette</b></td>
<td style="COLOR: #ff0000"> || </td><td id="3" align="middle" onmouseout="btnTimer()" onmouseover="showLayer("Menu3",'3')" style="COLOR: #ffffff"> <b>Notices</b></td>
<td style="COLOR: #ff0000"> || </td><td id="4" align="middle" onmouseout="btnTimer()" onmouseover="showLayer("Menu4",'4')" style="COLOR: #ffffff"> <b>Links</b></td>
</tr></table>
<div id="Menu0" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; VISIBILITY: hidden; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; z-ndex: 1"
>
<table bgcolor="#ffeecc" cellspacing="0" cellpadding="0" style="BORDER-COLLAPSE: collapse">
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="index.html"> Home </a> </td></tr>
</table></div>
<div id="Menu1" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; VISIBILITY: hidden; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; z-ndex: 1"
>
<table bgcolor="#ffeecc" cellspacing="0" cellpadding="0" style="BORDER-COLLAPSE: collapse">
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="What%20is%20a%20Mason.htm"> What is a Mason? </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="The%20Difference.htm"> What do AF&AM, F&AM, & PHA mean? </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="Become%20a%20Mason.htm"> Can I become a Mason? </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="The%20Holy%20Saints%20John.htm"> What is St. John's Day </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="themasonicring.htm"> The Masonic Ring </a> </td></tr>
</table></div>
<div id="Menu2" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; VISIBILITY: hidden; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; z-ndex: 1"
>
<table bgcolor="#ffeecc" cellspacing="0" cellpadding="0" style="BORDER-COLLAPSE: collapse">
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="MeetingHall.htm"> Our Meeting Hall </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="Officers.htm"> Meet the Officers </a> </td></tr>
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="StandingCommittees.htm"> Standing Committees </a> </td></tr>
</table></div>
<div id="Menu3" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; VISIBILITY: hidden; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; z-ndex: 1"
>
<table bgcolor="#ffeecc" cellspacing="0" cellpadding="0" style="BORDER-COLLAPSE: collapse">
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="gatekeeper.html"> May Notice </a> </td></tr>
</table></div>
<div id="Menu4" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; VISIBILITY: hidden; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; z-ndex: 1"
>
<table bgcolor="#ffeecc" cellspacing="0" cellpadding="0" style="BORDER-COLLAPSE: collapse">
<tr height="25" onmouseout="menuOut(this,'#ffeecc')" onmouseover="menuOver(this,'#FFFFFF')"
>
<td bgcolor="#000066"> </td><td align="left">
<a class="asd" href="links.htm"> Links Page </a> </td></tr>
</table></div>
</td></tr></table></p>