/* Horizontal Menu            */
/* Written by Robert LaMunyon */
/* robert.lamunyon@gm.com     */
/* April 24, 2006             */

document.close()
document.open("text/plain")

var menuFont="Arial";
var menuFontSize=13;
var menuOffBgColor="#1131A2"; // dark blue
var menuOffFontColor="white";
var menuOnBgColor="#ADC1E2"; // light blue
var menuOnFontColor="black";
var menuHeight="auto"; // use numbers if you want a fixed height

var subFont="Tahoma";
var subFontSize= 11;
var subOffBgColor="#7d7d7d"; // dark gray
var subOffFontColor="white";
var subOnBgColor="ADC1E2"; // light blue
var subOnFontColor="black";
var borderColor="#999 #333 #333 #999";
var subMenuWidth=160;
var textIndent=6;

var newLineChar = String.fromCharCode(10);
var dblQuote = String.fromCharCode(34);
var zIndex = 1000;
var leftPos=0;
var leftIndent=20;

htmlStr = newLineChar;
htmlStr += "<SPAN ID='HOR_MENU' STYLE='top:0px; left:0px; position:relative'>";
htmlStr += newLineChar + newLineChar;
htmlStr += "<DIV ID='SPACER1' ";
htmlStr += "STYLE='z-index:" + zIndex + "; background-color:" + menuOffBgColor + "; position:absolute; left:" + leftPos + "px; top:0px; width:" + leftIndent + "px; cursor:auto; height:" + menuHeight + "px; font-family:" + menuFont + "; font-size:" + menuFontSize + "; color:" + menuOffBgColor + "; padding:2px 0px 3px 0px'>M";
htmlStr += newLineChar + "</DIV>";
htmlStr += newLineChar;
leftPos=leftPos+leftIndent;
zIndex--;

MenuBar("home", "Home", "Home Page", "index.html", 56);
 SubMenu("omo", "On My Own of Michigan", "Home page", "index.html",true);
MenuBar("org", "Organization", "Organization", "bot.html", 96);
 SubMenu("mission", "Mission/Vision", "mission", "mission.html",false);
 SubMenu("bot", "Board of Trustees", "Board of Trustees", "bot.html",false);
 SubMenu("news", "Newsletters", "Newsletters", "newsletters.html",true);
MenuBar("progs", "Programs", "Social Programs", "social.html", 78);
 SubMenu("social", "Social Programs", "Social Programs", "social.html",false);
 SubMenu("apl", "Apartment Living Program", "Apartment Living", "apartment_living.html",false);
 SubMenu("act", "Social Activities", "Social Activities", "activities.html",true);
MenuBar("classes", "Classes", "Program Curriculum", "classes.html", 68);
 SubMenu("winter12", "Winter 2012 Schedule", "Winter 2012", "docs/Winter12-Schedule.pdf",false);
 SubMenu("Fall11", "Fall 2011 Schedule", "Fall 2011", "docs/Fall11-Schedule.pdf",false);
 SubMenu("summer11", "Summer 2011 Schedule", "Summer 2011", "docs/Summer11-Schedule.pdf",false);
 SubMenu("spring11", "Spring 2011 Schedule", "Spring 2011", "docs/Spring11-Schedule.pdf",true);
MenuBar("calndr", "Calendar", "Calendar", "2011_12.html", 74);
 SubMenu("nov11", "Nov 2011 Calendar", "November 2011", "2011_11.html",false);
 SubMenu("dec11", "Dec 2011 Calendar", "December 2011", "2011_12.html",false);
 SubMenu("jan12", "Jan 2012 Calendar", "January 2012", "2012_01.html",false);
 SubMenu("febn12", "Feb 2012 Calendar", "February 2012", "2012_02.html",false);
 SubMenu("mar12", "Mar 2012 Calendar", "March 2012", "2012_03.html",true);
MenuBar("events", "Events", "Sponsorship Opportunities", "opportunities.html", 60);
 SubMenu("yearly", "Yearly Events", "Yearly Events", "docs/Yearly-Events.pdf",false);
 SubMenu("banquet", "Annual Banquet 2/9/12", "Annual Banquet - Feb 9, 2012", "banquet.html",false);
 SubMenu("carnavale", "Carnavale 11/12/11", "Carnavale - Nov 12, 2011", "carnavale.html",false);
 SubMenu("thanks", "Gala Fundraiser Donations", "Thank You for Gala Donations", "docs/Gala-Fundraiser-Thank-Yous.pdf",false);
 SubMenu("oppor", "Sponsorship Opportunities", "Sponsorship Opportunities", "opportunities.html",true);
MenuBar("press", "Press", "News Stories", "news.html", 60);
 SubMenu("innews", "In the News", "In the News", "news.html",true);
MenuBar("contact", "Contact Us", "Contact Information", "contact-us.html", 86);
 SubMenu("contactus", "Contact Us", "Contact Information", "contact-us.html",false);
 SubMenu("volunt", "Volunteer Opportunities", "Volunteering", "volunteer.html",false);
 SubMenu("member", "Become a Member", "Members", "member.html",true);
MenuBar("charita", "Charitable Giving", "Charitable Giving", "charitable.html", 112);
 SubMenu("charita2", "Charitable Giving", "Charitable Giving", "charitable.html",false);
 SubMenu("donate", "Donate Now", "Make an On-Line Donation", "donate.html",false);
 SubMenu("wish", "Wish List", "Wish List", "wish_list.html",true);

htmlStr += newLineChar + newLineChar;
htmlStr += "<DIV ID='SPACER2'";
htmlStr += "STYLE='z-index:" + zIndex + "; background-color:" + menuOffBgColor + "; position:absolute; left:" + leftPos + "px; top:0px; width:100%; cursor:auto; height:" + menuHeight + "px; font-family:" + menuFont + "; font-size:" + menuFontSize + "; color:" + menuOffBgColor + "; padding:2px 0px 3px 0px'>M";
htmlStr += newLineChar + "</DIV>";
htmlStr += newLineChar;
htmlStr += newLineChar + "</SPAN>";

// un-comment the next line to see generated html string in the browser window
// htmlStr="<XMP>" + htmlStr + "</XMP>";

document.write(htmlStr);

function MenuBar(idStr, displayStr, helpStr, urlStr, menuWidth){
idStr=idStr.toUpperCase();
htmlStr += newLineChar;
htmlStr += "<DIV ID='" + idStr + "' ";
htmlStr += "STYLE='z-index:" + zIndex + "; background-color:" + menuOffBgColor + "; position:absolute; left:" + leftPos + "px; top:0px; width:" + menuWidth + "px; cursor:auto; height:" + menuHeight + "px;'";
if (helpStr != ""){
htmlStr += "TITLE='" + helpStr + "'";
}
htmlStr += " onmouseout=" + dblQuote + "SwapStyles('out','" + idStr + "'); HideMenu('" + idStr + "');" + dblQuote;
htmlStr += " onmouseover=" + dblQuote + "SwapStyles('over','" + idStr + "'); ShowMenu('" + idStr + "');" + dblQuote + ">";
htmlStr += newLineChar;
htmlStr += "<DIV ID='" + idStr + "_TEXT' ";
htmlStr += "STYLE='left:" + textIndent + "px; position:relative; width:" + (menuWidth-textIndent) + "px; padding:2px 0px 3px 0px'>";
htmlStr += newLineChar;
htmlStr += "<A ID='" + idStr + "_LINK' ";
htmlStr += "STYLE='text-decoration:none; color:" + menuOffFontColor + "; width:" + (menuWidth-textIndent) + "px; font-family:" + menuFont + "; font-size:" + menuFontSize + "' ";
if (urlStr != ""){
htmlStr += "TARGET='_top' HREF='" + urlStr + "'>";
htmlStr += displayStr + "</A></DIV>";
}
htmlStr += newLineChar;
htmlStr += newLineChar;
htmlStr += "<SPAN ID='" + idStr + "_SUBGROUP' ";
htmlStr += "STYLE='position:absolute; top:20 px; left:0px; display:none;'>";
htmlStr += newLineChar;
zIndex--;
leftPos=leftPos+menuWidth;
}


function SubMenu(idStr, displayStr, helpStr, urlStr, finalSub){
idStr=idStr.toUpperCase();
htmlStr += newLineChar;
htmlStr += "<DIV ID='" + idStr + "' ";
htmlStr += "STYLE='z-index:" + zIndex + "; border:1px solid; border-color:" + borderColor + "; background-color:" + subOffBgColor + "; position: relative; width:" + subMenuWidth + "px; cursor:auto; height:" + menuHeight + "px;'";
if (helpStr != ""){
htmlStr += "TITLE='" + helpStr + "'";
}
htmlStr += " onmouseout=" + dblQuote + "SubSwapStyles('out','" + idStr + "'); HideMenu('" + idStr + "');" + dblQuote;
htmlStr += " onmouseover=" + dblQuote + "SubSwapStyles('over','" + idStr + "'); ShowMenu('" + idStr + "');" + dblQuote + ">";
htmlStr += newLineChar;
htmlStr += "<DIV ID='" + idStr + "_TEXT' ";
htmlStr += "STYLE='left:" + textIndent + "px; position:relative; width:" + (subMenuWidth-textIndent-textIndent) + "px; padding:2px 0px 3px 0px'>";
htmlStr += newLineChar;
htmlStr += "<A ID='" + idStr + "_LINK' ";
htmlStr += "STYLE='text-decoration:none; color:" + subOffFontColor + "; width:" + (subMenuWidth-textIndent-textIndent) + "px; font-family:" + subFont + "; font-size:" + subFontSize + "' ";
if (urlStr != ""){
htmlStr += "TARGET='_top' HREF='" + urlStr + "'>";
htmlStr += displayStr + "</A></DIV>";
}
htmlStr += newLineChar + "</DIV>" + newLineChar;
if(finalSub){
htmlStr += "</SPAN>";
htmlStr += newLineChar + "</DIV>" + newLineChar;
}
zIndex--;
}


function SwapStyles(eventId, idStr){
isMouseout = (eventId.toUpperCase().indexOf("OUT") != -1);
if (isMouseout){
bgc = menuOffBgColor;
fc = menuOffFontColor;
}
else {
bgc = menuOnBgColor;
fc = menuOnFontColor;
}
document.getElementById(idStr).style.backgroundColor = bgc;
document.getElementById(idStr + "_TEXT").style.backgroundColor = bgc;
document.getElementById(idStr + "_LINK").style.color = fc;
return true;
}

function SubSwapStyles(eventId, idStr){
isMouseout = (eventId.toUpperCase().indexOf("OUT") != -1);
if (isMouseout){
bgc = subOffBgColor;
fc = subOffFontColor;
}
else {
bgc = subOnBgColor;
fc = subOnFontColor;
}
document.getElementById(idStr).style.backgroundColor = bgc;
document.getElementById(idStr + "_TEXT").style.backgroundColor = bgc;
document.getElementById(idStr + "_LINK").style.color = fc;
return true;
}

function ShowMenu(idStr){
var menuToShow = document.getElementById(idStr + "_SUBGROUP");
if (menuToShow == null) return false;
menuToShow.style.display = 'block';
return true;
}

function HideMenu(idStr){
var menuToHide = document.getElementById(idStr + "_SUBGROUP");
if (menuToHide == null) return false;
menuToHide.style.display = 'none';
return true;
}
