/*
Author:
   Francesco Paggin - Copyright (c) 2008

What it does:
   Function to simulate :focus pseudoclass with jquery.

Usage:
   Inside a document ready event, add this: $('input').inputfocus();
   You can pass an object as parameter to specify the class to toggle:
   $('input').inputfocus({class:'myCustomClass'});
*/

(function($) {
	$.fn.inputfocus = function(options) {
		var defaults = {
			classe: 'focus'
		};
		var opts = $.extend(defaults, options);
		return this.each(function() {
			var $this = $(this);
			$this.focus(function() {
				$(this).addClass(opts.classe);
			});
			$this.blur(function() {
				$(this).removeClass(opts.classe);
			});
		});
	}
})(jQuery);