var xmlhttp = new XMLHttpRequest();
var first_num = null;
var second_num = null;
var sign = null;
var start = true;
var tohca_num = null;
var nol_num = null;
var rav_num = null;
function operations(sign) {
start = true;
if (sign != "=")
window.sign = sign;
if (first_num == null) {
first_num = document.main.click.value;
document.main.click.value = press(num);
} else if (second_num == null) {
second_num = document.main.click.value;
Send();
}
first_num = null;
second_num = null;
sign = null;
tohca_num = null;
}
function nol(click) {
if (start) {
nol_num = press(num);
start = false;
}
document.main.click.value = document.main.click.value + click;
}
function press(num) {
if (start) {
document.main.click.value = "";
start = false;
}
document.main.click.value = document.main.click.value + num;
}
function clean() {
start = true;
if (document.main.click.value == "") {
document.main.click.value = "0";
}
document.main.click.value = "0";
second_num = null;
first_num = null;
tohca_num = null;
sign = null;
}
function point() {
tohca_num = document.main.click.value;
if (start) {
tohca_num = "0.";
start = false;
} else if (tohca_num.indexOf(".") == -1) {
tohca_num += (".");
}
document.main.click.value = tohca_num;
}
function del() {
var i = document.main.click.value;
document.main.click.value = i.substring(0, i.length - 1);
if (document.main.click.value == "") {
document.main.click.value = "0";
}
}