﻿var intId, textIdx=0;
function showAnimation()
{
	var aniSt = new Array("computing.", "computing..", "computing...", "computing....", "computing.....");
	document.getElementById('resultBox').value=aniSt[(textIdx++)%5];
	if (textIdx%20==0)
	{
		window.clearInterval(intId);
		var st = document.getElementById("inputBox").value;
		document.getElementById("resultBox").value = "|x|<0 ⇒ " + st;
	}
}

function doCompute(){ intId=self.setInterval("showAnimation()",200); }
function inputText(st){	document.getElementById("inputBox").value = st; }