// JavaScript Document
// Drop Bown Menu - Head Script
// copyright Stephen Chapman, 4th March 2005, 5th February 2006
// you may copy this menu provided that you retain the copyright notice
// Entry 1a
//var fix=1 keeps the nav bar in the same place during a scroll (irritating)
//
//
//        Adding menu items:
// Each division is composed of a Menu Name entry and subentries
// Simply plug in the menu name on the first line, 
// and subentries on the remaining lines, with the link on the left and the entry on the right (see below)
//			bar.addMenu('Home'); <--menu name
//			bar.addItem('entry1a.htm','Entry 1a'); <--subentries
//			bar.addItem('entry1b.htm','Entry 1b');

// It's okay to use a small amount of html, such as in the first addMenu area, /index.html -- this allows you to
// style links that don't have drop-downs. It also allows you to add small pix, such as in the second addMenu
// area, Programs




var fix = 0; var delay = 100; var modd = 0;
var bar = new menuBar();
bar.addMenu('<a href="/index.html" style="color:white; text-decoration:none;">Home</a>');
bar.addMenu('Summer');
bar.addItem('/register/register.html', '<b>REGISTER NOW</b>');
bar.addItem('/program/summer/summer_camp.html','<b>Summer Camps</b>');
bar.addItem('/program/summer/specialfriends.html','&#8226; Special Friends');
bar.addItem('/program/summer/CIT_Program.html','&#8226; Leadership (CIT)');
bar.addItem('/program/summer/adventures.html','&#8226; Adventures on the Coast');
bar.addItem('/program/summer/servants.html', '&#8226; Servant Events');
bar.addItem('/program/summer/shalom.html','&#8226; SHALOM Camp');
bar.addItem('/program/summer/sherpa.html','&#8226; Summer Sherpa');
bar.addItem('/program/summer/nurse.html','&#8226; Summer Camp Nurse');
bar.addItem('/program/summer/day_camp.html','<b>Day Camp</b>');
bar.addItem('/program/summer/day_camp_resources.html','&#8226; Resources and Graphics');
bar.addItem('/program/summer/day_camp_schedule.html','&#8226; 2012 Calendar');
bar.addItem('/donations/campership.html','<b>Campership Request</b>');
bar.addMenu('Retreats');
bar.addItem('/program/retreats/jrhigh.html','<b>Jr. High Retreats</b>');
bar.addItem('/program/retreats/jrhigh_JAM.html','&#8226; JAM');
bar.addItem('/program/retreats/jrhigh_EoY.html','&#8226; [EoY] End of the Year');
//bar.addItem('/program/retreats/srhigh.html','<b>Youth Retreats</b>');
//bar.addItem('/program/retreats/srhigh_fall.html','&#8226; Fall Teaming Retreat');
//bar.addItem('/program/retreats/srhigh_PACE.html','&#8226; PACE Contemplative');
bar.addItem('/program/retreats/adults.html','<b>Adult Retreats</b>');
bar.addItem('/program/retreats/adults_women.html','&#8226; Fall Womens Retreat');
bar.addItem('/program/retreats/family.html','<b>Family Retreats</b>');
bar.addItem('/program/retreats/family_memorialdayworkweekend.html','&#8226; Family Work Weekend');
bar.addItem('/TIP_CC.html','<b>Team Initiative Program</b>');
bar.addItem('/rentals.html','<b>Plan Your Own Retreat</b>');
bar.addMenu('Group Rentals');
bar.addItem('/rentals.html','<b>Rental Information</b>');
bar.addItem('/rentals/facilities_oak.html','&#8226; Oak Village');
bar.addItem('/rentals/facilities_lowerjensen.html','&#8226; Jensen Village');
bar.addItem('/rentals/facilities_evergreen.html','&#8226; Evergreen Village');
bar.addItem('/rentals/facilities_redwood.html','&#8226; Redwood Village');
bar.addItem('/rentals/facilities_madrones.html','&#8226; Madrone Village');
bar.addItem('/TIP_CC.html','<b>Challenge Course (TIP)</b>');
bar.addItem('/rentals.html','<b>Plan Your Own Retreat</b>');
bar.addMenu('Education');
bar.addItem('/program/education_fall.html','<b>Fall Outdoor Education</b>');
bar.addItem('/program/retreats/jrhigh.html','<b>Confirmation Retreats</b>');
bar.addMenu('About Us');
bar.addItem('/about/contact.html','<b>Contact Us</b>');
bar.addItem('/about/staff.html','&#8226; Staff');
bar.addItem('/about/directors.html','&#8226; Board of Directors');
bar.addItem('/about/causes.html','<b>Our Causes</b>');
bar.addItem('/about/employment.html','<b>Employment</b>');
bar.addItem('/about/employment_summer.html','&#8226; Summer Ministry Staff');
bar.addItem('/about/employment_yearround.html','&#8226; Year-Round Staff');
bar.addItem('/about/history/page_1.html','<b>History</b>');
bar.addItem('/about/alumni.html','<b>Alumni</b>');
bar.addItem('/about/directions.html','<b>Directions & Maps</b>');
bar.addItem('/about/camp_map.html','<b>Interactive Camp Map</b>');
bar.addMenu('Donate');
bar.addItem('/donations/onlinegiving.html','<b>Donate Online</b>');
bar.addItem('/donations/bigtreeclub.html','<b>Big Tree Club</b>');
bar.addItem('/donations/plannedgiving.html','<b>Planned Giving</b>');
bar.addItem('/donations/endowment.html','<b>Endowment Fund</b>');
bar.addItem('/donations/campership.html','<b>Campership Fund</b>');
bar.addItem('/donations/inkind.html','<b>Needs List</b>');
bar.addItem('/donations/inkind_volunteers.html','<b>Volunteer</b>');
bar.addItem('/program/summer/sherpa.html','&#8226; Summer Sherpa');
bar.addItem('/program/summer/nurse.html','&#8226; Summer Camp Nurse');
bar.addItem('/about/directors_committees_rangers.html','&#8226; Rangers (MTC Advocate)');
bar.addItem('/donations/annual_reports.html','<b>Annual Reports</b>');
bar.addItem('/donations/Thrivent.html','<b>Thrivent</b>');
bar.addItem('/donations/options.html','<b>Other Support Options</b>');


// do not change anything below this line
//var blc = '#663300';var blh = '#ffffff';var bla = '#996633';var lc = '#ffffff';var lh = '#cc9966';var la = '#ffffff';
var blc = '#7D241A';
var blh = '#ffffff';
var bla = '#E6BA85';
var lc = '#ffffff';
var lh = '#32f11f';
var la = '#7D241A';
function menuBar() {
	this.jj = -1;
	this.kk = 0;
	this.mO = new Array();
	this.addMenu = addMenu;
	this.addItem = addItem;
	this.writeBar = writeBar;
	this.writeDrop = writeDrop;
}
function addMenu(main) {
	this.mO[++this.jj] = new Object();
	this.mO[this.jj].main = main;
	this.kk = 0;
	this.mO[this.jj].link = new Array();
	this.mO[this.jj].name = new Array();
}
function addItem(link,name) {
	this.mO[this.jj].link[this.kk] = link;
	this.mO[this.jj].name[this.kk++] = name;
}
function writeBar() {
	for (var i=1; i <= this.mO.length; i++){
		document.write('<span id="navMenu'+i+'" class="mH">'+this.mO[i-1].main+'<\/span>');
	}
}
function writeDrop() {
	for (var i=1;i <= this.mO.length; i++){
		document.write('<div id="dropMenu'+i+'" class="mD">\r\n');
		for (var h=0; h < this.mO[i-1].link.length; h++){
			document.write('<a class="mL" href="'+this.mO[i-1].link[h]+'">'+this.mO[i-1].name[h]+'<\/a>\r\n');
		}
		document.write('<\/div>\r\n');
	}
}
if (fix) window.onscroll=sMenu;
window.onload=iMenu;
var onm = null;
var ponm = null;
var podm = null;
var ndm = bar.mO.length;

function posY() {
	return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;
}
function sMenu() {
	document.getElementById('mB').style.top = posY() + 'px';
 	for (i=1; i<=ndm; i++) {
		menuName = 'dropMenu' + i;
		odm = document.getElementById(menuName);
 		if (onm) {
			var yPos = onm.offsetParent.offsetTop + onm.offsetParent.offsetHeight;
			odm.style.top = yPos + 'px';
		}
	}
}
function iMenu() {
	if (document.getElementById) {
		document.onclick = mHide;
 		for (i=1; i<=ndm; i++) {
			menuName = 'dropMenu' + i;
 			navName = 'navMenu' + i;
 			odm = document.getElementById(menuName);
 			onm = document.getElementById(navName);
 			odm.style.visibility = 'hidden';
			onm.onmouseover =  mHov;
			onm.onmouseout = mOut;
		} 
		onm = null;
	} 
	return;
}
function  mHov(e) {
	if (modd) clearTimeout(modd);
	document.onclick = null;
 	honm = document.getElementById(this.id);
 	if (honm != onm) {
		honm.style.color = lh;
 		honm.style.backgroundColor = blh;
	} 
	menuName = 'drop' + this.id.substring(3,this.id.length);
 	odm = document.getElementById(menuName);
 	if (podm == odm) {
		mHide();
		return;
	} 
	if (podm != null) mHide();
 	onm = document.getElementById(this.id);
 	if ((ponm != onm ) || (podm == null)) {
		onm.style.color = la;
 		onm.style.backgroundColor = bla;
	} 
	if (odm) {
		xPos = onm.offsetParent.offsetLeft + onm.offsetLeft;
 		yPos = onm.offsetParent.offsetTop + onm.offsetParent.offsetHeight;
 		odm.style.left = xPos + 'px';
 		odm.style.top = yPos + 'px';
 		odm.style.visibility = 'visible';
 		odm.onmouseover = omov;
 		odm.onmouseout = omot;
 		podm = odm;
 		ponm = onm;
	}
}
function omov() {
	if (modd) clearTimeout(modd);
}
function omot() {
	modd = setTimeout('mHide()',delay);
}
function mOut(e) {
	modd = setTimeout('mHide()',delay);
	document.onclick = mHide;
	oonm = document.getElementById(this.id);
 	if (oonm != onm) {
		oonm.style.color = lc;
 		oonm.style.backgroundColor = blc;
	}
}
function mHide() {
	document.onclick = null;
 	if (podm) {
		podm.style.visibility = 'hidden';
 		podm = null;
 		ponm.style.color = lc;
 		ponm.style.backgroundColor = blc;
	} 
	onm = null;
}
if (fix) {
	var ag = navigator.userAgent.toLowerCase();
	var isG = (ag.indexOf('gecko') != -1);
	var isR=0;
	if (isG) {
		t = ag.split("rv:");
 		isR = parseFloat(t[1]);
	}
	if (isR && isR<1) setInterval('sMenu()',50);
}

