function send($e, $n, $id)
{
	$.post(
			"/quiz/voting",
			{id : $id, rate : $n},
			function(data){}
		);
}

jQuery.fn.sVote = function(config) {
    config = config || {};
    var defaults = {
	activeImageSrc: "/images/quizzem/star_gold.jpg",
	passiveImageSrc: "/images/quizzem/star_gray.jpg",
	maxScore: 5,
	fn: send //new Function()
    };   
    
    config = jQuery.extend(defaults, config);

    return this.each(function() {
	for (var i = 0; i < config.maxScore; ++i) {
		jQuery(this).append("<img />");
	}
	var $container = this;
	jQuery(this).find("img").attr("src", config.passiveImageSrc);

	jQuery(this).find("img").bind("mouseover", function(e) {
	    var len = jQuery($container).find("img").index(e.target) + 1;
		
	    jQuery($container).find("img").slice(0, len).attr("src", config.activeImageSrc);
	    jQuery($container).find("img").slice(len, config.maxScore).attr("src", config.passiveImageSrc);
	});
	
	jQuery(this).find("img").bind("mouseout", function(e) {
		jQuery($container).find("img").slice(0, config.curScore).attr("src", config.activeImageSrc);
	    jQuery($container).find("img").slice(config.curScore, config.maxScore).attr("src", config.passiveImageSrc);
	});
	
	jQuery(this).find("img").
	bind("click", function(e) {
	    jQuery($container).find("img").unbind("mouseover").unbind("mouseout").unbind("click");
	    config.fn.call(this, e, jQuery($container).find("img").index(e.target)+1, config.id);
	});
	
	jQuery($container).find("img").slice(0, config.curScore).attr("src", config.activeImageSrc);
	jQuery($container).find("img").slice(config.curScore, config.maxScore).attr("src", config.passiveImageSrc);
	
    });
}; 

