// bearstedcc.js
//
// Custom javascript functions for www.bearstedcc.org.uk website
// Written by Peter Farmer
// http://www.hbhosting.co.uk/

//
// function getElementStyle
//
// Cross-plaform style info grabber, returns value of style.
// so a style of "display: none;" would return "none".
// 
function getElementStyle(elemID, CSSStyleProp) {
	var elem = document.getElementById(elemID);
	if (elem.currentStyle) {
		return CSSStyleProp + ": " + elem.currentStyle[CSSStyleProp];
	}
	else if (window.getComputedStyle) {
		var compStyle = window.getComputedStyle(elem, "");
		return CSSStyleProp + ": " + compStyle.getPropertyValue(CSSStyleProp);
	}
	return "";
}

function toggleMenus(menu) {

	var menus = new Array( );
	menus[0] = "community_menu";
//	menus[1] = "mission_menu";

	for (var count = 0 ; count < menus.length ; count++) {
		if (menus[count] != menu) {
			var menu_style = getElementStyle(menus[count], 'display');
			if (menu_style != "display: none") {
				new Effect.toggle(document.getElementById(menus[count]), 'blind', {queue: 'front'});
			}
		}
	}

	// Second toggle the selected menu
	for (var count = 0 ; count < menus.length ; count++) {
		if (menus[count] == menu) {
			new Effect.toggle(document.getElementById(menus[count]), 'blind', {queue: 'end'});
		}
	}

	return false;

}

// var menu2_display = getElementStyle(menus[1], 'display');

