function link_view(form_id, destination) 
{
    $("#loading_bar").addClass("loading-show");
    $.ajax({
        type: "GET",
        enctype: 'multipart/form-data',
        url: destination,
        success: function (ret) {
            var data = JSON.parse(ret); 
            var view = data['view'];
            $("#iframe_" + form_id).html(view);
            $("#loading_bar").removeClass("loading-show");
        },
        error: function (e) {
            $("#loading_bar").removeClass("loading-show");
            error(e.responseText);
        }
    });

    $("#modal_view_" + form_id).modal("show");
}

function close_view(form_id) 
{
    $("#modal_view_" + form_id).modal("hide");
}

function link_search() 
{
    $("#modal_advanced_search").modal("show");
}

function close_search() 
{
    $("#modal_advanced_search").modal("hide");
}