$("li.friend").live('click', function() {
name = $(this).text();
// if-statement checking for existence of <div> should go here
// If <div> does not exist, then append element
$("div#chatbar").append("<div class='labels'><div id='" + name + "' style='display:none;'></div>" + name + "</div>");
// Else
alert('this record already exists');
});