//Main Nav

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

function removeClassName(el, name) {

  var i, curList, newList;

  if (el.className == null)
    return;

  // Remove the given class name from the element's className property.

  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}

// Submenu links
// Make this array fit to your own needs

var submenu=new Array()

submenu[0]='<a href="ArteeSys.asp">System Parameters</a>&nbsp;|&nbsp;<a href="KeywordxMain.asp">Keywords</a>'

submenu[1]='<a href="StCatMain.asp">Categories</a>&nbsp;|&nbsp;<a href="StGroupMain.asp">Groups</a>&nbsp;|&nbsp;<a href="StStyleMain.asp">Styles</a>&nbsp;|&nbsp;<a href="StClassMain.asp">Classes</a>&nbsp;|&nbsp;<a href="StOptMain.asp">Options</a>&nbsp;|&nbsp;<a href="StPackMain.asp">Packs</a>&nbsp;|&nbsp;<a href="StDesignMain.asp">Designs</a>&nbsp;|&nbsp;<a href="StMastMain.asp">Stock Master</a>&nbsp;|&nbsp;<a href="StItemsMain.asp">Items</a>'
//Removed from submenu[2] 25/09/07
//<a href="CustDiscMain.asp">Discounts</a>&nbsp;|&nbsp;
submenu[2]='<a href="CustMastMain.asp">Customer Maintenance</a>&nbsp;|&nbsp;<a href="SalesmanMain.asp">Account Managers</a>&nbsp;|&nbsp;<a href="CartFinish.asp">Cart Finalisation Entry</a>'

submenu[3]='<a href="#">Supplier Maintentance</a> '

submenu[4]='<a href="UserWebMain.asp">Client Users</a>&nbsp;|&nbsp;<a href="EmailMain.asp">Emails (Standard) Maintenance</a>&nbsp;|&nbsp;<a href="EmlTempMain.asp">Email Templates</a>'

submenu[5]='<a href="StNewMain.asp">New Products</a>&nbsp;|&nbsp;<a href="NewsMain.asp">News Maintenance</a>&nbsp;|&nbsp;<a href="ArteePg.asp">Front Page</a>&nbsp;|&nbsp;<a href="StPromoMain.asp">Promotions</a>&nbsp;|&nbsp;<a href="PageMain.asp">Info Pages</a>&nbsp;|&nbsp;<a href="PDFEntry.asp">Downloads</a>&nbsp;|&nbsp;<a href="MediaEntry.asp">Media</a>&nbsp;|&nbsp;<a href="CatalogUpload.asp" target="_blank">Catalogue Upload</a>'


var menuobj=document.getElementById? document.getElementById("subsTD1") : document.all
var menuobjTB=document.getElementById? document.getElementById("subsTB") : document.all
bMenuLoaded = true;

var activeButton = null;

function buttonClick(event, which, sName) {

	

  var button;

  // Get the target button element.
  

  if (browser.isIE)
    button = window.event.srcElement;
	
  else
    button = event.currentTarget;
	
	
  // Blur focus from the link to remove that annoying outline.

  button.blur();

  // Reset the currently active button, if any.

 
  if (activeButton != null)
  	
    resetButton(activeButton);

  // Activate this button, unless it was the currently active one

  if (button != activeButton) {
	depressButton(button);
    activeButton = button;
	thecontent=(which==-1)? "" : submenu[which]
  }
  
  else {
  	document[sName].src = "images/menu/"+sName+"_off.gif"
    activeButton = null;
	thecontent = ""
  }

  menuobj.innerHTML=thecontent

  return false;
}

function depressButton(button) {

button.className += "active";
}

function resetButton(button) {
  removeClassName(button, "active");
}

function resetSub(button) {
  menuobj.innerHTML=""
}


