﻿String.prototype.startsWith = function (str) {
    return this.indexOf(str) == 0;
};

function SetPageTitle(title) {
    document.title = title;
}

function WLError(msg) {

    
    $.ajax({
        url: '/JSError.aspx?rnd=' + Math.random(),
        type: 'POST',
        data: msg,
        error: function (obj, txt) {
            
            window.location = '/Error.aspx';
        },
        success: function (ret) {
            window.location = '/Error.aspx';
        }
    });
}

function WLAjaxError(jqXHR, textStatus, errorThrown) {
    WLError("txt=" + textStatus + "     errorThrown=" + errorThrown);
}

function imposeMaxLength(Object, MaxLen) {
    return (Object.value.length <= MaxLen);
}

function DisableButton(btn) {
    setTimeout(function () { btn.disabled = true; }, 0);
}



