	$(document).ready(function(){
		timestamp2 = 0;
		counter = 0;
		delay = 4000;
		text = 0;
		updateMsg2();
	});

	function addMessages2(xml) {

		if($("status",xml).text() == "2") {		
			//$("#messagewindow").append(">").fadeIn('slow');
			return;
		} // end if

		timestamp2 = $("time",xml).text();
		var str = $("msg",xml).text();
		str = str.replace("##", "&");

		text = '<span class=shoutout><img src="./images/alert_icon.jpg" width=15 align=left> ' + str + '</span><br>';
		//text = str + '<br>';

		$("message",xml).each(function() {
			//message = $("message",xml).get(i);
			$("#shoutout").append(text).fadeIn('slow');
		});

	} // end addMessages


	function updateMsg2() {
		
		//if (timestamp == 0) {

			$.get("./xml/xmlMessages.php",{ time: timestamp2 }, function(xml) {
				addMessages2(xml);
			});
			
			counter += 1;
			
			if (counter == 10) {

				delay = delay * 2;

				if (delay >= 60000) {
					delay = 60000;
				} // end if

				counter = 0;

			} // end if
			
			setTimeout('updateMsg2()', delay);

		//} // end if

	} // end updateMsg

