// *******************************************************************
// 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
// *******************************************************************
// Partial customizations by TechnikOne
// -- maintain mouseover image state when main nav image is hovered
// -- over by website visitor via the ResetMenuOptions() function
// *******************************************************************

//Contents for About Us Menu
var AboutUs = new Array()
AboutUs[0]='<a href="' + tld + 'ceo.asp">&#155;&nbsp;Chief Executive Officer</a>'
AboutUs[1]='<a href="' + tld + 'history.asp">&#155;&nbsp;History</a>'
AboutUs[2]='<a href="' + tld + 'mission.asp">&#155;&nbsp;Mission</a>'
AboutUs[3]='<a href="' + tld + 'senior-staff.asp">&#155;&nbsp;Senior Staff Members</a>'
AboutUs[4]='<a href="' + tld + 'board.asp">&#155;&nbsp;Board of Commissioners</a>'
AboutUs[5]='<a href="' + tld + 'meeting-schedule.asp">&#155;&nbsp;Meeting Schedule</a>'
AboutUs[6]='<a href="' + tld + 'directory.asp">&#155;&nbsp;Staff Directory</a>'
AboutUs[7]='<a href="' + tld + 'contact-us.asp">&#155;&nbsp;Contact Us</a>'

//Contents for Programs Menu
var Programs = new Array()
Programs[0]='<a href="' + tld + 'public-housing.asp">&#155;&nbsp;Public Housing</a>'
Programs[1]='<a href="' + tld + 'section8.asp">&#155;&nbsp;Housing Choice Vouchers (Section 8)</a>'
Programs[2]='<a href="' + tld + 'landlords.asp">&#155;&nbsp;Information For Landlords</a>'
Programs[3]='<a href="' + tld + 'resident-services.asp">&#155;&nbsp;Resident Services</a>'
Programs[4]='<a href="' + tld + 'fss.asp">&#155;&nbsp;Family Self-Sufficiency</a>'
Programs[5]='<a href="' + tld + 'homeownership.asp">&#155;&nbsp;Homeownership</a>'
Programs[6]='<a href="' + tld + 'education.asp">&#155;&nbsp;Education</a>'
Programs[7]='<a href="' + tld + 'youth.asp">&#155;&nbsp;For Youth</a>'


//Contents for Contracts & RFPs Menu
var Contracts = new Array()
Contracts[0]='<a href="' + tld + 'vendor-reg.asp">&#155;&nbsp;Vendor Registration</a>'
Contracts[1]='<a href="' + tld + 'rfps.asp">&#155;&nbsp;Open Contracts & RFPs</a>'
Contracts[2]='<a href="' + tld + 'rfps-closed.asp">&#155;&nbsp;Contract & RFP Archive</a>'
Contracts[3]='<a href="' + tld + 'vendor-home.asp">&#155;&nbsp;Vendor Login</a>'

//Contents for Careers Menu
var Careers = new Array()
Careers[0]='<a href="' + tld + 'how-to-apply.asp">&#155;&nbsp;How To Apply</a>'
Careers[1]='<a href="' + tld + 'open-positions.asp">&#155;&nbsp;Open Positions</a>'

//Contents for Careers Menu
var Communities = new Array()
		
var menuwidth='180px' //default menu width
var menubgcolor='#F0F4F7'  //menu bgcolor
var disappeardelay=100  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed - (uh... yeah, we needed to make some additional edits - mjm)

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"


// TechnikOne customization
switch (menucontents){
case 'AboutUs':
ResetMenuOptions();
document.images.n1.src = tld + 'imgs/nav1-0.jpg';
break;
case 'Programs':
ResetMenuOptions();
document.images.n2.src = tld + 'imgs/nav2-0.jpg';
break;
case 'GrowWithJHA':
ResetMenuOptions();
document.images.n3.src = tld + 'imgs/nav3-0.jpg';
break;
case 'LiveWithJHA':
ResetMenuOptions();
document.images.n4.src = tld + 'imgs/nav4-0.jpg';
break;
case 'DoBusinessWithJHA':
ResetMenuOptions();
document.images.n5.src = tld + 'imgs/nav5-0.jpg';
break;
case 'WorkForJHA':
ResetMenuOptions();
document.images.n6.src = tld + 'imgs/nav6-0.jpg';
break;
}




}

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"
ResetMenuOptions();
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

// TechnikOne customization
function ResetMenuOptions(){
document.images.n1.src = tld + 'imgs/nav1-0.jpg';
document.images.n2.src = tld + 'imgs/nav2-0.jpg';
// Nav item not in play >> document.images.n3.src = tld + 'imgs/nav3-0.jpg';
document.images.n4.src = tld + 'imgs/nav4-0.jpg';
document.images.n5.src = tld + 'imgs/nav5-0.jpg';
// Nav item not in play >> document.images.n6.src = tld + 'imgs/nav6-0.jpg';
}

function zorderHide(){
	if (document.getElementById("newsyr")){
		document.getElementById("newsyr").style.visibility = "hidden";
	}
}

function zorderShow(){
	if (document.getElementById("newsyr")){
		document.getElementById("newsyr").style.visibility = "visible";
	}
}



