/***********************************************
* 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 COME TO ASHEVILLE
var menu1=new Array()
//menu1[0]='<a href="/come-to-asheville-blog.php?cat=3" title="about asheville nc" >about asheville</a>'
//menu1[1]='<a href="/come-to-asheville-events.html" title="asheville nc events">events calender</a>'
//menu1[2]='<a href="/come-to-asheville-map.html" title="asheville nc map">map</a>'
//menu1[3]='<a href="/asheville-realty-team-contact.asp" title="asheville nc contact">RESERVATIONS & CONTACT</a>'

//Contents for menu 2 LUXURY HOMES 
var menu2=new Array()
//menu2[0]='<a href="/luxury-homes.php?cat=6" title="about asheville nc luxury homes">featured articles</a>'
//menu2[1]='<a href="/luxury-homes-listings.html" title="asheville nc luxury homes featured listings">featured listings</a>'
//menu2[2]='<a href="/luxury-homes-community.html" title="asheville nc luxury homes communities">find a community</a>'
//menu2[3]='<a href="/luxury-homes-mls.html" title="asheville nc luxury homes mls">mls search</a>'
//menu2[4]='<a href="/luxury-homes-agents.html" title="asheville nc luxury homes contact">meet our agents</a>'

//Contents for menu 3 RESIDENTIAL HOMES
var menu3=new Array()
//menu3[0]='<a href="/residential-homes.php?cat=7">featured articles</a>'
//menu3[1]='<a href="/residential-homes-listings.html">featured listings</a>'
//menu3[2]='<a href="/residential-homes-community.html">find a community</a>'
//menu3[3]='<a href="/residential-homes-mls.html">mls search</a>'
//menu3[4]='<a href="/residential-homes-agents.html">meet our agents</a>'
		
//Contents for menu 4 LAND AND HOMESITES
var menu4=new Array()
//menu4[0]='<a href="/land-homesites.php?cat=5">featured articles</a>'
//menu4[1]='<a href="/land-homesites-listings.html">featured listings</a>'
//menu4[2]='<a href="/land-homesites-community.html">find a community</a>'
//menu4[3]='<a href="/land-homesites-mls.html">mls search</a>'
//menu4[4]='<a href="/land-homesites-agents.html">meet our agents</a>'

//Contents for menu 5 CONDO TEAM
var menu5=new Array()
menu5[0]='<a href="/condo-team.php?cat=4" title="about asheville nc condo team">featured articles</a>'
menu5[1]='<a href="/condo-team-listings.html">featured listings</a>'
menu5[2]='<a href="/condo-team-community.html">find a community</a>'
menu5[3]='<a href="/condo-team-mls.html">mls search</a>'
menu5[4]='<a href="/condo-team-agents.html">meet our agents</a>'

//Contents for menu 6 VACATION RENTALS
var menu6=new Array()
menu6[0]='<a href="/vacation-rentals.php?cat=8">featured articles</a>'
menu6[1]='<a href="/vacation-rentals-community.html">find a community</a>'
/*menu6[2]='<a href="/vacation-rentals-listings.html">featured listings</a>'
menu6[3]='<a href="/vacation-rentals-agents.html">meet our agents</a>'*/

//Contents for menu 7 WILLOW POND
var menu7=new Array()
menu7[0]='<a href="/cabins/willowPond/events.html">event calander</a>'
menu7[1]='<a href="/cabins/willowPond/entertainment.html">entertainment</a>'
menu7[2]='<a href="/cabins/willowPond/restaurants.html">restaurants</a>'
menu7[3]='<a href="/cabins/willowPond/artGalleries.html">art galleries</a>'
menu7[4]='<a href="/cabins/willowPond/history.html">history</a>'
menu7[5]='<a href="/cabins/willowPond/landmarks.html">landmarks</a>'
menu7[6]='<a href="/cabins/willowPond/golfCourses.html">golf courses</a>'
menu7[7]='<a href="/cabins/willowPond/outdoors.html">outdoor activities</a>'
menu7[8]='<a href="/cabins/willowPond/shopping.html">shopping</a>'

//Contents for menu 8 TRANQUILITY KNOLL
var menu8=new Array()
menu8[0]='<a href="../../cabins/tranquilityKnoll/events.html">event calander</a>'
menu8[1]='<a href="../../cabins/tranquilityKnoll/entertainment.html">entertainment</a>'
menu8[2]='<a href="../../cabins/tranquilityKnoll/restaurants.html">restaurants</a>'
menu8[3]='<a href="../../cabins/tranquilityKnoll/artGalleries.html">art galleries</a>'
menu8[4]='<a href="../../cabins/tranquilityKnoll/history.html">history</a>'
menu8[5]='<a href="../../cabins/tranquilityKnoll/landmarks.html">landmarks</a>'
menu8[6]='<a href="../../cabins/tranquilityKnoll/golfCourses.html">golf courses</a>'
menu8[7]='<a href="../../cabins/tranquilityKnoll/outdoors.html">outdoor activities</a>'
menu8[8]='<a href="../../cabins/tranquilityKnoll/shopping.html">shopping</a>'

//Contents for menu 9 COUNTRY HAVEN
var menu9=new Array()
menu9[0]='<a href="../../cabins/countryHaven/events.html">event calander</a>'
menu9[1]='<a href="../../cabins/countryHaven/entertainment.html">entertainment</a>'
menu9[2]='<a href="../../cabins/countryHaven/restaurants.html">restaurants</a>'
menu9[3]='<a href="../../cabins/countryHaven/artGalleries.html">art galleries</a>'
menu9[4]='<a href="../../cabins/countryHaven/history.html">history</a>'
menu9[5]='<a href="../../cabins/countryHaven/landmarks.html">landmarks</a>'
menu9[6]='<a href="../../cabins/countryHaven/golfCourses.html">golf courses</a>'
menu9[7]='<a href="../../cabins/countryHaven/outdoors.html">outdoor activities</a>'
menu9[8]='<a href="../../cabins/countryHaven/shopping.html">shopping</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

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
