(function ($j) {
	$j.fn.styleTable = function (options) {
		var defaults = {
			css: 'styleTable'
		};
		options = $j.extend(defaults, options);

		return this.each(function () {

			input = $j(this);
			input.addClass(options.css);

			input.find("tr").live('mouseover mouseout', function (event) {
				if (event.type == 'mouseover') {
					$j(this).children("td").addClass("ui-state-hover");
				} else {
					$j(this).children("td").removeClass("ui-state-hover");
				}
			});

			input.find("th").addClass("ui-state-default");
			input.find("td").addClass("ui-widget-content");

			input.find("tr").each(function () {
				$j(this).children("td:not(:first)").addClass("first");
				$j(this).children("th:not(:first)").addClass("first");
			});
		});
	};
})(jQuery);
