//Drop down menus
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
var opr = (navigator.userAgent.indexOf("Opera")) ? 1 : 0;
var zindex = 100;
var hiddenconst = (ns6||ie4)? "hidden" : "hide";
var on_layer_id = -1;
var imgname;

// Call by onMouseOver="dropit(event,'nameofobj');"
function dropit(e, whichone) { 

// Assign image name to current dropmenu, must be manual
if (whichone == "dropmenu0")
  imgname = "about";
if (whichone == "dropmenu1")
  imgname = "members";
if (whichone == "dropmenu2")
  imgname = "nests";
if (whichone == "dropmenu3")
  imgname = "events";
if (whichone == "dropmenu4")
  imgname = "shop";

//Is there an existing menu or not?
curmenuID=ns6? document.getElementById(whichone).id : eval(whichone).id
if (window.themenu&&themenu.id!=curmenuID)
  themenuStyle.visibility=ns4?"hide" : "hidden"

//Determine position of object (since it could be anywhere)
themenu=ns6? document.getElementById(whichone): eval(whichone)
themenuStyle=(ns6||ie4)? themenu.style : themenu
themenuoffsetX=(ie4&&opr==-1)? document.body.scrollLeft : 0
themenuoffsetY=(ie4&&opr==-1)? document.body.scrollTop : 0
themenuStyle.left=ns6||ns4? e.pageX-e.layerX-5 : themenuoffsetX+event.clientX-event.offsetX-5
themenuStyle.top=ns6||ns4? e.pageY-e.layerY+18 : themenuoffsetY+event.clientY-event.offsetY+18
//For debugging purposes
//alert(themenuStyle.left+","+themenuStyle.top);


if (themenuStyle.visibility==hiddenconst) {
   themenuStyle.visibility=(ns6||ie4)? "visible" : "show"
   themenuStyle.zIndex=zindex++;
   on_layer_id = 1;
	 //onoff(1,imgname);
 }
 else {
   hidemenu();
 }
 return false;
}

function hidemenu(){
 if (on_layer_id == -1) {
   if ((ie4||ns6)&&window.themenu)
     themenuStyle.visibility="hidden";
   else if (ns4)
     themenu.visibility="hide";
	 //onoff(0,imgname);
  }
}

/*********************************************************************/
//AMY, this is the function to change nav images when rolled over
//		change the document.images.XXXXX.src to whatever is needed
/*********************************************************************/
function onoff(which,tmpimg) {
  // 0 = off; 1 = on
 document.images.about.src = "/images/nav_about_off.gif";
 document.images.members.src = "/images/nav_members_off.gif";
 document.images.gts.src = "/images/nav_gts_off.gif";
 document.images.columns.src = "/images/nav_articles_off.gif";
 if (tmpimg != null && which == 1) {
   var whatToDo = eval("document.images."+tmpimg);
   whatToDo.src = "/images/nav_"+tmpimg+"_on.gif";
 }
}

function layer_enter (id)
{
 on_layer_id = id;
 hidemenu(); 
}

function layer_exit ()
{
  on_layer_id = -1;
  setTimeout ('hidemenu()', 100);
}