function clearInput(element) {
if (element.defaultValue == element.value) element.value = '';
}

$('.add_dues').each(function() {
    var $box = $(this);
    var $chck = $box.parent().children('input');

    var getHeight = function($container) {
        //return $container.closest('li').hasClass('active') ? $container.children().outerHeight() + 10 : 0
        return $chck.is(':checked') ? $container.children().outerHeight() + 10 : 0
    };

    $box.wrapInner('<div></div>').each(function() {
        $(this).height(getHeight($(this)));
    });

    $chck.click(function() {
        h = getHeight($box);
        $box.stop(true).animate({height: h + 'px'}, 500);
        if (h == 0) {
            $box.find('input').each( function() {
                //removeAttr not working with XHTML 1.1 Strict
                //attr('checked', false) not working with XHTML 1.1 Strict
                this.checked = false;
            });
        }
    });

});

