function process_reply(ajax, report)
{
	report(ajax.responseText == "OK\n");
	if(ajax.responseText != "OK\n" && ajax.responseText != "Error\n")
		alert("Server responds: " + ajax.responseText);
}

function h1_on(password, report)
{
	var ajax = ajax_post("/cgi-bin/h1-on.cgi?" + password, {}, function(ajax) { return process_reply(ajax, report); });
}

function h1_off(password, report)
{
	var ajax = ajax_post("/cgi-bin/h1-off.cgi?" + password, {}, function(ajax) { return process_reply(ajax, report); });
}

function h2_on(password, report)
{
	var ajax = ajax_post("/cgi-bin/h2-on.cgi?" + password, {}, function(ajax) { return process_reply(ajax, report); });
}

function h2_off(password, report)
{
	var ajax = ajax_post("/cgi-bin/h2-off.cgi?" + password, {}, function(ajax) { return process_reply(ajax, report); });
}
