$(document).ready(function()
{
    if(typeof v.module !== 'undefined')
    { 
        $('#mainNavbar .nav li').removeClass('active');
        if(config.requestType == 'GET')
        {
            $('#mainNavbar .nav li a[href*=' + config.moduleVar + '\\=' + v.module + '\\&' + config.methodVar + '\\=browse]').parent('li').addClass('active');
        }
        else
        {
            $('#mainNavbar .nav li a[href*=' + v.module + '-browse-]').parent('li').addClass('active');
        }
    }
})

function loadPrevData($selector, dataID = 0, element = 'tr')
{
    var prev   = $selector.data('prev');
    var next   = $selector.data('next');
    var action = $selector.data('action');
    var field  = $selector.data('field');
    if(dataID == 0) dataID = $selector.data('dataid');

    $('.prevData.' + prev).remove();

    /* Must use flow as module name here because the function ajaxGetPrevData is not a action of a flow. */
    var link = createLink('flow', 'ajaxGetPrevData', 'prev=' + prev + '&next=' + next + '&action=' + action + '&dataID=' + dataID + '&element=' + element);
    $.get(link, function(prevData)
    {
        if(!prevData) return false;

        $selector.after(prevData);
    });
}
