fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=10;
_menuOpenDelay=10;
_subOffsetTop=2;
_subOffsetLeft=14;

with(background=new mm_style()){
    bgimage="images/red_spacer.gif";
    fontfamily="Verdana";
    bgcolor="#ffffff";
    fontsize="10";
    fontstyle="normal";
    fontweight="bold";
    image="images/spacer.gif";
    imagepadding=0;
    itemheight=25;
    itemwidth=171;
    offcolor="#ffffff";
    oncolor="#de7811";
    overbgimage="images/red_spacer.gif";
    separatorcolor="transparent";
    separatorsize=0;
    padding=0;
    verticalalign="middle";
    rawcss="text-align:left;vertical-align:middle;margin-top:10px;padding-bottom:2px;height:26px;";
}

if(mainSection == ""){
    nav = ""
} else {    
    nav = mainSection + ".asp";
}    

if(nav == "apartment_listings_details.asp" || nav == "apartment_listings_tenants.asp"){
    nav = "apartment_listings.asp";
}

function overImg(section){
    //alert("over");
    //alert(section);
    //alert(nav);
    //first clear all top button states EXCEPT current section, and current over
    
    if(nav !=""){
        if(nav != "about.asp"){
            document.getElementById('about_top').src = "/images/about_top.gif";
        }
        
        if(nav != "apartment_listings.asp"){
            document.getElementById('apartment_listings_top').src = "/images/apartment_listings_top.gif";
        }
        
        if(nav != "programs.asp"){
            document.getElementById('programs_top').src = "/images/programs_top.gif";
        }
        
        if(nav != "news_and_events.asp"){
            document.getElementById('news_and_events_top').src = "/images/news_and_events_top.gif";
        }
        
        if(nav != "resources.asp"){   
            document.getElementById('resources_top').src = "/images/resources_top.gif";
        }
        
        if(nav != "how_to_help.asp"){    
            document.getElementById('how_to_help_top').src = "/images/how_to_help_top.gif";
        }
       
        
        switch(nav){
            case "programs.asp":
                document.getElementById('apartment_listings_top').src = "/images/programs_left.gif";
                document.getElementById('news_and_events_top').src = "/images/programs_right.gif";
                break;
            case "news_and_events.asp":
                document.getElementById('programs_top').src = "/images/news_events_left.gif";
                document.getElementById('resources_top').src = "/images/news_events_right.gif";
                break;
            case "resources.asp":
                document.getElementById('news_and_events_top').src = "/images/resources_left.gif";
                document.getElementById('how_to_help_top').src = "/images/resources_right.gif";
                document.getElementById('resources_top').src = "/images/resources_top_over.gif";
                break;
            case "how_to_help.asp":
                document.getElementById('resources_top').src = "/images/how_to_help_left.gif";
                break;
        }
    } else {
        document.getElementById('about_top').src = "/images/h_about_top.gif";
        document.getElementById('apartment_listings_top').src = "/images/h_apartment_listings_top.gif";
        document.getElementById('programs_top').src = "/images/h_programs_top.gif";
        document.getElementById('news_and_events_top').src = "/images/news_and_events_top.gif";
        document.getElementById('resources_top').src = "/images/resources_top.gif";
        document.getElementById('how_to_help_top').src = "/images/how_to_help_top.gif"; 
    }
     
    section = section + "_top";
    if (nav == ""){
        //home page
        document.getElementById(section).src='/images/h_' + section + '_over.gif';   
    } else {
        //interior pages
        document.getElementById(section).src='/images/' + section + '_over.gif';
    }
}

function offImg(section){
    //alert("off");
    //alert(nav + "\n" + section + ".asp");
    if(nav != section + ".asp"){
    //alert("1");
        section = section + "_top";
        if (nav == ""){
            //home page
            document.getElementById(section).src='/images/h_' + section + '.gif';
        } else {
            //interior pages
            //alert(document.getElementById(section).src='/images/' + section + '.gif');
           
            document.getElementById(section).src='/images/' + section + '.gif';
        }
    } 
    
    if(nav != ""){
    
        if(nav != "about.asp"){
            document.getElementById('about_top').src = "/images/about_top.gif";
        }
        
        if(nav != "apartment_listings.asp"){
            document.getElementById('apartment_listings_top').src = "/images/apartment_listings_top.gif";
        }
        
        if(nav != "programs.asp"){
            document.getElementById('programs_top').src = "/images/programs_top.gif";
        }
        
        if(nav != "news_and_events.asp"){
            document.getElementById('news_and_events_top').src = "/images/news_and_events_top.gif";
        }
        
        if(nav != "resources.asp"){   
            document.getElementById('resources_top').src = "/images/resources_top.gif";
        }
        
        if(nav != "how_to_help.asp"){    
            document.getElementById('how_to_help_top').src = "/images/how_to_help_top.gif";
        }
    
        switch(nav){
            case "programs.asp":
                document.getElementById('apartment_listings_top').src = "/images/programs_left.gif";
                document.getElementById('news_and_events_top').src = "/images/programs_right.gif";
                break;
            case "news_and_events.asp":
                document.getElementById('programs_top').src = "/images/news_events_left.gif";
                document.getElementById('resources_top').src = "/images/news_events_right.gif";
                break;
            case "resources.asp":
                document.getElementById('news_and_events_top').src = "/images/resources_left.gif";
                document.getElementById('how_to_help_top').src = "/images/resources_right.gif";
                document.getElementById('resources_top').src = "/images/resources_top_over.gif";
                break;
            case "how_to_help.asp":
                document.getElementById('resources_top').src = "/images/how_to_help_left.gif";
                break;
        }
    }
}



with(milonic=new menuname("Main Menu")){
    alwaysvisible=1;
    orientation="horizontal";
    position="relative";
    itemheight=17;
    itemwidth=159;
    style=background;
    top=10;

//////////////////////////////////////////////////////////////////////////////////////
//          top level main nav buttons                                              //
//////////////////////////////////////////////////////////////////////////////////////
    //alert(nav);
    //about
    if(nav == "about.asp"){
        aI("onfunction=overImg('about');borderwidth=0;itemwidth=77;bgimage=images/nav_about.gif;image=images/nav_about_over.gif;overimage=images/nav_about_over.gif;showmenu=mnuabout;text=;url=pages.asp?p=57&c=20");
    } else {
        aI("onfunction=overImg('about');offfunction=offImg('about');borderwidth=0;itemwidth=77;bgimage=images/nav_about_over.gif;image=images/nav_about.gif;overimage=images/nav_about_over.gif;showmenu=mnuabout;text=;url=pages.asp?p=57&c=20");
    }
    //apartment listings
    if(nav == "apartment_listings.asp"){
        aI("onfunction=overImg('apartment_listings');borderwidth=0;itemwidth=139;bgimage=images/nav_apartment_listings.gif;image=images/nav_apartment_listings_over.gif;overimage=images/nav_apartment_listings_over.gif;showmenu=mnuapartment;text=;url=pages.asp?p=58&c=21");
    } else {
        aI("onfunction=overImg('apartment_listings');offfunction=offImg('apartment_listings');borderwidth=0;itemwidth=139;bgimage=images/nav_apartment_listings_over.gif;image=images/nav_apartment_listings.gif;overimage=images/nav_apartment_listings_over.gif;showmenu=mnuapartment;text=;url=pages.asp?p=58&c=21");
    }
    //programs
    if(nav == "programs.asp"){
        aI("onfunction=overImg('programs');borderwidth=0;itemwidth=81;bgimage=images/nav_programs.gif;image=images/nav_programs_over.gif;overimage=images/nav_programs_over.gif;showmenu=mnuprograms;text=;url=pages.asp?p=59&c=22");
    } else {
        aI("onfunction=overImg('programs');offfunction=offImg('programs');borderwidth=0;itemwidth=81;bgimage=images/nav_programs.gif;image=images/nav_programs.gif;overimage=images/nav_programs_over.gif;showmenu=mnuprograms;text=;url=pages.asp?p=59&c=22");
    }
    //news and events
    if(nav == "news_and_events.asp"){
        aI("onfunction=overImg('news_and_events');borderwidth=0;itemwidth=105;bgimage=images/nav_news_events.gif;image=images/nav_news_events_over.gif;overimage=images/nav_news_events_over.gif;showmenu=mnunewsevents;text=;url=pages.asp?p=60&c=23");
    } else {
        aI("onfunction=overImg('news_and_events');offfunction=offImg('news_and_events');borderwidth=0;itemwidth=105;bgimage=images/nav_news_events.gif;image=images/nav_news_events.gif;overimage=images/nav_news_events_over.gif;showmenu=mnunewsevents;text=;url=pages.asp?p=60&c=23");
    }
    //resources
    if(nav == "resources.asp"){
        aI("onfunction=overImg('resources');borderwidth=0;itemwidth=87;bgimage=images/nav_resources.gif;image=images/nav_resources_over.gif;overimage=images/nav_resources_over.gif;showmenu=mnuresources;text=;url=pages.asp?p=61&c=24");
    } else {
        aI("onfunction=overImg('resources');offfunction=offImg('resources');borderwidth=0;itemwidth=87;bgimage=images/nav_resources.gif;image=images/nav_resources.gif;overimage=images/nav_resources_over.gif;showmenu=mnuresources;text=;url=pages.asp?p=61&c=24");
    }
    //how to help
    if(nav == "how_to_help.asp"){
        aI("onfunction=overImg('how_to_help');borderwidth=0;itemwidth=111;bgimage=images/nav_how_to_help.gif;image=images/nav_how_to_help_over.gif;overimage=images/nav_how_to_help_over.gif;showmenu=mnuhowtohelp;text=;url=pages.asp?p=62&c=25");
    } else {
        aI("onfunction=overImg('how_to_help');offfunction=offImg('how_to_help');borderwidth=0;itemwidth=111;bgimage=images/nav_how_to_help.gif;image=images/nav_how_to_help.gif;overimage=images/nav_how_to_help_over.gif;showmenu=mnuhowtohelp;text=;url=pages.asp?p=62&c=25");
    }   
}

//////////////////////////////////////////////////////////////////////////////////////
//          about drop down                                                         //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnuabout")){
    
    
    style=background;
    left="offset=11";
    //top line
    aI("onfunction=overImg('about');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;
    //alert("hi");
    
    //alert(subNavPrimaryNav[1][j]);
    
    for(j=0;j<subNavFileName[1].length;j++){
    
	    if(subNavInNav[1][j] == "1" && (subNavPrimaryNav[1][j]) == 20){
            
            if(subNavParent[1][j] == ""){
             max += 1
            }
        } 
    }   
                 
    var x = 0       
    
    for(j=0;j<subNavFileName[1].length;j++){
	    if(subNavInNav[1][j] == "1" && (subNavPrimaryNav[1][j]) == 20){
            if(subNavParent[1][j] == ""){
			    //alert("hi");
			    x  += 1
			    //link text                                                                                                      
                aI("onfunction=overImg('about');offfunction=offImg('about');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[1][j] + ";url=/pages.asp?p=" + subNavId[1][j] + "&c=" + subNavPrimaryNav[1][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('about');offfunction=offImg('about');itemheight=1;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_div.gif;overbgimage=images/dd_div.gif;");
                } 
            }
        }
    }
    //bottom spacer
    aI("onfunction=overImg('about');offfunction=offImg('about');itemheight=13;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_bottom.gif;overbgimage=images/dd_bottom.gif;");
}

//////////////////////////////////////////////////////////////////////////////////////
//          apartment listings  drop down                                           //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnuapartment")){
    style=background;
    //top line
    aI("onfunction=overImg('apartment_listings');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;

    for(j=0;j<subNavFileName[2].length;j++){
	    if(subNavInNav[2][j] == "1" && (subNavPrimaryNav[2][j]) == 21){
            if(subNavParent[2][j] == ""){
             max += 1
            }
        } 
    }   

    var x=0;

    for(j=0;j<subNavFileName[2].length;j++){
	    if(subNavInNav[2][j] == "1" && (subNavPrimaryNav[2][j]) == 21){
            if(subNavParent[2][j] == ""){
			    x  += 1
			    //link text
                aI("onfunction=overImg('apartment_listings');offfunction=offImg('apartment_listings');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[2][j] + ";url=/pages.asp?p=" + subNavId[2][j] + "&c=" + subNavPrimaryNav[2][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('apartment_listings');offfunction=offImg('apartment_listings');itemheight=1;oncolor=#333333;offcolor=#333333;text=;image=images/dd_div.gif;");
                } 
            }
            
        }
    }
    //bottom spacer
    aI("onfunction=overImg('apartment_listings');offfunction=offImg('apartment_listings');itemheight=13;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_bottom.gif;overbgimage=images/dd_bottom.gif");
}


//////////////////////////////////////////////////////////////////////////////////////
//          programs  drop down                                                     //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnuprograms")){
    style=background;
    //top line
    aI("onfunction=overImg('programs');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;
    for(j=0;j<subNavFileName[3].length;j++){
	    if(subNavInNav[3][j] == "1" && (subNavPrimaryNav[3][j]) == 22){
            if(subNavParent[3][j] == ""){
             max += 1
            }
        } 
    }   
    
    x=0;
    
    for(j=0;j<subNavFileName[3].length;j++){
	    if(subNavInNav[3][j] == "1" && (subNavPrimaryNav[3][j]) == 22){
            if(subNavParent[3][j] == ""){
			    x  += 1
			    //link text
                aI("onfunction=overImg('programs');offfunction=offImg('programs');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[3][j] + ";url=/pages.asp?p=" + subNavId[3][j] + "&c=" + subNavPrimaryNav[3][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('programs');offfunction=offImg('programs');itemheight=1;oncolor=#333333;offcolor=#333333;text=;image=images/dd_div.gif;");
                } 
            }
        }
    }
    //bottom line
    aI("onfunction=overImg('programs');offfunction=offImg('programs');itemheight=13;oncolor=#333333;offcolor=#333333;text=;image=images/dd_bottom.gif;bgimage=images/spacer.gif;overbgimage=images/spacer.gif;");
}


//////////////////////////////////////////////////////////////////////////////////////
//          news/events drop down                                                   //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnunewsevents")){
    style=background;
    //top line
    aI("onfunction=overImg('news_and_events');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;
    for(j=0;j<subNavFileName[4].length;j++){
	    if(subNavInNav[4][j] == "1" && (subNavPrimaryNav[4][j]) == 23){
            if(subNavParent[4][j] == ""){
             max += 1
            }
        } 
    }   
    
    x=0;
    
    for(j=0;j<subNavFileName[4].length;j++){
	    if(subNavInNav[4][j] == "1" && (subNavPrimaryNav[4][j]) == 23){
            if(subNavParent[4][j] == ""){
			    x  += 1
			    //link text
                aI("onfunction=overImg('news_and_events');offfunction=offImg('news_and_events');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[4][j] + ";url=/pages.asp?p=" + subNavId[4][j] + "&c=" + subNavPrimaryNav[4][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('news_and_events');offfunction=offImg('news_and_events');itemheight=1;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_div.gif;overbgimage=images/dd_div.gif;");
                } 
            }
        }
    }
    //bottom line
    aI("onfunction=overImg('news_and_events');offfunction=offImg('news_and_events');itemheight=13;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_bottom.gif;overbgimage=images/dd_bottom.gif;");
}


//////////////////////////////////////////////////////////////////////////////////////
//          resources drop down                                                     //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnuresources")){
    style=background;
    //top line
    aI("onfunction=overImg('resources');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;
    for(j=0;j<subNavFileName[5].length;j++){
	    if(subNavInNav[5][j] == "1" && (subNavPrimaryNav[5][j]) == 24){
            if(subNavParent[5][j] == ""){
             max += 1
            }
        } 
    }   
    
    x=0;
    
    for(j=0;j<subNavFileName[5].length;j++){
	    if(subNavInNav[5][j] == "1" && (subNavPrimaryNav[5][j]) == 24){
            if(subNavParent[5][j] == ""){
			    x  += 1
			    //link text
                aI("onfunction=overImg('resources');offfunction=offImg('resources');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[5][j] + ";url=/pages.asp?p=" + subNavId[5][j] + "&c=" + subNavPrimaryNav[5][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('resources');offfunction=offImg('resources');itemheight=1;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_div.gif;overbgimage=images/dd_div.gif;");
                } 
            }
        }
    }
    //bottom line
    aI("onfunction=overImg('resources');offfunction=offImg('resources');itemheight=13;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_bottom.gif;overbgimage=images/dd_bottom.gif;");
}


//////////////////////////////////////////////////////////////////////////////////////
//          how to help drop down                                                   //
//////////////////////////////////////////////////////////////////////////////////////

with(milonic=new menuname("mnuhowtohelp")){
    style=background;
    //top line
    aI("onfunction=overImg('how_to_help');itemheight=11;oncolor=#ffffff;bgimage=images/dd_top.gif;overbgimage=images/dd_top.gif;");
    var max=0;
    for(j=0;j<subNavFileName[6].length;j++){
	    if(subNavInNav[6][j] == "1" && (subNavPrimaryNav[6][j]) == 25){
            if(subNavParent[6][j] == ""){
                max += 1
            }
        } 
    }   
    
    var x = 0;
    
    for(j=0;j<subNavFileName[6].length;j++){
	    if(subNavInNav[6][j] == "1" && (subNavPrimaryNav[6][j]) == 25){
            if(subNavParent[6][j] == ""){
			    x  += 1
			    //link text
                aI("onfunction=overImg('how_to_help');offfunction=offImg('how_to_help');itemheight=26;oncolor=#efeeca;offcolor=#efeeca;image=/images/mnu_spacer.gif;text=" + subNavTitle[6][j] + ";url=/pages.asp?p=" + subNavId[6][j] + "&c=" + subNavPrimaryNav[6][j] + ";");			
                if(x<max){
                //divider line
                    aI("onfunction=overImg('how_to_help');offfunction=offImg('how_to_help');itemheight=1;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_div.gif;overbgimage=images/dd_div.gif;");
                } 
            }
        }
    }
    //bottom line
    aI("onfunction=overImg('how_to_help');offfunction=offImg('how_to_help');itemheight=13;oncolor=#333333;offcolor=#333333;text=;bgimage=images/dd_bottom.gif;overbgimage=images/dd_bottom.gif;");
}

drawMenus();


