if (glow.isSupported == true) {
	// add a generic "hook" to html tag for enabled page:
	if (typeof document.documentElement.className == "string") {
		document.documentElement.className += " glow-enabled";
	} else {
		document.documentElement.className = "glow-enabled";
	}
}

glow.ready(function() {
	// speech dropdown
	var speechPanel = new glow.widgets.InfoPanel("#speech-menu", {
		context: "#speech",
		pointerPosition: "t",
		offsetInContext: {x: "50%", y: "80%"},
		id: "speech-dropdown-glow"
	});
	glow.events.addListener(
		'#speech',
		'click',
		function () {
			speechPanel.show();
			musicPanel.hide();
			azPanel.hide();
			return false;
		}
	);
	// music dropdown
	var musicPanel = new glow.widgets.InfoPanel("#music-menu", {
		context: "#music",
		pointerPosition: "t",
		offsetInContext: {x: "50%", y: "80%"},
		id: "music-dropdown-glow"
	});
	glow.events.addListener(
		'#music',
		'click',
		function () {
			speechPanel.hide();
			musicPanel.show();
			azPanel.hide();
			return false;
		}
	);
	// a-z dropdown
	var azPanel = new glow.widgets.InfoPanel("#az-menu", {
		context: "#az",
		pointerPosition: "t",
		offsetInContext: {x: "50%", y: "80%"},
		id: "az-dropdown-glow"
	});
	glow.events.addListener(
		'#az',
		'click',
		function () {
			speechPanel.hide();
			musicPanel.hide();
			azPanel.show();
			return false;
		}
	);
});