var defaultMenuWidth="150px" //set default menu width.

var linkset=new Array()
var menuposX=new Array()
var menuposY=new Array()
//Menus

linkset[0]='<a href="/about/crisis-in-uganda">Crisis In Uganda</a>'
linkset[0]+='<a href="/about/mission-and-values">Mission and Values</a>'
linkset[0]+='<a href="/about/who-we-are">Who We Are</a>'
linkset[0]+='<a href="/about/what-we-do">What We Do</a>'
menuposX[0]='550px'
menuposY[0]='62px'
menuposX[1]='737px'
menuposY[1]='62px'

//linkset[1]='<a href="/projects/orphanage">Expand the STAO Orphanage</a>'
//linkset[1]+='<a href="/2007-trip/2007-uganda-trip/">2007 Summer Trip</a>'
//linkset[1]+='<a href="/projects/widows">Widows Jewelry Project</a>'
//linkset[1]+='<a href="/help/volunteer">Volunteer/Intern Opportunities</a>'

//linkset[0]+='<hr>' //Optional Separator


var ie5=document.all && !window.opera
var ns6=document.getElementById

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=linkset[which]
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
//menuobj.contentwidth=menuobj.offsetWidth
//menuobj.contentheight=menuobj.offsetHeight
menuobj.style.left=menuposX[which]
menuobj.style.top=menuposY[which]
menuobj.style.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(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu
