(function($){$.fn.j3ssw=function(j){var k=this;var l=jQuery.extend({index:0,status:false,def:"j3sswdef",off:"j3sswoff",on:"j3sswon",mode:2,callback:function(a,b,c,d){}},j||{});return this.each(function(){var e=$(this);var f=l.def;var g;var h;var i;e.find(":radio").click(function(){var a=(h==$(this).val());var b=(i.attr("checked"));switch(l.mode){case 1:break;case 2:if(a){i.click()};break;case 3:if(a){if(!b){i.click()}else{$(this).removeAttr("checked");i.removeAttr("checked")}}else{$(this).attr("checked",true);i.removeAttr("checked")};break}g=e.find(":radio").filter(":checked");h=g.val();update($(this))});k.getStatus=function(){return i.attr("checked")};k.getSelection=function(){return h};function update(a){var b=a.attr("id");var c=(h==a.val());var d=(i.attr("checked"));switch(l.mode){case 1:f=c?l.on:f;break;case 2:f=c?(d?l.off:l.on):f;break;case 3:f=c?(d?l.off:l.on):l.def;break}e.find("label").removeClass(l.on).removeClass(l.off).removeClass(l.def);e.find("label[for!='"+b+"']").addClass(l.def);e.find("label[for='"+b+"']").addClass(f);l.callback(h,i.attr("checked"),e.attr("id"),k)}e.prepend('<input type="checkbox">');e.find("input").css({"position":"absolute","top":"-99999px","left":"-99999px"});e.find("label").addClass(l.def);e.find("label").hover(function(){$(this).css("cursor","pointer")},function(){$(this).css("cursor","default")});i=e.find(":checkbox").attr("checked",l.status);g=e.find(":radio").eq(l.index).attr("checked",true);h=g.val();update(g)})}})(jQuery);