﻿Sys.Application.add_init(AppInit);
var divElem = 'ShoutboxErrorDiv';
 
function AppInit(sender) {
  Sys.WebForms.PageRequestManager.getInstance().add_endRequest(End);
}

function End(sender, args) {
    var error = false;
    
    if (args.get_error() != null) {
        ToggleAlertDiv('visible', 'Shoutbox-Verbindung verloren!<br />Versuche neu zu verbinden...');                
        args.set_errorHandled(true);         
    } else {
        ToggleAlertDiv('hidden', '');
    }
}

function ToggleAlertDiv(visString, text)
{
     var adiv = $get(divElem);
     adiv.style.visibility = visString;
     adiv.innerHTML = text;
}


