﻿// JScript File
   onerror = handleErrors;
   
   var msg = null
    function handleErrors(errorMessage, url, line)
    {
        msg = "Something unexpected has happened on this page.\n\n";
        msg += "It is possible that this page may not display\n";
        msg += "properly as a result.\n";
        msg += "Click OK to continue.\n\n";
        msg += "Problem: " + errorMessage + "\n";
        msg += "URL: " + url + "\n";
        msg += "Line #: " + line;
        alert(msg);
        return true
    }
    function kuh(btn)
    {
        // process only the Enter key
        if (event.keyCode == 13)
        {
            // cancel the default submit
            event.returnValue=false;
            event.cancel = true;
            // submit the form by programmatically clicking the specified button
            btn.click();
        }
    }

    function open_win(sUrl)
    {
        var p = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0";
        var w = window.open(sUrl,"_blank",p);
    }
    function open_win_fs(sUrl)
    {
        var p = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,left=0,top=0,resizable=1,copyhistory=0,width=" + (screen.availWidth - 20).toString() + ",height=" + (screen.availHeight - 60).toString();
        var w = window.open(sUrl,"_blank",p);
    }
    function open_win_modeless(sUrl)
    {
        var p = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=" + screen.availWidth + ",height=" + screen.availHeight;
        var w = window.showModelessDialog(sUrl,"_blank",p);
    }
    function popup_page(sUrl)
    {
        var p = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=600,height=600";
        var w = window.open(sUrl,"_blank",p);
    }
    function open_info(sUrl,ht,wid)
    {
        var p = "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width="+wid+",height="+ht;
        var w = window.open(sUrl,"_blank",p);
    }

    function showpic_nw(filltype)
    {
        var x="showpic.aspx?FillType=" + filltype;
        window.open(x,'_blank','height=500, width=500, status=yes, toolbar=no, menubar=no, location=no, directories=no, titlebar=no');
    }

function LTrim(str) { 
     for (var k=0; k<str.length && str.charAt(k)<=" " ; k++) ;
     return str.substring(k,str.length);
}
function RTrim(str) {
     for (var j=str.length-1; j>=0 && str.charAt(j)<=" " ; j--) ;
     return str.substring(0,j+1);
}
function Trim(str) {
     return LTrim(RTrim(str));
}    
