Javascript help

by Matthew Ohlman <matthew(at)ohlman.com>

 Date:  Wed, 09 Jan 2002 17:36:41 -0600
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original
Hi list. I have a couple of problems in the following code.
-----------------------------------------
<HTML><HEAD>
<TITLE>Model 126 Service Manual - 300SDL Chapter</title>
<STYLE TYPE="text/css">
BODY
{
scrollbar-base-color: #C0C0C0;
scrollbar-Face-Color: #C0C0C0;
scrollbar-Track-Color: #C0C0C0;
scrollbar-Highlight-Color: #C0C0C0;
scrollbar-Shadow-Color: #C0C0C0;
scrollbar-DarkShadow-Color: #C0C0C0;
}
</STYLE>

</HEAD>
<script type="text/javascript">
function showmenu(elmnt)
{
document.all(elmnt).style.visibility="visible"
}

function hidemenu(elmnt)
{
document.all(elmnt).style.visibility="hidden"
}

</script>

<script type="text/javascript">
function showmenu(elmnt)
{
document.all(elmnt).style.visibility="visible"
}

function hidemenu(elmnt)
{
document.all(elmnt).style.visibility="hidden"
}
</script>
<BODY bgcolor = "#C0C0C0">
<STYLE type="text/css">
table.menu
{
font-size:100%;
visibility:hidden;
}
</STYLE>
<Style type="Text/CSS">

{text: White;}
a.two:link {color: White; text-decoration: none}
a.two:hover { text-decoration: underline}
a.two:hover {color: Black; text-decoration: none}
a.three:hover{background:White}
a.three {text-decoration: none; color: black; font-face: Times new roman}
a.two {cursor: hand}
a.two:visited {color: White; text-decoration: none}
td.menu{background: C0C0C0}
</STYLE>
<img src="mblogo.gif" align="left"><center><h3>Model 126 Service Manual - 
300SDL Chapter</h3></center></tr></td>
<font face="Time NEw Roman" color="#000000">
<br><br>
<br><br><br><b><h3>Main Function</h3><br></b><font size="4">
<table width="100%"><td onClick="showmenu('GeneralTechData')" 
onClick="hidemenu('PedalAssembly')" width="100%"></a>
  <a class="two" onMouseOver="window.status='Chassis'; return true;" 
onMouseOut="window.status=''; return 
true;"  onClick="hidemenu('ChargSysStarter')"><font face="arial" 
size="3">00  General, Technical Data</a><br></font>

<tr><td onClick="showmenu('ChargSysStarter')" width="100%"></a>
  <a class="two" onMouseOver="window.status='Charging System Starter'; 
return true;" onMouseOut="window.status=''; return 
true;"  onClick="hidemenu('GeneralTechData')"><font face="arial" size="3" 
color="#00000">15 Charging system, starter</a></a><br></a></font>

<table width="100%"><td onClick="showmenu('PedalAssembly')" 
onClick="hidemenu('ChargSysStarter')" width="100%"></a>
  <a class="two" onMouseOver="window.status='Pedal Assembly'; return true;" 
onMouseOut="window.status=''; return 
true;"  onClick="hidemenu('GeneralTechData')"><font face="arial" 
size="3">29  Pedal Assembly</a><br></font>

    </a><Div style= "position: absolute; top: 100px; left:500px "><table 
class="menu" id="GeneralTechData" width="100%"><h3>Sub Function</h3>
    <br><tr><td class="menu" width="100%"><a href="chassis\00-0005.PDF" 
class="three">0005  Instructions for use of service manual</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0010.PDF" 
class="three">0010  Engine and Vehicle Identification</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0015.PDF" 
class="three">0015  Technical Data</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0020.PDF" 
class="three">0020  Vehicle identification and number location</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0030.PDF" 
class="three">0030  Vehicle data card</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0035.PDF" 
class="three">0035  Body plate</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0510.PDF" 
class="three">0510  Handling Components</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0550.PDF" 
class="three">0550  Handling nuts and bolts</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-8070.PDF" 
class="three">8070  Cleaning and maintenace of vehicle paint 
finish</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-8080.PDF" 
class="three">8080  Cleaning vehicle interior</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-8503.PDF" 
class="three">8503  Cleaing engine compartment</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-0015.PDF" 
class="three">9000  Towing of vehicle</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-9001.PDF" 
class="three">9001  Catalytic Converters</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-9004.PDF" 
class="three">9004  Positioning of jack stands</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-9005.PDF" 
class="three">9005  Lifting vehicle with on-board jack</a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-9007.PDF" 
class="three">9007  Lifting vehicle with floor jack </a></td></tr>
    <tr><td class="menu" width="100%"><a href="chassis\00-9008.PDF" 
class="three">9008  Lifting vehicle on hoist</a></td></tr>
</table></table>
   <Div style= "position: absolute; top:140px; left:500px "><table 
class="menu" id="ChargSysStarter" width="100%">
<tr><td class="menu" width="100%"><font size="2"><a 
href="chassis\15-600.PDF" class="three">600  Testing alternator and 
regulator in vehicle</a></td></tr>
<tr><td class="menu" width="100%"><font size="2"><a 
href="chassis\15-640.PDF" class="three">640 Replacing fan 
assembly</a></td></tr>
<tr><td class="menu" width="100%"><font size="2"><a 
href="chassis\15-700.PDF" class="three">700 Removing and installation of 
starter</a></td></tr>
</table></table>
   <Div style= "position: absolute; top:140px; left:500px "><table 
class="menu" id="PedalAssembly" width="100%">
    <tr><td class="menu" width="100%"><a href="chassis\00-9008.PDF" 
class="three">9008  Lifting vehicle on hoist</a></td></tr>

</table>
</BODY></HTML>
---------------------------------------------------------

What this does is when one of the categories is clicked, it hides the other 
menus that are up, and shows that menu. So, how do I make all the menus go 
away? I can only get them to go away when I have only two categories.  Does 
anybody know how I can extend the OnClick code so that It will not display 
the menus? To see this in action (though the links will not work, go to 
http://www.ohlman.com/hwgexample.html . If you don't understand my 
question, go there and click on one of the Main Functions.
My next problem is not quite as important as the one above, but when I 
click on Sub Function, it displays unwanted menus.

Any help at all on this problem would be very greatly appreciated. Also, I 
am using IE6.0 to view this page. Thanks in advance for any input on this 
problem.

Matthew
Also, I am sorry If this message post is a repeat I have tried to send it 
twice already, but I am not getting any messages from this list!


| Matthew Ohlman
| Ohlman Pages
| http://www.ohlman.com/
"There's a difference between a philosophy and a bumper sticker. "
     Charles M. Schulz

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA