Thanks, okay this is how my menu works at the moment:
I have a bunck of lists with anchor tags in it, I am calling the showmenu function and passing it the class of the link and it opens the submenu inside the corresponding list. My problem is I can't pass the link inside the generic function because it dosn't know which link to open.
Here is my source code:
CSS:
<style type="text/css">
#leftmenu{
width:132px;
margin:0;
background-image: url(/images/sdc-dsc/intracom/left_menu2.gif);
border-right: 2.0px outset #A7BFD7;
border-bottom: 2.0px outset #A7BFD7;
border-left: 1.0px outset #A7BFD7;
border-top: 1.0px outset #A7BFD7;
background-repeat:repeat-y;
background-color:#ADC4DB;
}
li.Main ul {
display: none;
}
li.Main{
list-style-type:none;
list-style-image:none;
}
ul.Item{
list-style-type:none;
border-style:groove;
border-width:1px;
border-right:none;
border-left:none;
border-color:#330066;
background-color:#FAFAFA;
margin-left:0;
}
a.mlinks:link,a.mlinks:visited{
font-size :80%;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
color: #FFFFFF;
text-decoration:none;
width:100%;height:100%;
cursor

ointer;
display:block;
padding-left:.5em;
padding-top:.2em;
padding-bottom:.2em;
border-style:solid;
border-width:1px;
border-right:none;
border-bottom:none;
border-left:none;
border-color:#FFFFFF;
}
a.slinks:link,a.slinks:visited{
font-weight:lighter;
font-family:Arial, Helvetica, sans-serif;
font-size:75%;
color:#333399;
width:100%;height:100%;
cursor

ointer;
text-decoration:none;
display:block;
padding-top:.2em;
padding-bottom:.2em;
padding-left:1.0em;
}
#Menu{margin-left:0;padding:0;}
#Menu a{text-decoration:none;}
.Main a:hover{
color:#003366;
width:100%;
height:100%;
background-color:#E8E8E8;
}
.rule{
margin-left:3.5px;
width:110px;
}
</style>
-----------------------------------------------------------
Javascript:
<script type="text/javascript" language="javascript">
function togSub(link) {
var myURL = window.location.href+"";
var menu = link.parentNode.getElementsByTagName('ul')[0];
var smenus = document.getElementsByTagName("ul");
for (i=0; i<smenus.length; i++){
if(smenus
.className == 'Item'){
if (smenus.style.display == 'block'){
smenus.style.display='none';
smenus.parentNode.getElementsByTagName('a')[0].style.backgroundColor = '';
smenus.parentNode.getElementsByTagName('a')[0].style.color = '';
}
}
}
if(menu.className == 'Item'){
if(menu.style.display == ''){
menu.style.display = 'block';
link.style.backgroundColor = '#E8E8E8';
link.style.color = '#003366';
}
else{
menu.style.display = '';
link.style.backgroundColor = '';
link.style.color = '';
}
}
}
</script>
------------------------------------------------------------
HTML:
<div ID="leftmenu">
<ul ID="Menu">
<li class="Main"><a style="border-top:none;" href="#" class="mlinks">Main Link One </a></li>
<li class="Main"><a href="#" onclick="togSub(this); return false;" class="mlinks">Main Link Two</a>
<ul class="Item">
<li><a href="/directoryOne/something.html" class="slinks">SubMenu Option One</a></li>
<li><a href="/directoryOne/something2.html" class="slinks">SubMenu Option Two</a></li>
<li><a href="/directoryOne/something3.html" class="slinks">SubMenu Option Three</a></li>
<li><a href="/directoryOne/aomething4.html" class="slinks">SubMenu Option Four</a></li>
<li><a href="/directoryOne/something5.html" class="slinks">SubMenu Option Five</a></li>
</ul>
</li>
<li class="Main"><a href="#" class="mlinks">Main Link Three</a></li>
<li class="Main"><a href="#" onclick="togSub(this); return false;" class="mlinks">Main Link Four</a>
<ul class="Item">
<li><a href="#" class="slinks">SubMenu Option One</a></li>
<li><a href="#" class="slinks">SubMenu Option Two</a></li>
<li><a href="#" class="slinks">SubMenu Option Three</a></li>
</ul>
</li>
<li class="Main"><a href="#" onclick="togSub(this); return false;" class="mlinks">Main Link Five</a>
<ul class="Item">
<li><a href="#" class="slinks">SubMenu Option One</a></li>
<li><a href="#" class="slinks">SubMenu Option Two</a></li>
<li><a href="#" class="slinks">SubMenu Option Three</a></li>
</ul>
</li>
</ul>
</div>
------------------------------------------------------------
I am sorry if the code is a bit long, but this code is working so you should be able to run it if you cut and paste it in an html file. Could you help me by looking at the code. Thanks!
Sunny