

function calculate(f){
	var selNum = f.valitud.selectedIndex;
	var selText = f.valitud.options[selNum].text;
	var c = document.valuuta.eek.value;
	var b;
	
	if (selText == "USD")
		b = Math.round(c / 10); 
	else if (selText == "EUR") 
		b = Math.round(c / 15.6); 
	else if (selText == "GBP")
		b = Math.round(c / 22.0); 
	else if (selText == "LVL")
		b = Math.round(c / 22.0);
	else if (selText == "RUB")
		b = Math.round(c * 0.43);	
	else 
		b = Math.round(c / 1.67); 
			
	document.valuuta.sum.value = selText + " " + b;
}


function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}