﻿function printPage(elementId) {
    var printContent = document.getElementById(elementId);
    var printWindow = window.open('', '', 'left=50000,top=50000,width=0,height=0');
    printWindow.document.write(printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();
}
function PrintDetails(ordernumber) {
    var noCache = new Date();
    $.ajax({
        type: 'get',
        url: 'LoadDetail.aspx',
        data: 'id=' + ordernumber + '&noCache=' + noCache.toString(),
        success: function(msg) {
            $('#loadDetail').dialog('destroy'); //dialog plugin's bug. need to be destroyed first
            $('#loadDetail').html(msg);
            $('#loadDetail').hide();
            printPage('loadDetail');
        }
    });
}

