;(function($){
    $.fn.selectBox = function(){
        with ($(this)) 
        {
            with (find('ul')) 
            {
                find('li').click(function() {
                    $(this).parent().prev().val($(this).text());
                });
                slideUp("fast");
            }
        
            var btn = parent();
            
            $(document).click(function(e){
                if(e.target.id == find('input').attr('id'))
                {
                    with (find('ul')) 
                    {
                        //css('top', parent().position().top + parent().height() - 2);                    
                        slideToggle("fast");
                    }  
                }
                else
                {
                    with (find('ul')) 
                    {                
                        slideUp("fast");
                    } 
                }
            });
        }
    }
})(jQuery);