﻿// JScript File
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

//Javascript Print based on element Id
function JSPrint(strid)
{
    var txtContent, WinPrint;
    txtContent = document.getElementById(strid);
    WinPrint =window.open('','','left=0,top=0,width=600,height=500,toolbar=0,scrollbars=0,status=0');
    WinPrint.document.open(txtContent.outerHTML);
    WinPrint.document.write('<html><head><title>Printing</title>');
    WinPrint.document.write('<link href="Styles/print.css" rel="stylesheet" type="text/css" />');
    WinPrint.document.write('</head><body>');
    WinPrint.document.write(txtContent.outerHTML);
    WinPrint.document.write('</body></html>');
    WinPrint.document.close();
    WinPrint.focus();
    WinPrint.print();
    WinPrint.close();
}

//Supress ajax error popup. All errors are being logged to the database and Local C Drive
//See CaseSearch.Master.CS function ScriptManager1_AsyncPostBackError
function EndRequestHandler(sender, args)
{
    if (args.get_error() != undefined)
    {
        args.set_errorHandled(true);
        //location.reload(true);
    }
}

function load() 
{
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}


