

#menu {
 width: 100%;  
}

#menu ul {
 list-style: none;
 padding: 2px;   /* padding to buttons */
 margin: 0px ;   /* indent from outside div */
}

#menu li {
 float: left;     /* left for horizonal menu, otherwise its vertical. */
}

#menu a, #menu a:visited {
 text-align: center;  /* position text within li button */
 text-decoration: none; /* remove typical underline */
 display: block;    /* treats layout of buttons like they're table cells rather than list items */
 width: 120px;   /* button outside dimensions */
 color: white;  /* link text colour */
 background-color: #333;
 padding: 4px;   /* padding of text within button */
 margin: 1px;   /* padding of button within list item */
}

#menu a:hover, #menu a:visited:hover {  /* override as neccesary for mouse over effects */
 color: white; 
 background-color: #666;
}

#menu ul ul {  /* this one is the dropdown */
 position: absolute; /* so we can hide it */
 left: -999em;  /* by default it is hidden */
 width: 150px;  /* width of the entire dropdown */
 margin: 0px;  /* relative position of the menu to the button... 0=tight on bottom.. */
 padding: 0px;
 z-index: 99999;
}

#menu ul ul ul {
 position: absolute;
 top: auto;  /* auto means that it will be in the typicall indented list position below the first menu */
 left: 0px;   /* 0 */
 margin: -20px 150px;       /* adjust the margins to position the 2nd level popout menu to the right*/
 width: 150px;   /* width is based on the containing block */
}

#menu ul ul a, #menu ul ul a:visited  {  /* override colours for drop down buttons */
 background-color:#666;
 color:white;
 width: 200px;
 text-align:left;
 border-top: 1px  solid white;
 border-left: 1px  solid white;
 border-right: 0px ;
 border-bottom: 1px  solid #000000;
 padding:4px;
 margin:0px; 
}

#menu li ul a:hover {  /* override colours for drop down buttons */
 color: #ffffff;
 background-color: #000000;
}


#menu li:hover ul ul, 
#menu li:hover ul ul ul, 
#menu li.sfhover ul ul, 
#menu li.sfhover ul ul ul 
{
 left: -999em;
}

#menu li:hover ul, 
#menu li li:hover ul, 
#menu li li li:hover ul, 
#menu li.sfhover ul, 
#menu li li.sfhover ul, 
#menu li li li.sfhover ul {
 left: auto;
}