function calcVi(x, y) {
	var a, b, n, d, h;

	if(y < 20) {
		a = Math.log(y);
		b = 1.0727 + 0.6175 * a + 0.9744 * Math.pow(a, 2) - 0.3764 * Math.pow(a, 3) + 0.04824 * Math.pow(a, 4);
		n = (b - Math.log(x)) / a;
		d = 100 + (Math.pow(10, n) - 1) / 0.00715 + 0.5;
		d = parseInt(d + 0.5);
	}
	else {
		h = 1795.2 / Math.pow(y, 2) + 0.1818 * Math.pow(y, 2) + 10.357 * y - 54.547;
		n = ((Math.log(h) / Math.log(10)) - (Math.log(x) / Math.log(10))) / (Math.log(y) / Math.log(10));
		d = ((Math.pow(10, n) - 1) / 0.00715) + 100;
		d = parseInt(d + 0.5);
	}

	return d;
}

function calcKv100(x, y) {
	var a;
	a = x * (7.16 * y - 49.04) / 10000 + 0.989 * Math.log(y) + 0.135;
	a = parseInt(a * 100 + 0.5) / 100;
	return a;
}

function calcKv40(x, y) {
	var a, b, d;
	a = Math.log((0.00715 * (x - 100)) + 1) / Math.log(10);
	b = Math.log(y);
	d = Math.exp((-a * b) + 1.0727 + (0.6175 * b) + (0.9744 * Math.pow(b, 2)) - (0.3764 * Math.pow(b, 3)) + (0.04824 * Math.pow(b, 4)))
	d = parseInt(d * 10 + 0.5) / 10;
	return d;
}
