function ArtistFanSet( artist_id, set ) {

	var data = {
		m: 'artist_view',
		rpc: 'fan_set',
		artist_id: artist_id,
		set: set
	}

	$.post ( '/index.php', data, function( data ) {
			var r = data.split(',');
			var count = r[0];
			var status = r[1];

			if ( count == 0 ) {
				$('#artist-fans h4').html ( 'Fans' );	
			} else if ( count == 1 ) {
				$('#artist-fans h4').html ( 'One Fan' );	
			} else {
				$('#artist-fans h4').html ( count + ' Fans' );	
			}

			if ( status == 1 ) {
				$('#FanCount').html ( 'You are a Fan - <a href="javascript:void(0);" onclick="ArtistFanSet(' + artist_id + ',-1);">Undo</a>' );	

				if ( $('#artist-fan-user').length == 0 ) {
					$('#artist-fans ul').prepend ( '<li id="artist-fan-user"></li>' );
					$('#artist-fan-user').load ( '/artist_view?rpc=artist_fan_user' );
				}

			} else {
				// removed

				if ( $('#artist-fan-user').length > 0 ) {
					$('#artist-fan-user').fadeOut (250, function () { $('#artist-fan-user').remove(); } );
				}

				$('#FanCount').html ( '<a href="javascript:void(0);" onclick="ArtistFanSet(' + artist_id + ',1);">Become a Fan</a>' );
			}
			
		});
	
}

