$(document).ready(function()
{
    $.setAjaxForm('#startForm', function(response)
    {
        if(response.confirm)
        {
            if(confirm(response.confirm))
            {
                $('#doStart').val('yes');
                $('#startForm').submit();
            }
            return false;
        }
        else if(response.callback)
        {
            var rcall = window[response.callback];
            if($.isFunction(rcall))
            {
                param = response.callback_params ? response.callback_params : '';
                if(rcall(param) === false) return false;
            }
        }
        else if(response.result == 'success')
        {
            setTimeout(function(){location.href = response.locate;}, 1200);
        }

        return false;
    })
})
