/*
####################################################################
# SystematicMenu - Standards compliant popup menu script 
#
# Copyright (C) 2002 by Paul Smith (Paul@Systematic-NI.com) 
#
# This program is free software; you can redistribute it and/or 
# modify it under the terms of the GNU General Public License 
# as published by the Free Software Foundation; either version 2 
# of the License, or (at your option) any later version. 
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
# GNU General Public License for more details. 
# You should have received a copy of the GNU General Public License 
# along with this program; if not, write to the 
# Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, 
# Boston, MA  02111-1307, USA. 
# $Id: SystematicMenu,v 1.0 2002/10/13 11:00:00
####################################################################

This script is compliant with HTML4.01 Transitional and CSS2.
Gecko based browsers (eg Netscape 6 and Mozilla) use CSS for ALL of the menu manipulation;
IE4+ uses script to manipulate MS proprietary BOM objects, as they do not recognise some CSS2;
other browsers ignore the script block as only IE recognises script type "text/Jscript";
Browsers capable of rendering CSS but prior to Gecko eg NS4 ignore CSS code after a / * / * / line
so they leave all menu items on screen;
Browsers which do not recognise CSS or script also leave all menu items on screen;
so the menus degrade properly for older or security constrained browsers.
Nested menuitems are handled by dropping a <div class="menu"> into the list of menu items
*/


// JavaScript Code that uses proprietary BOM
// Internet Explorer features not available in
// other browsers.
// Apparently IE5.0 does not read menu.css past the /*/*/ line so the following is necessary to 
// hide the submenus at start up
document.write("<style type='text/css'>div.menubox{position: absolute;margin-left:0px;visibility:hidden;} </style>");


// IE4&5 do not support hover on objects other than anchors
//the following script does for IE4&5 what the advanced css does for Gecko!
function openmenu(menutoshow){
if(menutoshow.children.tags("DIV").length>0){
  menu=menutoshow.children.tags("DIV").item(0);
  menu.style.left=0;
  menu.style.visibility="visible";
  menu.style.top=13;
  }
}

function leavemenu(menutohide){
if(menutohide.children.tags("DIV").length>0){
 var newelement=event.toElement;
 if (newelement != menutohide.children.tags("DIV").item(0)){
   menutohide.children.tags("DIV").item(0).style.visibility="hidden";
   }
}}
