$( function() {

	$(document).bind( "userBusy", function() {
		$("#session-login").busy();
		$("#session-welcome-logout").busy();
	} );
	
	$(document).bind( "userUnbusy", function() {
		$("#session-login").unbusy();
		$("#session-welcome-logout").unbusy();
	} );
	
	$(document).bind( "userLoggedIn", function() {
		$("#session-login").hide();
		$("#session-welcome img.avatar").attr( "src", Plastic.User.avatar_url );
		$("#session-welcome-username").text( Plastic.User.username );
		$("#session-welcome").show();
	} );
	
	$(document).bind( "userLoggedOut", function() {
		$("#session-welcome-username").text("");
		$("#session-welcome").hide();
		$("#session-login").show();
	} );
	
} );
