// JavaScript Document
/***********************************************

* 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

***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="../index.php?option=com_content&view=category&layout=blog&id=36&Itemid=55" title="Sunday Sermons">Sermons</a>'
menu1[1]='<a href="../index.php?option=com_content&view=article&id=241&Itemid=85" title="Sermon/Worship Schedule">Sermon Schedule</a>'
menu1[2]='<a href="../index.php?option=com_content&view=category&layout=blog&id=35&Itemid=53" title="Read Tom MacMillans Monday Message">Monday Messages</a>'
menu1[3]='<a href="../index.php?option=com_content&view=category&layout=blog&id=37&Itemid=56" title="Devotions at John Knox">Devotions</a>'
menu1[4]='<a href="../index.php?option=com_content&view=category&layout=blog&id=38&Itemid=57" title="Worship & Music">Worship & Music</a>'
menu1[5]='<a href="../index.php?option=com_content&view=category&layout=blog&id=39&Itemid=58" title="Stix">Stix</a>'
menu1[6]='<a href="../index.php?option=com_content&view=category&layout=blog&id=40&Itemid=59" title="Liturgical Movement">Liturgical Movement</a>'

//Contents for menu 2, and so on

var menu2=new Array()
menu2[0]='<a href="../index.php?option=com_content&view=category&layout=blog&id=41&Itemid=60" title="Communications">Communication</a>'
menu2[1]='<a href="../index.php?option=com_content&view=category&layout=blog&id=42&Itemid=61" title="Congregational Life">Congregational Life</a>'
menu2[2]='<a href="../index.php?option=com_content&view=category&layout=blog&id=43&Itemid=62" title="Deacons">Deacons</a>'
menu2[3]='<a href="../index.php?option=com_content&view=category&layout=blog&id=44&Itemid=63" title="Evangelism and Membership">Evangelism &amp; Membership</a>'
menu2[4]='<a href="../index.php?option=com_content&view=category&layout=blog&id=45&Itemid=64" title="Finance">Finance</a>'
menu2[5]='<a href="../index.php?option=com_content&view=category&layout=blog&id=46&Itemid=65" title="Personnel">Personnel</a>'
menu2[6]='<a href="../index.php?option=com_content&view=category&layout=blog&id=47&Itemid=66" title="Properties">Properties</a>'
menu2[7]='<a href="../index.php?option=com_content&view=category&layout=blog&id=48&Itemid=67" title="Session">Session</a>'
menu2[8]='<a href="../index.php?option=com_content&view=category&layout=blog&id=49&Itemid=68" title="Spiritual Growth">Spiritual Growth</a>'
menu2[9]='<a href="../index.php?option=com_content&view=category&layout=blog&id=50&Itemid=69" title="Stephen Ministry">Stephen Ministry</a>'

//Contents for menu 3

var menu3=new Array()
menu3[1]='<a href="../index.php?option=com_content&view=category&layout=blog&id=51&Itemid=70" title="Christian Education">Christian Education</a>'
menu3[2]='<a href="../index.php?option=com_content&view=category&layout=blog&id=52&Itemid=71" title="John Knox Preschool Program">Preschool</a>'
menu3[3]='<a href="../index.php?option=com_content&view=category&layout=blog&id=53&Itemid=72" title="Childrens Ministry">Childrens Ministry </a>'
menu3[4]='<a href="../index.php?option=com_content&view=category&layout=blog&id=68&Itemid=88" title="Confirmation">Confirmation</a>'
menu3[5]='<a href="../index.php?option=com_content&view=category&layout=blog&id=54&Itemid=73" title="John Knox Youth Program">Youth Ministry</a>'
menu3[6]='<a href="../index.php?option=com_content&view=category&layout=blog&id=55&Itemid=74" title="LOGOS">LOGOS</a>'
menu3[7]='<a href="../index.php?option=com_content&view=category&layout=blog&id=56&Itemid=75" title="Vacation Bible School">Vacation Bible School</a>'
menu3[8]='<a href="../index.php?option=com_content&view=category&layout=blog&id=71&Itemid=89" title="Bible Study">Bible Study</a>'
menu3[9]='<a href="../index.php?option=com_weblinks&view=category&id=60&Itemid=78" title="Links, Information and Resources">Resources</a>'

//Contents for menu 4

var menu4=new Array()
menu4[0]='<a href="../index.php?option=com_content&view=category&layout=blog&id=58&Itemid=77" title="Missions">Missions</a>'
menu4[1]='<a href="../index.php?option=com_content&view=category&layout=blog&id=77&Itemid=94" title="John Knox Women"> John Knox Women</a>'
//menu4[1]='<a style="text-indent:10px;">Henderson Settlement</a>'
//menu4[2]='<a style="text-indent:10px;">Gulfport Workcamp</a>'
//menu4[3]='<a style="text-indent:10px;">Mission Links</a>'
menu4[4]='<a href="../index.php?option=com_content&view=category&layout=blog&id=59&Itemid=79" title="Prayer Circles">Prayer Circles</a>'
menu4[5]='<a href="../index.php?option=com_content&view=category&layout=blog&id=67&Itemid=87" title="Faith at Work"> Faith at Work Groups</a>'
menu4[6]='<a href="../index.php?option=com_content&view=category&layout=blog&id=75&Itemid=93" title="Nicaragua Mission"> Nicaragua Mission</a>'


/*
//Contents for menu 5

var menu5=new Array()
menu5[0]='<a class="foot_indent">Nicaragua Mission</a>'
menu5[1]='<a class="foot_indent">Henderson Settlement</a>'
menu5[2]='<a class="foot_indent">Gulfport Workcamp</a>'
menu5[3]='<a class="foot_indent">Mission Links</a>'
*/
		
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=4 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

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

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" 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
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-obj.offsetWidth < 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 menu up?

edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight

if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)

edgeoffset=dropmenuobj.y

}

}

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")+obj.offsetWidth+horizontaloffset+"px"

dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"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)

}


