// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var myglobal;

function showGraph(graphName)
{
	// get all performance graphs
	var x = document.getElementsByClassName('performance-graph');
	// make them invisible
	for (var i = 0; i < x.length; ++i ) {
		x[i].style.display = 'none';
	}
	// show the one we want
	document.getElementById(graphName).style.display = 'block';
	
	selectGraphTab(graphName);
}

function selectGraphTab(tabName) {
	// get graph tabs container
	x = document.getElementById('graphTabs').childNodes;
	// iterate through it's child nodes
	for (var i = 0; i < x.length; ++i) {
		var tab = tabName + "_graphTab";
		if (x[i].id == tab) {
			x[i].className = 'selectedTab';
		} else {
			x[i].className = 'normalTab';
		}
	}
}
