var App_SideBlockForms = { init: function(items, element) { $('#' + current(items)).show(); var obj = this; $('input[name=' + element + ']').click(function() { obj.hideItems(items); $('#' + $(this).val()).show(); }); }, hideItems: function(items) { for (var key in items) { $('#' + items[key]).hide(); } } };