
showSubMenu5 = -1
showSubMenuItem5 = -1
showSubMenu4 = -1
showSubMenuItem4 = -1
showSubMenu3 = -1
showSubMenuItem3 = -1
showSubMenu2 = -1
showSubMenuItem2 = -1
showHighlight1 = -1

/// FORMAT MENU  ///
menuStyle = "flat,flat,flat,flat,flat"                               // Menu Style (flat, 3d)
outerCellBorder = "1,2,1,1,2"                               // Border width (for no border, enter 0)
cellBorder = 1                                        // Border width (for no border, enter 0)  THIS VALUE APPLIES TO ALL MENUS
verticalOffset = "6,0,0,0,0"                                // Vertical offset of Sub Menu. 
horizontalOffset = "-10,0,0,0,0"                            // Horizontal offset of Sub Menu. 
subMenuDelay = 500                                      // Time sub menu stays visible for (in miliseconds). THIS VALUE APPLIES TO ALL MENUS
subMenuStyle = "float,fixed,fixed,fixed,fixed"                          // float = float popup menu next to mouse pointer. fixed = based on offsets
subIndicate = 1                                       // Show if a sub menu is present (use 0 for "no")  THIS VALUE APPLIES TO ALL MENUS
subIndicateLoc = "1,1,0,0,1"                                // Determines if indicator location should be before or after menu text. 0 = before, 1 = after
indicator = "<img src='images/blip.gif' border='0'>,,<img src='images/blip.gif' border='0'>,<img src='images/blip.gif' border='0'>," // Symbol to show if a sub menu is present (subIndicate must be to set to 1)
                                                      // Use standard HTML <img> tag. You can use a character instead of an image. 
                                                      // e.g.      indicator = ">"
//indicator0 = "<img src='images/blip_off.gif' border='0'>,"

showSubMenuIndent = "20px,0px,0px,0px,0px"           //Amount to indent the visible sub menu.  

// Main Menu Items
menuWidth = "158px,140px,115px,360px,87px"                // Width of menu item.  Use 0 for default
menuHeight = "0,28px,0,0,0"                    // Width of menu item.  Use 0 for default 28px
borderColor = "White,#735A94,White,White,#7B8CBD"            // Border Colour (flat mode only)#7B8CBD
backgroundColor = "White,#7B8CBD,White,White,Red"            // Border Colour (flat mode only)#7B8CBD
borderHighlight = "#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF"      // Border Highlight Colour (3d mode only)
borderShadow = "#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF"         // Border Shadow Colour (3d mode only)
menuBackground = "#FFFFFF,#0F1030,#FFFFFF,#FFFFFF,#0F1030"       // Cell Background Colour #0F1030
menuHoverBackground = "#FFFFFF,#735A94,#FFFFFF,#FFFFFF,#735A94"  // Cell Background Colour on mouse rollover #735A94
fontFace = "arial,arial,arial,arial,arial"                 // Font Face
fontColour = "#333399,#FFFFFF,#333399,#333399,#FFFFFF"           // Font Colour
fontHoverColour = "#CC3333,#FFFFFF,#CC3333,#CC3333,#FFFFFF"      // Font Colour on mouse rollover
fontSize = "8pt,10pt,8pt,8pt,8pt"                    // Font Size
fontDecoration = "none,none,none,none,none"             // Style of the link text (none, underline, overline, line-through)
fontWeight = "bold,bold,bold,bold,bold"                 // Font Weight (normal, bold)
fontHoverSize = "10pt,10pt,9pt,10pt,9pt"              // Font Size
textAlign = "left,center,left,left,center"                // Align text within cell
cellPadding = "8,0,2,2,0"                      // Cell Padding
textWrap = "nowrap,,wrap,wrap,"

// Sub Menu Items
smenuWidth = "0,140px,0,0,0"                   // Width of sub menu item.  Use 0 for default
sborderColor = "#333399,#333399,#333399,#333399,#333399"         // Border Colour (flat mode only)
sborderHighlight = "#E9E9E2,#E9E9E2,#E9E9E2,#E9E9E2,#E9E9E2"     // Border Highlight Colour (3d mode only)
sborderShadow = "#83837C,#83837C,#83837C,#83837C,#83837C"        // Border Shadow Colour (3d mode only)
smenuBackground = "#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF"      // Cell Background Colour
smenuHoverBackground = "#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF,#FFFFFF" // Cell Background Colour on mouse rolloverr
sfontFace = "arial,arial,arial,arial,arial"                // Font Face
sfontColour = "#333399,#333399,#333399,#333399,#333399"          // Font Colour
sfontHoverColour = "#CC3333,#CC3333,#CC3333,#CC3333,#CC3333"     // Font Colour on mouse rollover
sfontSize = "8pt,7pt,8pt,8pt,8pt"                    // Font Size
sfontDecoration = "none,none,none,none,none"            // Style of the link text (none, underline, overline, line-through)
sfontWeight = "bold,bold,bold,bold,bold"                // Font Weight (normal, bold)
sfontHoverSize = "10pt,8pt,10pt,10pt,8pt"             // Font Size
stextAlign = "left,left,left,left,left"                 // Align text within cell
scellPadding = "2,2,2,2,2"                     // Cell Padding

quantity = 5
/// END FORMAT MENU  ////

/// 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"
// Menu Styles
function createStyles(quant){
  styleBorder=(menuStyle.split(",")[quant-1].toLowerCase() == "flat")?cellBorder:0 
  document.writeln ('<style>');
  document.writeln ('.rcMenuStatic'+quant+' {font-family:'+fontFace.split(",")[quant-1]+';font-size:'+fontSize.split(",")[quant-1]+';color:'+fontColour.split(",")[quant-1]+';font-weight:'+fontWeight.split(",")[quant-1]+';background-color:'+menuBackground.split(",")[quant-1]+'; text-align:'+textAlign.split(",")[quant-1]+';  text-decoration:'+fontDecoration.split(",")[quant-1]+'}');
  document.writeln ('.rcMenuHover'+quant+'  {font-family:'+fontFace.split(",")[quant-1]+';font-size:'+fontHoverSize.split(",")[quant-1]+';color:'+fontHoverColour.split(",")[quant-1]+';font-weight:'+fontWeight.split(",")[quant-1]+';background-color:'+menuHoverBackground.split(",")[quant-1]+'; text-align:'+textAlign.split(",")[quant-1]+'; text-decoration:'+fontDecoration.split(",")[quant-1]+'}');
  document.writeln ('.rcTableStatic'+quant+' {border-color:'+borderColor.split(",")[quant-1]+';border-width:1px;border-style:solid;border-collapse:collapse;background-color:'+menuBackground.split(",")[quant-1]+';}');
  //document.writeln ('.rcTableHover'+quant+' {border-color:'+borderColor.split(",")[quant-1]+';border-width:1px;border-style:solid;border-collapse:collapse;background-color:'+menuHoverBackground.split(",")[quant-1]+';}');
  document.writeln ('.rcShowSubMenuStatic'+quant+' {font-family:'+fontFace.split(",")[quant-1]+';font-size:'+fontHoverSize.split(",")[quant-1]+';color:'+fontHoverColour.split(",")[quant-1]+';font-weight:'+fontWeight.split(",")[quant-1]+';background-color:'+menuBackground.split(",")[quant-1]+'; text-align:'+textAlign.split(",")[quant-1]+'; cursor:hand; text-decoration:'+fontDecoration.split(",")[quant-1]+'}');
  document.writeln ('.rcShowSubMenuItemStatic'+quant+' {font-family:'+sfontFace.split(",")[quant-1]+';font-size:'+sfontSize.split(",")[quant-1]+';color:'+sfontColour.split(",")[quant-1]+';font-weight:'+sfontWeight.split(",")[quant-1]+';text-decoration:'+sfontDecoration.split(",")[quant-1]+';background-color:'+smenuBackground.split(",")[quant-1]+'; text-align:'+stextAlign.split(",")[quant-1]+';cursor: hand; text-indent:'+showSubMenuIndent.split(",")[quant-1]+'}');
  document.writeln ('.rcShowSubMenuItemHover'+quant+'  {font-family:'+sfontFace.split(",")[quant-1]+';font-size:'+sfontHoverSize.split(",")[quant-1]+';color:'+sfontHoverColour.split(",")[quant-1]+';font-weight:'+sfontWeight.split(",")[quant-1]+';text-decoration:'+sfontDecoration.split(",")[quant-1]+';background-color:'+smenuHoverBackground.split(",")[quant-1]+'; text-align:'+stextAlign.split(",")[quant-1]+';cursor:hand;text-indent:'+showSubMenuIndent.split(",")[quant-1]+'}');
  document.writeln ('.rcShowSubMenuItemChosen'+quant+' {font-family:'+sfontFace.split(",")[quant-1]+';font-size:'+sfontHoverSize.split(",")[quant-1]+';color:'+sfontHoverColour.split(",")[quant-1]+';font-weight:'+sfontWeight.split(",")[quant-1]+';text-decoration:'+sfontDecoration.split(",")[quant-1]+';background-color:'+smenuHoverBackground.split(",")[quant-1]+'; text-align:'+stextAlign.split(",")[quant-1]+';cursor:hand;text-indent:'+showSubMenuIndent.split(",")[quant-1]+'}');
  document.writeln ('.rcSubMenuStatic'+quant+' {font-family:'+sfontFace.split(",")[quant-1]+';font-size:'+sfontSize.split(",")[quant-1]+';color:'+sfontColour.split(",")[quant-1]+';font-weight:'+sfontWeight.split(",")[quant-1]+';text-decoration:'+sfontDecoration.split(",")[quant-1]+';background-color:'+smenuBackground.split(",")[quant-1]+'; text-align:'+stextAlign.split(",")[quant-1]+';cursor:hand;}');
  document.writeln ('.rcSubMenuHover'+quant+'  {font-family:'+sfontFace.split(",")[quant-1]+';font-size:'+sfontHoverSize.split(",")[quant-1]+';color:'+sfontHoverColour.split(",")[quant-1]+';font-weight:'+sfontWeight.split(",")[quant-1]+';text-decoration:'+sfontDecoration.split(",")[quant-1]+';background-color:'+smenuHoverBackground.split(",")[quant-1]+'; text-align:'+stextAlign.split(",")[quant-1]+';cursor:hand;}');
  document.writeln ('</style>');
}
// Build and show the main menu items
function showMenus(quant,definedOrientation)
{
  createStyles(quant);
  
  //create an iframe to be used as an workaround for IE when dislaying popup menus over SELECT (dropdown list) controls
  document.writeln ('<iframe id=iFramePopup src=blank.html scrolling=No frameborder=0 style="visibility:hidden; position:absolute;z-index: 10; width: 1px; height = 1px;"></iframe>');
  
  if(definedOrientation!=""){orientation=definedOrientation}
  //if (orientation.toLowerCase() == "vertical"){document.writeln ('<table border="0" cellpadding="0" cellspacing="'+outerCellBorder.split(",")[quant-1]+'" bgColor="'+borderColor.split(",")[quant-1]+'">')}
  //else{document.writeln                                         ('<table border="0" cellpadding="0" cellspacing="'+outerCellBorder.split(",")[quant-1]+'" bgColor="'+borderColor.split(",")[quant-1]+'"><tr>')}  
  if (orientation.toLowerCase() == "vertical"){document.writeln ('<table id="'+quant+'table" border="1" borderColor="'+borderColor.split(",")[quant-1]+'" cellpadding="0" cellspacing="'+outerCellBorder.split(",")[quant-1]+'" class="rcTableStatic'+quant+'">')}
  else{document.writeln                                         ('<table id="'+quant+'table" border="1" borderColor="'+borderColor.split(",")[quant-1]+'" cellpadding="0" cellspacing="'+outerCellBorder.split(",")[quant-1]+'" class="rcTableStatic'+quant+'"><tr>')}  
  //if (orientation.toLowerCase() == "vertical"){document.writeln ('<table border="0" cellpadding="0" cellspacing="'+outerCellBorder.split(",")[quant-1]+'" >')}
  //else{document.writeln                                         ('<table border="0" cellpadding="0" cellspacing="0" ><tr>')}  
  for (x=0; x<eval("Menu"+quant).length; x++)
  {
    if (orientation.toLowerCase()=="vertical") document.writeln('<tr>')
    
    if (subIndicate == 1 && subIndicateLoc.split(",")[quant-1] == "0") //&&eval("subMenu"+quant)[x].length>=1)
    {
        document.writeln('<td class="rcMenuStatic'+quant+'" id="'+quant+'cell'+x+'a" align="right">');
        document.writeln ('<a id="'+quant+'mainLink'+x+'a" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcMenuStatic'+quant+'" >'+indicator.split(",")[quant-1]+'</a>&nbsp&nbsp</td>');
    } 

	  if (x == eval("showSubMenu"+quant)) {
	    //document.writeln ('<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu();popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\', event);" onMouseOut="clearMenu('+quant+','+x+')" >')   
		//document.writeln ('<a id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcShowSubMenuStatic'+quant+'">');
		//document.writeln ('<div id="'+quant+'button'+x+'"><table border="0" cellspacing="'+cellPadding.split(",")[quant-1]+'" cellpadding="0" ><tr>');
        //document.writeln ('<td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="rcShowSubMenuStatic'+quant+'" id="'+quant+'cell'+x+'" nowrap>');
        //document.writeln (eval("Menu"+quant)[x][0]+'</td>');
        
 	    document.writeln ('<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu();popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\', event);" onMouseOut="clearMenu('+quant+','+x+')" ')   
        document.writeln ('><div id="'+quant+'button'+x+'"><table border="0" cellspacing="'+cellPadding.split(",")[quant-1]+'" cellpadding="0" ><tr>');
        document.writeln ('<td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="rcShowSubMenuStatic'+quant+'" id="'+quant+'cell'+x+'" ' + textWrap.split(",")[quant-1] + '>' );
        document.writeln ('<a id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcShowSubMenuStatic'+quant+'" >'+eval("Menu"+quant)[x][0]+'</a></td>');

	  } else {
    
        if (x == eval("showHighlight"+quant)) state = "rcMenuHover"+quant;
		else state = "rcMenuStatic"+quant;
		
        //document.writeln ('<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\', event); " onMouseOut="clearMenu('+quant+','+x+')" >')   
		//document.writeln ('<a id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="'+state+'">');
		//document.writeln ('<div id="'+quant+'button'+x+'"><table border="0" cellpadding="'+cellPadding.split(",")[quant-1]+'" cellspacing="0" ><tr ><td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="'+state+'" id="'+quant+'cell'+x+'" nowrap>');
        //document.writeln (eval("Menu"+quant)[x][0]+'</td>');
       
       //special code to show new_splat image here
       if ('Customer<br>Services' == eval("Menu"+quant)[x][0]) {       
          document.writeln ('<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\', event); " onMouseOut="clearMenu('+quant+','+x+')" ')   
		  document.writeln ('><div id="'+quant+'button'+x+'"><table border="0" cellspacing="'+cellPadding.split(",")[quant-1]+'" cellpadding="0" ><tr ><td style="width: '+ '80' + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="'+state+'" id="'+quant+'cell'+x+'" ' + textWrap.split(",")[quant-1] + '>');
		  //document.writeln ('><div id="'+quant+'button'+x+'"><table border="1" cellpadding="'+cellPadding.split(",")[quant-1]+'" cellspacing="0" style="border-color:'+borderColor.split(",")[quant-1]+';border-width:1px;border-style:solid;border-collapse:collapse;"><tr ><td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="'+state+'" id="'+quant+'cell'+x+'" ' + textWrap.split(",")[quant-1] + '>');
          document.writeln ('<a id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="'+state+'">'+eval("Menu"+quant)[x][0]+'</a></td>');

 		} else {
      
          document.writeln ('<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\', event); " onMouseOut="clearMenu('+quant+','+x+')" ')   
		  document.writeln ('><div id="'+quant+'button'+x+'"><table border="0" cellspacing="'+cellPadding.split(",")[quant-1]+'" cellpadding="0" ><tr ><td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="'+state+'" id="'+quant+'cell'+x+'" ' + textWrap.split(",")[quant-1] + '>');
		  //document.writeln ('><div id="'+quant+'button'+x+'"><table border="1" cellpadding="'+cellPadding.split(",")[quant-1]+'" cellspacing="0" style="border-color:'+borderColor.split(",")[quant-1]+';border-width:1px;border-style:solid;border-collapse:collapse;"><tr ><td style="width: '+ menuWidth.split(",")[quant-1] + ';height: ' + menuHeight.split(",")[quant-1] + ';" class="'+state+'" id="'+quant+'cell'+x+'" ' + textWrap.split(",")[quant-1] + '>');
          document.writeln ('<a id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="'+state+'">'+eval("Menu"+quant)[x][0]+'</a></td>');
        }
      }
              
    if (subIndicate == 1 && subIndicateLoc.split(",")[quant-1] == "1") //&&eval("subMenu"+quant)[x].length>=1)
    {
       //special code to show new_splat image here
      
       //if (quant == 2 && x ==3) {
       if ('Customer<br>Services' == eval("Menu"+quant)[x][0]) {       
        document.writeln('<td class="rcMenuStatic'+quant+'" id="'+quant+'cell'+x+'a" align="left">');
        document.writeln ('<a id="'+quant+'mainLink'+x+'a" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcMenuStatic'+quant+'">'+ '<img src="images/New_Splash.gif" border="0">' +'</a></td>');

		} else {
        document.writeln('<td class="rcMenuStatic'+quant+'" id="'+quant+'cell'+x+'a" align="right">');
        document.writeln ('<a id="'+quant+'mainLink'+x+'a" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcMenuStatic'+quant+'">'+indicator.split(",")[quant-1]+'</a></td>');
        }
    } 
    //else if (subIndicate == 1)
    //{
    //  document.writeln('<td class="rcMenuStatic'+quant+'" id="'+quant+'cell'+x+'a" align="right">');
    //  document.writeln ('<a id="'+quant+'mainLink'+x+'a" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcMenuHover'+quant+'">'+indicator0.split(",")[quant-1]+'</a></td>');
    //}
    
    document.writeln ('</tr></table></div></td>');    
    if (orientation.toLowerCase()=="vertical") { 
      document.writeln('</tr>')
      if (x == eval("showSubMenu"+quant)) {
        for (y=0; y<eval("subMenu"+quant)[x].length; y++) {
          document.writeln ('<tr>');
          
          if (y == eval("showSubMenuItem"+quant)) {
            iclass = "rcShowSubMenuItemChosen"
          } else {
            iclass = "rcShowSubMenuItemStatic"
          }

          if (eval("subMenu"+quant)[x][y][1].indexOf("#") != -1)  //Here...
          {
            document.writeln ('<td bgColor="'+eval("subMenu"+quant)[x][y][2]+'" id="'+quant+'subMenu'+x+y+'" onMouseOver="hoverMenu(); clearPopDowns('+quant+'); highlightMenu(\'sub\','+x+','+y+',\'\','+quant+')" nowrap')
            if (menuStyle.split(",")[quant-1].toLowerCase() == "3d"){document.writeln ('style="border-left:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-top:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-right:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';border-bottom:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';"');}
            document.writeln ('><p style="font-family:'+sfontFace.split(",")[quant-1]+'; font-size:'+sfontSize.split(",")[quant-1]+'; color:'+eval("subMenu"+quant)[x][y][1]+'"id="'+quant+'subLink'+x+y+'">'+eval("subMenu"+quant)[x][y][0]+'</p></td></tr>');
          }
          else
          {
            document.writeln ('<td id="' + quant + 'subMenu'+x+y+'" style="width: '+smenuWidth.split(",")[quant-1]+';" class="'+iclass+quant+'" onMouseOver="hoverMenu(); clearPopDowns('+quant+'); highlightMenu(\'sub\','+x+','+y+',\'\','+quant+')" onMouseOut="clearMenu('+quant+','+x+');" onclick="tdMouseClick(\''+quant+'subLink'+x+y+'\')" nowrap')
            if (menuStyle.split(",")[quant-1].toLowerCase() == "3d"){document.writeln ('style="border-left:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-top:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-right:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';border-bottom:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';"');}
            document.writeln ('><a id="'+quant+'subLink'+x+y+'" href="'+(eval("subMenu"+quant)[x][y][1]).replace("!","#")+'" target="'+eval("subMenu"+quant)[x][y][2]+'" class="' + iclass+quant+'">'+eval("subMenu"+quant)[x][y][0]+'</a></td></tr>');
          }
        }
      }
    }
  }
  if (orientation.toLowerCase() == "vertical"){document.writeln ('</table>');}
  else{document.writeln ('</tr></table>');}   
// Build the sub menu items
  for (x=0; x<eval("Menu"+quant).length; x++)
  { 
    if (eval("subMenu"+quant)[x].length > 0)
    { 
    //Begin submenu html
      document.writeln ('<div id="'+quant+'MENU'+x+'" style="visibility:hidden; position:absolute; z-index: 20;" >');
      
      document.writeln ('<table width="'+smenuWidth.split(",")[quant-1]+'" border="0" cellpadding="'+scellPadding.split(",")[quant-1]+'" cellspacing="'+styleBorder+'" bgColor="'+sborderColor.split(",")[quant-1]+'">');
      if (x != eval("showSubMenu"+quant)) {
      for (y=0; y<eval("subMenu"+quant)[x].length; y++)
      {
        document.writeln ('<tr>');
        if (eval("subMenu"+quant)[x][y][1].indexOf("#") != -1)//here2
        {
          document.writeln ('<td bgColor="'+eval("subMenu"+quant)[x][y][2]+'" id="'+quant+'subMenu'+x+y+'" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+',\'\','+quant+')" nowrap')
          if (menuStyle.split(",")[quant-1].toLowerCase() == "3d"){document.writeln ('style="border-left:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-top:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-right:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';border-bottom:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';"');}
          document.writeln ('><p style="font-family:'+sfontFace.split(",")[quant-1]+'; font-size:'+sfontSize.split(",")[quant-1]+'; color:'+eval("subMenu"+quant)[x][y][1]+'"id="'+quant+'subLink'+x+y+'">'+eval("subMenu"+quant)[x][y][0]+'</p></td></tr>');
        }
        else
        {
          document.writeln ('<td id="'+quant+'subMenu'+x+y+'" class="rcSubMenuStatic'+quant+'" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+',\'\','+quant+')" onMouseOut="clearMenu('+quant+','+x+');" onclick="tdMouseClick(\''+quant+'subLink'+x+y+'\')" nowrap')
          if (menuStyle.split(",")[quant-1].toLowerCase() == "3d"){document.writeln ('style="border-left:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-top:'+cellBorder+'px solid '+sborderHighlight.split(",")[quant-1]+';border-right:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';border-bottom:'+cellBorder+'px solid '+sborderShadow.split(",")[quant-1]+';"');}
          document.writeln ('><a id="'+quant+'subLink'+x+y+'" href="'+(eval("subMenu"+quant)[x][y][1]).replace("!","#")+'" target="'+eval("subMenu"+quant)[x][y][2]+'" class="rcSubMenuStatic'+quant+'">'+eval("subMenu"+quant)[x][y][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,quant)
{
  //alert ("entering highlightMenu " + element + " " + mainMenu + " " + dropMenu + " " + state + " " + quant)
  hoverMenu();

  //tableState=(state == "hover")?"rcTableHover"+quant:"rcTableStatic"+quant;

  state=(state == "hover")?"rcMenuHover"+quant:"rcMenuStatic"+quant;
  if (mainMenu == eval("showSubMenu"+quant)) state="rcShowSubMenuStatic"+quant;

  if (element == "sub")
  {
    
    if (mainMenu == eval("showSubMenu"+quant)) {
      for (x=0; x < eval("subMenu"+quant)[mainMenu].length; x++)
      {
        if (x == eval("showSubMenuItem"+quant)) {
          iclass = "rcShowSubMenuItemChosen"
        } else {
          iclass = "rcShowSubMenuItemStatic"
        }

        if (eval("subMenu"+quant)[mainMenu][x][1].indexOf("#") == -1){ //unhighlights within the drop down menu
          eval(obj+'("'+quant+'subMenu'+mainMenu+x+'").className = "'+iclass+quant+'"')
          eval(obj+'("'+quant+'subLink'+mainMenu+x+'").className = "'+iclass+quant+'"')
        }
      } 
      if (eval("subMenu"+quant)[mainMenu][dropMenu][1].indexOf("#") == -1)  { //highlights within the drop down menu
        eval(obj+'("'+quant+'subMenu'+mainMenu+dropMenu+'").className="rcShowSubMenuItemHover'+quant+'"')
        eval(obj+'("'+quant+'subLink'+mainMenu+dropMenu+'").className="rcShowSubMenuItemHover'+quant+'"')
      }
    } else {
      for (x=0; x < eval("subMenu"+quant)[mainMenu].length; x++)
      {
    
        if (eval("subMenu"+quant)[mainMenu][x][1].indexOf("#") == -1){ //unhighlights within the drop down menu
          eval(obj+'("'+quant+'subMenu'+mainMenu+x+'").className = "rcSubMenuStatic'+quant+'"')
          eval(obj+'("'+quant+'subLink'+mainMenu+x+'").className = "rcSubMenuStatic'+quant+'"')
        }
      } 
      if (eval("subMenu"+quant)[mainMenu][dropMenu][1].indexOf("#") == -1)  { //highlights within the drop down menu
        eval(obj+'("'+quant+'subMenu'+mainMenu+dropMenu+'").className="rcSubMenuHover'+quant+'"')
        eval(obj+'("'+quant+'subLink'+mainMenu+dropMenu+'").className="rcSubMenuHover'+quant+'"')
      }
    }
  }
  else
  {
  
    if (mainMenu == eval("showSubMenu"+quant)) {
    
      for (x=0; x < eval("subMenu"+quant)[mainMenu].length; x++)
      {
    
        if (x == eval("showSubMenuItem"+quant)) {
          iclass = "rcShowSubMenuItemChosen"
        } else {
          iclass = "rcShowSubMenuItemStatic"
        }

        if (eval("subMenu"+quant)[mainMenu][x][1].indexOf("#") == -1){ //unhighlights within the drop down menu
          eval(obj+'("'+quant+'subMenu'+mainMenu+x+'").className = "'+iclass+quant+'"')
          eval(obj+'("'+quant+'subLink'+mainMenu+x+'").className = "'+iclass+quant+'"')
        }
      } 
    }
    if (mainMenu == eval("showHighlight"+quant)) state = "rcMenuHover"+quant
    eval(obj+'("'+quant+'cell'+mainMenu+'").className = "'+state+'"')
    eval(obj+'("'+quant+'mainLink'+mainMenu+'").className = "'+state+'"')
    //eval(obj+'("'+quant+'table'+'").className = "'+tablestate+'"')

    if (subIndicate == 1) //&&eval("subMenu"+quant)[mainMenu].length>=1)
    {
      eval(obj+'("'+quant+'cell'+mainMenu+'a").className = "'+state+'"')
      eval(obj+'("'+quant+'mainLink'+mainMenu+'a").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 if(dim=="width")
  {
    oWidth = obj.offsetWidth
    return oWidth
  }  
  else if(dim=="height")
  {
    oHeight = obj.offsetHeight
    return oHeight
  }    
  else
  {
    alert("Error: invalid offset dimension '" + dim + "' in getOffset()")
    return false;
  }
}
// Show sub menus
function popDown(quant, param, id, orientation, evt)
{
  var cellBorderOffset = (isNS6)?cellBorder:eval(cellBorder*2)
  var browserAdjustment = (isNS6)?cellBorder:0
  var menu;
  var button;
  subvis = false;
  if (id)
  {    
    getOffset(eval(obj+'(id)'),'left');
    getOffset(eval(obj+'(id)'),'top');    
    getOffset(eval(obj+'(id)'),'width');  
    getOffset(eval(obj+'(id)'),'height');
    
    if (eval("Menu"+quant+"["+param+"][3]")=="right" && eval("subMenu"+quant+"["+param+"].length")>0) 
    { 
      oLeft=oLeft  
      oLeft=oLeft+oWidth; 
      getOffset(eval(obj+'("'+quant+'MENU'+param+'")'),'width');
      oLeft=oLeft-oWidth ;
      if (orientation.toLowerCase() == "vertical") alignAdjustment = cellBorder;
      else alignAdjustment = cellBorder;
    }
    else 
    {
      alignAdjustment = 0
      oLeft=oLeft
    }    
  }  

  n = 0;    
  while (n < eval("Menu"+quant).length)
  {          
    menu = quant+"MENU"+n
    if (param == n)
    {
      theObj = eval(obj+'(menu)');
      if (theObj)
      {
         
        if (orientation.toLowerCase()=="vertical"){
          // keep -- theObj.style.left=(menuStyle.split(",")[quant-1].toLowerCase()=="flat")?oLeft+oWidth+cellBorder+parseInt(horizontalOffset.split(",")[quant-1]):oLeft+oWidth+cellBorderOffset+parseInt(horizontalOffset.split(",")[quant-1]);
          var xcoordFixed = (menuStyle.split(",")[quant-1].toLowerCase()=="flat")?oLeft+oWidth+cellBorder+parseInt(horizontalOffset.split(",")[quant-1]):oLeft+oWidth+cellBorderOffset+parseInt(horizontalOffset.split(",")[quant-1]);
          var xcoordFloat = ((window.event)?window.event.x : evt.pageX);
          xcoordFloat = xcoordFloat + 6;
          theObj.style.left=((subMenuStyle.split(",")[quant-1].toLowerCase()=="float")?xcoordFloat + "px":xcoordFixed + "px");
          theObj.style.top=(menuStyle.split(",")[quant-1].toLowerCase()=="flat")?oTop-cellBorder+parseInt(verticalOffset.split(",")[quant-1]):oTop+parseInt(verticalOffset.split(",")[quant-1])-browserAdjustment
        }
        else{
          theObj.style.left=(menuStyle.split(",")[quant-1].toLowerCase()=="flat")?oLeft-cellBorder+parseInt(horizontalOffset.split(",")[quant-1])+alignAdjustment:oLeft+parseInt(horizontalOffset.split(",")[quant-1])-browserAdjustment+alignAdjustment;
          theObj.style.top=(menuStyle.split(",")[quant-1].toLowerCase()=="flat")?oTop+oHeight+cellBorder+parseInt(verticalOffset.split(",")[quant-1]):oTop+oHeight+cellBorderOffset+parseInt(verticalOffset.split(",")[quant-1]);
        }
        iFrameAdjust(menu);
        theObj.style.visibility = "visible"
        subvis = true
      }
      
       highlightMenu('main',n,'','hover',quant)
       if (eval("subMenu"+quant)[param].length > 0)
       {
         for (x=0; x<eval("subMenu"+quant)[param].length; x++)
         {
           if (n == eval("showSubMenu"+quant)) {
           
             if (x == eval("showSubMenuItem"+quant)) {
               iclass = "rcShowSubMenuItemChosen"
             } else {
               iclass = "rcShowSubMenuItemStatic"
             }

             if(eval("subMenu"+quant)[param][x][1].indexOf("#") == -1){
               eval (obj+'("'+quant+'subMenu'+param+x+'").className = "'+iclass+quant+'"')
               eval (obj+'("'+quant+'subLink'+param+x+'").className = "'+iclass+quant+'"')  
             }
           } else {
             if(eval("subMenu"+quant)[param][x][1].indexOf("#") == -1){
               eval (obj+'("'+quant+'subMenu'+param+x+'").className = "rcSubMenuStatic'+quant+'"')
               eval (obj+'("'+quant+'subLink'+param+x+'").className = "rcSubMenuStatic'+quant+'"')  
             }
           }       
         }
       }
    }
    else 
    {  
    
      z = 1;    
      //z = quant;
      
      while (z < quantity+1) {
        menu = z+"MENU"+n   
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "hidden"') 
          //since there is only one iframe, do not hide if submenu is being moused over
          if (subvis == false) {
            iFrameObj = document.getElementById('iFramePopup');
            iFrameObj.style.visibility = "hidden"
          }

        }
        highlightMenu ('main',n,'','static',quant)
        z++
      }
    }

    n++
  }  
}

function iFrameAdjust(menu)
{

  iFrameObj = document.getElementById('iFramePopup');
  theObj = eval(obj+'(menu)');
  iFrameObj.style.width = theObj.offsetWidth;
  iFrameObj.style.height = theObj.offsetHeight;
  iFrameObj.style.top= theObj.style.top;
  iFrameObj.style.left= theObj.style.left;
  iFrameObj.style.visibility = "visible"
  //alert ("width: " + iFrameObj.style.width + " Height: " + iFrameObj.style.height + " Top: " + iFrameObj.style.top + " Left: " + iFrameObj.style.to


}
// Clear the pop down menus
function clearPopDowns(quant)
{
  n = 0;    
  while (n < eval("Menu"+quant).length)
  {
    if (n != eval("showSubMenu"+quant)) {          
      for (x=1; x<quantity+1; x++)
      {       
        menu = x+"MENU"+n   
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "hidden"') 
          iFrameObj = document.getElementById('iFramePopup');
          iFrameObj.style.visibility = "hidden"
        }
        highlightMenu ('main',n,'','static',quant)
      }
    }
    n++
  }  
}

// Re-set timer for sub menus
function hoverMenu()
{
  //alert ("hoverMenu");
  if (timer)
  clearTimeout(timer)
}
// Set timer for sub menus
function clearMenu(quant,menu)
{
  setDelay = subMenuDelay
  delay = (eval("subMenu"+quant)[menu].length > 0)?setDelay:1
  
  timer = setTimeout("popDown("+quant+","+(eval("Menu"+quant).length + 1)+")",delay)
}
// when you click the box, perform the same function as if the user had clicked the hyperlink
function tdMouseClick(theElement)
{
  eval(obj+'(theElement).click()')
}

    function enterCheck(buttonName,e) {
     //the purpose of this function is to allow the enter key to point to the correct button to click.

      var key;

      if(window.event)
        key = window.event.keyCode;     //IE
      else
        key = e.which;     //firefox

      if (key == 13) {
        //Get the button the user wants to have clicked

        var btn = document.getElementById(buttonName);
        if (btn != null) { //If we find the button click it
           btn.click();
           return false;
        }
      }
      return true;
   }

