﻿function printPartOfPage(elementId) {
    var printContent = document.getElementById(elementId);
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

    printWindow.document.write(printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();
}

function printPartOfPage2(elementId) {
    var printContent = document.getElementById(elementId);
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

    var PrintHeader = '<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" /></head><body>';
    var PrintFooter = '</body></html>';

    printWindow.document.write(PrintHeader);
    printWindow.document.write(printContent.innerHTML);
    printWindow.document.write(PrintFooter);


    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();
}

function pop(theURL) {
    window.open(theURL, 'MdkmN', 'width=800,height=600,scrollbars=yes');
}

function pop_600x600(theURL) {
    window.open(theURL, 'MdkmN', 'width=600,height=600,scrollbars=yes');
}

function CalcKeyCode(aChar) {
    var character = aChar.substring(0, 1);
    var code = aChar.charCodeAt(0);
    return code;
}

function checkNumber(val) {
    var strPass = val.value;
    var strLength = strPass.length;
    var lchar = val.value.charAt((strLength) - 1);
    var cCode = CalcKeyCode(lchar);

    if (cCode < 48 || cCode > 57) {
        var myNumber = val.value.substring(0, (strLength) - 1);
        val.value = myNumber;
    }
    return false;
}
