
function submitAction(formName, actionName) {
	form = document.getElementById(formName);
	if(form) {
		var input = document.createElement("input");
		input.setAttribute("type", "hidden" );
		input.setAttribute("name", actionName );
		input.setAttribute("value", "true" );
		form.appendChild(input);

		form.submit();
	}
}

function showContent(name) {
	document.getElementById(name).style.display = 'inline';
}

function hideContent(name) {
	document.getElementById(name).style.display = 'none';
}

function switchChart(chart) {
	if (chart=='minutely') {
		showContent('minutely_chart');
		showContent('minutely_link');
		hideContent('daily_chart');
		hideContent('daily_link');
	}
	else if (chart=='daily') {
		showContent('daily_chart');
		showContent('daily_link');
		hideContent('minutely_chart');
		hideContent('minutely_link');
	}
}

function switchingDisabled(name, check) {
	element = document.getElementById(name);
	if (element) {
		element.disabled = check;
	}
}

