var leomegastr= "<table cellspacing=\"0\" cellpadding=\"0\" id=\"LeoMegamenu1\" class=\"ddm1\">";
	leomegastr= leomegastr + "<tr>";
	leomegastr= leomegastr + "<td>";
        
	leomegastr= leomegastr + "<a class=\"item1\" target=\"\" href=\"index.html\" id=1,0>Synod Info</a>";
	leomegastr= leomegastr +  "<div class=\"section\">";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"index.html\" id=1,1>Home</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"about.htm\" id=1,2>About Us</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=117775443778163435833.000446d2e50b23302d874&ll=29.952053,-95.416903&spn=4.805801,10.283203&z=7\" id=1,3>Map</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"contact_info.htm\" id=1,4>Contact Us</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"directions.htm\" id=1,5>Directions</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"bishoppage.htm\" id=1,6>Bishop</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"council.htm\" id=1,7>Council</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"http://www.elca.org\" id=1,8>ELCA Web Site</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"history.htm\" id=1,9>History</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mission_support.htm\" id=1,10>Mission Support</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"staff.htm\" id=1,11>Staff</a>";
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
	leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=2,0>Congregations</a>";
	leomegastr= leomegastr +  "<div class=\"section\">";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\"  href=\"congregations/Websitebycity.pdf\" id=2,1>Alphabetlcally by City</a>";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\"  href=\"http://www.gulfcoastsynod.org/congregations/Org_Directory_for_Website.pdf\" id=2,2>Alphabetically by Name</a>";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\"  href=\"congregations.htm\" id=2,3>Search by Zip Code</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"congregations/transition_process.pdf\" id=2,4>Call Process Information</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"guidelines.htm\" id=2,7>Compensation Guidelines</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"call_process.htm\" id=2,8>Congregations in Call Process</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"constitution.htm\" id=2,9>Model Constitution</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"needs.htm\" id=2,10>Needs</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"safe_haven.htm\" id=2,11>Safe Haven</a>";


	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
		leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=3,0>Resources</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\"  href=\"bible.htm\" id=3,1>Bible Search</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"emphasis.htm\" id=3,2>Calendar of Emphasis</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"devotions.htm\" id=3,3>Daily Devotions</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"downloads.htm\" id=3,4>Downloads</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"connections.htm\" id=3,5>E-Newsletter</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"graphics.htm\" id=3,6>Graphics/Clipart</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"http://www.futurewithhope.org\" id=3,7>Hurricane Relief</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links.htm\" id=3,8>Links</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"listserv.htm\" id=3,9>Listservs (Group Email)</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"constitution.htm\" id=3,10>Model Constitution</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"treasurers.htm\" id=3,11>Treasurer</a>";
		leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
		leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=4,0>Ministries</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
		leomegastr= leomegastr + "<a class=\"item2\" target=\"\"  href=\"campus.htm\" id=4,1>Campus Ministry</a>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"index.html\" id=4,2>Christian Education</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"augsburg_fortress.htm\" id=4,2,1>Augsburg Fortress</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"bible.htm\" id=4,2,2>Bible Search</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_CE.htm\" id=4,2,3>Christian Ed Links/Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"confessions.htm\" id=4,2,4>Lutheran Confessions</a>";
	leomegastr= leomegastr +  "</div>";
		
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"index.html\" id=4,3>Communications</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"communications.htm\" id=4,3,1>Communications Survey</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"connections.htm\" id=4,3,2>E-Newsletter</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"graphics.htm\" id=4,3,3>Graphics/Clipart</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"listserv.htm\" id=4,3,4>Listservs (Group Email)</a>";
	leomegastr= leomegastr +  "</div>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"evangelismnew.htm\" id=4,4>Evangelism/Outreach</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"strategy.htm\" id=4,4,1>ELCA Evangelism Strategy</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_evangelism.htm\" id=4,4,2>Evangelism Links/Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mbuilders.htm\" id=4,4,3>Mission Builders</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mfounders.htm\" id=4,4,4>Mission Founders</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mpartners.htm\" id=4,4,5>Mission Partners</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"starts.htm\" id=4,4,6>New Mission Starts</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_prayer.htm\" id=4,4,7>Prayer Resources</a>";
	        leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"evangelismnew.htm\" id=4,4,8>Evangelism Videos</a>";
	leomegastr= leomegastr +  "</div>";
		
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,5>Financial</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"bop.htm\" id=4,5,1>Board of Pensions</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"foundation.htm\" id=4,5,2>ELCA Foundation</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"forms.htm\" id=4,5,3>Financial Forms</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mission_fund.htm\" id=4,5,4>Mission Endowment Fund</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mif.htm\" id=4,5,5>Mission Investment Fund</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mission_support.htm\" id=4,5,6>Mission Support</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"records.htm\" id=4,5,7>Record Keeping</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"treasurers.htm\" id=4,5,8>Resources for Treasurers</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"offering.htm\" id=4,5,9>What Your Offering Does</a>";
	leomegastr= leomegastr +  "</div>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"global_mission.htm\" id=4,6>Global Mission</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"creation_care\" id=4,6,1>Creation Care</a>";
		
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"\" id=4,13>Hispanic/Latino</a>";	
		    leomegastr= leomegastr +  "<div class=\"section\">";
		    leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"links_hispanic.htm\" id=4,13,1>Hispanic Links/Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"spanish_worship.htm\" id=4,13,2>Worship Resources in Spanish</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"tri_synod_plan.htm\" id=4,13,3>Tri-Synod Strategic Plan</a>";
	leomegastr= leomegastr +  "</div>";
	
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,7>Social Ministry</a>";
	leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"advocacy.htm\" id=4,7,1>Advocacy and Justice</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"companion_synod.htm\" id=4,7,2>Companion Synods</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"response.htm\" id=4,7,3>Disaster Response</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"aios.htm\" id=4,7,4>Ministry Groups (AIOs)</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\"  href=\"links_socmin.htm\" id=4,7,5>Social Ministry Links/Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"hunger.htm\" id=4,7,6>World Hunger Program</a>";
	leomegastr= leomegastr +  "</div>";
		
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,8>Stewardship</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"emphasis.htm\" id=4,8,1>Calendar of Emphasis</a>";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"eco_justice.htm\" id=4,8,2>Eco-Justice Newsletter</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"ELCA_stewardship.htm\" id=4,8,3>ELCA Stewardship Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"fund_raising.htm\" id=4,8,4>Fund Raising Policies</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"academy.htm\" id=4,8,5>Stewardship Academy</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_stewardship.htm\" id=4,8,6>Stewardship Links/Resources</a>";
	leomegastr= leomegastr +  "</div>";
		
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,9>Transformational Ministry</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"about_trans.htm\" id=4,9,1>About Transformation</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"asset_mapping.htm\" id=4,9,2>Asset Mapping</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"factors.htm\" id=4,9,3>Change Factors</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"coaching.htm\" id=4,9,4>Coaching 101</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"ncd.htm\" id=4,9,5>Natural Church Development</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"renewing.htm\" id=4,9,6>Renewing Congregations</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"through_prayer.htm\" id=4,9,7>Through Prayer</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_transform.htm\" id=4,9,8>Transforming Links/Resources</a>";
	leomegastr= leomegastr +  "</div>";
		leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,10>Worship</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"about_worship.htm\" id=4,10,1>About Worship</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"congregations.htm\" id=4,10,2>Congregations in the ELCA</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"ELW.htm\" id=4,10,3>Evangelical Lutheran Worship Book</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"questions.htm\" id=4,10,4>FAQs</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"graphics.htm\" id=4,10,5>Graphics/Clipart</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"use.htm\" id=4,10,6>Use of the Means of Grace</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_worship.htm\" id=4,10,7>Worship Links/Resources</a>";
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,11>Youth & Family Ministry</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"camphope.htm\" id=4,11,1>Camp Hope</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"campus.htm\" id=4,11,2>Campus Ministries</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"lutherhill.htm\" id=4,11,3>Lutherhill</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"http://www.soggyshoes.org\" id=4,11,4>Soggy Shoes Web Site</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"institute.htm\" id=4,11,5>Youth and Family Institute</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_yfm.htm\" id=4,11,6>Y&FM Links/Resources</a>";
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"index.html\" id=4,12>Young Adult</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"yaministries.htm\" id=4,12,1>Young Adult Ministries</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_ya.htm\" id=4,12,2>Young Adult Links/Resources</a>";
	leomegastr= leomegastr +  "</div>";


	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
		leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=5,0>Leadership</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"called.htm\" id=5,1>Are You Called to Ministry?</a>";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"bop.htm\" id=5,2>Board of Pensions</a>";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"candidacy.htm\" id=5,3>Candidacy Committee</a>";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"Deans-Ministeriums.htm\" id=5,4>Deans/Ministeriums</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"rostered_forms.htm\" id=5,5>Forms for Rostered Leaders</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"interim.htm\" id=5,6>Interim Ministry</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"jobs.htm\" id=5,7>Job Opportunities</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"links_leader.htm\" id=5,8>Leadership Links/Resources</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"leadership_program_for_musicians.htm\" id=5,9>Leadership Program for Musicians</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"melanchthon.htm\" id=5,10>Melanchthon Institute</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mi.htm\" id=5,11>Mission Interpreters</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"sabbatical.htm\" id=5,12>Sabbatical Information</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"supply_pastors.htm\" id=5,13>Supply Pastors</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"http://www.summertheologicalinstitute.org\" id=5,14>Summer Theological Institute</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"assembly2007.htm\" id=5,15>Synod Assembly 2007</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"text_studies.htm\" id=5,16>Text Studies</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"theo_conf.htm\" id=5,17>Theological Conference</a>";
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
		leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=6,0>Events</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"SynodAssembly2009.htm\" id=6,1>Synod Assembly 2009</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"assembly08temp(2).htm\" id=6,2>Synod Assembly 2008</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"assembly2007.htm\" id=6,3>Synod Assembly 2007</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"theo_conf.htm\" id=6,4>Theological Conference</a>";
			
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr +  "<td>";
		leomegastr= leomegastr + "<a class=\"item1\" target=\"\"  href=\"index.html\" id=7,0>Ministry Partners</a>";
		leomegastr= leomegastr +  "<div class=\"section\">";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"brenham.htm\" id=7,0,1>Brenham Ministries</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"companion_synod.htm\" id=7,0,2>Companion Synods</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"lutherhill.htm\" id=7,0,3>Lutherhill</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"lmm.htm\" id=7,0,4>Men's Ministries (LMM)</a>";
			leomegastr= leomegastr + "<a class=\"item2\" target=\"\" & href=\"aios.htm\" id=7,0,5>Ministry Groups (AIOs)</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"partner.htm\" id=7,0,6>Partner Synod</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"mission_fund.htm\" id=7,0,7>Mission Endowment Fund</a>";
			leomegastr= leomegastr + "<a class=\"item2\"  target=\"\" & href=\"welca.htm\" id=7,0,8>Women's Ministries (WELCA)</a>";
	leomegastr= leomegastr +  "</div>";
	leomegastr= leomegastr +  "</td>";

	leomegastr= leomegastr + "</tr>";

leomegastr= leomegastr + "</table>"


function LeoMegaMenu(id) {

    /* Type of the menu: "horizontal" or "vertical" */
    this.type = "horizontal";

    /* Delay (in miliseconds >= 0): show-hide menu
     * Hide must be > 0 */
    this.delay = {
        "show": 0,
        "hide": 400
    }
    /* Change the default position of sub-menu by Y pixels from top and X pixels from left
     * Negative values are allowed */
    this.position = {
        "level1": { "top": 0, "left": 0},
        "levelX": { "top": 0, "left": 0}
    }

    /* fix ie selectbox bug ? */
    this.fixIeSelectBoxBug = true;

    /* Z-index property for .section */
    this.zIndex = {
        "visible": 500,
        "hidden": -1
    };

    // Browser detection
    this.browser = {
        "ie": Boolean(document.body.currentStyle),
        "ie5": (navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1),
        "ie6": (navigator.appVersion.indexOf("MSIE 6.0") != -1)
    };
    
    if (!this.browser.ie) {
        this.browser.ie5 = false;
        this.browser.ie6 = false;
    }

    /* Initialize the menu */
    this.init = function() {
        if (!document.getElementById(this.id)) { return alert("LeoMegaMenu.init() failed. Element '"+ this.id +"' does not exist."); }
        if (this.type != "horizontal" && this.type != "vertical") { return alert("LeoMegaMenu.init() failed. Unknown menu type: '"+this.type+"'"); }
        if (this.browser.ie && this.browser.ie5) { fixWrap(); }
        fixSections();
        parse(document.getElementById(this.id).childNodes, this.tree, this.id);
    }

    /* Search for .section elements and set width for them */
    function fixSections() {
        var arr = document.getElementById(self.id).getElementsByTagName("div");
        var sections = new Array();
        var widths = new Array();
        
        for (var i = 0; i < arr.length; i++) {
            if (arr[i].className == "section") {
                sections.push(arr[i]);
            }
        }
        for (var i = 0; i < sections.length; i++) {
            widths.push(getMaxWidth(sections[i].childNodes));
        }
        for (var i = 0; i < sections.length; i++) {
            sections[i].style.width = (widths[i]) + "px";
        }
        if (self.browser.ie) {
            for (var i = 0; i < sections.length; i++) {
                setMaxWidth(sections[i].childNodes, widths[i]);
            }
        }
    }

    function fixWrap() {
        var elements = document.getElementById(self.id).getElementsByTagName("a");
        for (var i = 0; i < elements.length; i++) {
            if (/item2/.test(elements[i].className)) {
                elements[i].innerHTML = '<div nowrap="nowrap">'+elements[i].innerHTML+'</div>';
            }
        }
    }

    /* Search for an element with highest width among given nodes, return that width */
    function getMaxWidth(nodes) {
        var maxWidth = 0;
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType != 1 || /section/.test(nodes[i].className)) { continue; }
            if (nodes[i].offsetWidth > maxWidth) { maxWidth = nodes[i].offsetWidth; }
        }
        return maxWidth;
    }

    /* Set width for item2 elements */
    function setMaxWidth(nodes, maxWidth) {
        for (var i = 0; i < nodes.length; i++) {
            if (nodes[i].nodeType == 1 && /item2/.test(nodes[i].className) && nodes[i].currentStyle) {
                if (self.browser.ie5) {
                    nodes[i].style.width = (maxWidth) + "px";
                } else {
                    nodes[i].style.width = (maxWidth - parseInt(nodes[i].currentStyle.paddingLeft) - parseInt(nodes[i].currentStyle.paddingRight)) + "px";
                }
            }
        }
    }

    /* Parse nodes, create events, position elements */
    function parse(nodes, tree, id) {
        for (var i = 0; i < nodes.length; i++) {
            if (1 != nodes[i].nodeType) {
                continue;
            }
            switch (true) {
                // .item1
                case /\bitem1\b/.test(nodes[i].className):
                    nodes[i].id = id + "-" + tree.length;
                    tree.push(new Array());
                    nodes[i].onmouseover = itemOver;
                    nodes[i].onmouseout = itemOut;
                    break;
                // .item2
                case /\bitem2\b/.test(nodes[i].className):
                    nodes[i].id = id + "-" + tree.length;
                    tree.push(new Array());
                    nodes[i].onmouseover = itemOver;
                    nodes[i].onmouseout = itemOut;
                    break;
                // .section
                case /\bsection\b/.test(nodes[i].className):
                    // id, events
                    nodes[i].id = id + "-" + (tree.length - 1) + "-section";
                    nodes[i].onmouseover = sectionOver;
                    nodes[i].onmouseout = sectionOut;
                    // position
                    var box1 = document.getElementById(id + "-" + (tree.length - 1));
                    var box2 = document.getElementById(nodes[i].id);
                    var el = new Element(box1.id);
                    if (1 == el.level) {
                        if ("horizontal" == self.type) {
                            box2.style.top = box1.offsetTop + box1.offsetHeight + self.position.level1.top + "px";
                            if (self.browser.ie5) {
                                box2.style.left = self.position.level1.left + "px";
                            } else {
                                box2.style.left = box1.offsetLeft + self.position.level1.left + "px";
                            }
                        } else if ("vertical" == self.type) {
                            box2.style.top = box1.offsetTop + self.position.level1.top + "px";
                            if (self.browser.ie5) {
                                box2.style.left = box1.offsetWidth + self.position.level1.left + "px";
                            } else {
                                box2.style.left = box1.offsetLeft + box1.offsetWidth + self.position.level1.left + "px";
                            }
                        }
                    } else {
                        box2.style.top = box1.offsetTop + self.position.levelX.top + "px";
                        box2.style.left = box1.offsetLeft + box1.offsetWidth + self.position.levelX.left + "px";
                    }
                    // sections, sectionsShowCnt, sectionsHideCnt
                    self.sections.push(nodes[i].id);
                    self.sectionsShowCnt.push(0);
                    self.sectionsHideCnt.push(0);
                    if (self.fixIeSelectBoxBug && self.browser.ie6) {
                        nodes[i].innerHTML = nodes[i].innerHTML + '<iframe id="'+nodes[i].id+'-iframe" src="javascript:false;" scrolling="no" frameborder="0" style="position: absolute; top: 0px; left: 0px; display: none; filter:alpha(opacity=0);"></iframe>';
                    }
                    break;
            }
            if (nodes[i].childNodes) {
                if (/\bsection\b/.test(nodes[i].className)) {
                    parse(nodes[i].childNodes, tree[tree.length - 1], id + "-" + (tree.length - 1));
                } else {
                    parse(nodes[i].childNodes, tree, id);
                }
            }
        }
    }

    /* event, item:onmouseover */
    function itemOver() {
        //debug("itemOver("+this.id+") , visible = " + self.visible);
        self.itemShowCnt++;
        var id_section = this.id + "-section";
        if (self.visible.length) {
            var el = new Element(self.visible.getLast());
            el = document.getElementById(el.getParent().id);
            if (/item\d-active/.test(el.className)) {
                el.className = el.className.replace(/(item\d)-active/, "$1");
            }
        }
        if (self.sections.contains(id_section)) {
            clearTimers();
            self.sectionsHideCnt[self.sections.indexOf(id_section)]++;
            var cnt = self.sectionsShowCnt[self.sections.indexOf(id_section)];
            var timerId = setTimeout(function(a, b) { return function() { self.showSection(a, b); } } (id_section, cnt), self.delay.show);
            self.timers.push(timerId);
        } else {
            if (self.visible.length) {
                clearTimers();
                var timerId = setTimeout(function(a, b) { return function() { self.showItem(a, b); } } (this.id, self.itemShowCnt), self.delay.show);
                self.timers.push(timerId);
            }
        }
    }

    /* event, item:onmouseout */
    function itemOut() {
        //debug("itemOut("+this.id+") , visible = " + self.visible);
        self.itemShowCnt++;
        var id_section = this.id + "-section";
        if (self.sections.contains(id_section)) {
            self.sectionsShowCnt[self.sections.indexOf(id_section)]++;
            if (self.visible.contains(id_section)) {
                var cnt = self.sectionsHideCnt[self.sections.indexOf(id_section)];
                var timerId = setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(id_section, cnt), self.delay.hide);
                self.timers.push(timerId);
            }
        }
    }

    /* event, section:onmouseover */
    function sectionOver() {
        //debug("sectionOver("+this.id+") , visible = " + self.visible);
        self.sectionsHideCnt[self.sections.indexOf(this.id)]++;
        var el = new Element(this.id);
        var parent = document.getElementById(el.getParent().id);
        if (!/item\d-active/.test(parent.className)) {
            parent.className = parent.className.replace(/(item\d)/, "$1-active");
        }
    }

    /* event, section:onmouseout */
    function sectionOut() {
        //debug("sectionOut("+this.id+") , visible = " + self.visible);
        self.sectionsShowCnt[self.sections.indexOf(this.id)]++;
        var cnt = self.sectionsHideCnt[self.sections.indexOf(this.id)];
        var timerId = setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(this.id, cnt), self.delay.hide);
        self.timers.push(timerId);
    }

    /* Show section (1 argument passed)
     * Try to show section (2 arguments passed) - check cnt with sectionShowCnt */
    this.showSection = function(id, cnt) {
        if (typeof cnt != "undefined") {
            if (cnt != this.sectionsShowCnt[this.sections.indexOf(id)]) { return; }
        }
        //debug("showSection("+id+", "+cnt+") , visible = " + this.visible);
        this.sectionsShowCnt[this.sections.indexOf(id)]++;
        if (this.visible.length) {
            if (id == this.visible.getLast()) { return; }
            var el = new Element(id);
            var parents = el.getParentSections();
            //debug("getParentSections("+el.id+") = " + parents);
            for (var i = this.visible.length - 1; i >= 0; i--) {
                if (parents.contains(this.visible[i])) {
                    break;
                } else {
                    this.hideSection(this.visible[i]);
                }
            }
        }
        var el = new Element(id);
        var parent = document.getElementById(el.getParent().id);
        if (!/item\d-active/.test(parent.className)) {
            parent.className = parent.className.replace(/(item\d)/, "$1-active");
        }
        if (document.all) { document.getElementById(id).style.display = "block"; }
        document.getElementById(id).style.visibility = "visible";
        document.getElementById(id).style.zIndex = this.zIndex.visible;
        if (this.fixIeSelectBoxBug && this.browser.ie6) {
            var div = document.getElementById(id);
            var iframe = document.getElementById(id+"-iframe");
            iframe.style.width = div.offsetWidth + parseInt(div.currentStyle.borderLeftWidth) + parseInt(div.currentStyle.borderRightWidth);
            iframe.style.height = div.offsetHeight + parseInt(div.currentStyle.borderTopWidth) + parseInt(div.currentStyle.borderBottomWidth);
            iframe.style.top = -parseInt(div.currentStyle.borderTopWidth);
            iframe.style.left = -parseInt(div.currentStyle.borderLeftWidth);
            iframe.style.zIndex = div.style.zIndex - 1;
            iframe.style.display = "block";
        }
        this.visible.push(id);
    }

    /* Emulating an empty non-existent section, we have to hide elements, works like showSection() */
    this.showItem = function(id, cnt) {
        if (typeof cnt != "undefined") {
            if (cnt != this.itemShowCnt) { return; }
        }
        this.itemShowCnt++;
        if (this.visible.length) {
            var el = new Element(id + "-section");
            var parents = el.getParentSections();
            //debug("showItem() getParentSections("+el.id+") = " + parents);
            for (var i = this.visible.length - 1; i >= 0; i--) {
                if (parents.contains(this.visible[i])) {
                    break;
                } else {
                    this.hideSection(this.visible[i]);
                }
            }
        }
    }

    /* Hide section (1 argument passed)
     * Try to hide section (2 arguments passed) - check cnt with sectionHideCnt */
    this.hideSection = function(id, cnt) {
        if (typeof cnt != "undefined") {
            if (cnt != this.sectionsHideCnt[this.sections.indexOf(id)]) { return; }
            if (id == this.visible.getLast()) {
                //debug("hideSectionAll("+id+", "+cnt+") , visible = " + this.visible);
                for (var i = this.visible.length - 1; i >= 0; i--) {
                    this.hideSection(this.visible[i]);
                }
                return;
            }
        }
        //debug("hideSection("+id+", "+cnt+") , visible = " + this.visible);
        var el = new Element(id);
        var parent = document.getElementById(el.getParent().id);
        if (/item\d-active/.test(parent.className)) {
            parent.className = parent.className.replace(/(item\d)-active/, "$1");
        }
        document.getElementById(id).style.zIndex = this.zIndex.hidden;
        document.getElementById(id).style.visibility = "hidden";
        if (document.all) { document.getElementById(id).style.display = "none"; }
        if (this.fixIeSelectBoxBug && this.browser.ie6) {
            var iframe = document.getElementById(id+"-iframe");
            iframe.style.display = "none";
        }
        if (this.visible.contains(id)) {
            if (id == this.visible.getLast()) {
                this.visible.pop();
            } else {
                //throw "LeoMegaMenu.hideSection('"+id+"', "+cnt+") failed, trying to hide a section that is not the deepest visible section";
                return;
            }
        } else {
            //throw "LeoMegaMenu.hideSection('"+id+"', "+cnt+") failed, cannot hide element that is not visible";
            return;
        }
        this.sectionsHideCnt[this.sections.indexOf(id)]++;
    }

    /* Element (.section, .item2 etc) */
    function Element(id) {
        
        this.menu = self;
        this.id = id;

        /* Get Level of given id
         * Examples: menu-1 (1 level), menu-1-4 (2 level) */
        this.getLevel = function() {
            var s = this.id.substr(this.menu.id.length);
            return s.substrCount("-");
        }

        /* Get parent Element */
        this.getParent = function() {
            var s = this.id.substr(this.menu.id.length);
            var a = s.split("-");
            a.pop();
            return new Element(this.menu.id + a.join("-"));
        }

        /* Check whether an element has a parent element */
        this.hasParent = function() {
            var s = this.id.substr(this.menu.id.length);
            var a = s.split("-");
            return a.length > 2;
        }

        /* Check whether an element has a sub-section */
        this.hasChilds = function() {
            return Boolean(document.getElementById(this.id + "-section"));
        }

        /* Get parent section elements for current section */
        this.getParentSections = function() {
            var s = this.id.substr(this.menu.id.length);
            s = s.substr(0, s.length - "-section".length);
            var a = s.split("-");
            a.shift();
            a.pop();
            var s = this.menu.id;
            var parents = [];
            for (var i = 0; i < a.length; i++) {
                s += ("-" + a[i]);
                parents.push(s + "-section");
            }
            return parents;
        }
        
        this.level = this.getLevel();
    }

    /* Clear all timers set with setTimeout() */
    function clearTimers() {
        for (var i = self.timers.length - 1; i >= 0; i--) {
            clearTimeout(self.timers[i]);
            self.timers.pop();
        }
    }

    var self = this;
    this.id = id; /* menu id */
    this.tree = []; /* tree structure of menu */
    this.sections = []; /* all sections, required for timeout */
    this.sectionsShowCnt = [];
    this.sectionsHideCnt = [];
    this.itemShowCnt = 0;
    this.timers = []; // timeout ids
    this.visible = []; /* visible section, ex. Array("menu-0-section", ..) , succession is important: top to bottom */
}

/* Finds the index of the first occurence of item in the array, or -1 if not found */
if (typeof Array.prototype.indexOf == "undefined") {
    Array.prototype.indexOf = function(item) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] === item) {
                return i;
            }
        }
        return -1;
    }
}

/* Check whether array contains given string */
if (typeof Array.prototype.contains == "undefined") {
    Array.prototype.contains = function(s) {
        for (var i = 0; i < this.length; i++) {
            if (this[i] === s) {
                return true;
            }
        }
        return false;
    }
}

/* Counts the number of substring occurrences */
if (typeof String.prototype.substrCount == "undefined") {
    String.prototype.substrCount = function(s) {
        return this.split(s).length - 1;
    }
}

/* Get the last element from the array */
if (typeof Array.prototype.getLast == "undefined") {
    Array.prototype.getLast = function() {
        return this[this.length-1];
    }
}

function LeoMegaDynamicMenu()
{
 	var ddm1 = new LeoMegaMenu('LeoMegamenu1');
    ddm1.delay.show = 0;
    ddm1.delay.hide = 400;
    ddm1.position.levelX.left = 2;
    ddm1.init();
}
