
function initPage() {
    resizeParentIframe('messagePage', window);
    scrollParentToTop();
}

function validateCheckBox(elmt) {
    var total = 0;
    //var composeBtn = document.getElementById("ComposeBtn");
    var replyBtn = document.getElementById("ReplyBtn");
    var replyAllBtn = document.getElementById("ReplyAllBtn");
    var forwardBtn = document.getElementById("ForwardBtn");
    var deleteBtn = document.getElementById("DeleteBtn");

    total = $('#PatientMessageList input[type=checkbox]:checked').length;
    
    // Enable/Disable all botton except Delete when more than one checkbox was selected
    //if (composeBtn != null) {
    //    composeBtn.disabled = (total > 1);
    //}
    if (replyBtn != null) {
        replyBtn.disabled = (total != 1);
    }
    if (replyAllBtn != null) {
        replyAllBtn.disabled = (total != 1);
    }
    if (forwardBtn != null) {
        forwardBtn.disabled = (total != 1);
    }
    // DeleteBtn
    if (deleteBtn != null)
        deleteBtn.disabled = (total == 0);
}


// Ready function to trigger simplePagination.js plugin
$(function () {
    var currentPag = parseInt($('#CurrentPageValue').val());
    if (currentPag <= 0)
        currentPag = 1;
    var totalPages = parseInt($('#TotalPagesValue').val());
    //if (totalPages > 1) {                                       // Only show when there is more than one page
    $('.pagination-page').pagination({  // simplePagination.js plugin
        pages: totalPages,
        currentPage: currentPag,
        cssStyle: 'light-theme',
        onPageClick: function (pageNumber) {                // When page button is clicked
            $('#CurrentPageValue').val(pageNumber);         // Set current page for server side changes
            $("#PageClickButton").trigger('click');	        // AX-24898.24919.2 $("#PageClickButton").click();                  // Trigger click buttom
        }
    });
    //}
});
