function startList() {
	if (document.all && document.getElementById) {
		navRoot = document.getElementById("navList");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

/* School Agendas */
var agenda = '';
var state = '';
var prevState = '';

function agendaState(agenda,state)	{
	if(state=='show')	{
		prevState='hide';
		document.getElementById(agenda).className = state;
		document.getElementById(prevState + agenda).className = state;
		document.getElementById(state + agenda).className = prevState;		
	}	else	{
		prevState='show';
		document.getElementById(agenda).className = state;
		document.getElementById(state + agenda).className = state;
		document.getElementById(prevState + agenda).className = prevState;				
	}
}

/* Maps */
var map = '';
var prevMap = 'keneskys';
	
function showMap(map)	{	
	document.getElementById(prevMap).className = 'hide';
	document.getElementById(map).className = 'show';
	
	/* if(map=='wave')	{
		document.getElementById('hours').className = 'hide';
	}	else	{
		document.getElementById('hours').className = 'show';
	} */
	prevMap = map;
}

/* Calendars */
var calendar = '';
var prevCalendar = 'red';
var counter = 0;

function showCalendar(calendar)	{
	document.getElementById(prevCalendar).className = 'hide';
	document.getElementById(prevCalendar + 'Flag').className = '';
	document.getElementById(calendar).className = 'show';
	document.getElementById(calendar + 'Flag').className = 'On';
	if(counter==0)	{
		Reload();
	}
	counter ++;
	prevCalendar = calendar;
}
 
function Reload () {
var f = document.getElementById('blueFrame');
f.src = f.src;
}

function showPopup(map, display)	{
	document.getElementById(map).style.display = display;
}

/* Landing on php pages */
function noSubmit()	{
	window.location = 'http://www.srobertson.ca/clients/kenesky/index.html';
}

/* Where are they now */
var control;
var prevControl = 'collapse';
	
function showForm()	{
	if(prevControl=='collapse')	{
		prevControl='expand';
		document.getElementById('actionForm').className = 'infoContainerRow1 show';
		document.getElementById('actionButton').className = 'infoContainerRow1 show';
		document.getElementById('expandForm').className = 'hide';
		document.getElementById('collapseForm').className = 'show';
	}	else	{
		prevControl='collapse';
		document.getElementById('alumni_err').className = 'hide';
		document.getElementById('actionForm').className = 'infoContainerRow1 hide';
		document.getElementById('actionButton').className = 'infoContainerRow1 hide';
		document.getElementById('collapseForm').className = 'hide';
		document.getElementById('expandForm').className = 'show';
		document.kenesky_alumni.reset();
		document.getElementById('name').className = 'textField validate';
		document.getElementById('email').className = 'textField validate';
		document.getElementById('level').className = 'textField validate';
		document.getElementById('current').className = 'validate';
	}
}

function popContact() {
	var url = window.location.href;
	if(url.indexOf('?form=') != -1)	{
		document.getElementById('formControl').className = 'collapse';
		document.getElementById('actionButton').className = 'infoContainerRow1 show';
		document.getElementById('actionForm').className = 'infoContainerRow1 show';
	}
}
