function mm_getChildItems(menuname) {
	var m = getMenuByName(menuname);	
	var items = new Array();
	if (_m[m]) {
		items = _m[m][0];
		for(var x in items) {
			var i = items[x];
			if (typeof _mi[i][3] != 'undefined') {
				items = items.concat(mm_getChildItems(_mi[i][3]));
			}
		}
	}
	return items;
}

function mm_getChildMenus(menuname) {
	var m = getMenuByName(menuname);	
	var menus = new Array();
	menus[0] = m;
	var items = new Array();
	if (_m[m]) {
		items = _m[m][0];
		for(var x in items) {
			var i = items[x];
			if (typeof _mi[i][3] != 'undefined') {
				//menus.push(getMenuByName(_mi[i][3]));
				menus = menus.concat(mm_getChildMenus(_mi[i][3]));
				//items = items.concat(mm_getChildItems(_mi[i][3]));
			}
		}
	}
	return menus;
}

function mm_showMenu(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
	var menuNum = getMenuByName(menuName);
	if (arguments.length > 1)_m[menuNum][7] = arguments[1];
	menuDisplay(menuNum, 1);
}

function mm_hideMenu(menuName) // , alwaysVisState = optional. 1=on, 0=off
{
	var menuNum = getMenuByName(menuName);
	if (arguments.length > 1)_m[menuNum][7] = arguments[1];
	menuDisplay(menuNum, 0);
}

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=800;
_menuOpenDelay=150;
_subOffsetTop=0;
_subOffsetLeft=0;
closeAllOnClick = true;
buildAllMenus = true;
//buildAfterLoad = true;

with(topMenu=new mm_style()){
rawcss="font-size: 1em; font-weight: bold; padding: 4px;cursor:pointer;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow-down.gif";
onsubimage="images/over_arrow-down.gif"
subimageposition='left';
subimagepadding=1;
align="center";
offfunction="resetDescription('units')";
margin="0";
//tipfollow=1;
}

with(menuStyle=new mm_style()){
rawcss="font-size: .8em; padding: 3px; padding-right: 12px;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow.gif";
onsubimage="images/over_arrow.gif"
subimagepadding=1;
align="right";
margin="0";
offfunction='resetDescription()';
//tipfollow=1;
}

with(listingsTopMenu=new mm_style()){
rawcss="font-size: 1em; font-weight: bold; padding: 4px;cursor:pointer;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/listings_menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow-down.gif";
onsubimage="images/over_arrow-down.gif"
subimageposition='left';
subimagepadding=1;
align="center";
offfunction="resetDescription('units')";
margin="0";
//tipfollow=1;
}
with(listingsStyle=new mm_style()){
rawcss="font-size: .8em; padding: 3px; padding-right: 12px;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/listings_menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow.gif";
onsubimage="images/over_arrow.gif"
subimagepadding=1;
align="right";
margin="0";
offfunction='resetDescription()';
//tipfollow=1;
}

with(shadedtopMenu=new mm_style()){
rawcss="font-size: 1em; font-weight: bold; padding: 4px;cursor:pointer;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/area_menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow-down.gif";
onsubimage="images/over_arrow-down.gif"
subimageposition='left';
subimagepadding=1;
align="center";
offfunction="resetDescription('units')";
margin="0";
//tipfollow=1;
}
with(shadedmenuStyle=new mm_style()){
rawcss="font-size: .8em; padding: 3px; padding-right: 12px;";
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
bgimage='images/area_menu_bg.gif';
offcolor="#525d6c";
oncolor="#ffffff";
onbgcolor="#ffa722";
separatorcolor="#999999";
separatorsize=1;
subimage="images/arrow.gif";
onsubimage="images/over_arrow.gif"
subimagepadding=1;
align="right";
margin="0";
offfunction='resetDescription()';
//tipfollow=1;
}


with(milonic=new menuname("apa")){
style=listingsStyle;
openstyle="rtl";
aI("text=All;pointer=default;showmenu=apa_by_room_all;id=apa_by_room_all;onfunction=updateDescription();")
aI("text=1 Bedroom;pointer=default;showmenu=apa_by_room_1;id=apa_by_room_1;onfunction=updateDescription();")
aI("text=2 Bedroom;pointer=default;showmenu=apa_by_room_2;id=apa_by_room_2;onfunction=updateDescription();")
aI("text=3 Bedroom;pointer=default;showmenu=apa_by_room_3;id=apa_by_room_3;onfunction=updateDescription();")
aI("text=4+ Bedroom;pointer=default;showmenu=apa_by_room_4;id=apa_by_room_4;onfunction=updateDescription();")
}

with(milonic=new menuname("apa_by_room_all")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('apa_by_room_short_all');clickfunction=changeUnitReport('apa_by_room_short_all');id=apa_by_room_short_all;")
aI("text=All Listings;onfunction=updateDescription('apa_by_room_long_all');clickfunction=changeUnitReport('apa_by_room_long_all');id=apa_by_room_long_all;")
aI("text=Best Values;onfunction=updateDescription('best_apa_by_room_all');offbgcolor=#ffffdd;clickfunction=changeUnitReport('best_apa_by_room_all');id=best_apa_by_room_all;")
}

with(milonic=new menuname("apa_by_room_1")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('apa_by_room_short_1');clickfunction=changeUnitReport('apa_by_room_short_1');id=apa_by_room_short_1;")
aI("text=All Listings;onfunction=updateDescription('apa_by_room_long_1');clickfunction=changeUnitReport('apa_by_room_long_1');id=apa_by_room_long_1;")
aI("text=Best Values;onfunction=updateDescription('best_apa_by_room_1');offbgcolor=#ffffdd;clickfunction=changeUnitReport('best_apa_by_room_1');id=best_apa_by_room_1;")
}

with(milonic=new menuname("apa_by_room_2")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('apa_by_room_short_2');clickfunction=changeUnitReport('apa_by_room_short_2');id=apa_by_room_short_2;")
aI("text=All Listings;onfunction=updateDescription('apa_by_room_long_2');clickfunction=changeUnitReport('apa_by_room_long_2');id=apa_by_room_long_2;")
aI("text=Best Values;onfunction=updateDescription('best_apa_by_room_2');offbgcolor=#ffffdd;clickfunction=changeUnitReport('best_apa_by_room_2');id=best_apa_by_room_2;")
}

with(milonic=new menuname("apa_by_room_3")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('apa_by_room_short_3');clickfunction=changeUnitReport('apa_by_room_short_3');id=apa_by_room_short_3;")
aI("text=All Listings;onfunction=updateDescription('apa_by_room_long_3');clickfunction=changeUnitReport('apa_by_room_long_3');id=apa_by_room_long_3;")
aI("text=Best Values;onfunction=updateDescription('best_apa_by_room_3');offbgcolor=#ffffdd;clickfunction=changeUnitReport('best_apa_by_room_3');id=best_apa_by_room_3;")
}


with(milonic=new menuname("apa_by_room_4")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('apa_by_room_short_4');clickfunction=changeUnitReport('apa_by_room_short_4');id=apa_by_room_short_4;")
aI("text=All Listings;onfunction=updateDescription('apa_by_room_long_4');clickfunction=changeUnitReport('apa_by_room_long_4');id=apa_by_room_long_4;")
aI("text=Best Values;onfunction=updateDescription('best_apa_by_room_4');offbgcolor=#ffffdd;clickfunction=changeUnitReport('best_apa_by_room_4');id=best_apa_by_room_4;")
}

with(milonic=new menuname("roo")){
style=listingsStyle;
openstyle="rtl";
aI("text=Recent Listings;onfunction=updateDescription('roo_short');clickfunction=changeUnitReport('roo_short');id=roo_short;")
aI("text=All Listings;onfunction=updateDescription('roo_all');clickfunction=changeUnitReport('roo_all');id=roo_all;")
aI("text=Best Values;onfunction=updateDescription('best_roo');clickfunction=changeUnitReport('best_roo');id=best_roo;offbgcolor=#ffffdd;")
}

with(milonic=new menuname("rfs")){
style=listingsStyle;
screenposition='right';
openstyle="rtl";
left='offset=-5';
aI("text=Houses For Sale;onfunction=updateDescription('rfs_all');clickfunction=changeUnitReport('rfs_all');id=rfs_all;")
aI("text=Prices Per Square Foot;onfunction=updateDescription('rfs_price_per_foot');clickfunction=changeUnitReport('rfs_price_per_foot');id=rfs_price_per_foot;")
aI("text=Gross Rent Multiplier;onfunction=updateDescription('gross_rent_multiplier');clickfunction=changeUnitReport('gross_rent_multiplier');id=gross_rent_multiplier;")
aI("text=Best Value;onfunction=updateDescription('best_rfs');clickfunction=changeUnitReport('best_rfs');id=best_rfs;offbgcolor=#ffffdd;")
}

with(milonic=new menuname("areabasic")){
overflow="scroll";
style=shadedmenuStyle;
openstyle="rtl";
aI("onfunction=updateDescription('population_by_zip');clickfunction=changeAreaReport('population_by_zip');id=population_by_zip;text=Population;")
aI("onfunction=updateDescription('income_by_zip');clickfunction=changeAreaReport('income_by_zip');id=income_by_zip;text=Avg Household Income;")
aI("onfunction=updateDescription('crime_by_zip');clickfunction=changeAreaReport('crime_by_zip');id=crime_by_zip;text=Crime Rate per Capita;")
}

with(milonic=new menuname("apa_average_price")){
overflow="scroll";
style=shadedmenuStyle;
openstyle="rtl";
aI("onfunction=updateDescription('apa_average_price_1');clickfunction=changeAreaReport('apa_average_price_1');id=apa_average_price_1;text=1 Bedroom;")
aI("onfunction=updateDescription('apa_average_price_2');clickfunction=changeAreaReport('apa_average_price_2');id=apa_average_price_2;text=2 Bedroom;")
aI("onfunction=updateDescription('apa_average_price_3');clickfunction=changeAreaReport('apa_average_price_3');id=apa_average_price_3;text=3 Bedroom;")
aI("onfunction=updateDescription('apa_average_price_4');clickfunction=changeAreaReport('apa_average_price_4');id=apa_average_price_4;text=4+ Bedroom;")
aI("onfunction=updateDescription('apa_average_price_all');clickfunction=changeAreaReport('apa_average_price_all');id=apa_average_price_all;text=All Bedrooms;")
}

with(milonic=new menuname("areapremium")){
//overflow="scroll";
style=shadedmenuStyle;
screenposition='right';
openstyle="rtl";
left="offset=-5";
aI("text=Average Rents;pointer=default;showmenu=apa_average_price;id=apa_average_price;onfunction=updateDescription();")
aI("onfunction=updateDescription('rfs_average_price');clickfunction=changeAreaReport('rfs_average_price');id=rfs_average_price;text=Average Home Prices;")
aI("onfunction=updateDescription('apa_units_per_zip');clickfunction=changeAreaReport('apa_units_per_zip');id=apa_units_per_zip;text=Total Rental Units on Market;")
aI("text=Rent to Housing Price Index;pointer=default;showmenu=apa_vs_rfs;id=apa_vs_rfs;onfunction=updateDescription();")
aI("onfunction=updateDescription('apa_vs_roo');clickfunction=changeAreaReport('apa_vs_roo');id=apa_vs_roo;text=Apartment Rent to Room Rent Index;")
aI("text=Average Real Estate Appreciation;pointer=default;showmenu=appreciation;id=appreciation;onfunction=updateDescription();")
aI("onfunction=updateDescription('apa_growth');clickfunction=changeAreaReport('apa_growth');id=apa_growth;text=Growth in Rents 2005-2006;")
aI("onfunction=updateDescription('vacancy_by_zip');clickfunction=changeAreaReport('vacancy_by_zip');id=vacancy_by_zip;text=Apartment Listing Density;")
aI("onfunction=updateDescription('vacancy_growth');clickfunction=changeAreaReport('vacancy_growth');id=vacancy_growth;text=Apartment Listing Density Change over Time;")
aI("onfunction=updateDescription('default_risk');clickfunction=changeAreaReport('default_risk');id=default_risk;text=Area Default Risk Index;")
}

with(milonic=new menuname("apa_vs_rfs")){
overflow="scroll";
style=shadedmenuStyle;
openstyle="rtl";
aI("onfunction=updateDescription('apa_vs_rfs_by_room_1');clickfunction=changeAreaReport('apa_vs_rfs_by_room_1');id=apa_vs_rfs_by_room_1;text=1 Bedroom;")
aI("onfunction=updateDescription('apa_vs_rfs_by_room_2');clickfunction=changeAreaReport('apa_vs_rfs_by_room_2');id=apa_vs_rfs_by_room_2;text=2 Bedroom;")
aI("onfunction=updateDescription('apa_vs_rfs_by_room_3');clickfunction=changeAreaReport('apa_vs_rfs_by_room_3');id=apa_vs_rfs_by_room_3;text=3 Bedroom;")
aI("onfunction=updateDescription('apa_vs_rfs_by_room_4');clickfunction=changeAreaReport('apa_vs_rfs_by_room_4');id=apa_vs_rfs_by_room_4;text=4+ Bedroom;")
aI("onfunction=updateDescription('apa_vs_rfs_by_room_all');clickfunction=changeAreaReport('apa_vs_rfs_by_room_all');id=apa_vs_rfs_by_room_all;text=All weighted average;")
}

with(milonic=new menuname("appreciation")){
overflow="scroll";
openstyle="rtl";
style=shadedmenuStyle;
aI("onfunction=updateDescription('rfs_growth_old');clickfunction=changeAreaReport('rfs_growth_old');id=rfs_growth_old;text=1996-2006;")
aI("onfunction=updateDescription('rfs_growth');clickfunction=changeAreaReport('rfs_growth');id=rfs_growth;text=2005-2006 (Recent);")
}

with(milonic=new menuname("roles")){
overflow="scroll";
align='left';
style=menuStyle;
aI("text=Renter;clickfunction=changeRole('renter');")
aI("text=Home Owner or Shopper;clickfunction=changeRole('owner');")
aI("text=Landlord;clickfunction=changeRole('landlord');")
aI("text=Investor/Researcher;clickfunction=changeRole('investor');")
aI("text=None;clickfunction=changeRole('none');")
}


