var MUTES = {}; $(".mute").live("click", function(){ $(this).removeClass("mute"); $(this).addClass("unmute"); $(this).html("o"); var nick = $(this).parent().children("a").html().replace(/]+>/,""); $(".nick_" + nick).hide(); MUTES[nick] = true; }); $(".unmute").live("click", function(){ $(this).removeClass("unmute"); $(this).addClass("mute"); $(this).html("x"); var nick = $(this).parent().children("a").html().replace(/]+>/,""); $(".nick_" + nick).show(); delete MUTES[nick]; }); function buildUserDiv(user) { var muted = MUTES[user.nick] ? 'o' : 'x'; if (user.avatar) { return ''; } else { return ''; } }