/* We need the idw namespace to be set up and everything the feedback does goes
into the user_feedback sub-namespace. */
idw.insertdocsintopage = {};


idw.insertdocsintopage.display_doc_callback= function(data_in, status, xmlrequest)
{
    var data = data_in['data'];
   $('#' + data.target).html(data.data).show();
   $('#' + data.target).css('border-color', '#DBDDE9').css('border-width','2px').css('border-style', 'solid').css('padding', "5px");
};

idw.insertdocsintopage.display_inline_doc = function(document_type, document_id)
{
    if ($('#'+document_id).html() === "")
    {
        $('#h'+document_id).html("&#x25B2;");//BLACK UP-POINTING TRIANGLE
        id=document_id.substr(document_id.search('_')+1);
        var ud_dict = {
            'document_type': document_type,
            'document_id': id,
            'lang': idw.lang,
            'target': document_id
            };
    
        $.post("/objects/document_access/get_data", JSON.stringify(ud_dict),
            idw.insertdocsintopage.display_doc_callback, "json");
    }
    else
    {
        $('#'+document_id).html("").hide();
        $('#h'+document_id).html("&#x25BC;");//BLACK DOWN-POINTING TRIANGLE
    };
};


