/* ########## radioCheckbox (copyright e2see.de) ##########
<script>
$(document).ready(function(){
    $('.checkbox > input[type="checkbox"]').each(function(){
        $(this).styledCheckbox_connect();
    });

    $('.radio > input[type="radio"]').each(function(){
        $(this).styledRadio_connect();
    });
});
</script>
*/

$.fn.styledCheckbox_connect = function(){

    var thisOb = this;
    if(thisOb.parent().is('.checkbox')){
        var par = thisOb.parent();

        if($(this).is(':checked')){
            par.addClass('checked');
        }else {
            par.removeClass('checked');
        }

        thisOb.on('change', function(){
            if($(this).is(':checked')){
                $(this).parent().addClass('checked');
            }else {
                $(this).parent().removeClass('checked');
            }
        });
    }
    return thisOb;
}

$.fn.styledRadio_connect = function(){

    var thisOb = this;
    if(thisOb.parent().is('.radio')){
        var par = thisOb.parent();

        if($(this).is(':checked')){
            par.addClass('checked');
        }else {
            par.removeClass('checked');
        }

        thisOb.on('change', function(){

            if($(this).is(':checked')){
                $(this).parent().addClass('checked');
            }else {
                $(this).parent().removeClass('checked');
            }
            if($(this).closest('form').length == 1){
                // falls andere im gleichen form sind
                $(this).closest('form').find('input[type="radio"][name="'+ $(this).attr('name') +'"]').each(function(){
                    if($(this).is(':checked')){
                        $(this).parent().addClass('checked');
                    }else {
                        $(this).parent().removeClass('checked');
                    }
                });
            }

        });
    }
    return thisOb;
}





/* cdn 25ms */