if (window.location.href.indexOf("account/login") === -1) {
    var pathName = "";
    if (window.location.pathname)
        pathName = "?returnUrl=" + window.location.pathname;
    var d = localStorage.getItem("ud");
    if (d === undefined || d === "failed" || d === null) {
        window.location.href = "/account/login" + pathName;
    } else {
        var model = JSON.parse(d);
        if (model === null || model === undefined) {
            window.location.href = "/account/login" + pathName;
        }
    }
    window.errorNumber;
    if (window.location.href.indexOf("404") !== -1) {
        var url = location.href.split('?');
        history.replaceState({}, null, url[0]);
        window.errorNumber = 404;
    } 
    if (window.location.href.indexOf("403") !== -1) {
        var url = location.href.split('?');
        history.replaceState({}, null, url[0]);
        window.errorNumber = 403;
    }
}