/* 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("progcur", "Program Curriculum", "Program Curriculum", "classes.html",false);
 SubMenu("spring10", "Spring 2010 Schedule", "Spring 2010", "docs/Spring10-Schedule.pdf",false);
 SubMenu("winter10", "Winter 2010 Schedule", "Winter 2010", "docs/Winter10-Schedule.pdf",false);
 SubMenu("fall09", "Fall 2009 Schedule", "Fall 2009", "docs/Fall09-Schedule.pdf",false);
 SubMenu("summer09", "Summer 2009 Schedule", "Summer 2009", "docs/Summer09-Schedule.pdf",true);
MenuBar("calndr", "Calendar", "Calendar", "2010_05.html", 74);
 SubMenu("apr10", "Apr 2010 Calendar", "April 2010", "2010_04.html",false);
 SubMenu("may10", "May 2010 Calendar", "May 2010", "2010_05.html",false);
 SubMenu("jun10", "Jun 2010 Calendar", "June 2010", "2010_06.html",true);
MenuBar("events", "Events", "Sponsorship Opportunities", "opportunities.html", 60);
 SubMenu("golf", "Charity Golf Outing - 6/21/10", "Charity Golf Outing", "golf.html",false);
 SubMenu("oppor", "Sponsorship Opportunities", "Sponsorship Opportunities", "opportunities.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;
}