﻿var _errorinit = false;
var _errors = "";
function raiseError(error)
{
    try
    {
        if (!_errorinit)
        {
            $('body').append("<div id='divIRError' style='position:absolute;width:2px;height:2px;background-color:red;z-index:1000;' onclick='showErrors();'/>");
            _errorinit = true;
        }
        _errors+=error+"\n";
        $('#divIRError').show();
        $.post("/LogJSError.aspx", { JSError:error, Page: location.href });
    }
    catch(ex)
    {   alert("An error occurred running scripts on this page, but logging failed."); }
}
function showErrors()
{
    if (_errors == "")
        _errors = "<no errors to display>";
    alert(_errors);
    _errors = "";
    $('#divIRError').hide();
}