/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//HOME
var menu1=new Array()
menu1[0]='<a href="http://www.theprojecteden.org/extra/privacy.php" title="Privacy">Privacy</a>'
menu1[1]='<a href="http://www.theprojecteden.org/extra/map.php" title="Site Map">Site Map</a>'
menu1[2]='<a href="http://www.theprojecteden.org/extra/links.php" title="Links">Links</a>'

//ABOUT US
//var menu2=new Array()
//menu2[0]='<a href="/about/history.php" title="History">History</a>'
//menu2[0]='<a href="/about/mission.php" title="Mission">Mission</a>'
//menu2[0]='<a href="/about/leadership.php" title="Leadership">Leadership</a>'
//menu2[3]='<a href="/about/work.php" title="Where We Work">Where We Work</a>'
//menu2[2]='<a href="/about/projects.php" title="Projects">Projects</a>'

//SPONSORSHIP
//var menu3=new Array()
//menu3[0]='<a href="/sponsorship/learn.php" title="Learn About Sponsorship">Learn About Sponsorship</a>'
//menu3[1]='<a href="/sponsorship/sponsor.php" title="Sponsor A Project">Sponsor A Project</a>'
//menu3[2]='<a href="/sponsorship/partner.php" title="Partner A Project">Partner A Project</a>'
//menu3[3]='<a href="/sponsorship/corporate.php" title="Corporate Sponsorship">Corporate Sponsorship</a>'

//TAKE ACTION
var menu2=new Array()
menu2[0]='<a href="http://www.theprojecteden.org/action/index.php" title="Invest-Partner-Empower">Invest-Partner-Empower</a>'
//menu2[1]='<a href="/action/#partner" title="Partner">Partner</a>'
//menu2[2]='<a href="/action/#empower" title="Empower">Empower</a>'
menu2[1]='<a href="http://www.theprojecteden.org/action/contribute.php" title="Contribute">Contribute</a>'
//menu2[1]='<a href="/action/support.php" title="Company Support">Company Support</a>'
//menu2[2]='<a href="/action/items.php" title="In-Kind Contributions">In-Kind Contributions</a>'
menu2[2]='<a href="http://www.theprojecteden.org/action/volunteer.php" title="Become A Volunteer">Become A Volunteer</a>'
menu2[3]='<a href="http://www.theprojecteden.org/action/tellfriend.php" title="Tell A Friend">Tell A Friend</a>'
menu2[4]='<a href="http://www.theprojecteden.org/action/signup.php" title="Sign-Up For Email Updates">Sign-Up For Email Updates</a>'

//NEWS
var menu3=new Array()
//menu4[0]='<a href="/news/press.php" title="Press Releases">Press Releases</a>'
//menu4[1]='<a href="/news/haiti.php" title="News From Haiti">News From Haiti</a>'
//menu3[0]='<a href="/news/news.php" title="Project Eden In The News">Project Eden Haiti</a>'
menu3[0]='<a href="http://www.theprojecteden.org/news/events.php?y=" title="Project Eden Events">Project Eden Events</a>'

//FAQS
var menu4=new Array()
//menu5[0]='<a href="/faqs/general.php" title="General FAQs">General FAQs</a>'
//menu5[1]='<a href="/faqs/sponsorship.php" title="Sonsorship FAQs">Sponsorship FAQs</a>'
menu4[1]='<a href="http://www.theprojecteden.org/faqs/nations.php" title="Nation\'s FAQs">Nation\'s FAQs</a>'


var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
       
if (browserVer >= 3) version = "n3";
else version = "n2";               
if (version == "n3")
{
image1=new Image();   image1.src="http://www.theprojecteden.org/pe_images/btn_a1.jpg";
image2=new Image();   image2.src="http://www.theprojecteden.org/pe_images/btn_a.jpg";
image3=new Image();   image3.src="http://www.theprojecteden.org/pe_images/btn_b1.jpg";
image4=new Image();   image4.src="http://www.theprojecteden.org/pe_images/btn_b.jpg";

//image5=new Image();   image5.src="/pe_images/btn_d1.jpg";
//image6=new Image();   image6.src="/pe_images/btn_d.jpg";

image5=new Image();   image5.src="http://www.theprojecteden.org/pe_images/btn_d1.jpg";
image6=new Image();   image6.src="http://www.theprojecteden.org/pe_images/btn_d.jpg";
image7=new Image();   image7.src="http://www.theprojecteden.org/pe_images/btn_e1.jpg";
image8=new Image();   image8.src="http://www.theprojecteden.org/pe_images/btn_e.jpg";
image9=new Image();   image9.src="http://www.theprojecteden.org/pe_images/btn_f1.jpg";
image10=new Image();  image10.src="http://www.theprojecteden.org/pe_images/btn_f.jpg";
image11=new Image();  image11.src="http://www.theprojecteden.org/pe_images/btn_g1.jpg";
image12=new Image();  image12.src="http://www.theprojecteden.org/pe_images/btn_g.jpg";
}

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth,x){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
show(x);

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(x){
	show(x);
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if(hidemenu_onclick=="yes"){
	document.onclick=hidemenu
}

function show(x)
{
 if (version == "n3")
  {
    if (x=="1")  document.images["home"].src=image1.src;
    if (x=="2")  document.images["home"].src=image2.src; 
    if (x=="3")  document.images["about"].src=image3.src;
    if (x=="4")  document.images["about"].src=image4.src; 
    //if (x=="5")  document.images["sponsorship"].src=image5.src;
    //if (x=="6")  document.images["sponsorship"].src=image6.src; 
    if (x=="5")  document.images["action"].src=image5.src;
    if (x=="6")  document.images["action"].src=image6.src; 
    if (x=="7")  document.images["news"].src=image7.src;
    if (x=="8")  document.images["news"].src=image8.src; 
    if (x=="9")  document.images["faqs"].src=image9.src;
    if (x=="10")  document.images["faqs"].src=image10.src; 
    if (x=="11")  document.images["contact"].src=image11.src;
    if (x=="12")  document.images["contact"].src=image12.src; 
   }
}

function clearall()
{
 if (version == "n3")
  {
    document.images["home"].src=image2.src;
    document.images["about"].src=image4.src;
    //document.images["sponsorship"].src=image6.src;
    document.images["action"].src=image6.src;
    document.images["news"].src=image8.src;
    document.images["faqs"].src=image10.src;
    document.images["contact"].src=image12.src;
  }
}

