<!--//------------------------------------------------------------------------------------
if (document.all)
{
  n=0;
  ie=1;
  fShow="visible";
  fHide="hidden";
  menuSubItemStyleClass="clsSubMenuItemIE";
  menuHeaderStyleClass="clsMenuHeaderStyleIE";
}
else if (document.layers)
{
  n=1;
  ie=0;
  fShow="show";
  fHide="hide";
  menuSubItemStyleClass="clsSubMenuItemNS";
  menuHeaderStyleClass="clsMenuHeaderStyleNS";
}
else
{
  n=0;
  ie=0;
}

function ttnbRefreshMenuStructure()
{
  if (n) // for Netscape only
  {
    var menubarIndex = 1;   // ignore "Home"
    for (index=0;index < top.document.layers.length;index++) {
      if (top.document.layers[index].id.indexOf("submenu") != -1) {
	    layerHTMLstring = "";
        layerHTMLstring += "<table border="+menubar.subMenuPaneBorder+" bgcolor="+menubar.bgColor+">\n";
        
		for (itemIndex=0;itemIndex < top.document.layers[index].document.links.length;itemIndex++) {
	      /* Now rewrite the layer using our stored text. */
          layerHTMLstring += "<tr><td><a class="+menuSubItemStyleClass+" title='' href='";
          layerHTMLstring += menubar.subMenuLayerDataArray[menubarIndex][itemIndex].location;
          layerHTMLstring += "'>";
          layerHTMLstring += menubar.subMenuLayerDataArray[menubarIndex][itemIndex].text;
          layerHTMLstring += "&nbsp;</a></td></tr>\n";
		}
        layerHTMLstring += "</table>\n";
        top.document.layers[index].document.open();
        top.document.layers[index].document.write(layerHTMLstring);
        top.document.layers[index].document.close();
        top.document.layers[index].onMouseOver = setCurMenuVisible2;
	    top.document.layers[index].onMouseOut = setCurMenuInvisible;
        top.document.layers[index].document.linkColor = "#FFFFFF";
        top.document.layers[index].document.vlinkColor = "#87AFBF";
        top.document.layers[index].document.alinkColor = "#87AFBF";
        top.document.layers[index].document.hlinkColor = "#87AFBF";
		menubarIndex++;
	  }
      if (top.document.layers[index].id.indexOf("menuheader") != -1) {
		top.document.layers[index].visibility = fShow;
	  }
	}
  }
}

function MenuLayerData()
{
  // no code needed
}

function addItem(idItem, text, location, altLocation)
{
  var Lookup = "<!-- ITEM "+idItem+" -->";
  if (HTMLstr.indexOf(Lookup) != -1)
  {
    alert(idItem + " already exist");
    return;
  }

  var MENUitem = "\n<!-- ITEM "+idItem+" -->\n";
  
  /* New code that calculates the width of each menu heading individually depending on heading text. */
  this.menuHeaderPaneWidth = (text.length + 2) * this.menuHeaderPaneWidthFactor;

  /* This is a more robust way of making sure that menubar headers don't wrap onto a second line. */
  /* But take it out again because it causes other problems. */
  //text = text.replace(" ", "&nbsp;");

  if (n)
  {
    var index = this.subMenuLayerDataArray.length;
    this.subMenuLayerDataArray[index] = new Array();
    this.menuHeaderLayerDataArray[idItem] = new MenuLayerData();
    this.menuHeaderLayerDataArray[idItem].location = location;

    MENUitem += "<td width="+this.menuHeaderPaneWidth+" height="+this.subMenuPaneHeight+">\n";
    MENUitem += "<ilayer name="+idItem+"menuheader" + " width="+this.menuHeaderPaneWidth+" visibility=hide>";
    MENUitem += "<a title='" + text + "' href='"+location+"' class="+menuHeaderStyleClass;
    MENUitem += " onMouseOver='displaySubMenu(";
    MENUitem += '"';
    MENUitem += idItem;
    MENUitem += '"';
    MENUitem += ")' onMouseOut='setCurMenuInvisible2();' onclick='return true;'>";
    MENUitem += "&nbsp;&nbsp;";
    MENUitem += text;
    MENUitem += "&nbsp;";
    MENUitem += "</a>";
    MENUitem += "</ilayer>";
    MENUitem += "</td>\n";
  }
  else if (ie)
  {
    MENUitem += "<td  height="+this.subMenuPaneHeight+">\n";
	/* the menuHeaderStyle on the DIV seems to affect vertical positioning of the header menubar text? */
    MENUitem += "<div width="+this.menuHeaderPaneWidth+" id='"+idItem+"' style='position:relative; "+this.menuHeaderStyle+"' "
    MENUitem += 'onMouseOver="';
    MENUitem += "displaySubMenu('"+idItem+"')";
    MENUitem += '" ';
    MENUitem += "onMouseOut='setCurMenuInvisible();'>\n";
    //MENUitem += "<a class="+menuHeaderStyleClass+" title='"+text+"'";
    MENUitem += "<a class="+menuHeaderStyleClass+" title=''";
    if (location != null)
    {
      MENUitem += "href='"+location+"' onClick='hideCurrentMenu()'";
    }
    else
    {
      if (altLocation != null)
      {
        MENUitem += "href='"+altLocation+"' ";
      }
      else
      {
        MENUitem += "href='.' ";
      }
      MENUitem += "onClick='return false;'"
    }
    MENUitem += ">";
    MENUitem += "&nbsp;&nbsp;";
    MENUitem += text;
    MENUitem += "&nbsp;";
    MENUitem += "</a>\n";
    MENUitem += "</div>\n";
    MENUitem += "</td>\n";
  }

  MENUitem += "<!-- END OF ITEM "+idItem+" -->\n";
  MENUitem += "<!-- MAIN_MENU -->\n";

  HTMLstr = HTMLstr.replace("<!-- MAIN_MENU -->\n", MENUitem);
  
}

function addSubItem(idParent, text, location)
{
  var MENUitem = "";
  Lookup = "<!-- ITEM "+idParent+" -->";
  if (HTMLstr.indexOf(Lookup) == -1)
  {
    alert(idParent + " not found");
    return;
  }
  Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
  if (HTMLstr.indexOf(Lookup) == -1)
  {
    MENUitem += "\n";
    if (n)
    {
      MENUitem += "<layer id='"+idParent+"submenu' visibility=hide bgcolor='"+this.bgColor;
      MENUitem += " onMouseOut='setCurMenuInvisible();' onMouseOver='setCurMenuVisible2();'";
      MENUitem += "'>\n";
      MENUitem += "<table border="+this.subMenuPaneBorder+" bgcolor="+this.bgColor+">\n";
      MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
      MENUitem += "</table>\n";
      MENUitem += "</layer>\n";
    }
    if (ie)
    {
      MENUitem += "<span bgcolor=black id='"+idParent+"submenu' onMouseOut='setCurMenuInvisible();'";
      MENUitem += " onMouseOver='setCurMenuVisible();'";
      MENUitem += " style='background-color:"+this.bgColor+"; position:absolute; visibility: hidden '>\n";
      MENUitem += "<table border="+this.subMenuPaneBorder+" bgcolor="+this.bgColor+">\n";
      MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
      MENUitem += "</table>\n";
      MENUitem += "</span>\n";
    }
    MENUitem += "\n";
    MENUitem += "<!-- SUB_MENU -->\n";
    HTMLstr = HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
  }

  if (n)
  {
      var currentMenuIndex = this.subMenuLayerDataArray.length - 1;
      var index = this.subMenuLayerDataArray[currentMenuIndex].length;
      this.subMenuLayerDataArray[currentMenuIndex][index] = new MenuLayerData();
      this.subMenuLayerDataArray[currentMenuIndex][index].text = text;
      this.subMenuLayerDataArray[currentMenuIndex][index].location = location;
  }
  MENUitem = "<tr><td><a class="+menuSubItemStyleClass+" title='' href='"+location+"'>"+text+"&nbsp;</a></td></tr>\n";
  //MENUitem = "<tr><td><a style="+menuSubItemStyle+" title='' href='"+location+"'>"+text+"&nbsp;</a></td></tr>\n";
  //MENUitem = "<tr><td><a class="+menuSubItemStyleClass+" title='"+text+"' href='"+location+"'>"+text+"&nbsp;</a></td></tr>\n";
  MENUitem += Lookup;
  HTMLstr = HTMLstr.replace(Lookup, MENUitem);

}

function showMenuBar()
{
  document.writeln(HTMLstr);
}

function MenuBar()
{
   this.bgColor = "#0000CC";
  if (ie)
  {
    /* style (as well as styleClass) needed for IE DIV */
    this.menuHeaderStyle = "font: bold 7pt Verdana, Arial, Helvetica; color: yellow; text-decoration: none;";
    //this.subMenuPaneWidth = subMenuPaneWidth;
    this.menuHeaderPaneWidthFactor = 15;
    this.subMenuPaneHeight = 18;
    this.menuHeaderIndent = 7;
	this.rightmargin = 1;
  }
  else if (n)
  {
    this.subMenuLayerDataArray = new Array();
    this.menuHeaderLayerDataArray = new Array();
	
    this.menuHeaderStyle = "font: bold 8pt Verdana, Arial, Helvetica; color: white; text-decoration: none;";
    //this.subMenuPaneWidth = subMenuPaneWidth - 9;
    this.menuHeaderPaneWidthFactor = 6;
    this.subMenuPaneHeight = 18;
    this.menuHeaderIndent = 1;
	if ("index" != "newspaper edition") {
	  this.rightMargin = 1;
	} else {
	  this.rightMargin = 400;
	}
  }
  this.mainPaneBorder = 0;
  this.subMenuPaneBorder = 0;

   this.addItem    = addItem;
  this.addSubItem = addSubItem;
  this.showMenuBar   = showMenuBar;

   lastMenu = null;
  lastMenuHeading = null;

  HTMLstr = "<!-- MENU PANE DECLARATION BEGINS -->\n";
  HTMLstr += "\n";
  HTMLstr += "<table width=650 cellpadding=0 height=14 cellspacing=0 bgcolor="+this.bgColor+" border="+this.mainPaneBorder+">\n";
  HTMLstr += "<tr>";
  HTMLstr += "<td width='"+this.menuHeaderIndent+"'><font face='verdana,arial,sans-serif' size='1' color='#ffffff'>&nbsp;</font></td>";
  HTMLstr += "<!-- MAIN MENU STARTS -->\n";
  HTMLstr += "<!-- MAIN_MENU -->\n";
  HTMLstr += "<!-- MAIN MENU ENDS -->\n";
  HTMLstr += "<td width='"+this.rightMargin+"'><font face='verdana,arial,sans-serif' size='1' color='#ffffff'>&nbsp;</font></td>";
  HTMLstr += "</tr>\n";
  HTMLstr += "</table>\n";
  HTMLstr += "\n";
  HTMLstr += "<!-- SUB MENU STARTS -->\n";
  HTMLstr += "<!-- SUB_MENU -->\n";
  HTMLstr += "<!-- SUB MENU ENDS -->\n";
  HTMLstr += "\n";
  HTMLstr += "<!-- MENU PANE DECLARATION ENDS -->\n";
}

function displaySubMenu(idMainMenu)
{
  var menu;
  var submenu;
  //alert(eval("nav" + idMainMenu));
  
  if (n)
  {
    idMainMenuLayerName = idMainMenu + "menuheader";
    menu = document.layers[idMainMenuLayerName];

     if (document.layers[idMainMenu+"submenu"] != null)
    {
      submenu = document.layers[idMainMenu+"submenu"];
      if (lastMenu != null && lastMenu != submenu) hideCurrentMenu();
	  
      submenu.left = document.layers[idMainMenuLayerName].pageX + 3;
      submenu.top  = document.layers[idMainMenuLayerName].pageY +
      document.layers[idMainMenuLayerName].clip.height;
		if (eval("nav" + idMainMenu)) {
      		submenu.visibility = fShow;
		}

      submenu.onMouseOut=hideCurrentMenu;
    } else
    {
      if (lastMenu != null) hideCurrentMenu();
    }
  }
  else if (ie)
  {
     if (document.all.item(idMainMenu+"submenu") != null)
    {
      menu = eval(idMainMenu);
      submenu = eval(idMainMenu+"submenu.style");

      var totalOffset = 0;
      var item = menu;
      do
      {
        totalOffset += eval('item.offsetLeft');
        item = eval('item.offsetParent');
      } while (item != null);
      submenu.left = totalOffset+3;

      submenu.top  = menu.style.top;
	  if (eval("nav" + idMainMenu)) {
      		submenu.visibility = fShow;
		}
      
    }

    if (lastMenu != null && lastMenu != submenu)
    {
      hideCurrentMenu();
    }

  }
  
  setCurMenuVisible();
  lastMenu = submenu;
  lastMenuHeading = menu;

}

function hideCurrentMenu()
{
  if (lastMenu != null)
  {
    lastMenu.visibility = fHide;
    lastMenu = null;
    lastMenuHeading = null;
  }
}

var timeOutID = null;
function setCurMenuVisible()
{
   if (timeOutID)
  {
    clearTimeout(timeOutID);
    timeOutID = null;
  }
}

function setCurMenuVisible2()
{
   if (timeOutID)
  {
    clearTimeout(timeOutID);
    timeOutID = null;
  }

  /* This timeout when executed should clear out any hide timeout set by leaving the menu bar. (?) */  
  timeOutID = setTimeout("setCurMenuVisible()", 300)
  
}

function setCurMenuInvisible()
{
   if (ie || 
         (n && lastMenuHeading && lastMenu &&
          lastMenuHeading.name+"submenu" != lastMenu.name))
  {
    timeOutID = setTimeout("hideCurrentMenu()", 500)
  }
}

function setCurMenuInvisible2()
{
   if (n)
  {
    timeOutID = setTimeout("hideCurrentMenu()", 500)
  }
}


var menubar = new MenuBar();

         menubar.addItem('Home', 'HOME', 'index.html', null);
           menubar.addSubItem('Home', 'Home', 'index.html');
		   
           menubar.addSubItem('Home', 'Multimedia', 'http://www.geocities.com/central_united/multimedia.html');
		   
		    var navHome = true;

         menubar.addItem('Bill', 'CLUB&nbsp;DETAILS', 'details.html', null);
           menubar.addSubItem('Bill', 'Club&nbsp;Details', 'details.html');
		   
           menubar.addSubItem('Bill', 'Club&nbsp;History', 'history.html');
		 
           menubar.addSubItem('Bill', 'Club&nbsp;Profile', 'profile.html');

           menubar.addSubItem('Bill', 'Honours&nbsp;Board', 'honours.html');
		   
		    var navBill = true;

         menubar.addItem('News', 'NEWS', 'news.html', null);
           menubar.addSubItem('News', 'The Latest News', 'news.html');

           menubar.addSubItem('News', 'Archived News', 'archive_news.html');

		   var navNews = true;

         menubar.addItem('Leagues', 'LEAGUES', 'nationalleague.html', null);
           menubar.addSubItem('Leagues', 'National&nbsp;League', 'nationalleague.html');
		   
           menubar.addSubItem('Leagues', 'Northern&nbsp;Premier', 'premierleague.html');
		   
           menubar.addSubItem('Leagues', 'Under&nbsp;19s', 'under19s.html');
		   
           menubar.addSubItem('Leagues', 'Fams&nbsp;2', 'fams2.html');
		   
           menubar.addSubItem('Leagues', 'Over&nbsp;30s', 'over_30s.html');
		   
           menubar.addSubItem('Leagues', 'Over&nbsp;35s', 'over_35s.html');
		   
		    var navLeagues = true;

         menubar.addItem('Cup', 'CUP', 'chatcup.html', null);
           menubar.addSubItem('Cup', '1998&nbsp;Semi-Final', 'ccupsemi.html');
		   
           menubar.addSubItem('Cup', '1998&nbsp;Semi-Final&nbsp;Pics', 'chatham_cup_semi-final_act.html');
		   
           menubar.addSubItem('Cup', '1998&nbsp;Chatham&nbsp;Cup&nbsp;Final', 'central_win_cup_again.html');
		   
           menubar.addSubItem('Cup', '1998&nbsp;Chatham&nbsp;Cup&nbsp;Final&nbsp;Pics', 'chatham_cup_final_1998.html');

           menubar.addSubItem('Cup', '2001&nbsp;Chatham&nbsp;Cup&nbsp;Semi-Final', 'cc_semi2001.htm');
		   
           menubar.addSubItem('Cup', '2001&nbsp;Chatham&nbsp;Cup&nbsp;Final', 'cc_final2001.html');

           menubar.addSubItem('Cup', '2005&nbsp;Chatham&nbsp;Cup&nbsp;Semi-Final', 'cc_semi2005.html');
		   
           menubar.addSubItem('Cup', '2005&nbsp;Chatham&nbsp;Cup&nbsp;Final', 'cc_final2005.html');
		   
		    var navCup = true;

         menubar.addItem('Reports', 'MATCH&nbsp;REPORTS', 'latest.html', null);
		   menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;2003', 'NL2003.html');
		   
           menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;2002', 'latest.html');

           menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;2001', 'latest2001.html');
		   
           menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;2000', 'latest2000.html');
		   
           menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;1999', 'latest99.html');
		   
           menubar.addSubItem('Reports', 'National&nbsp;League&nbsp;1998', 'latest98.html');
		   
		              menubar.addSubItem('Reports', 'Northern&nbsp;Premier&nbsp;2002', 'np2002_main_page.html');
					  		   
           menubar.addSubItem('Reports', 'Northern&nbsp;Premier&nbsp;2001', 'np2001_match_reports.html');
	   
		    var navReports = true;

         menubar.addItem('Players', 'PLAYER&nbsp;PROFILES', 'player_profiles.html', null);
           menubar.addSubItem('Players', 'Michael&nbsp;Ridenton', 'michael_profile.html');
		   
           menubar.addSubItem('Players', 'Jason&nbsp;New', 'jason_profile.html');
		   
           menubar.addSubItem('Players', 'Bruce&nbsp;Hill', 'bruce_profile.html');
		   
           menubar.addSubItem('Players', 'Greg&nbsp;Uhlmann', 'greg_profile.html');
		   
           menubar.addSubItem('Players', 'Ross&nbsp;Nicholson', 'ross_profile.html');
		   
           menubar.addSubItem('Players', 'Daniel&nbsp;Aliaga', 'daniel_profile.html');
		   
           menubar.addSubItem('Players', 'Andy&nbsp;Levick', 'andy_profile.html');
		   
           menubar.addSubItem('Players', 'Campbell&nbsp;Banks', 'campbell_profile.html');
		   
           menubar.addSubItem('Players', 'Keith&nbsp;(Buzzer)&nbsp;Mackay', 'buzzer_profile.html');
		   
		    var navPlayers = true;

         menubar.addItem('Moments', 'CLUB&nbsp;MOMENTS', 'moments_people.html', null);
           menubar.addSubItem('Moments', 'Faces&nbsp;at&nbsp;the&nbsp;Club', 'faces_at_the_club.html');
		   
           menubar.addSubItem('Moments', 'It&nbsp;Really&nbsp;Happened!', 'it_really_happened_.htm');
		   
           menubar.addSubItem('Moments', 'Melbourne&nbsp;1998', 'melbourne.html');

           menubar.addSubItem('Moments', 'Prizewinners&nbsp;1998', 'winter_prize98.html');
		   
           menubar.addSubItem('Moments', 'Summer&nbsp;League&nbsp;Prizewinners&nbsp;97-98', 'prizewinners.html');
		   
           menubar.addSubItem('Moments', 'Oceania&nbsp;Club&nbsp;Championships&nbsp;Fiji&nbsp;1999', 'fiji1999.html');

           menubar.addSubItem('Moments', 'Wynton&nbsp;Rufer', 'wynton_rufer.html');

           menubar.addSubItem('Moments', 'World&nbsp;Cup&nbsp;Fever&nbsp;1998', 'report.html');

           menubar.addSubItem('Moments', 'Players&nbsp;From&nbsp;Overseas', 'miki.html');

           menubar.addSubItem('Moments', 'Who&nbsp;is&nbsp;Paul&nbsp;Marshall', 'marshall_lore.html');

           menubar.addSubItem('Moments', 'Ross&nbsp;Nicholson&nbsp;World&nbsp;Cup&nbsp;Keeper', 'ross2002.html');
		   
	       menubar.addSubItem('Moments', 'Pictures&nbsp;of&nbsp;club&nbsp;faithful&nbsp;after&nbsp;Grand&nbsp;Final', 'faithful_2001.html');		   

	       menubar.addSubItem('Moments', 'Youngs&nbsp;Make&nbsp;History!', 'youngs.html');
		   
	       menubar.addSubItem('Moments', 'Kiwitea&nbsp;Street&nbsp;Legend&nbsp;-&nbsp;Ivo&nbsp;Trbuhovich', 'ivo_t.html');

		    var navMoments = true;

         menubar.addItem('Links', 'LINKS', 'nzlinks.html', null);
           menubar.addSubItem('Links', 'New&nbsp;Zealand&nbsp;Links', 'nzlinks.html');
		   
           menubar.addSubItem('Links', 'General&nbsp;Links', 'Central_Links.html');

		    var navLinks = true;

         menubar.addItem('Email', 'EMAIL', 'mailto:central_united@yahoo.com', null);

		    var navEmail = true;menubar.showMenuBar();

if (ie)
{
  document.body.onclick=hideCurrentMenu;
  document.body.onscroll=hideCurrentMenu;
}
else if (n)
{
  document.onmousedown=hideCurrentMenu;
  window.captureEvents(Event.MOUSEMOVE);
}

//-------------------------------------------------------------------------------------->
