//****************************************************************************
// Drop Menu script by Marten Jak. 2005 Not to be used without permission
//****************************************************************************
//displays a drop menu by making a div element visible as a sub menu to 2 levels.
//base menu link id must be 'menu' + unique id
//1st level menu div id must be named 'submenu' + the base menu link id
//1st level menu link id must be 'menu' + unique id
//2nd level menu div id must be named 'subsubmenu' + the 1st level menu link id
//
//eg.
//
//
//
//
//
//set 'DM_menuColor' as the color of the parent menu link hover color
//****************************************************************************
var DM_menuColor='#d7479d'; //parent menu link hover color
var DM_DomMenuLevel1=null; //id of the base menu item
var DM_DomMenuLevel2=null; //id of the 1st level menu item
var DM_DomSubMenu=null; //1st level menu div
var DM_i=0; //specific variables
var DM_Count=0;
var DM_DomSubSubMenu=null; //2nd level menu div
var DM_subi=0; //specific variables
var DM_subCount=0;
var DM_Delay=2; //time of DM_Delay before the submenu hides
var DM_wait=100; //function recursion DM_Delay
function showMenu(menuName)
{
if (FD_isDHTML)
{
// check to see if a 1st level menu div is still visible, if so, then hide it first
if (DM_DomSubMenu!=null)
{
// hide the 1st level menu div
DM_DomSubMenu.visibility='hidden';
DM_DomSubMenu.zIndex='0';
DM_DomSubMenu=null;
DM_Count=0;
//clear the color of the base menu item
DM_DomMenuLevel1.color='';
DM_DomMenuLevel1=null;
}
//display the 1st level menu div
var DM_idSMenu = 'submenu' + menuName;
DM_DomSubMenu = findDOM(DM_idSMenu, 1);
DM_DomSubMenu.visibility='visible';
DM_DomSubMenu.zIndex='300';
//highlight the base menu item
var DM_idMenu='menu' + menuName;
DM_DomMenuLevel1 = findDOM(DM_idMenu, 1);
DM_DomMenuLevel1.color=DM_menuColor;
}
else
{
return null;
}
}
function holdMenu()
{
if((DM_DomSubMenu)&&(DM_i==0))
{ //clear the 1st level menu div and the base menu item
DM_DomSubMenu.visibility='hidden';
DM_DomSubMenu.zIndex='0';
DM_DomSubMenu=null;
DM_Count=0;
DM_DomMenuLevel1.color='';
DM_DomMenuLevel1=null;
return false;
}
if(DM_i==2)
{
DM_Count=0;
return false;
}
if(DM_i==1)
{
DM_Count = DM_Count+1;
if(DM_Count <= DM_Delay)
{
setTimeout('holdMenu(' + DM_i + ')', DM_wait);
}
if(DM_Count > DM_Delay)
{
DM_i=0;
setTimeout('holdMenu(' + DM_i + ')', DM_wait);
}
}
}
function hideMenu(menuName)
{
if (DM_DomSubMenu.name!=('submenu'+ menuName))
{
//hide the 2nd level menu div
DM_DomSubMenu.visibility='hidden';
DM_DomSubMenu.zIndex='0';
DM_DomSubMenu=null;
DM_subCount=0;
//clear the color of the 1st level menu item
DM_DomMenuLevel1.color='';
DM_DomMenuLevel1=null;
}
}
function showSubMenu(submenuName)
{
if (FD_isDHTML)
{
// check to see if a 2nd level menu div is still visible, if so, then hide it first
if (DM_DomSubSubMenu!=null)
{ //hide the 2nd level menu div
DM_DomSubSubMenu.visibility='hidden';
DM_DomSubSubMenu.zIndex='0';
DM_DomSubSubMenu=null;
DM_subCount=0;
//clear the color of the 1st level menu item
DM_DomMenuLevel2.color='';
DM_DomMenuLevel2=null;
}
var DM_idSMenu='menu' + submenuName;
var DM_idSSMenu = 'subsubmenu' + submenuName;
//highlight the 1st level menu item
DM_DomMenuLevel2 = findDOM(DM_idSMenu, 1);
DM_DomMenuLevel2.color=DM_menuColor;
//display the 2nd level menu div
DM_DomSubSubMenu = findDOM(DM_idSSMenu, 1);
DM_DomSubSubMenu.visibility='visible';
DM_DomSubSubMenu.zIndex='310';
}
else
{
return null;
}
}
function holdSubMenu()
{
if((DM_DomSubSubMenu)&&(DM_subi==0))
{ //clear the 2nd level menu div and the 1st level menu item
DM_DomSubSubMenu.visibility='hidden';
DM_DomSubSubMenu.zIndex='0';
DM_DomSubSubMenu=null;
DM_subCount=0;
DM_DomMenuLevel2.color='';
DM_DomMenuLevel2=null;
return false;
}
if(DM_subi==2)
{
DM_subCount=0;
return false;
}
if(DM_subi==1)
{
DM_subCount = DM_subCount+1;
if(DM_subCount <= DM_Delay)
{
setTimeout('holdSubMenu(' + DM_subi + ')', DM_wait);
}
if(DM_subCount > DM_Delay)
{
DM_subi=0;
setTimeout('holdSubMenu(' + DM_subi + ')', DM_wait);
}
}
}
function setMenuLinkBG(strElementID,intFlag)
{
if(intFlag==1)
{
document.getElementById(strElementID).style.backgroundColor="#d7479d"; //c4dfff
}
else
{
document.getElementById(strElementID).style.backgroundColor="";
}
}
function buttonHot(objElementID,intHover)
{
/*
var objButton = null;
objButton = findDOM(objElementID,1);
if(intHover==1)
{
objButton.color="#000066"; //d7479d
}
else
{
objButton.color="#ffffff";
}
*/
}