var Menu = new Array ()     
var subMenu = new Array ()  
   Menu[0] = new Array("Products", "#","_top")
     subMenu[0] = new Array()
     subMenu[0][0] = new Array ("SOFTScale&trade;", "http://www.roctek.com/SoftScale.htm","_top")
  	 subMenu[0][1] = new Array ("SOFTakeoff&trade;", "http://www.roctek.com/SOFTakeoff.htm","_top")
     subMenu[0][2] = new Array ("WinScale&trade;", "http://www.roctek.com/WinScale.htm","_top")
     subMenu[0][3] = new Array ("eSOFTakeoff&trade;", "http://www.roctek.com/eSOFTakeoff.htm","_top")
     subMenu[0][4] = new Array ("PRESTTO&trade;", "http://www.roctek.com/PRESTTO.htm","_top")	 
     subMenu[0][5] = new Array ("WinEx Master&trade;", "http://www.roctek.com/WinExMaster.htm","_top")
     subMenu[0][6] = new Array ("WinEx-<i>de</i>&trade; ", "http://www.roctek.com/WinExde.htm","_top")
//     subMenu[0][7] = new Array ("eWinEx&trade; & WinEx&trade;", "http://www.roctek.com/eWinEx.htm","_top")
     
   Menu[1] = new Array("FREE Demos", "http://www.roctek.com/inforequest.asp","_top") 
     subMenu[1] = new Array()
   Menu[2] = new Array("Support & Services", "http://www.roctek.com/suppServices.htm","_top")
     subMenu[2] = new Array() 
 //Menu[3] = new Array("Request Live Demo", "ReqNetMeet.asp","_top") 
 //    subMenu[3] = new Array()
	 
//   Menu[4] = new Array("Request Information", "requestinfo.asp","_top") 
//     subMenu[4] = new Array() 
   
   Menu[3] = new Array("Digitizers&nbsp;&nbsp;/&nbsp;&nbsp;Drivers", "http://www.roctek.com/digitizer.htm","_top")
     subMenu[3] = new Array()  

   Menu[4] = new Array("Customer Login", "http://12.132.113.100/PlugLookup.asp","_top")
   //Menu[4] = new Array("Customer Login", "PlugLookup.asp","_top")
     subMenu[4] = new Array() 	 
   
   Menu[5] = new Array("Dealers&nbsp;&nbsp;/&nbsp;&nbsp;Distributors","http://www.roctek.com/Dealers.asp","_top") 
     subMenu[5] = new Array()
   Menu[6] = new Array("Product Data Sheets&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","http://www.roctek.com/brochures.htm","_top")
     subMenu[6] = new Array() 
   Menu[7] = new Array("Testimonials","http://www.roctek.com/testimonials.htm","_top")
     subMenu[7] = new Array() 

  Menu[8] = new Array("Feedback","http://www.roctek.com/feedback.asp","_top") 
     subMenu[8] = new Array()
   Menu[9] = new Array("About ROCTEK","http://www.roctek.com/History.htm","_top")
     subMenu[9] = new Array()  
   Menu[10] = new Array("Contact Us","http://www.roctek.com/contactus.htm","_top")
     subMenu[10] = new Array() 	 
   Menu[11] = new Array("Did you know...","http://www.roctek.com/doyouknow.htm","_top")
     subMenu[11] = new Array() 	 
   Menu[12] = new Array("Employment","http://www.roctek.com/empOpportunities.htm","_top")
     subMenu[12] = new Array() 
	 

//   Menu[4] = new Array("Master Builder Integration", "http://www.roctek.com/MBIntegrationSupport.htm","_top")
//     subMenu[4] = new Array() 



  // Menu[13] = new Array("Search","search.asp","_top")
   //  subMenu[13] = new Array() 
   //document.write('<a href="MBIntegrationSupport.htm"><img src="images/masterbuilderlogo.JPG" width=""></a>');
 
   

//menuStyle = "3d"                                     // Menu Style (flat, 3d)
cellPadding = 2                                      // Cell Padding
//verticalOffset = 0                                   // Vertical offset of Sub Menu. 
subMenuDelay = 1                                     // Time sub menu stays visible for (in seconds)
cellHeight=10
cellWidth=0
indicator = "<img src='images/arrow.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 = ">"

// Main Menu Items
borderColor = ""                    // Border Colour (flat mode only)#06578F #841413
borderShadow = ""                   // Border Shadow Colour (3d mode only)#31556D
//menuBackground = "#841413"                 // Cell Background Colour
//menuHoverBackground = "#841413"            // Cell Background Colour on mouse rollover
//fontFace = "arial"                         // Font Face
//fontColour = "white"                     // Font Colour
fontHoverColour = "#FFCC00"                // Font Colour on mouse rollover
//fontSize = "9pt"                           // Font Size

// Sub Menu Items
//sborderColor = ""                   // Border Colour (flat mode only)#A6A684
//smenuBackground = "#841413"                // Cell Background Colour#660000
//smenuHoverBackground = "#841413"           // Cell Background Colour on mouse rolloverr
//sfontFace = "arial"                        // Font Face
//sfontColour = "white"                    // Font Colour
//sfontHoverColour = "#FFCC00"               // Font Colour on mouse rollover
//sfontSize = "9pt"                          // Font Size
//sShadow = 1
SubMenucellWidth=180



var isIE = (document.getElementById && document.all)?true:false;
var timer;
var obj = (isIE)?"document.all":"document.getElementById"

// Menu Styles
document.writeln ('<style>');
document.writeln ('.rcMenuHover { font-family:Arial; font-size: 12px; font-weight: bold; color: #ffcc00; cursor:hand;}');
//document.writeln ('.rcMenuStatic {font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:bold;background-color:'+menuBackground+'; cursor:hand; text-decoration:none;}');
//document.writeln ('.rcMenuHover  {font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:bold;background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:none;}');
//document.writeln ('.rcSubMenuStatic {font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:bold;background-color:'+smenuBackground+'; cursor:hand; text-decoration:none;}');
//document.writeln ('.rcSubMenuHover  {font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:bold;background-color:'+smenuHoverBackground+'; cursor:hand; text-decoration:none;}');
document.writeln ('</style>');

// Build and show the main menu items
function showMenus()
{
  document.writeln ('<table border="1" cellpadding="3" cellspacing=0 bgColor="'+borderColor+'">');
  for (x=0; x<Menu.length; x++)
  {
	document.writeln('<tr><td width=' + cellWidth +' height='+cellHeight );
	if (subMenu[x].length<1)
		document.writeln('onclick="tdMouseClick(\'mainLink'+x+'\')" ');
	document.writeln('onMouseOver="hoverMenu(); popDown('+x+', \'button'+x+'\'); " onMouseOut="clearMenu('+x+')" ')
	document.writeln ('style="border-right:0px solid '+borderShadow+';border-bottom:0px solid '+borderShadow+';">');
    document.writeln ('<div id="button'+x+'"><table border="0" cellpadding="'+cellPadding+'" cellspacing="0" width="100%">');
	document.writeln ('<tr><td  id="cell'+x+'" nowrap  style="cursor:hand;"');
//	if (x==5)
//		document.writeln('onclick="ShowUnavailableMessage()" ');
	document.writeln ('onmouseover="checkColor('+x+',1)" onmouseout="checkColor('+x+',2)">');
    document.writeln ('<a id="mainLink'+x+'" href="'+Menu[x][1]+'" target="'+Menu[x][2]+'" class="rcMenuStatic">&nbsp;&nbsp;'+Menu[x][0]+'</a></td>');
    if (subMenu[x].length>=1)
	{
      document.writeln('<td class="rcMenuStatic" id="cell'+x+'a" align="right"  style="cursor:hand;">');
      document.writeln ('<a id="mainLink'+x+'a" href="'+Menu[x][1]+'" target="'+Menu[x][2]+'">'+indicator+'</a></td>');
	}
    document.writeln ('</tr>');
//    if (x != Menu.length-1)
//		document.writeln('<tr><td colspan=3><img src="images/line.gif" width=166></td></tr>');
	document.writeln ('</table></div></td>');    
	document.writeln('</tr>')	
  }

  document.writeln ('</table>');
  document.writeln ('<table border="0" cellpadding="3" cellspacing=0>');
  document.writeln('<tr><td>&nbsp;</td></tr>');
  document.writeln('<tr><td>');
  document.writeln('<a href="CAGCmembers.htm"><img src="images/CAGCBanner.JPG" border=0></a>');
  document.writeln('</td><tr>');
  //document.writeln('<tr><td height="10"></td></tr>');  
  //document.writeln('<tr><td>');
  //document.writeln('<a href="MBIntegrationSupport.htm"><img src="images/masterbuilderlogo.JPG" border=0></a>');
  //document.writeln('</td><tr>');
  //document.writeln ('</table>');  

  document.writeln ('</table>');  


//  document.writeln ('<tr><td colspan=3><img src="images/tabledown.gif"></td></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:1;  width:196px; top:0px" >'); //left:204px; top:85px; 
      document.writeln ('<table border="1" cellpadding="3" cellspacing=0 bgcolor="#FFFFFF" >');
//	  document.writeln('<tr><td onMouseOver="hoverMenu();"  onMouseOut="clearMenu('+x+');"><img src="images/tableup.gif"></td></tr>');
      for (y=0; y<subMenu[x].length; y++)
      {
        document.writeln ('<tr><td style="cursor:hand;"  bgColor="'+borderColor+'" width=' + SubMenucellWidth +'  height='+cellHeight);
		document.writeln ('id="subMenu'+x+y+'" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+');checkSubColor('+x+','+y+',1);" onMouseOut="clearMenu('+x+');checkSubColor('+x+','+y+',2);" onclick="tdMouseClick(\'subLink'+x+y+'\')" nowrap>')
        document.writeln ('<a id="subLink'+x+y+'" href="'+subMenu[x][y][1]+'" target="'+subMenu[x][y][2]+'" class="rcMenuStatic">&nbsp;&nbsp;&nbsp;&nbsp;'+subMenu[x][y][0]+'</a>');
		document.writeln ('</td></tr>');
//		document.writeln('<tr><td onMouseOver="hoverMenu();" onMouseOut="clearMenu('+x+');"><img src="images/line1.gif"></td></tr>');
      }
//  	  document.writeln('<tr><td onMouseOver="hoverMenu();" onMouseOut="clearMenu('+x+');"><img src="images/subdown.gif"></td></tr>');
      document.writeln ('</table></div>');
    }
	//
  }  

//checkSubColor('+x+','+y+',1);
function checkSubColor(MenuX,MenuY,colorVal)
{
  if (colorVal ==1)
  {
	eval(obj+'("subMenu'+MenuX+MenuY+'").style.color = "#000000"');
	eval(obj+'("subLink'+MenuX+MenuY+'").style.color = "#000000"');	
  }
  else   if (colorVal == 2)
  {
	eval(obj+'("subMenu'+MenuX+MenuY+'").style.color = "#841413"');
	eval(obj+'("subLink'+MenuX+MenuY+'").style.color = "#841413"');	
  }
}

function checkColor(mainMenu,colorVal)
{
  if (colorVal ==1)
  {
	eval(obj+'("cell'+mainMenu+'").style.color = "#000000"');
	eval(obj+'("mainLink'+mainMenu+'").style.color = "#000000"');	
  }
  else   if (colorVal == 2)
  {
	eval(obj+'("cell'+mainMenu+'").style.color = "#841413"');
	eval(obj+'("mainLink'+mainMenu+'").style.color = "#841413"');	
  }
}
 
// Change colour or menu and submenu items when the mouse hovers over.  
function highlightMenu(element,mainMenu,dropMenu,state)
{
  state=(state == "hover")?"rcMenuStatic":"rcMenuStatic"
  if (element == "sub")
  {
    for (x=0; x < subMenu[mainMenu].length; x++)
    {
      eval(obj+'("subMenu'+mainMenu+x+'").className = "rcMenuStatic"')
      eval(obj+'("subLink'+mainMenu+x+'").className = "rcMenuStatic"')
    }   
  }
  else
  {
    eval(obj+'("cell'+mainMenu+'").className = "'+state+'"')
    eval(obj+'("mainLink'+mainMenu+'").className = "'+state+'"')
    if (subMenu[mainMenu].length>=1)
    {
      eval(obj+'("cell'+mainMenu+'a").className = "'+state+'"')
      eval(obj+'("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(param, id)
{
  var cellBorderOffset = 5	//To set the white space between main menu and sub menu
  var browserAdjustment = 0
  var menu;
  var button;

  if (id)
  {    
    getOffset(eval(obj+'(id)'),'left');
    getOffset(eval(obj+'(id)'),'top');    
    getOffset(eval(obj+'(id)'),'width');  
    getOffset(eval(obj+'(id)'),'height');
  }  
  n = 0;    
  while (n < Menu.length)
  {          
    menu = "MENU"+n
    if (param == n)
    {
      theObj = eval(obj+'(menu)');
      if (theObj)
      {
         theObj.style.visibility = "visible"
		 theObj.style.left=oLeft+oWidth+cellBorderOffset;
		 theObj.style.top=oTop-browserAdjustment;
        }
      
       highlightMenu('main',n,'','hover')
       if (subMenu[param].length > 0)
       {
         for (x=0; x<subMenu[param].length; x++)
         {
           eval (obj+'("subMenu'+param+x+'").className = "rcMenuStatic"')
           eval (obj+'("subLink'+param+x+'").className = "rcMenuStatic"')         
         }
       }
    }
    else 
    {          
      if (eval(obj+'(menu)'))
      {
        eval(obj+'(menu).style.visibility = "hidden"')            
      }
      highlightMenu ('main',n,'','static')

    }
    n++
  }  
}

// Re-set timer for sub menus
function hoverMenu()
{
  if(timer)
  clearTimeout(timer)
}

// 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)
}

// when you click the box, perform the same function as if the user had clicked the hyperlink
function tdMouseClick(theElement)
{
  eval(obj+'(theElement).click()')
}
//Used to display message for Inclement weather.
function ShowUnavailableMessage()
{
  alert("Due to Hurricane conditions in Florida you may experience some difficulties in our website and support services!\nWe regret any inconvenience.");
}
////// END MENU CODE  ///////////////////////////////////////////////////////////////////
//-->