
// Use Freely as long as following disclaimer is intact ::
//---------------------------------------------------------------
// Cross Browser Multi-Orientation Menu v1.0 23rd October 2003
// This script written by Rik Comery. www.ricom.co.uk
// For support, visit the "Resources" section at www.ricom.co.uk
// All rights reserved.


var Menu = new Array ();
var subMenu = new Array ();
var subSubMenu = new Array ();
var horizontalSubOffset = new Array();;	

////// ADD MENU ITEMS  

//////////////////////////////////////////////////////////////////////////////////////////////
//  To add a new menu item, follow the format below.  Every "Menu" must adhere to the following rules
//
//  1. Each menu has a number. i.e. "Menu[0]". This number must start at 0 and be incremented by one for each menu item added.
//  2. Whether you want a sub menu or not, each menu must have the "subMenu[x] = new Array()" line, where x is the same as the 
//     main "Menu[x]" number.
//  3. If you DO want a sub menu, you must assign it TWO numbers. i.e. "subMenu[x][x]". The first number is the same 
//     as the main "Menu" number, and the second must start at 0 and be incremented by one, for every sub menu item added.
//  4. the script is CASE SENSITIVE. 
//
//  -- Example --
//  Menu[0] = new Array ("Link Name", "URL", "Frame Target")
//    subMenu[0] = new Array()
//    subMenu[0][0] = new Array ("Link Name", "URL", "Frame Target")
//    subMenu[0][1] = new Array ("Link Name", "URL", "Frame Target")
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////
	horizontalSubOffset[0] = 130; //This is the width of this menu structure, adjust so sub sub menus line up right
   Menu[0] = new Array("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", "index.htm","_top");
     subMenu[0] = new Array();  
	 	subSubMenu[0] = new Array(); 
	 	subSubMenu[0][0] = new Array();

		
		
	horizontalSubOffset[1] = 135; //This is the width of this menu structure, adjust so sub sub menus line up right
   Menu[1] = new Array("&nbsp;&nbsp;&nbsp;&nbsp;The Chamber&nbsp;&nbsp;&nbsp;&nbsp;", "About.htm","_top");
     subMenu[1] = new Array();
	 	subSubMenu[1] = new Array();
     subMenu[1][0] = new Array ("About the Chamber", "About.htm","_top");
	 	subSubMenu[1][0] = new Array();
     subMenu[1][1] = new Array ("Management & Staff", "managment&staff.htm","_top");
	 	subSubMenu[1][1] = new Array();
     subMenu[1][2] = new Array ("Board of Directors", "BoardofDirectors.htm","_top");
	 	subSubMenu[1][2] = new Array();
     subMenu[1][3] = new Array ("Ambassadors", "ambassadors.html","_top");
	 	subSubMenu[1][3] = new Array();
     subMenu[1][4] = new Array ("Divisions & Committees", "committees.htm","_top");
	 	subSubMenu[1][4] = new Array();
	 subMenu[1][5] = new Array ("Benefits of Membership", "benefits.html","_top");
	 	subSubMenu[1][5] = new Array();
	 subMenu[1][6] = new Array ("Join the Chamber", "https://secure.conferenceson-line.com/vallejochamber/jointhechamber.php","_top");
	 	subSubMenu[1][6] = new Array();
	 subMenu[1][7] = new Array ("Cornerstone Sponsors", "sponsors.htm","_top");
	 	subSubMenu[1][7] = new Array();
	 subMenu[1][8] = new Array ("Business Plan", "BusinessPlan.htm","_top");
	 	subSubMenu[1][8] = new Array();
	 subMenu[1][9] = new Array ("Political Advocacy", "advocacy.html","_top");
	 	subSubMenu[1][9] = new Array();
	 subMenu[1][10] = new Array ("Contact Us", "http://vallejochamber.chambermaster.com/directory/jsp/inforeq/ContactUs.jsp?ccid=445","_top");
	 	subSubMenu[1][10] = new Array();

	horizontalSubOffset[2] = 142; //This is the width of this menu structure, adjust so sub sub menus line up right
   Menu[2] = new Array("&nbsp;&nbsp;Business Directory&nbsp;&nbsp;", "http://vallejochamber.chambermaster.com/directory/jsp/busdir/Search.jsp?ccid=445","_top");
     subMenu[2] = new Array();
	 	subSubMenu[2] = new Array();

	horizontalSubOffset[3] = 171; //This is the width of this menu structure, adjust so sub sub menus line up right
   Menu[3] = new Array("&nbsp;&nbsp;Business Resources&nbsp;&nbsp;", "News.html","_top");
     subMenu[3] = new Array();
	 	subSubMenu[3] = new Array();
	 subMenu[3][0] = new Array ("News", "News.html","_top");
	 	subSubMenu[3][0] = new Array();
		subSubMenu[3][0][0] = new Array ("Vallejo Business Newsletter", "VallejoBusiness.htm","_top");
		subSubMenu[3][0][1] = new Array ("Vallejo BusinessWire", "VallejoBusinessWire.html","_top");
		subSubMenu[3][0][2] = new Array ("Vallejo Business E-Insider", "e-Inisder.html","_top");
		subSubMenu[3][0][3] = new Array ("Chamber Press Releases", "PressReleases.htm","_top");
		subSubMenu[3][0][4] = new Array ("Recent Media", "RecentMedia.html","_top");
		subSubMenu[3][0][5] = new Array ("Members in the News", "MemberInTheNews.html","_top");
		subSubMenu[3][0][6] = new Array ("Spotlights", "Spotlights.html","_top");
     subMenu[3][1] = new Array ("Advertising Opportunities", "advertisingOpp.html","_top");
	 	subSubMenu[3][1] = new Array();
     subMenu[3][2] = new Array ("Sponsorship Opportunities&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", "SponsorshipOp.html","_top");
	 	subSubMenu[3][2] = new Array();
     subMenu[3][3] = new Array ("Membership Advantage", "membershipAdvantages.html","_top");
	 	subSubMenu[3][3] = new Array();
	 subMenu[3][4] = new Array ("Hot Deals", "http://vallejochamber.chambermaster.com/directory/jsp/hotdeals/Search.jsp?ccid=445","_top");
	 	subSubMenu[3][4] = new Array();
	 subMenu[3][5] = new Array ("Products for Sale", "products.html","_top");
	 	subSubMenu[3][5] = new Array();
	 subMenu[3][6] = new Array ("Contact Us", "http://vallejochamber.chambermaster.com/directory/jsp/inforeq/ContactUs.jsp?ccid=445","_top"); 
	 	subSubMenu[3][6] = new Array();
	 
	horizontalSubOffset[4] = 117; //This is the width of this menu structure, adjust so sub sub menus line up right
   Menu[4] = new Array("&nbsp;&nbsp;&nbsp;Calendar&nbsp;&nbsp;&nbsp;", "http://vallejochamber.chambermaster.com/directory/events.jsp?ccid=445","_top");
     subMenu[4] = new Array();
	 	subSubMenu[4] = new Array();
     subMenu[4][0] = new Array ("Chamber Events", "chamberevent.htm","_top");
	 	subSubMenu[4][0] = new Array();
     subMenu[4][1] = new Array ("Community Events&nbsp;&nbsp;&nbsp;&nbsp;", "http://vallejochamber.chambermaster.com/directory/events.jsp?ccid=445","_top");
	 	subSubMenu[4][1] = new Array();
     subMenu[4][2] = new Array ("Submit Event", "http://vallejochamber.chambermaster.com/directory/jsp/events/dlg/Public_AddEvent.jsp?ccid=445","_blank");
	 	subSubMenu[4][2] = new Array();
	 
	 horizontalSubOffset[5] = -117; //These ones need to go to the right, so I made them negative, size of sub sub menu		
	Menu[5] = new Array("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Partners&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", "Partners.html","_top");
     subMenu[5] = new Array();
	 	subSubMenu[5] = new Array();
	 subMenu[5][0] = new Array ("Business/Labor Partnership of Vallejo", "Partners.html","_top");
	 	subSubMenu[5][0] = new Array();
	 subMenu[5][1] = new Array ("CCRC - Central Core Restoration Corporation", "http://ccrcorp.info/","_blank");
	 	subSubMenu[5][1] = new Array();
	 subMenu[5][2] = new Array ("City of Vallejo", "http://www.ci.vallejo.ca.us/GovSite/","_blank");
	 	subSubMenu[5][2] = new Array();
	 subMenu[5][3] = new Array ("Leadership Vallejo", "http://www.leadershipvallejo.com","_blank");
	 	subSubMenu[5][3] = new Array();
     subMenu[5][4] = new Array ("SCORE", "http://www.eastbayscore.org/","_blank");
	 	subSubMenu[5][4] = new Array();
     subMenu[5][5] = new Array ("Shop Vallejo First", "http://www.shopvallejofirst.com/","_blank");
	 	subSubMenu[5][5] = new Array();
	 subMenu[5][6] = new Array ("Six Flags Tickets & Experiences", "sixflags.html","_top");
	 	subSubMenu[5][6] = new Array();
     subMenu[5][7] = new Array ("SBDC - Small Business Development Center", "Partners.html","_top");
	 	subSubMenu[5][7] = new Array();
     subMenu[5][8] = new Array ("Solano Economic Development Corp.", "http://www.solanoedc.org/","_blank");
	 	subSubMenu[5][8] = new Array();
     subMenu[5][9] = new Array ("Vallejo Business Alliance", "VBA.html","_top");
	 	subSubMenu[5][9] = new Array();
     subMenu[5][10] = new Array ("ValNet - Vallejo Business Networking Group", "http://www.vallejovalnet.com/","_blank");
	 	subSubMenu[5][10] = new Array();
     subMenu[5][11] = new Array ("ValPAC - Vallejo Chamber Political Action Committee", "http://valpac.org/","_blank");
	 	subSubMenu[5][11] = new Array();
     subMenu[5][12] = new Array ("Vallejo City Unified School District", "http://www.vallejo.k12.ca.us/","_blank");
	 	subSubMenu[5][12] = new Array();
     subMenu[5][13] = new Array ("Vallejo Convention and Visitors Bureau", "http://www.visitvallejo.com/","_blank");
		subSubMenu[5][13] = new Array();
	 subMenu[5][14] = new Array ("Vallejo Main Street/CCRC", "http://www.vallejomainstreet.com/","_blank");
	 	subSubMenu[5][14] = new Array();
	 
	 horizontalSubOffset[6] = -195; //These ones need to go to the right, so I made them negative, suze of sub sub menu
	Menu[6] = new Array("&nbsp;&nbsp;&nbsp;&nbsp;Community&nbsp;&nbsp;&nbsp;&nbsp;", "AboutVallejo.htm","_top");
     subMenu[6] = new Array();
	 	subSubMenu[6] = new Array();
	 subMenu[6][0] = new Array ("About Vallejo", "AboutVallejo.htm","_top");
	 	subSubMenu[6][0] = new Array();
     subMenu[6][1] = new Array ("Working", "stengthening.htm","_top");
	 	subSubMenu[6][1] = new Array();
		subSubMenu[6][1][0] = new Array ("Strengthening the Local Economy", "stengthening.htm","_top");
		subSubMenu[6][1][1] = new Array ("Kosmont Study", "Kosmont.htm","_top");
		subSubMenu[6][1][2] = new Array ("Demographics", "demographics.htm","_top");
		subSubMenu[6][1][3] = new Array ("Mare Island Commercial Map", "PDF/LEASE%20EXHIBIT%2048'x96%20Lease%20Map%20(1).pdf","_blank");
     subMenu[6][2] = new Array ("Living", "VallejoToday.htm","_top");
	 	subSubMenu[6][2] = new Array();
		subSubMenu[6][2][0] = new Array ("Vallejo Today", "VallejoToday.htm","_top");
		subSubMenu[6][2][1] = new Array ("Relocation Information", "RelocationInfo.htm","_top");
		subSubMenu[6][2][2] = new Array ("Employment(Major Employers)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", "Employment.htm","_top");
		subSubMenu[6][2][3] = new Array ("Frequent Phone Numbers", "FrequentPhone.htm","_top");
		subSubMenu[6][2][4] = new Array ("Transportation", "Trasportation.htm","_top");
     subMenu[6][3] = new Array ("Arts & Culture", "ArtCulture.htm","_top");
	 	subSubMenu[6][3] = new Array();
     subMenu[6][4] = new Array ("Business Property", "http://gis.ci.vallejo.ca.us/","_blank");
	 	subSubMenu[6][4] = new Array();
	 subMenu[6][5] = new Array ("Economic Development", "EconomicDevelopment.html","_top");
	 	subSubMenu[6][5] = new Array();
     subMenu[6][6] = new Array ("Education", "EducationWorkForce.htm","_top");
	 	subSubMenu[6][6] = new Array();
     subMenu[6][7] = new Array ("Health Care & Community Service", "HealthComm.htm","_top");
	 	subSubMenu[6][7] = new Array();
     subMenu[6][8] = new Array ("Meeting & Event Facilities", "meetinghalls.html","_top");
	 	subSubMenu[6][8] = new Array();
     subMenu[6][9] = new Array ("Local Weather", "http://www.areacodehelp.com/cgi-bin/weather/weather.cgi?pands=vallejo,ca","_blank");
		subSubMenu[6][9] = new Array();
	 subMenu[6][10] = new Array ("Recreation", "recreation.htm","_top"); 
	 	subSubMenu[6][10] = new Array(); 
	 subMenu[6][11] = new Array ("Clubs and Organizations", "ClubsOrgs.html","_top"); 
	 	subSubMenu[6][11] = new Array(); 
	 subMenu[6][12] = new Array ("Job Search", "http://vallejochamber.chambermaster.com/directory/jsp/jobs/Search.jsp?ccid=445","_top"); 
	 	subSubMenu[6][12] = new Array(); 
		
////// FORMAT MENU  ///////////////////////////////////////////////////////////////////
var orientation = "horizontal";                 // Orientation of menu.  (horizontal, vertical)
var cellPadding = 3;                            // Cell Padding
var cellBorder = 1;                            // Include table border (for no border, enter 0)
var verticalOffset = 23;                        // Vertical offset of Sub Menu. (if set to 0, default offset will be used)
var verticalSubOffset = 0; 						// Vertical offset of Sub Menu. (No default for this)
var horizontalOffset = 0;                       // Horizontal offset of Sub Menu. (if set to 0, default offset will be used)
var subMenuDelay = 1;                           // Time sub menu stays visible for (in seconds)

// Main Menu Items, 013366
var borderColor = "#FFFFFF";                    // Border Colour 
var menuBackground = "#003366";                 // Cell Background Colour
var menuHoverBackground = "#003366";            // Cell Background Colour on mouse rollover
var fontFace = "arial";                         // Font Face
var fontColour = "#DDDDDD";                     // Font Colour
var fontHoverColour = "#C4B78C";                // Font Colour on mouse rollover
var fontSize = "11pt";                           // Font Size
var fontDecoration = "none";                    // Style of the link text (none, underline, overline, line-through)
var fontWeight = "normal";                      // Font Weight (normal, bold)

// Sub Menu Items
var sborderColor = "#FFFFFF";                    // Border Colour 
var smenuBackground = "#003366";                 // Cell Background Colour
var smenuHoverBackground = "#003366";            // Cell Background Colour on mouse rolloverr
var sfontFace = "arial";                         // Font Face
var sfontColour = "#DDDDDD";                     // Font Colour
var sfontHoverColour = "#C4B78C";                // Font Colour on mouse rollover
var sfontSize = "9pt";                           // Font Size
var sfontDecoration = "none";                    // Style of the link text (none, underline, overline, line-through)
var sfontWeight = "normal";                      // Font Weight (normal, bold)



////// DO NOT EDIT BELOW THIS LINE  ///////////////////////////////////////////////////////////////////

// Browser Sniffer
var isIE = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;

var timer;
var obj = (isIE)?"document.all":"document.getElementById";

// Default horizontal and vertical offsets
if (verticalOffset == 0 || verticalOffset == "") 
{
  verticalOffset = (orientation=="horizontal")?20:5;
}

if (horizontalOffset == 0 || horizontalOffset == "") 
{
  horizontalOffset = (orientation=="horizontal")?-1:70;
}

// Menu Styles
document.writeln ('<style>');
document.writeln ('.rcMenuStatic {font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+';background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuHover  {font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+';background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcSubMenuStatic {font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand}');
document.writeln ('.rcSubMenuHover  {font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand}');
document.writeln ('</style>');

// Build and show the main menu items
function showMenus()
{
  if (orientation == "vertical")
  {
    document.writeln ('<table border="0" cellpadding="0" cellspacing="'+cellBorder+'" bgColor="'+borderColor+'">');
  }
  else
  {
    document.writeln ('<table border="0" cellpadding="0" cellspacing="'+cellBorder+'" bgColor="'+borderColor+'"><tr>');
  }  
  for (x=0; x<Menu.length; x++)
  {
    if (orientation=="vertical") document.writeln('<tr>');
    document.writeln ('<td onclick="tdMouseClick(\'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown('+x+', \'button'+x+'\'); " onMouseOut="clearMenu('+x+')" ><div id="button'+x+'"><table border="0" cellpadding="'+cellPadding+'" cellspacing="0" width="100%"><tr><td class="rcMenuStatic" id="cell'+x+'" nowrap>');
    document.writeln ('<a id="mainLink'+x+'" href="'+Menu[x][1]+'" target="'+Menu[x][2]+'" class="rcMenuStatic">'+Menu[x][0]+'</a></td>');
    document.writeln ('</tr></table></div></td>');    
    if (orientation=="vertical") document.writeln('</tr>');
  }
  if (orientation == "vertical")
  {
    document.writeln ('</table>');
  }
  else
  {
      document.writeln ('</tr></table>');
  }   

}  

// Build the sub menu items
  for (x=0; x<Menu.length; x++)
  { 
    if (subMenu[x].length > 0)
    {     
      document.writeln ('<div id="MENU'+x+'" style="visibility:hidden; position:absolute; z-index:2" >');
      document.writeln ('<table border="0" cellpadding="'+cellPadding+'" cellspacing="'+cellBorder+'" bgColor="'+sborderColor+'">');
      for (y=0; y<subMenu[x].length; y++)
      {
        document.writeln ('<tr><td id="subMenu'+x+y+'" class="rcSubMenuStatic" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+'); popSubDown('+x+', '+y+', \'button'+x+y+'\');" onMouseOut="clearMenu('+x+');" onclick="tdMouseClick(\'subLink'+x+y+'\')" nowrap><div id="button'+x+y+'"><a id="subLink'+x+y+'" href="'+subMenu[x][y][1]+'" target="'+subMenu[x][y][2]+'" class="rcSubMenuStatic">'+subMenu[x][y][0]+'</a></div></td></tr>');
      }
      document.writeln ('</table></div>');
    }
	
// Build the sub sub menu items
	if (subSubMenu[x].length > 0)
    { 
  		for (y=0; y<subSubMenu[x].length; y++)
  		{ 
    		if (subSubMenu[x][y].length > 0)
    		{     
      			document.writeln ('<div id="sMENU'+x+y+'" style="visibility:hidden; position:absolute; z-index:2" >');
      			document.writeln ('<table border="0" cellpadding="'+cellPadding+'" cellspacing="'+cellBorder+'" bgColor="'+sborderColor+'">');
      			for (z=0; z<subSubMenu[x][y].length; z++)
      			{
        			document.writeln ('<tr><td id="subSubMenu'+x+y+z+'" class="rcSubMenuStatic" onMouseOver="hoverSubMenu(); highlightSubMenu(\'sub\','+x+','+y+','+z+')" onMouseOut="clearSubMenu('+x+','+y+');" onclick="tdMouseClick(\'subSubLink'+x+y+z+'\')" nowrap><a id="subSubLink'+x+y+z+'" href="'+subSubMenu[x][y][z][1]+'" target="'+subSubMenu[x][y][z][2]+'" class="rcSubMenuStatic">'+subSubMenu[x][y][z][0]+'</a></td></tr>');
      			}
      			document.writeln ('</table></div>');
   			}
		}
	}
  }

// Change colour or menu and submenu items when the mouse hovers over.  
function highlightMenu(element,mainMenu,dropMenu,state)
{
  state=(state == "hover")?"rcMenuHover":"rcMenuStatic";
  if (element == "sub")
  {
    for (x=0; x < subMenu[mainMenu].length; x++)
    {
      eval(obj+'("subMenu'+mainMenu+x+'").className = "rcSubMenuStatic"');
      eval(obj+'("subLink'+mainMenu+x+'").className = "rcSubMenuStatic"');
    }
    eval(obj+'("subMenu'+mainMenu+dropMenu+'").className="rcSubMenuHover"');
    eval(obj+'("subLink'+mainMenu+dropMenu+'").className="rcSubMenuHover"');
  }
  else
  {
    eval(obj+'("cell'+mainMenu+'").className = "'+state+'"');
    eval(obj+'("mainLink'+mainMenu+'").className = "'+state+'"');
  }
}

// Change colour or subSubmenu items when the mouse hovers over.  
function highlightSubMenu(element,mainMenu,dropMenu,dropDropMenu,state)
{
  state=(state == "hover")?"rcMenuHover":"rcMenuStatic";
  if (element == "sub")
  {
    for (x=0; x < subSubMenu[mainMenu][dropMenu].length; x++)
    {
      eval(obj+'("subSubMenu'+mainMenu+dropMenu+x+'").className = "rcSubMenuStatic"');
      eval(obj+'("subSubLink'+mainMenu+dropMenu+x+'").className = "rcSubMenuStatic"');
    }
    eval(obj+'("subSubMenu'+mainMenu+dropMenu+dropDropMenu+'").className="rcSubMenuHover"');
    eval(obj+'("subSubLink'+mainMenu+dropMenu+dropDropMenu+'").className="rcSubMenuHover"');
  }
  else
  {
    eval(obj+'("cell'+mainMenu+'").className = "'+state+'"');
    eval(obj+'("mainLink'+mainMenu+'").className = "'+state+'"');
  }
}

// Find positioning for sub menus
function getOffset(obj, dim) 
{
  if(dim=="left") 
  {
    oLeft = obj.offsetLeft;
    while(obj.offsetParent!=null)
    {   
      oParent = obj.offsetParent;
      oLeft += oParent.offsetLeft;
      obj = oParent;
    }
    return oLeft;
  }
  else if(dim=="top")
  {
    oTop = obj.offsetTop;
    while(obj.offsetParent!=null)
    {
      oParent = obj.offsetParent;
      oTop += oParent.offsetTop;
      obj = oParent;
    }
    return oTop;
  }
  else
  {
    alert("Error: invalid offset dimension '" + dim + "' in getOffset()");
    return false;
  }
}

// Find positioning for sub sub menus
function getSubOffset(obj, dim) 
{
  if(dim=="left") 
  {
    oLeft = obj.offsetLeft;
    while(obj.offsetParent!=null)
    {   
      oParent = obj.offsetParent;
      oLeft += oParent.offsetLeft;
      obj = oParent;
    }
    return (oLeft);
  }
  else if(dim=="top")
  {
    oTop = obj.offsetTop;
    while(obj.offsetParent!=null)
    {
      oParent = obj.offsetParent;
      oTop += oParent.offsetTop;
      obj = oParent;
    }
    return oTop;
  }
  else
  {
    alert("Error: invalid offset dimension '" + dim + "' in getOffset()");
    return false;
  }
}

// Show sub menus
function popDown(param, id)
{
  var menu;
  var button;

  if (id)
  {
    getOffset(eval(obj+'(id)'),'left');
    getOffset(eval(obj+'(id)'),'top');
  }

  n = 0;
  while (n < Menu.length)
  {
 	invSubDown(n);
	
    //button = eval(obj+'("cell'+n+'")')
    menu = "MENU"+n;
    if (param == n)
    {
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "visible"');
          eval(obj+'(menu).style.left = oLeft + horizontalOffset;');
          eval(obj+'(menu).style.top = oTop + verticalOffset;');
        }
         highlightMenu('main',n,'','hover');
         if (subMenu[param].length > 0)
         {
           for (x=0; x<subMenu[param].length; x++)
           {
             eval (obj+'("subMenu'+param+x+'").className = "rcSubMenuStatic"');
             eval (obj+'("subLink'+param+x+'").className = "rcSubMenuStatic"');
           }
         }
      }
      else 
      {
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "hidden"');
        }
        highlightMenu ('main',n,'','static');

      }
    n++
  }  
}

// Show sub sub menus
function popSubDown(param, param2, id)
{
  var menu;
  var button;

  if (id)
  {
    getSubOffset(eval(obj+'(id)'),'left');
    getSubOffset(eval(obj+'(id)'),'top');
  }
  n = 0;
  while (n < subMenu[param].length)
  {

    //button = eval(obj+'("cell'+n+'")')
    menu = "sMENU"+param+n;
    if (param2 == n)
    {
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "visible"');
          eval(obj+'(menu).style.left = oLeft + horizontalSubOffset[param];');
          eval(obj+'(menu).style.top = oTop + verticalSubOffset;');
        }
         //highlightMenu('sub',param,n,'hover');
         if (subSubMenu[param][param2].length > 0)
         {
           for (x=0; x<subSubMenu[param][param2].length; x++)
           {
             eval (obj+'("subSubMenu'+param+param2+x+'").className = "rcSubMenuStatic"');
             eval (obj+'("subSubLink'+param+param2+x+'").className = "rcSubMenuStatic"');
           }
         }
      }
      else 
      {
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "hidden"');
        }
        //highlightMenu ('sub',param,n,'static');

      }
    n++
  }  
}

// Hide sub sub menus
function invSubDown(param)
{
  var menu;
  var button;

  inv = 0;
  while (inv < subMenu[param].length)
  {

    //button = eval(obj+'("cell'+inv+'")')
    menu = "sMENU"+param+inv;

    if (eval(obj+'(menu)'))
    {
        eval(obj+'(menu).style.visibility = "hidden"');
    }
       
    inv++
  }  
}

// Re-set timer for sub menus
function hoverMenu()
{
  if(timer)
  clearTimeout(timer);
  
  if(timer2)
  clearTimeout(timer2);
}

// Re-set timer for sub sub menus
function hoverSubMenu()
{
  if(timer)
  clearTimeout(timer);
  
  if(timer2)
  clearTimeout(timer2);
}

// Set timer for sub menus
function clearMenu(menu)
{
  setDelay = subMenuDelay*1000;
  delay = (subMenu[menu].length > 0)?setDelay:1;
  
  timer = setTimeout("popDown("+(Menu.length + 1)+")",delay);
  timer2 = setTimeout("popSubDown("+menu+","+(subMenu[menu].length + 1)+")",delay);
}

// Set timer for sub menus
function clearSubMenu(menu,menu2)
{
  setDelay = subMenuDelay*1000;
  delay2 = (subSubMenu[menu][menu2].length > 0)?setDelay:1;
  
  timer2 = setTimeout("popSubDown("+menu+","+(subMenu[menu].length + 1)+")",delay2);
  timer = setTimeout("popDown("+(Menu.length + 1)+")",delay2);
  
}

// when you click the box, perform the same function as if the user had clicked the hyperlink
function tdMouseClick(theElement)
{
  eval(obj+'(theElement).click()');
}
////// END MENU CODE  ///////////////////////////////////////////////////////////////////
