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

//ABOUT US
var menu1=new Array()
menu1[0]='<a href="aboutus2.htm" class="menu">Our story</a><br>'
menu1[1]='<a href="staff.htm" class="menu">Our staff</a><br>'
menu1[2]='<a href="services.htm" class="menu">Our services</a><br>'
menu1[3]='<a href="saviour.htm" class="menu">Our Saviour</a><br>'
menu1[4]='<a href="contact.htm" class="menu">Contact us</a><br>'

//COMMUNITY
var menu2=new Array()
menu2[0]='<a href="smallgroups.htm" class="menu">Small groups</a><br>'
menu2[1]='<a href="lifegroups.htm" class="menu">Life groups</a><br>'
menu2[2]='<a href="supportgroups.htm" class="menu">Support groups</a><br>'
menu2[3]='<a href="whatson.htm" class="menu">Whats on / events</a><br>'

//LEGACY
var menu3=new Array()
menu3[0]='<a href="allstars.htm" class="menu">Allstars</a><br>'
menu3[1]='<a href="smallstars.htm" class="menu">Smallstars</a><br>'
menu3[2]='<a href="littlestars.htm" class="menu">Littlestars</a><br>'
menu3[3]='<a href="schools.htm" class="menu">Schools work</a><br>'
menu3[4]='<a href="big.htm" class="menu">BIG</a><br>'

//DESTINY
var menu4=new Array()
menu4[0]='<a href="destinationhome.htm" class="menu">Destination: home</a><br>'

//GENEROSITY
var menu5=new Array()
menu5[0]='<a href="missions.htm" class="menu">Missions</a><br>'
menu5[1]='<a href="ourmissionaries.htm" class="menu">Our Missionaries</a><br>'
menu5[2]='<a href="healingonthestreets.htm" class="menu">Healing on the Streets</a><br>'
menu5[3]='<a href="nightlight.htm" class="menu">Night Light</a><br>'
menu5[4]='<a href="illuminate.htm" class="menu">Illuminate</a><br>'
menu5[5]='<a href="face2face.htm" class="menu">Face2Face</a><br>'
menu5[6]='<a href="seniormoments.htm" class="menu">Senior Moments</a><br>'

//TACKLING POVERTY
var menu6=new Array()
menu6[0]='<a href="activelisteningteam.htm" class="menu">Active Listening Team</a><br>'
menu6[1]='<a href="capmoney.htm" class="menu">CAP Money</a><br>'
menu6[2]='<a href="capdebtcounselling.htm" class="menu">CAP Debt Counselling</a><br>'
menu6[3]='<a href="compassionchristmas.htm" class="menu">Compassion Christmas</a><br>'
menu6[4]='<a href="engagehiv.htm" class="menu">Engage HIV</a><br>'
menu6[5]='<a href="outwardfocusedchristmas.htm" class="menu">Outward Focused Christmas Gifts</a><br>'
menu6[6]='<a href="futurecompassionprojects.htm" class="menu">RFT Future Compassion Projects</a><br>'
menu6[7]='<a href="resourcing.htm" class="menu">Sunday Food Giveaway</a><br>'

//OPPORTUNITY
var menu7=new Array()
menu7[0]='<a href="encounter.htm" class="menu">Encounter</a><br>'
menu7[1]='<a href="volunteer.htm" class="menu">Volunteer</a><br>'
menu7[2]='<a href="internships.htm" class="menu">Internships</a><br>'
menu7[3]='<a href="resources.htm" class="menu">Resources</a><br>'
menu7[4]='<a href="recruitment.htm" class="menu">Positions available</a><br>'

//ITINERARY
var menu8=new Array()
menu8[0]='<a href="itinerary_scott.htm" class="menu">Alan & Kathryn Scott</a><br>'
menu8[1]='<a href="itinerary_marx.htm" class="menu">Mark Marx</a><br>'
menu8[2]='<a href="itinerary_sheppard.htm" class="menu">Tre Sheppard</a><br>'

var menuwidth='135px' //default menu width
var menubgcolor='#5b5b5b'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

var ie4=document.all
var ns6=document.getElementById&&!document.all

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=-500
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 windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
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")-2+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+4+"px"
}

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(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
