function camfex_convert()
{
    var box = document.getElementById('oCamfexRate');
    if (document.getElementById('oCamfexDoSell').checked) {
        vRate = aCamfexRatesSell[box.options[box.selectedIndex].value];
        vAmount = Number(document.getElementById('oCamfexAmount').value) / aCamfexAmounts[box.options[box.selectedIndex].value];
        vResult = vRate * vAmount;
        vResult = Math.round(vResult * 100) / 100;
        document.getElementById('oCamfexResult').innerHTML = '<b>' + vResult + ' CZK</b>';
    } else if (document.getElementById('oCamfexDoBuy').checked) {
        vRate = aCamfexRatesBuy[box.options[box.selectedIndex].value];
        vAmount = Number(document.getElementById('oCamfexAmount').value) / aCamfexAmounts[box.options[box.selectedIndex].value];
        vResult = vRate * vAmount;
        vResult = Math.round(vResult * 100) / 100;
        document.getElementById('oCamfexResult').innerHTML = '<b>' + vResult + ' CZK</b>';
   }
}
