(function($) {
	$.fn.clear = function()
	{
	  return $(':input', this).each(function() {
			$(this).blur();
			var type = this.type, tag = this.tagName.toLowerCase();

			if (tag == 'form')
				$(':input', this).clearForm();
			if (type == 'text' || type == 'password' || tag == 'textarea' || type == 'file')
				this.value = '';
			else if (type == 'checkbox' || type == 'radio')
				this.checked = false;
			else if (tag == 'select')
				this.selectedIndex = 0;
	  });
	};
}) (jQuery);
