var _notifyTimer = null;

function NotificationListener(xml) {
	//alert("OK so far");
	$(xml).find('notifications').find('notification').each(function() {
		
		//alert($(this).text());
		
		var n_data = new Array();
		 
		 var n_action = $(this).find('n_action').text();
		 $(this).find('n_data').each(function() {
			n_data.push($(this).text());
		 });
		 var action_str = n_action+"(n_data)";
		
		//alert(action_str);
		
		eval(action_str);
	});
}

function NotificationAlert(notification_text) {
	if (notification_text !== undefined) {
		$("#notification_alert").html(notification_text);
		$("#notification_alert").slideDown('fast');
		_notifyTimer = setTimeout("hideNotification()",5000);
	}
}

function hideNotification() {
	$("#notification_alert").slideUp('fast');
}
