Your IP : 3.15.170.2
if(!BXRL){var BXRL={};var BXRLW=null}RatingLike=function(t,e,i,n,o,p,s,u,a){this.enabled=true;this.likeId=t;this.entityTypeId=e;this.entityId=i;this.available=n=="Y"?true:false;this.userId=o;this.localize=p;this.template=s;this.pathToUserProfile=u;this.pathToAjax=typeof a=="string"?a:"/bitrix/components/bitrix/rating.vote/vote.ajax.php";this.box=BX("bx-ilike-button-"+t);if(this.box===null){this.enabled=false;return false}this.button=BX.findChild(this.box,{className:"bx-ilike-left-wrap"},true,false);this.buttonText=BX.findChild(this.button,{className:"bx-ilike-text"},true,false);this.count=BX.findChild(this.box,{tagName:"span",className:"bx-ilike-right-wrap"},true,false);this.countText=BX.findChild(this.count,{tagName:"span",className:"bx-ilike-right"},true,false);this.popup=null;this.popupId=null;this.popupOpenId=null;this.popupTimeoutId=null;this.popupContent=BX.findChild(BX("bx-ilike-popup-cont-"+t),{tagName:"span",className:"bx-ilike-popup"},true,false);this.popupContentPage=1;this.popupListProcess=false;this.popupTimeout=false;this.likeTimeout=false;this.lastVote=BX.hasClass(s=="standart"?this.button:this.count,"bx-you-like")?"plus":"cancel"};RatingLike.LiveUpdate=function(t){if(t.USER_ID==BX.message("USER_ID"))return false;for(var e in BXRL){if(BXRL[e].entityTypeId==t.ENTITY_TYPE_ID&BXRL[e].entityId==t.ENTITY_ID){var i=BXRL[e];i.countText.innerHTML=parseInt(t.TOTAL_POSITIVE_VOTES);i.count.insertBefore(BX.create("span",{props:{className:"bx-ilike-plus-one"},style:{width:i.countText.clientWidth-8+"px",height:i.countText.clientHeight-8+"px"},html:t.TYPE=="ADD"?"+1":"-1"}),i.count.firstChild);if(i.popup){i.popup.close();i.popupContentPage=1}}}};RatingLike.Set=function(t,e,i,n,o,p,s,u,a){if(s===undefined)s="standart";if(!BXRL[t]||BXRL[t].tryToSet<=5){var l=BXRL[t]&&BXRL[t].tryToSet?BXRL[t].tryToSet:1;BXRL[t]=new RatingLike(t,e,i,n,o,p,s,u,a);if(BXRL[t].enabled){RatingLike.Init(t)}else{setTimeout(function(){BXRL[t].tryToSet=l+1;RatingLike.Set(t,e,i,n,o,p,s,u,a)},500)}}};RatingLike.Init=function(t){if(BXRL[t].available){BX.bind(BXRL[t].template=="standart"?BXRL[t].button:BXRL[t].buttonText,"click",function(e){clearTimeout(BXRL[t].likeTimeout);if(BX.hasClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like")){BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_N"];BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)-1;BX.removeClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like");BXRL[t].likeTimeout=setTimeout(function(){if(BXRL[t].lastVote!="cancel")RatingLike.Vote(t,"cancel")},1e3)}else{BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_Y"];BXRL[t].countText.innerHTML=parseInt(BXRL[t].countText.innerHTML)+1;BX.addClass(BXRL[t].template=="standart"?this:BXRL[t].count,"bx-you-like");BXRL[t].likeTimeout=setTimeout(function(){if(BXRL[t].lastVote!="plus")RatingLike.Vote(t,"plus")},1e3)}BX.removeClass(this.box,"bx-ilike-button-hover");BX.PreventDefault(e)});BX.bind(BXRL[t].box,"mouseover",function(){BX.addClass(this,"bx-ilike-button-hover")});BX.bind(BXRL[t].box,"mouseout",function(){BX.removeClass(this,"bx-ilike-button-hover")})}else{if(BXRL[t].buttonText!=undefined)BXRL[t].buttonText.innerHTML=BXRL[t].localize["LIKE_D"]}RatingLike.PopupScroll(t);BX.bind(BXRL[t].count,"mouseover",function(){clearTimeout(BXRL[t].popupTimeoutId);BXRL[t].popupTimeoutId=setTimeout(function(){if(BXRLW==t)return false;if(BXRL[t].popupContentPage==1)RatingLike.List(t,1);BXRL[t].popupTimeoutId=setTimeout(function(){RatingLike.OpenWindow(t)},400)},400)});BX.bind(BXRL[t].count,"mouseout",function(){clearTimeout(BXRL[t].popupTimeoutId)});BX.bind(BXRL[t].count,"click",function(){clearTimeout(BXRL[t].popupTimeoutId);if(BXRL[t].popupContentPage==1)RatingLike.List(t,1);RatingLike.OpenWindow(t)});BX.bind(BXRL[t].box,"mouseout",function(){clearTimeout(BXRL[t].popupTimeout);BXRL[t].popupTimeout=setTimeout(function(){if(BXRL[t].popup!==null){BXRL[t].popup.close();BXRLW=null}},1e3)});BX.bind(BXRL[t].box,"mouseover",function(){clearTimeout(BXRL[t].popupTimeout)})};RatingLike.OpenWindow=function(t){if(parseInt(BXRL[t].countText.innerHTML)==0)return false;if(BXRL[t].popup==null){BXRL[t].popup=new BX.PopupWindow("ilike-popup-"+t,BXRL[t].template=="standart"?BXRL[t].count:BXRL[t].box,{lightShadow:true,offsetLeft:5,autoHide:true,closeByEsc:true,zIndex:2005,bindOptions:{position:"top"},events:{onPopupClose:function(){BXRLW=null},onPopupDestroy:function(){}},content:BX("bx-ilike-popup-cont-"+t)});BXRL[t].popup.setAngle({});BX.bind(BX("ilike-popup-"+t),"mouseout",function(){clearTimeout(BXRL[t].popupTimeout);BXRL[t].popupTimeout=setTimeout(function(){BXRL[t].popup.close()},1e3)});BX.bind(BX("ilike-popup-"+t),"mouseover",function(){clearTimeout(BXRL[t].popupTimeout)})}if(BXRLW!=null)BXRL[BXRLW].popup.close();BXRLW=t;BXRL[t].popup.show();RatingLike.AdjustWindow(t)};RatingLike.Vote=function(t,e){BX.ajax({url:BXRL[t].pathToAjax,method:"POST",dataType:"json",data:{RATING_VOTE:"Y",RATING_VOTE_TYPE_ID:BXRL[t].entityTypeId,RATING_VOTE_ENTITY_ID:BXRL[t].entityId,RATING_VOTE_ACTION:e,sessid:BX.bitrix_sessid()},onsuccess:function(e){BXRL[t].lastVote=e.action;BXRL[t].countText.innerHTML=e.items_all;BXRL[t].popupContentPage=1;BXRL[t].popupContent.innerHTML="";spanTag0=document.createElement("span");spanTag0.className="bx-ilike-wait";BXRL[t].popupContent.appendChild(spanTag0);RatingLike.AdjustWindow(t);if(BX("ilike-popup-"+t)&&BX("ilike-popup-"+t).style.display=="block")RatingLike.List(t,null)},onfailure:function(t){}});return false};RatingLike.List=function(t,e){if(parseInt(BXRL[t].countText.innerHTML)==0)return false;if(e==null)e=BXRL[t].popupContentPage;BXRL[t].popupListProcess=true;BX.ajax({url:BXRL[t].pathToAjax,method:"POST",dataType:"json",data:{RATING_VOTE_LIST:"Y",RATING_VOTE_TYPE_ID:BXRL[t].entityTypeId,RATING_VOTE_ENTITY_ID:BXRL[t].entityId,RATING_VOTE_LIST_PAGE:e,PATH_TO_USER_PROFILE:BXRL[t].pathToUserProfile,sessid:BX.bitrix_sessid()},onsuccess:function(i){BXRL[t].countText.innerHTML=i.items_all;if(parseInt(i.items_page)==0)return false;if(e==1){BXRL[t].popupContent.innerHTML="";spanTag0=document.createElement("span");spanTag0.className="bx-ilike-bottom_scroll";BXRL[t].popupContent.appendChild(spanTag0)}BXRL[t].popupContentPage+=1;for(var n=0;n<i.items.length;n++){BXRL[t].popupContent.appendChild(BX.create("a",{attrs:{href:i.items[n]["URL"],target:"_blank"},props:{className:"bx-ilike-popup-img"},children:[BX.create("span",{props:{className:"bx-ilike-popup-avatar"},html:i.items[n]["PHOTO"]}),BX.create("span",{props:{className:"bx-ilike-popup-name"},html:i.items[n]["FULL_NAME"]})]}))}RatingLike.AdjustWindow(t);RatingLike.PopupScroll(t);BXRL[t].popupListProcess=false},onfailure:function(t){}});return false};RatingLike.AdjustWindow=function(t){if(BXRL[t].popup!=null){BXRL[t].popup.bindOptions.forceBindPosition=true;BXRL[t].popup.adjustPosition();BXRL[t].popup.bindOptions.forceBindPosition=false}};RatingLike.PopupScroll=function(t){BX.bind(BXRL[t].popupContent,"scroll",function(){if(this.scrollTop>(this.scrollHeight-this.offsetHeight)/1.5){RatingLike.List(t,null);BX.unbindAll(this)}})};
//# sourceMappingURL=rating_like.map.js