(function($) {
	$.tiny = $.tiny || {};
	$.tiny.rating = {
		options : {

		}
	};
	$.fn.rating = function(oPopup, options) {
		var options = $.extend( {}, $.tiny.rating.options, options);
		new Rating($(this), oPopup, options)
		return this;
	};
	function Rating(root, options) {

		oItems = $('.item', root);

		function initialize() {
			setEvent();
		}
		;

		function setEvent() {
			oItems.hover(function() {
				for ( var i = 0; i <= oItems.index(this); i++) {
					$(oItems.get(i)).addClass('item_hover');
				}
			}, function() {
				oItems.removeClass('item_hover');
			});

			oItems.click(function() {
				oItems.unbind('mouseenter').unbind('mouseleave');
				for ( var i = 0; i <= oItems.index(this); i++) {
					$(oItems.get(i)).addClass('item_hover');
				}
			})
		}
		;
		return initialize();
	}
	;
})(jQuery);
