(function($){
 $.fn.idle = function(time)
  {
      var o = $(this);
      o.queue(function()
      {
         setTimeout(function()
         {
            o.dequeue();
         }, time);
      });
  };

 $.fn.hintbox = function() {
    var current_hint = false;
    return this.each(function() {
        iname = $(this).attr('name');
        
        $('#'+iname+'-info').click(function(){
            current_hint = $('#'+$(this).attr('hint'));
            current_hint.fadeIn('slow');
            return false;
        });
        $(document).click(function(){
            if(current_hint){
                current_hint.fadeOut();
                current_hint = false;
            }
        });

        /*$(this).focus(function(){
            name = $(this).attr('name');
            $('#'+name+'-hint').fadeIn('slow');            
        });*/
        $(this).blur(function(){
            name = $(this).attr('name');
            $('#'+$(this).attr('name')+'-hint').fadeOut('slow');
        });
    });
 };
})(jQuery);

