(function( options ){

  $.fn.validNormal = function(options) {

        var defaults = 
		{
			NegMessage:			'NO',
			PosMessage:			'OK',
			PosClassName:		'positive',
			responseIn:			'div',
			regular:			'^[a-¿A-¯0-9.-_!@\#\$\%\^\&\*\(\)]{5,20}$',
			type:				'normal'
			
		};
		var options = $.extend(defaults, options);	// generuje odpowiednie rekordy ze zmiennej default

 
		this.keyup(function(){
				var regular = new RegExp(options.regular);
				var check = $(this).val();
				if (!regular.test(check)) 
				{
					$(options.responseIn + "." + $(this).attr('name')).html(	options.NegMessage	);
					$(options.responseIn + "." + $(this).attr('name')).removeClass(	options.PosClassName	);
				}
				else 
				{
				$(options.responseIn + "." + $(this).attr('name')).html(	options.PosMessage	);
				$(options.responseIn + "." + $(this).attr('name')).addClass(	options.PosClassName	);
				}
		});
  };
  
  
   $.fn.validPass = function() {

        var defaults = 
		{
			NegMessage:			'NO',
			PosMessage:			'OK',
			PosClassName:		'positive',
			responseIn:			'div',
			checkWith:			'input[name=pass]'
			
		};
		var options = $.extend(defaults, options);	// generuje odpowiednie rekordy ze zmiennej default

  
		this.keyup(function(){	
				var checkWith = $(options.checkWith).val();
				var check = $(this).val();
				if (check != checkWith) 
				{
					$(options.responseIn + "." + $(this).attr('name')).html(	options.NegMessage	);
					$(options.responseIn + "." + $(this).attr('name')).removeClass(	options.PosClassName	);
				}
				else 
				{
				$(options.responseIn + "." + $(this).attr('name')).html(	options.PosMessage	);
				$(options.responseIn + "." + $(this).attr('name')).addClass(	options.PosClassName	);
				}
		});
  };
})( jQuery );
