<!---
// Use Freely as long as following disclaimer is intact:
//---------------------------------------------------------------
// Cross Browser Multi-Orientation Menu v1.2 11th February 2004
// Written by Rik Comery. www.ricom.co.uk, support at www.ricom.co.uk           
// All rights reserved.                                         
// Featured in the SimplytheBest DHTML Scripts Library at http://simplythebest.net/scripts/



var mouseout;
var mouseover;


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	//alert(changeImages.arguments[i] + " " + changeImages.arguments[i+1]);
	if (document.images && (preloadFlag == true)) {

		for (var i=0; i<changeImages.arguments.length; i+=2) {
			//alert("test: "+changeImages.arguments[i] + " " + changeImages.arguments[i+1]);
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		preloadFlag = true;
	}
}








preloadImages();








//  MENU ITEMS - DUPLICATE THIS ENTIRE SECTION FOR MULTIPLE MENUS.   
var Menu1 = new Array ()
var subMenu1 = new Array ()


Menu1[0] = new Array("Home Page", "/index.shtml","_top", "left")
  subMenu1[0] = new Array()
  subMenu1[0][0] = new Array("About Us", "/aboutus.shtml","_top")
Menu1[1] = new Array("Educational Products", "/educational_products.shtml","_top", "left")
  subMenu1[1] = new Array()
Menu1[2] = new Array("Rock Gifts", "/rockgifts.shtml","_top", "left")
  subMenu1[2] = new Array()
Menu1[3] = new Array("Jewelry", "/jewelry.shtml","_top", "left")
  subMenu1[3] = new Array()
Menu1[4] = new Array("Lapidary", "/lapidary.shtml","_top", "left")
  subMenu1[4] = new Array()
  subMenu1[4][0] = new Array("Classes", "/lapidary_classes.shtml","_top")
  subMenu1[4][1] = new Array("Equipment & Supplies", "/equipment_supplies.shtml","_top")
Menu1[5] = new Array("Ugly Nuts", "/ugly_nuts.shtml","_top", "left")
  subMenu1[5] = new Array()
Menu1[6] = new Array("Contact Us", "javascript:document.busContact.submit();","_top", "left")
  subMenu1[6] = new Array()





////// FORMAT MENU
menuStyle = "flat"                            // Menu Style (flat, 3d)
useimages = "no";

cellPadding = 2                                      // Cell Padding
cellBorder = 1	 				     // Include table border (0 for no border)

//cellPadding = 0                                     // Cell Padding
//cellBorder = 0	 				     // Include table border (0 for no border)


verticalOffset = 0                                   // Vertical offset of Sub Menu. 
horizontalOffset = 0                                 // Horizontal offset of Sub Menu. 
subMenuDelay = 1                                     // Time sub menu stays visible for (in seconds)
subIndicate = 0                                      // Show if a sub menu is present (0 for "no")
// Symbol to show if a sub menu is present (subIndicate must be to set to 1)
indicator = ">"


moverimage = "/images/"
moutimage =  "/images/"


MMcellwidth  = "116px"
MMcellheight = "14px"
SMcellwidth  = "116px"
SMcellheight = "14px"


cellVAlign  = "default"
cellHAlign = "center"

                                                // Use standard HTML <img> tag. You can use a character instead of an image. 
                                                // e.g.      indicator = ">"
// Main Menu Items
borderColor = "#666633"                   // Border Colour (flat mode only)
borderHighlight = ""           // Border Highlight Colour (3d mode only)
borderShadow = ""                 // Border Shadow Colour (3d mode only)
menuBackground = "#000000"             // Cell Background Colour
menuHoverBackground = "#E8E7B9"   // Cell Background Colour on mouse rollover
fontFace = "arial"                         // Font Face
fontColour = "#E8E7B9"                     // Font Colour
fontHoverColour = "#000000"            // Font Colour on mouse rollover
fontSize = "11px"                          // Font Size
fontDecoration = "none"              // Style of the link text (none, underline, overline, line-throughnt
fontWeight = "bold"                      // Font Weight (normal, bold)

// Sub Menu Items
sborderColor = "#666666"                   // Border Colour (flat mode only)
sborderHighlight = ""           // Border Highlight Colour (3d mode only)
sborderShadow = ""                 // Border Shadow Colour (3d mode only)
smenuBackground = "#000000"             // Cell Background Colour
smenuHoverBackground = "#E8E7B9"   // Cell Background Colour on mouse rolloverr
sfontFace = "arial"                        // Font Face
sfontColour = "#E8E7B9"                    // Font Colour
sfontHoverColour = "#000000"           // Font Colour on mouse rollover
sfontSize = "11PX"                         // Font Size
sfontDecoration = "none"             // Style of the link text (none, underline, overline, line-through)
sfontWeight = "bold"                     // Font Weight (normal, bold)
sShadow = 1

////// END FORMAT MENU

quantity = 1

////// 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"

styleBorder=(menuStyle.toLowerCase() == "flat")?cellBorder:0 

// Menu Styles
document.writeln ('<style>');

document.writeln ('.rcMenuStatic {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+'; background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuStatic:visited {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+'; background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuStatic:active {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+'; background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuStatic:link {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+'; background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuStatic:hover {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontColour+';font-weight:'+fontWeight+'; background-color:'+menuBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');

document.writeln ('.rcMenuHover  {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+'; background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuHover:visited  {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+'; background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuHover:active  {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+'; background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuHover:link  {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+'; background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');
document.writeln ('.rcMenuHover:hover  {text-align: '+cellHAlign+'; vertical-align: '+cellVAlign+';  width: '+MMcellwidth+';height: '+MMcellheight+';font-family:'+fontFace+';font-size:'+fontSize+';color:'+fontHoverColour+';font-weight:'+fontWeight+'; background-color:'+menuHoverBackground+'; cursor:hand; text-decoration:'+fontDecoration+'}');

document.writeln ('.rcSubMenuStatic {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuStatic:visited {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuStatic:active {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuStatic:link {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuStatic:hover {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuBackground+'; cursor:hand; margin-left:1px;}');

document.writeln ('.rcSubMenuHover  {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuHover:visited  {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuHover:active  {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuHover:link  {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand; margin-left:1px;}');
document.writeln ('.rcSubMenuHover:hover  {width: '+SMcellwidth+';height: '+SMcellheight+';font-family:'+sfontFace+';font-size:'+sfontSize+';color:'+sfontHoverColour+';font-weight:'+sfontWeight+';text-decoration:'+sfontDecoration+';background-color:'+smenuHoverBackground+'; cursor:hand; margin-left:1px;}');

document.writeln ('</style>');



// Build and show the main menu items
function showMenus(quant,definedOrientation)
{
  var outputtext="";
  
  if(definedOrientation!="")
  {
    orientation=definedOrientation;
  }
  
  if (orientation.toLowerCase() == "vertical")
  {
    outputtext=outputtext+ '<table border="0" cellpadding="0" cellspacing="'+styleBorder+'" bgColor="'+borderColor+'">';
  }
  else
  {
    outputtext=outputtext+'<table border="0" cellpadding="0" cellspacing="'+styleBorder+'" bgColor="'+borderColor+'"><tr>';
  }  
  
  
  for (x=0; x<eval("Menu"+quant).length; x++)
  {
    if (orientation.toLowerCase()=="vertical") 
    {
      outputtext=outputtext + '<tr>';
    }
   
    outputtext=outputtext+'<td onclick="tdMouseClick(\''+quant+'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown(\''+quant+'\','+x+', \''+quant+'button'+x+'\',\''+orientation+'\');" onMouseOut="clearMenu('+quant+','+x+')" ';
        
    if (menuStyle.toLowerCase() == "3d")
    {
      outputtext=outputtext+'style=" border-left:'+cellBorder+'px solid '+borderHighlight+';border-top:'+cellBorder+'px solid '+borderHighlight+';border-right:'+cellBorder+'px solid '+borderShadow+';border-bottom:'+cellBorder+'px solid '+borderShadow+'; "';
    }        
    

    // holder div
    outputtext=outputtext+'><div id="'+quant+'button'+x+'">';    
    outputtext=outputtext+'<table border="0" cellpadding="'+cellPadding+'" cellspacing="0" bgColor="'+borderColor+'">';
    outputtext=outputtext+'<tr><td id="'+quant+'cell'+x+'" class="rcMenuStatic" nowrap>';


    if (useimages == "yes")
    {
	outputtext=outputtext+'<a class="rcMenuStatic" ONMOUSEOVER="changeImages(\''+quant+'image1'+x+'.jpg\', \'/images/cell_'+x+'_mouseover.jpg\')\; return true;" ';
	outputtext=outputtext+' ONMOUSEOUT="changeImages(\''+quant+'image1'+x+'.jpg\', \'/images/cell_'+x+'_mouseout.jpg\')\; return true;" ';
	outputtext=outputtext+' id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'">';
	outputtext=outputtext+'<img name="'+quant+'image1'+x+'.jpg" src="/images/cell_'+x+'_mouseout.jpg" border=0>';
	outputtext=outputtext+'</a>';
    }
    else
    {
	outputtext=outputtext+'<a class="rcMenuStatic" id="'+quant+'mainLink'+x+'" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'">';
	outputtext=outputtext+eval("Menu"+quant)[x][0];	
	outputtext=outputtext+'</a>';
    }    
         



    outputtext=outputtext+'</td>';

    if (subIndicate == 1&&eval("subMenu"+quant)[x].length>=1)
    {
      outputtext=outputtext+'<td class="rcMenuStatic" id="'+quant+'cell'+x+'a" align="right">';
      outputtext=outputtext+'<a id="'+quant+'mainLink'+x+'a" href="'+eval("Menu"+quant)[x][1]+'" target="'+eval("Menu"+quant)[x][2]+'" class="rcMenuStatic">'+indicator+'</a></td>';
    }    
    
    
    outputtext=outputtext+'</tr></table></div>';    
    outputtext=outputtext+'</td>'; 
	
	
         
    if (orientation.toLowerCase()=="vertical") outputtext=outputtext+'</tr>';
  }
  
  if (orientation.toLowerCase() == "vertical")
  {
    outputtext=outputtext+'</table>';
  }
  else
  { 
    outputtext=outputtext+'</tr></table>';
  }   
  

// Build the sub menu items
  for (x=0; x<eval("Menu"+quant).length; x++)
  { 
    if (eval("subMenu"+quant)[x].length > 0)
    {     
      outputtext=outputtext+'<div id="'+quant+'MENU'+x+'" style="visibility:hidden; position:absolute; z-index:2" >';
      outputtext=outputtext+'<table border="0" cellpadding="'+cellPadding+'" cellspacing="'+styleBorder+'" bgColor="'+sborderColor+'">';
      for (y=0; y<eval("subMenu"+quant)[x].length; y++)
      {
        outputtext=outputtext+'<tr><td id="'+quant+'subMenu'+x+y+'" class="rcSubMenuStatic" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+',\'\','+quant+')" onMouseOut="clearMenu('+quant+','+x+');" onclick="tdMouseClick(\''+quant+'subLink'+x+y+'\')" nowrap';
        if (menuStyle.toLowerCase() == "3d"){outputtext=outputtext+'style="border-left:'+cellBorder+'px solid '+sborderHighlight+';border-top:'+cellBorder+'px solid '+sborderHighlight+';border-right:'+cellBorder+'px solid '+sborderShadow+';border-bottom:'+cellBorder+'px solid '+sborderShadow+';"';}
        outputtext=outputtext+'><a id="'+quant+'subLink'+x+y+'" href="'+eval("subMenu"+quant)[x][y][1]+'" target="'+eval("subMenu"+quant)[x][y][2]+'" class="rcSubMenuStatic">'+eval("subMenu"+quant)[x][y][0]+'</a></td></tr>';
      }
      outputtext=outputtext+'</table></div>';
    }
  }
  
  // display the tables.
  document.writeln(outputtext);
  //alert (outputtext);

} 





// Change colour or menu and submenu items when the mouse hovers over.  
function highlightMenu(element,mainMenu,dropMenu,state,quant)
{
  hoverMenu();
  state=(state == "hover")?"rcMenuHover":"rcMenuStatic"
  if (element == "sub")
  {
    for (x=0; x < eval("subMenu"+quant)[mainMenu].length; x++)
     {
      eval(obj+'("'+quant+'subMenu'+mainMenu+x+'").className = "rcSubMenuStatic"')
      eval(obj+'("'+quant+'subLink'+mainMenu+x+'").className = "rcSubMenuStatic"')
    }   
    eval(obj+'("'+quant+'subMenu'+mainMenu+dropMenu+'").className="rcSubMenuHover"')
    eval(obj+'("'+quant+'subLink'+mainMenu+dropMenu+'").className="rcSubMenuHover"')
  }
  else
  {
    eval(obj+'("'+quant+'cell'+mainMenu+'").className = "'+state+'"')
    eval(obj+'("'+quant+'mainLink'+mainMenu+'").className = "'+state+'"')

    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)
{
  var cellBorderOffset = (isNS6)?cellBorder:eval(cellBorder*2)
  var browserAdjustment = (isNS6)?cellBorder:0
  //var cellBorderOffset = 0;
  //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');
    
    if (eval("Menu"+quant+"["+param+"][3]")=="right") 
    { 
      oLeft=oLeft  
      oLeft=oLeft+oWidth; 
      getOffset(eval(obj+'("'+quant+'MENU'+param+'")'),'width');
      oLeft=oLeft-oWidth ;
      alignAdjustment = cellBorder*2 + 1
    }
    else 
    {
      alignAdjustment = 0
      oLeft=oLeft
    }    
  }  


  // fudge the dropdown placement for netscape
  //if (isNS6 && (orientation.toLowerCase()=="horizontal"))
  //{
//	oLeft=oLeft-160;
 // }
	
	
  
  n = 0;    
  while (n < eval("Menu"+quant).length)
  {          
    menu = quant+"MENU"+n
    if (param == n)
    {
      theObj = eval(obj+'(menu)');
      if (theObj)
      {
         theObj.style.visibility = "visible"
 
	

	

          if (orientation.toLowerCase()=="vertical"){
            theObj.style.left=(menuStyle.toLowerCase()=="flat")?oLeft+oWidth+cellBorder+horizontalOffset:oLeft+oWidth+cellBorderOffset+horizontalOffset;
            theObj.style.top=(menuStyle.toLowerCase()=="flat")?oTop-cellBorder+verticalOffset:oTop+verticalOffset-browserAdjustment}
          else{
            theObj.style.left=(menuStyle.toLowerCase()=="flat")?oLeft-cellBorder+horizontalOffset+alignAdjustment:oLeft+horizontalOffset-browserAdjustment+alignAdjustment;
            theObj.style.top=(menuStyle.toLowerCase()=="flat")?oTop+oHeight+cellBorder+verticalOffset:oTop+oHeight+cellBorderOffset+verticalOffset;}
      }
      
      highlightMenu('main',n,'','hover',quant)
      if (eval("subMenu"+quant)[param].length > 0)
      {
         for (x=0; x<eval("subMenu"+quant)[param].length; x++)
         {
           eval (obj+'("'+quant+'subMenu'+param+x+'").className = "rcSubMenuStatic"')
           eval (obj+'("'+quant+'subLink'+param+x+'").className = "rcSubMenuStatic"')         
         }
      }
    }
    else 
    {  
      for (x=1; x<quantity+1; x++)
      {       
        menu = x+"MENU"+n   
        //alert(menu)     
        if (eval(obj+'(menu)'))
        {
          eval(obj+'(menu).style.visibility = "hidden"')            
        }
        highlightMenu ('main',n,'','static',quant)
      }
    }
    n++
  }  
}

// Re-set timer for sub menus
function hoverMenu()
{
  if(timer)
  clearTimeout(timer)
}

// Set timer for sub menus
function clearMenu(quant,menu)
{
  setDelay = subMenuDelay*1000
  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()')
}
//-->
