function showAlerts()
{
	var xhr;
	try
	{
		xhr = new XMLHttpRequest();
	} catch (error)
	{
		try
		{
			xhr = new ActiveXObject('Microsoft.XMLHTTP');
		} catch (error)
		{
			xhr = null;
		}
	}
	
	if (xhr != null)
	{
	    var query = '?site=';

	    if (window.location.pathname.toLowerCase().indexOf('/empac') >= 0 ) {
		    query += 'empac';
		} else if (window.location.pathname.toLowerCase().indexOf('/isis') >= 0 ) {
		    query += 'isis';
		} else if (window.location.pathname.toLowerCase().indexOf('/it') >= 0 ) {
		    query += 'it';
		}

		
		xhr.open('GET', 'http://www.uml.edu/it/alerts/alertsxml.aspx' + query, true);

		xhr.onreadystatechange = function()
		{
			if (xhr.readyState == 4)
			{
				if (xhr.status == 200 || xhr.status == 304)
				{
                    var alerts = xhr.responseXML.getElementsByTagName('alert');
                    if (alerts.length <= 0) 
                    {
                        var elem, vis;  
                        if( document.getElementById ) 
                            elem = document.getElementById('results');  
                        else if( document.all ) 
                            elem = document.all['results'];  
                        else if( document.layers ) 
                            elem = document.layers['results'];  
                        vis = elem.style;
                        vis.display = 'none';
                        return;
                    }
                    var html = ('<h3>Alert</h3>');
                    for (var i = 0; i < alerts.length; i++)
                    {
                        html += ('<div class="alert">' + alerts[i].firstChild.nodeValue + '</div>');
                    }
                    document.getElementById('results').innerHTML = html;
				} else
				{
					alert("Error: " + xhr.status);
				}
		    } else {
		    }
		};
		xhr.send(null);
	}
}

window.onload = showAlerts;