var d = document;
var hide = null;
/* 
	sets default category - value is the # of the menu id 
	1 = Stott Pilates, 2 = Certification, 3 = About
*/
window.onload = function() { d.getElementById('a' + cat).className = 'on'; }

function showMenu(x, e) {
	if (e.type == 'mouseover') {
		if (hide != null) {
			clearTimeout(hide);
		}
		hideMenu();
		d.getElementById('a' + x.id).className = 'on';
		d.getElementById('dd' + x.id).style.display = 'block';
	} else if (e.type == 'mouseout') {
		hide = setTimeout('hideMenu()',1000);
		return hide;
	}
}

function hideMenu() {
	var div;
	for (var i = 1; i < 4; i++) {
		div = d.getElementById('dd'+i);
		div.style.display = 'none';
		d.getElementById('a' + i).className = (cat != i) ? '' : 'on';
	}
}

function help(section, e){
	if (section == 'directions') {
		d.getElementById('help').style.backgroundPosition = (e.type == 'mouseover') ? '0 -15px' : '0 0';
	} else if (section == 'contact') {
		d.getElementById('help').style.backgroundPosition = (e.type == 'mouseover') ? '0 -30px' : '0 0';
	}
}

function show(el, sect, num){
	var div = d.getElementById(sect + num).style.display;
	d.getElementById(sect + num).style.display = (div != 'block') ? 'block' : 'none';
	el.style.backgroundPosition = (div == 'block') ? '-14px 0' : '0 -14px';
}

function showCalendar() {
	var obj = window.open('http://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=treynolds%40inspireatlanta.com&amp;color=%232952A3&amp;ctz=America%2FNew_York','Calendar','width=600,height=400,scrollbars=no,statusbar=no,resizable=yes');
	return obj;
/*
	var body = d.getElementsByTagName('body')[0];
	var obj = d.createElement('iframe');
	obj.src = 'http://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=treynolds%40inspireatlanta.com&amp;color=%232952A3&amp;ctz=America%2FNew_York';
	obj.width = '800';
	obj.height = '600';
	obj.setAttribute('frameborder','no');
	obj.setAttribute('scrolling','no');
	obj.style.border = '0';
	obj.style.margin = 'auto';
	obj.style.position = 'absolute';
	obj.style.zIndex = '1000';
	body.insertBefore(obj, body.childNodes[0]);
*/
}