//  init internal variables needed for menu generation ------------------------------
var chrarr = ["0","1","2","3","4","5","6","7","8","9","A",
              "B","C","D","E","F","G", "H", "I", "J", "K", "L"];
var menuArr = new Array(); var trackArr = new Array();
//  end init internal varibales needed for menu generation --------------------------


//  START HERE
//  define menu here ----------------------------------------------------------------

/**
 * API for addMenu(myName, parentName, parentIndex, myArray)
 *
 * @param myName Unique string name for this menu group.
 * @param parentName Name of the parent menu group that this menu group should
 *        spring from. Should be "" for base menu.
 * @param parentIndex Index of the entry on the parent's menu group that this
 *        menu group should spring from
 * @param myArray String[][] which defines this menu group. Each String[][] menu
 *        group is made up of several String[] menu items. Menu items should be 
 *        of the form : 
 *        ["name on menu", "url launched"] for normal menu entry
 *        ["name on menu", "-"] if this entry has a child menu group 
 *        ["name on menu", "url", "b"] launch entry in blank window
 *        ["name on menu", "url", "f", "frame_name"] launch entry in frame called frame_name
 */

addMenu("Base", "", 0, //  for the base menu, make the second argument ""
        [
         ["Home", "Default.asp"],
         ["Profile", "-"],
         ["Services", "-"],
         ["Knowledge", "-"],
         ["Current", "-"],
         ["Contact", "contact.asp"]
         ]);

addMenu("Profile", "Base", 1,
        [
         ["&nbsp;About Custom Fab", "profile.asp?page=about"],
         ["&nbsp;Our Team", "profile.asp?page=team"],
         ["&nbsp;Quality Control", "profile.asp?page=quality"],
         ["&nbsp;Photo Gallery", "profile.asp?page=photoGal"]
         ]);

addMenu("Services", "Base", 2,
        [
         ["&nbsp;Custom Fabrication", "services.asp?page=fab"],
         ["&nbsp;Powder Coating", "services.asp?page=pCoat"],
         ["&nbsp;Liquid Coating", "services.asp?page=lCoat"]
         ]);

addMenu("Knowledge", "Base", 3,
        [
         ["&nbsp;Questions & Answers", "knowledge.asp?page=qnas"],
         ["&nbsp;Powder Coating Solutions", "knowledge.asp?page=coatSolutions"],
         ["&nbsp;How Powder Coating Works", "knowledge.asp?page=howItWorks"],
         ["&nbsp;Markets &amp; Uses", "knowledge.asp?page=marketUse"],
         ["&nbsp;Powder Types &amp; Properties", "knowledge.asp?page=typeProp"],
         ["&nbsp;Appearance Characteristics", "knowledge.asp?page=appearance"],
         ["&nbsp;Performance Characteristics", "knowledge.asp?page=performance"]
         ]);

addMenu("Current", "Base", 4,
        [
         ["&nbsp;Industry News", "current.asp?page=iNews"],
         ["&nbsp;News @ CustomFab", "current.asp?page=fabNews"],
         ["&nbsp;Job Opportunities", "current.asp?page=jobs"]
         ]);

//  end define menu ------------------------------------------------------------------

//  initialise user-defined elements -------------------------------------------------

//  x and y offsets of the menu from the element on the page with id=placer (adjust this
//  to get the positioning of the menu once its been created)
var totXOff = 23;
var totYOff = 10;

//  CHANGE THIS IF YOU WANT
//  background colors
var bgLowColor = "#000080";
var bgHiColor = "#FFFFFF";
//  base menu items width in pixels
var baseWVal = 110;
//  other menu items width in pixels
var menuWVal = 175;
//  text colors
var textLowColor = "#C0C0C0";
var textHiColor = "#000000";
//  base menu items and other menu items text settings (CSS)
var baseText = "11px Verdana, Georgia, Arial, Helvetica, sans-serif";
var menuText = "10px Verdana, Georgia, Arial, Helvetica, sans-serif";
// text offsets from the top and left
var textLeftOff = 0;
var textTopOff = 2;

// EFFECTS (can't have both together)
// do you want shadows
var shadowFlag = true;
// do you want the menu to be faded (100 for no)
var alpha = 100;

// delay value in milliseconds before the menu disappears
var delayVal = 500;
// border colors and pattern (CSS)
var borderLow = "2px solid #808080";
var borderHi = "2px solid #808080";
// x and y offsets of child menus that pop up when you mouse over the parent item
var menXOff = 0;
var menYOff = 0;
// src of arrow gif
var arrowGif = "images/arrow.gif";
// shadow options (color and offset)
var shadowColor = "#000000";
var shadowOff = 3;
// end initialise user-defined elements ----------------------------------------------


// add menu function ---------------------------------------------
function addMenu(myName, parentName, parentInd, valueArr){
  var myAcr = "";
  if(parentName != "")
    myAcr += trackArr[parentName] + chrarr[parentInd];  
  else
    myAcr = "a";
  menuArr[myAcr] = valueArr;
  trackArr[myName] = myAcr;
}
// end add menu function -------------------------------------------------------------

