function setRollover(A,D,C){var B=A.parent().parent().find('.b-rollover-tip *[id ^= "rating-label"]');A.css({cursor:"pointer"});A.click(function(){var E=C=="shop"?"shop_id="+D:"modelid="+D;var F=A.index(this)-2;var G=$(this);$.ajax({type:"post",url:"/gate/rating/rate-"+C+".xml",data:E+"&gr_0="+F+"&a=c&sk="+mvc.obj("user").prop("sk"),dataType:"xml",timeout:"3000",cache:false,beforeSend:function(){},complete:function(){},error:function(){alert("Ошибка выставления оценки,\nпопробуйте позже")},success:function(H){var K=$(H).find("page").find("data").find("grade").find("gr-0").text();if(K){var J=A.eq(2+parseInt(K));J.prevAll().andSelf().addClass("b-rating__star-my");J.nextAll().removeClass("b-rating__star-my");B.removeClass("visible");var I=$("#rating-label-link");if(I.length>0){I.addClass("visible")}else{$("#rating-label"+K+"").addClass("visible")}}}});return false});A.hover(function(){$(this).prevAll().andSelf().addClass("b-rating__star-my-hover");$(this).nextAll().addClass("b-rating__star-hover");rate=A.index(this)-2;B.addClass("hover-hidden");$("#rating-label"+rate+"").removeClass("hover-hidden");$("#rating-label"+rate+"").addClass("hover-visible")},function(){A.removeClass("b-rating__star-hover b-rating__star-my-hover");B.removeClass("hover-hidden hover-visible")})}function initRollover(B,A){setRollover($("#rollover-stars_"+B+" .b-rating_"+A+" .b-rating__star"),B,A)};