$(document).ready(function()
{
    $.setAjaxForm('#createForm', function(response)
    {
        if(response.result == 'fail' && response.error !== undefined)
        {
            bootbox.alert(response.error);
            return false;
        }
        else
        {
            if(response.locate) setTimeout(function(){location.href = response.locate;}, 1200);    
        }
    })

    $('#createAddress').click(function()
    {
        $('#newAddress').css('border-left-color', '#d6dae3').css('border-radius', '4px 0 0 4px');
    })

    $('.input-group').each(function()
    {
        if($(this).find('.input-group-addon').length == 1) $(this).find('.input-group-addon').css({'border-left' : '1px solid #d6dae3', 'border-right' : '1px solid #d6dae3'});
    });
})
