jQuery.fn.formGroup = function(){
  return this.each(function(){
    if(jQuery(this).not('.ready')){
      var o = this;
      jQuery('input', this).each(function(){
        jQuery(this)
          .css({opacity:0, margin:0, padding:0, width:'0px', height:'0px', visibility:'hidden', overflow:'hidden'})
          .wrap( jQuery("<span class='"+((jQuery(this).is(':checked'))? 'checked' : 'unchecked')+"'></span>").css({overflow:'hidden', cursor:'pointer', font:'normal 0px/0px arial', letterSpacing:'0px', wordSpacing:'0px'}) )
          .parent().click(function(){
            var status = (jQuery('input', this).is(':checked')) ? false : true;
            jQuery('input:checkbox', this).attr('checked', status);
            if(status) jQuery('input:radio', this).attr('checked', true);
            if(jQuery('input', this).is(':radio')) jQuery('.checked', o).removeClass('checked').addClass('unchecked');
            jQuery(this).removeClass('checked').removeClass('unchecked').addClass((jQuery('input', this).is(':checked'))? 'checked' : 'unchecked');
        });
      });
      jQuery(this).addClass('ready');
    }
  });
};