	/*
	* jGrow 0.2
	* 08.02.2008
	* 0.2 release: 04.03.2008
	* 0.2.1 release: 15.09.2008	
	*/
	
	(function($) {

		$.fn.jGrow = function(options) {

			var opts = $.extend({}, $.fn.jGrow.defaults, options);

			return this.each(function() {
			


				$(this).css({ overflow: "hidden" }).bind("keyup", function() {

					$this = $(this);

					var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

					if(o.rows == 0 && (this.scrollHeight > this.clientHeight)) {
						
						this.rows += 10;
						//jQuery('div#container').css('height', '500px');
						//jQuery('div#container').width(800);
						//$('div#container div:first-child').css('height',280);

						
					} else if((this.rows <= o.rows) && (this.scrollHeight > this.clientHeight)) {

						this.rows += 10;
						
//jQuery('div#container').css('height', '500px');
//jQuery('div#container').height(300);
//$('div#container div:first-child').css('height',280);


					} else if(o.rows != 0 && this.rows > o.rows) {

						$this.css({ overflow: "auto" });

					}

					$this.html();

				});

			});

		}

		$.fn.jGrow.defaults = { rows: 0 };


						
	})(jQuery);
