// ****************************************************************************
//  drop menu script by Marten Jak.  Not to be used without permission.
// ****************************************************************************

// displays a drop menu by making a div visible.  
// submenu div id must be named 'submenu' + the parent div id
// parent menu link id must be 'menu' + parent div id

// eg.	<div id="Item1">
//           	<a id="menuItem1" onmouseover="i=2; showMenu('Item1')" onmouseout="i=1; holdMenu()">
//		   Item 1
//	     	</a>
//	</div>
//      <div id="submenuItem1" onmouseover="i=2; showMenu('Item1');" onmouseout="i=1; holdMenu();">
//           	<a>Item1a</a>          
//           	<a>Item1b</a>
//           	<a>Item1c</a>
//      </div>

// set menuColor as the color of the parent menu link hover color

// *****************************************************************************

<!--

var DM_DomMenu=null;
var DM_DomSubMenu=null;
var DM_i=0;
var DM_Delay=2;                 //time for DM_Delay of submenu hide
var DM_Count=0;
var DM_Wait=50;
var DM_DropmenuOpacity=80;
var DM_SubMenuBGColor="#c8c88b";
var DM_DomMenuLink=null;

function initialiseSubMenus()
	{
		if (isDHTML)
			{
			
			}
		else
			{
				return null;
			}
	}
	
		
function gotoURL(strPageURL)
	{
		document.location=strPageURL;
	}
	
function highlightTextLink(strElementId,intAction)
	{
		if (isDHTML)
			{
				var objTextLink = findDOM(strElementId, 1);
				if(intAction==1)
					{
						//objTextLink.class='submenutext';						
					}
				else
					{
						//objTextLink.class="";
					}
			}
		else
			{
				return null;
			}
	}

function showMenu(menuName)
	{
		if (isDHTML)
			{	
				// check to see if a submenu is still visible,if so, then hide it				
				if (DM_DomSubMenu!=null)  
					{
						DM_DomSubMenu.visibility='hidden';
						DM_DomSubMenu.zIndex='0';
						DM_DomSubMenu=null;
						DM_Count=0;
						DM_DomMenu=null;
					}
				
				//DM_i=2;				
				var idSMenu = 'submenu_' + menuName;	
				DM_DomSubMenu = findDOM(idSMenu, 1);																		
				DM_DomSubMenu.visibility='visible';			
				DM_DomSubMenu.zIndex='300';
			}
			
		else
			{
				return null;
			}
	}
	
function hideMenu()
	{
		if((DM_DomSubMenu))
			{
				DM_DomSubMenu.visibility='hidden';
				DM_DomSubMenu.zIndex='0';
				DM_DomSubMenu=null;
				DM_Count=0;
				DM_DomMenu=null;
				return false;
			}
	}

function holdMenu()
	{		
		if((DM_DomSubMenu)&&(DM_i==0))
			{
				DM_DomSubMenu.visibility='hidden';
				DM_DomSubMenu.zIndex='0';
				DM_DomSubMenu=null;
				DM_Count=0;
				DM_DomMenu=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 toggleClamMenu(clamName, parentContainer, intLineCount)
	{
		var strParentContainerHeight="";
		var intContainerHeight=0;
		var strClamArrow="";
		
		if (isDHTML)
			{
				if (document.getElementById(clamName).style.display=='none')
					{						
						document.getElementById(clamName).style.display='block';
						strParentContainerHeight=document.getElementById(parentContainer).style.height;
						//extract the integer value only
						strParentContainerHeight = strParentContainerHeight.substring(0,strParentContainerHeight.length-2);						
						intContainerHeight=parseInt(strParentContainerHeight);
						intContainerHeight=intContainerHeight+(intLineCount*15);
						document.getElementById(parentContainer).style.height=intContainerHeight+'px';
						//change the clam arrow
						strClamArrow=clamName + '_arrow';
						document.getElementById(strClamArrow).innerText='p';
						
					}
					
				else
					{
						document.getElementById(clamName).style.display='none';
						strParentContainerHeight=document.getElementById(parentContainer).style.height;
						//extract the integer value only
						strParentContainerHeight = strParentContainerHeight.substring(0,strParentContainerHeight.length-2);						
						intContainerHeight=parseInt(strParentContainerHeight);
						intContainerHeight=intContainerHeight-(intLineCount*15);
						document.getElementById(parentContainer).style.height=intContainerHeight+'px';
						//change the clam arrow
						strClamArrow=clamName + '_arrow';
						document.getElementById(strClamArrow).innerText='q';
					}
			}
	}
	
	
function setMenuLinkBG(strElementID,intFlag)
	{
		DM_DomMenuLink = findDOM(strElementID,0);
		
		if(intFlag==1)
			{
				DM_DomMenuLink.lastChild.style.backgroundColor=DM_SubMenuBGColor;
			}
		else
			{
				DM_DomMenuLink.lastChild.style.backgroundColor="";
			}
		
	}


//-->		