// Set the URL so the rollovers and drop-downs work from any directory
var siteURL = "http://www.jonescounty.com/";

/***********************************************
* 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 Live
var menulive=new Array()
menulive[0]='<a href="http://www.jonescounty.com/live/quality.html">Quality of Life</a>'
menulive[1]='<a href="http://www.jonescounty.com/live/housing.html">Housing</a>'
menulive[2]='<a href="http://www.jonescounty.com/live/history.html">History</a>'
menulive[3]='<a href="http://www.jonescounty.com/live/climate.html">Regional Climate</a>'

//Contents for menu Work
var menuwork=new Array()
menuwork[0]='<a href="http://www.jonescounty.com/work/industry.html">Industry Overview</a>'
menuwork[1]='<a href="http://www.jonescounty.com/work/labor.html">Labor Force</a>'
menuwork[2]='<a href="http://www.jonescounty.com/work/partners.html">Valued Partners</a>'
menuwork[3]='<a href="http://www.jonescounty.com/work/entrepreneurism.html">Entrepreneurism</a>'
menuwork[4]='<a href="http://www.jonescounty.com/work/tech_park.html">Technology Park</a>'
menuwork[5]='<a href="http://www.jonescounty.com/work/location.html">Location</a>'
menuwork[6]='<a href="http://www.jonescounty.com/work/transportation.html">Transportation</a>'
menuwork[7]='<a href="http://www.jonescounty.com/work/prospect_center.html">Prospect Center</a>'
		
//Contents for menu Play
var menuplay=new Array()
menuplay[0]='<a href="http://www.jonescounty.com/play/parks.html">Area Parks</a>'
menuplay[1]='<a href="http://www.jonescounty.com/play/athletics.html">Athletics</a>'
menuplay[2]='<a href="http://www.jonescounty.com/play/sportsplex.html">Sportsplex</a>'
menuplay[3]='<a href="http://www.jonescounty.com/play/outdoor.html">Outdoor Activities</a>'
menuplay[4]='<a href="http://www.jonescounty.com/play/arts.html">Arts and Culture</a>'
menuplay[5]='<a href="http://www.jonescounty.com/play/events.html">Festivals and Events</a>'

//Contents for menu Learn
var menulearn=new Array()
menulearn[0]='<a href="http://www.jonescounty.com/learn/k12.html">K-12 Schools</a>'
menulearn[1]='<a href="http://www.jonescounty.com/learn/colleges.html">Colleges</a>'
menulearn[2]='<a href="http://www.jonescounty.com/learn/comm_outreach.html">Community Outreach</a>'

//Contents for menu Shop
var menushop=new Array()
menushop[0]='<a href="http://www.jonescounty.com/shop/local.html">Local Shopping</a>'
menushop[1]='<a href="http://www.jonescounty.com/shop/regional.html">Regional Shopping</a>'

//Contents for menu Care
var menucare=new Array()
menucare[0]='<a href="http://www.jonescounty.com/care/values.html">Community Values</a>'
menucare[1]='<a href="http://www.jonescounty.com/care/civic_outreach.html">Civic Outreach</a>'
menucare[2]='<a href="http://www.jonescounty.com/care/healthcare.html">Healthcare</a>'
menucare[3]='<a href="http://www.jonescounty.com/care/clinics.html">Medical Clinics</a>'

//Contents for menu Visit
var menuvisit=new Array()
menuvisit[0]='<a href="http://www.jonescounty.com/visit/accommodations.html">Accommodations</a>'
menuvisit[1]='<a href="http://www.jonescounty.com/visit/attractions.html">Attractions</a>'
menuvisit[2]='<a href="http://www.jonescounty.com/visit/directions.html">Directions</a>'

//Contents for menu Contact
var menucontact=new Array()
menucontact[0]='<a href="http://www.jonescounty.com/contact/utility_contacts.html">Utility Contacts</a>'
menucontact[1]='<a href="http://www.jonescounty.com/contact/county_contacts.html">County Contacts</a>'
menucontact[2]='<a href="http://www.jonescounty.com/contact/request_info.html">Request Info</a>'

var menuwidth='165px' //default menu width
var menubgcolor='#ffffff'  //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

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){
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"
}

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
