replaced StatCalc applet with javascript code