/*
function calcCurrencyCount(form){
	var Table = document.getElementById("TableExchange");
	
	var i1 = form.currency1.value;
	var i2 = form.currency2.value;
	
	var a = (i1 != 0) ? Table.rows[i1].cells[1].innerText : 1
	var b = (i2 != 0) ? Table.rows[i2].cells[1].innerText : 1
	
	form.value2.value = form.value1.value * (a / b);
}
*/
function calcNotaryTax(form){
	var val = parseFloat(form.value1.value);
	if(!isNaN(val)){
		var tax = 30;
		
		if(val > 100 && val <= 1000)
			tax = 30 + (val - 100) * 0.015;
		else if(val > 1000 && val <= 10000)
			tax = 43.50 + (val - 1000) * 0.013;
		else if(val > 10000 && val <= 50000)
			tax = 160.50 + (val - 10000) * 0.008;
		else if(val > 50000 && val <= 100000)
			tax = 480.50 + (val - 50000) * 0.005;
		else if(val > 100000 && val <= 500000)
			tax = 730.50 + (val - 100000) * 0.002;
		else if(val > 500000) tax = 1530.50 + ((val - 500000) * 0.001 < 6000 ? (val - 500000) * 0.001 : 6000);
		
		tax = tax * 1.2;
		form.value3.value = tax;
		
		var not_taxa2 = val * 0.025;
		form.value2.value = not_taxa2;

		var taxa5 = 10; //taxa vpisvane
		if(val > 5000)
			taxa5 = val * 0.001;

		form.value5.value = taxa5;
			
		form.value4.value = tax + not_taxa2 + taxa5; //other taxes
	}else{
		form.value2.value = 
		form.value3.value =
		form.value4.value = 
		form.value5.value = " ";
	}
}
