$(document).ready(function() {
    // Демонстрация помечания машин звёздочками
    $(".f-showroom .f-offers").add(".f-car-list li").hover(
        function() {
            $(this).find(".star").addClass("star_hover");
        },
        function() {
            $(this).find(".star").removeClass("star_hover");
        }
    );

    $(".f-offers .star").hover(
        function() {
            $(this).addClass("star_hover");
        },
        function() {
            $(this).removeClass("star_hover");
        }
    );

    $(".f-showroom .star").add(".f-car-list .star").add(".f-the-car .star").click(function(){
        if ($(this).hasClass("star_selected")) {
            $(this).removeClass("star_selected");
        } else {
            $(this)
                .addClass("star_selected")
                .after("<span class='marked' style='left:"+ $(this).position().left  +"px; top:"+ $(this).position().top +"px;'>помечено</span>");
                setTimeout(function() {
					$(".marked")
                        .fadeOut("slow", function(){
                            $(this).remove();
                        });
				}, 1000);
        }
    });

}); 
