$(document).ready(function()
{
    $('#depositor').change(function()
    {
        $.get(createLink('trade', 'ajaxGetCurrency', 'depositorID=' + $(this).val()), function(currency)
        {
            if(!currency) return false;

            var exchangeRate = currency == v.mainCurrency ? 1 : '';
            $('#currency').val(currency);
            $('#currencyLabel').val(currency);
            $('.exchangeRate').val(exchangeRate).toggle(currency != v.mainCurrency);
        });
    });

    $('.exchangeRate').hide();

    if(v.type == 'redeem')
    {
        $('tr.category').show();
        $('tr.investList').show();
        $('tr.trader').hide();
    }
    else
    {
        $('tr.category').hide();
        $('tr.investList').hide();
        $('tr.trader').show();
    }
});
