$j(function() {

	function setCount(users, guests, admins) {
		//alert('setCount()'); // for debugging
		$j('#userscount').html(users);
		$j('#guestscount').html(guests);
		$j('#adminscount').html(admins);
	}
	
	function getCount() {
		$j.ajax({
			type: "POST",
			url: '/usercounts/getcount',
			dataType: 'xml',
			success: function(msg) {
				users = $j(msg).find('users').text();
				guests = $j(msg).find('guests').text();
				admins = $j(msg).find('admins').text();
				//alert('users: ' + users + ' guests: ' + guests + ' admins: '+admins);  // for debugging
				setCount(users, guests, admins);
			}
		});
	}
	
	getCount();
});