$(function() {
    $("#bk_assistlinks dd:eq(1)").hide();
	$("#allowed_xhtml").wrap('<a href="#"></a>').click(function() {
		$("#bk_assistlinks dd:eq(1)").slideToggle("normal");
		return false;
	});
	
	$(".emote_list img").click(function() {
        emote($(this).attr("title"));
 	});

	$("#selectallid").click(function() {
        if ($(this).attr("checked") == true) {
        	$(":checkbox").attr("checked", "checked");
        }
		else {
            $(":checkbox").removeAttr("checked");
  		}
 	});
 	
 	$(".emote_list a").click(function() {
        $(".bk_label img:eq(0)").attr("src", $("img", this).attr("src"));
		$("input#shortcut").val($("img", this).attr("alt"));
		$("input[@name=emote_id]").val($("img", this).attr("id").substring(5));

		
		return false;
	});
});

function emote (smilie) {
	$("#comment").val($("#comment").val() + smilie);
    $("#comment").focus();
}
