/*
 * jQuery Form Info Plugin 1.0.0
 * Show info element related to a form field on focus.
 *
 * e.g.
 *  $('.info').info();
 *
 * Copyright (c) Luis Sancho (http://www.luissancho.com), 2009.
 * Dual-licensed under the BSD (BSD-LICENSE.txt) and GPL (GPL-LICENSE.txt)
 * licenses.
 */
(function($)
{
    $.fn.info = function()
    {
        return this.each(function()
        {
            var $info = $(this);
            var $elem = $('*[@name=' + $info.attr('rel') + ']');
            
            $elem.bind('focus', function()
            {
                $info.fadeIn('fast');
                $(this).addClass('info_input');
            });

            $elem.bind('blur', function()
            {
                $info.fadeOut('fast');
                $(this).removeClass('info_input');
            });
        });
    }
})(jQuery);