<!--

// Don't display any script errors:
window.onerror = HM_ErrorHandler;
function HM_ErrorHandler()
{
  return true;
}

// Set up menu style
document.write(
	'<style>',
		'.menuskin{',
		'position:absolute;',
   		'width:200px;',
		'background-color:#FFFFCC;',
		'border:1px solid black;',
		'font:normal 12px Verdana;',
		'line-height:18px;',
		'z-index:100;',
		'visibility:hidden;',
		'}',
		'.menuskin a{',
		'text-decoration:none;',
		'color:black;',
		'padding-left:10px;',
		'padding-right:10px;',
		'}',
		'#mouseoverstyle{',
		'background-color:highlight;',
		'}',
		'#mouseoverstyle a{',
		'color:white;',
		'}',
		'</style>'
		);

// Navigate to given menu link
function navMenuLink(strHref)
{
	// Navigate
	window.location.href = strHref;
}

// Create menu definitions
var linkset=new Array()
var strBase = "";

// Menu item setup
function MI(iMenuIndex, bFirstItem, strItemText, strHref)
{
	var strItem = '<div class="menuitems"><a href="javascript:navMenuLink(' +
				"'" + strHref + "'" + ')" target="BeeCAREMainFrame">' + 
				strItemText + '</a></div>';
	if( bFirstItem )
		linkset[iMenuIndex] = strItem;
	else
		linkset[iMenuIndex] += strItem;
}

// Products menu
strBase = "/Catalog/";
MI(0,1,"Protective Clothing",strBase+"Clothing/Clothing.htm");
MI(0,0,"Hive Stuff",strBase+"Hives/HS-Components.htm");
MI(0,0,"Tools & Equipment",strBase+"Equip.htm");
MI(0,0,"Supplies",strBase+"Supplies/Supplies.htm");
MI(0,0,"Medication & Feeding",strBase+"Medication.htm");
MI(0,0,"Books",strBase+"Books/Books.htm");

/*
// BBoard menu
strBase = "/Navigation/BBoard/";
MI(1,1,"Bulletin Board Main Page",strBase+"BulletinBoard.htm");
MI(1,0,"Business Cards",strBase+"BusinessCards.htm");
MI(1,0,"Personal Ads",strBase+"PersonalAds.htm");
MI(1,0,"Swarm List (for bee problems)",strBase+"SwarmList.htm");
MI(1,0,"Visitor Photos",strBase+"Photos/Photos.htm");
*/

// BLC menu
strBase = "/Navigation/BLC.htm#";
MI(1,1,"Honeybees and their Life",strBase+"Honeybees and their Life");
MI(1,0,"Honeybee Encyclopedia",strBase+"Encyclopedia");
MI(1,0,"Getting Started in Beekeeping",strBase+"Getting Started");
MI(1,0,"Hives and Beekeeping Equipment",strBase+"Hives and Equip");
MI(1,0,"Best Beekeeping Practices",strBase+"Best Beekeeping Practices");
MI(1,0,"Diseases, Pests & Treatments",strBase+"Diseases");

// BKInfo menu
strBase = "/Other sites/";
MI(2,1,"Beekeeping Information Sites",strBase+"Beekeeping Info Sites.htm");
MI(2,0,"Beekeeping Suppliers",strBase+"Beekeeping Suppliers.htm");
MI(2,0,"Honeybee Product Sites",strBase+"Bee Product Sites.htm");
MI(2,0,"Package Bee & Queen Suppliers",strBase+"Bee Suppliers.htm");
MI(2,0,"Texas Beekeepers Association","/Directories/TBA Chapters.htm");
MI(2,0,"Wildflower Seed Suppliers",strBase+"Wildflower Farms.htm");

// Menu code & data
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function showmenu(iMenuIndex, objTopMenu, objEvent, iMenuWidth, iMenuLeft)
{
	if (!document.all&&!document.getElementById&&!document.layers)
		return;

	var which = linkset[iMenuIndex];
	var menuobj = ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : 
				ns4? document.popmenu : "";
	menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj;

	menuobj.thestyle.width = iMenuWidth;
	clearhidemenu();
	if (ie4||ns6)
		menuobj.innerHTML = which;
	else
	{
	menuobj.document.write('<layer name=gui bgColor=#FFFFCC width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>');
	menuobj.document.close();
	}

	menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width;
	menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height;
	var eventX=ie4? objEvent.clientX : ns6? objEvent.clientX : objEvent.x;
	eventY=ie4? objEvent.clientY : ns6? objEvent.clientY : objEvent.y;

	var rightedge = ie4 ? document.body.clientWidth : window.innerWidth;
	if( iMenuLeft + iMenuWidth > rightedge )
		iMenuLeft = rightedge - iMenuWidth;
	menuobj.thestyle.left = iMenuLeft;
	menuobj.thestyle.top = document.body.scrollTop;
	menuobj.thestyle.visibility = "visible";
	return false;
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
var menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e){
var menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function highlightmenu(objEvent,state){
if (document.all)
source_el=objEvent.srcElement
else if (document.getElementById)
source_el=objEvent.target
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="menuitems"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}
}
}
}

if (ie4||ns6)
document.onclick=hidemenu

-->
