$.fn.inputExample = function(options) {

        var defaults = 
		{
            textColorBefore:	'#aaa',
			textColorAfter:		'#000',
			area:				'input[type=text]'
			
		};
		var options = $.extend(defaults, options);	// generuje odpowiednie rekordy ze zmiennej default
	
function switchText()
{
	if ($(this).val() == $(this).attr('title'))
	{
		$(this).val('').css('color', options.textColorAfter);
		}
	else if ($.trim($(this).val()) == '')
	{
		$(this).css('color',options.textColorBefore).val($(this).attr('title'));
	}
}

$(options.area + '[title!=""]').each(function() {
	if ($.trim($(this).val()) == '') $(this).val($(this).attr('title'));
	if ($(this).val() == $(this).attr('title')) $(this).css('color',options.textColorBefore);
}).focus(switchText).blur(switchText);

$('form').submit(function() {
	$(this).find(options.area + '[title!=""]').each(function() {
		if ($(this).val() == $(this).attr('title')) $(this).val('');
	});
});		

}
