/*********************************************** - McDevitt Navigation
* 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
***********************************************/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//Contents for menu 1 - Contact Us
var menu1=new Array();
menu1[0]='<a href="http://www.mcdevitttownandcountry.com/contactus.html">Contact Us</a>';
menu1[1]='<a href="http://www.mcdevitttownandcountry.com/dreamhome.html">Describe Your Dream Home</a>';

//Contents for menu 2 - Buyer's Links
var menu2=new Array();
menu2[0]='<a href="http://www.mcdevitttownandcountry.com/mls.html">Property Search</a>';
menu2[1]='<a href="http://www.mcdevitttownandcountry.com/dreamhome.html">Describe Your Dream Home</a>';
menu2[2]='<a href="http://www.mcdevitttownandcountry.com/mortgage.html">Mortgage Resources</a>';
menu2[3]='<a href="http://www.mcdevitttownandcountry.com/buyers.html">Why Buy Through Us?</a>';



//Contents for menu 3 - Seller's Links
var menu3=new Array()
menu3[0]='<a href="http://www.mcdevitttownandcountry.com/whylist.html">Why List with us</a>';
menu3[1]='<a href="http://www.mcdevitttownandcountry.com/cma.html">Your Home Value</a>';
menu3[2]='<a href="http://www.mcdevitttownandcountry.com/marketing-plan.html">McDevitt Marketing Plan</a>';


//Contents for menu 4 - About McDevitt Town and Country
var menu4=new Array()
menu4[0]='<a href="http://www.mcdevitttownandcountry.com/aboutus.html">About Us</a>'
menu4[1]='<a href="http://www.mcdevitttownandcountry.com/agents.html">Our Agents</a>'
menu4[2]='<a href="http://www.mcdevitttownandcountry.com/agents.html#jamie">&nbsp;&nbsp;&nbsp;Jamie McDevitt</a>'
menu4[3]='<a href="http://www.mcdevitttownandcountry.com/agents.html#noel">&nbsp;&nbsp;&nbsp;Noel McDevitt</a>'
menu4[4]='<a href="http://www.mcdevitttownandcountry.com/agents.html#ellen">&nbsp;&nbsp;&nbsp;Ellen Pfann</a>'
menu4[5]='<a href="http://www.mcdevitttownandcountry.com/agents.html#bishop">&nbsp;&nbsp;&nbsp;J. O. Bishop</a>'
menu4[6]='<a href="http://www.mcdevitttownandcountry.com/agents.html#dahl">&nbsp;&nbsp;&nbsp;Inge Dahl</a>'
menu4[12]='<a href="http://www.mcdevitttownandcountry.com/agents.html#support">Support Staff</a>'
menu4[13]='<a href="http://www.mcdevitttownandcountry.com/agents.html#melanie">&nbsp;&nbsp;&nbsp;Melanie Montesanti</a>'
menu4[14]='<a href="http://www.mcdevitttownandcountry.com/testimonials.html">Testimonials</a>'

//Contents for menu 5 - Properties for Sale
var menu5=new Array()
menu5[0]='<a href="http://www.mcdevitttownandcountry.com/mls.html">Featured Properties</a>'
menu5[1]='<a href="http://www.mcdevitttownandcountry.com/community/whiteoak.html">White Oak Farms</a>'

//Contents for menu 6 - Area information
var menu6=new Array()
menu6[0]='<a href="http://www.mcdevitttownandcountry.com/area.html">About the Area</a>';
menu6[1]='<a href="http://www.mcdevitttownandcountry.com/pinehurst-gated.html">Gated & Golf Communities</a>';
menu6[2]='<a href="http://www.mcdevitttownandcountry.com/golfinfo.html">Golf Area Information</a>';
menu6[3]='<a href="http://www.mcdevitttownandcountry.com/info/pinehurst-nc-events.htm">Local Events</a>';
menu6[4]='<a href="http://www.mcdevitttownandcountry.com/info/pinehurst-membership.html">Pinehurst Country Club</a>';
menu6[5]='<a href="http://www.mcdevitttownandcountry.com/equestrian.html">Equestrian Community</a>';
menu6[6]='<a href="http://www.mcdevitttownandcountry.com/info/walthour-moss-foundation.html">Walthour-Moss Foundation</a>';
menu6[7]='<a href="http://www.mcdevitttownandcountry.com/equestriancal.html">Equestrian Calendar</a>';
menu6[8]='<a href="http://www.mcdevitttownandcountry.com/school.html">Our Schools</a>';
menu6[9]='<a href="http://www.mcdevitttownandcountry.com/info/realestate-tax.html">Local Real Estate Taxes</a>';

//Contents for menu 7 - FREE stuff
//var menu7=new Array()
//menu7[0]='<a href="http://www.mcdevitttownandcountry.com/free_dvd.html">FREE DVD of the Area</a>'
//menu7[1]='<a href="http://www.mcdevitttownandcountry.com/free_condo.html">FREE lodging in our area</a>'


//Contents for menu 8 - Premier Properties
//var menu8=new Array()
//menu8[0]='<a href="http://www.mcdevitttownandcountry.com/premprop/main.php">Premier Properties</a>'


//Contents for menu 9 - home page
//var menu9=new Array()
//menu9[0]='<a href="http://www.mcdevitttownandcountry.com">McDevitt Sotheby's International Realty home page</a>'

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

/////No further editing 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=-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")+"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




