﻿function CheckForUnreadNotes(caseId)
{
    CaseService.CaseHasUnreadNotes(caseId,
        function(result, context, methodName)
        {
            jQuery('.' + caseId)
                .removeClass(result.HasUnreadNotes == false ? 'button_unread_notes' : 'button_read_notes')
                .addClass(result.HasUnreadNotes == false ? 'button_read_notes' : 'button_unread_notes')
                .attr({value : result.NotesCount});

        }
    );
}

function loadNotesFrame(button, orderId, innerOrderId)
{
    button.parentNode.getElementsByTagName('iframe')[0].src = "NotesListPage.aspx?OrderId=" + orderId + "&InnerOrderId=" + innerOrderId;    
}

function loadIFrame(link, contorlId) {
    document.getElementById(contorlId).src = link;
}

function showMasterPrintCasePopup(code, id)
{   
    eval(code);
    var popup = document.getElementById(id);
    if (popup)
        popup.click();
}