jQuery(function(a){a(document).on("totalpoll.after.ajax",function(c,b){b.container.find(".totalpoll-choice-checkbox:checked").closest(".totalpoll-choice").addClass("totalpoll-choice-selected")});a(document).delegate(".totalpoll-view-vote .totalpoll-choice-checkbox","change",function(){var d=a(this);var b=d.closest(".totalpoll-choice");var c=d.closest(".totalpoll-poll-container");if(d.prop("checked")===true){if(d.attr("type")=="radio"){c.find(".totalpoll-choice-checkbox").prop("checked",false);c.find(".totalpoll-choice").removeClass("totalpoll-choice-selected")}b.addClass("totalpoll-choice-selected");d.prop("checked",true)}else{b.removeClass("totalpoll-choice-selected");d.prop("checked",false)}})});