!function(){if(void 0===window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader||void 0===window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader.loading){var t=function(t,e){if(!window.localStorage)return e;var i=t+"_expiredAt",o=localStorage.getItem(i);if(!o)return e;if(o=parseInt(o,10),isNaN(o))return e;if((new Date).valueOf()>o)return e;var n=localStorage.getItem(t);return n||e},e=function(e,i){var o="fp_yv6Ky8pO9yZXff_clicked_"+e,n=t(o,"");if((n=n+","+i).length>1024){var a=n.search(",");n=-1==a?i:n.substring(a)}!function(t,e,i){if(window.localStorage){var o=t+"_expiredAt",n=new Date;n.setSeconds(n.getSeconds()+i),localStorage.setItem(t,e),localStorage.setItem(o,n.valueOf())}}(o,n,259200)},i=function(t){"console"in window&&window.console.log("yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader: "+t)},o=function(t){return window.JSON.stringify?window.JSON.stringify(t):window.JSON.encode?window.JSON.encode(t):void 0},n=function(t){return window.JSON.parse?window.JSON.parse(t):window.JSON.decode?window.JSON.decode(t):void 0},a=function(){return void 0!==window.JSON};(function(){void 0===Array.isArray&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),document.getElementsByClassName||(document.getElementsByClassName=function(t){for(var e=[],i=document.getElementsByTagName("*"),o=new RegExp("(^|\\s)"+t+"(\\s|$)"),n=0;n<i.length;n++)o.test(i[n].className)&&e.push(i[n]);return e})})();var s={xmlHttpRequest:null,useJsonp:!1,init:function(){null==this.xmlHttpRequest&&(this.xmlHttpRequest=new XMLHttpRequest,"withCredentials"in this.xmlHttpRequest&&a()||(this.useJsonp=!0))},jsonp:function(t){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=t+"&"+Math.random(),document.getElementsByTagName("head")[0].appendChild(e)},ajax:function(t,e,a,s){var d=this;this.xmlHttpRequest.open("POST",t,!0),this.xmlHttpRequest.withCredentials=!0,this.xmlHttpRequest.onerror=function(t){i("Error with status "+t.target.status+" occurred while receiving the document"),s.call(window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader,d.xmlHttpRequest,e)},this.xmlHttpRequest.onreadystatechange=function(){if(4==d.xmlHttpRequest.readyState)if(200==d.xmlHttpRequest.status){var t=n(d.xmlHttpRequest.responseText);a.call(window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader,t)}else i("Error while load items with status "+d.xmlHttpRequest.status),s.call(window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader,d.xmlHttpRequest,e)},this.xmlHttpRequest.send(o(e))}},d=1,l=2,r={product:1,news:2,value:3,excludeNews:function(){this.value&=~this.news},excludeProduct:function(){this.value&=~this.product},getValue:function(){return this.value}},u=[];void 0!==window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader&&void 0!==window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader.toLoad&&(u=window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader.toLoad),window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader={maxLoadingIterations:100,toLoad:u,list:[],loading:!1,requester:s,functionName:"yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader.handleData",possibleUps:["up2","up3","up4","up5","up6","up7","up8","up9","up10","up11","up12","up13","up14","up15","up16","up17","up18","up19"],isSuitableElement:function(t){return null!=t&&void 0!==t.tagName},isHiddenElement:function(t){return"none"===window.getComputedStyle(t).display},init:function(){for(var t=document.getElementsByClassName("yv6Ky8pO9yZXff-WY4nGmmADa-oVfdKk"),e=0;e<t.length;e++)if("yes"==t[e].getAttribute("data-autoload"))if(this.isHiddenElement(t[e]))i("Hidden element found.");else{var o=t[e].getAttribute("data-id");o&&this.addForLoad(o,t[e],null,null)}this.addToLoadFromOuterData(),this.loadLoop()},addForLoad:function(t,e,i,o){this.list.push({blockId:t,element:e,domain:i,emptyCallback:o})},load:function(t,e,o,n){this.isSuitableElement(e)?this.isHiddenElement(e)?i("Hidden element, skip."):(this.addForLoad(t,e,o,n),this.loadLoop()):i("Not suitable element.")},addToLoadFromOuterData:function(){var t;for(t=0;t<this.toLoad.length;t++)this.isSuitableElement(this.toLoad[t].element)?this.isHiddenElement(this.toLoad[t].element)?i("Hidden element found."):this.addForLoad(this.toLoad[t].blockId,this.toLoad[t].element,this.toLoad[t].domain,this.toLoad[t].emptyCallback):i("Not suitable element found.");this.toLoad=[]},l:function(){this.addToLoadFromOuterData(),this.loadLoop()},loadLoop:function(){if(!(this.loading||this.list.length<1)){if(this.maxLoadingIterations--,this.maxLoadingIterations<1)return i("Too many loading iterations, smt goes wrong, stopping..."),void(this.list={});this.loading=!0,this.requester.init();var e,o,n,a,s=[],u={},c=this.list[0].domain;for(e=0;e<this.list.length&&c===this.list[e].domain;e++)for(s.push(this.list[e].blockId),o=0;o<this.possibleUps.length;o++)(n=this.list[e].element.getAttribute("data-"+this.possibleUps[o]))&&""!==n&&(u[this.possibleUps[o]]=n);var f=null==c?function(){var t,e,i=document.getElementById("yv6Ky8pO9yZXff-WY4nGmmADa-oVfdKk-id");if(i){var o=i.getAttribute("src");if(o)return-1!==(e=(t=o).indexOf("//"))&&(t=t.substring(e+2)),-1!==(e=t.indexOf("/"))&&(t=t.substring(0,e)),t}return"tend-new.com"}():c;if(f="//"+f+"/fetch",this.requester.useJsonp){var m="";for(a in u)m+="&"+u[a];this.requester.jsonp(f+"?a="+s.join(",")+"&b="+this.functionName+"&c="+r.getValue()+m)}else{var h={a:s.join(","),c:r.getValue()},p=t("fp_yv6Ky8pO9yZXff_clicked_"+d,"");p&&(h.d=p);var y=t("fp_yv6Ky8pO9yZXff_clicked_"+l,"");for(a in y&&(h.e=y),u)h[a]=u[a];this.requester.ajax(f,h,this.handleData,this.handleError)}}},getBlockData:function(t){for(var e=this.list.length-1;e>=0;e--)if(this.list[e].blockId==t)return this.list[e];return{}},removeOneFromList:function(t){for(var e=[],i=this.list.length-1;i>=0;i--)this.list[i].blockId!=t&&e.push(this.list[i]);this.list=e},handleError:function(t,e){if(void 0!==e&&null!=e&&null!=e.a.split){var i,o,n=e.a.split(",");for(o=0;o<n.length;o++)i=parseInt(n[o],10),this.removeOneFromList(i);this.loading=!1,this.loadLoop()}},handleData:function(t){if(void 0===t||!t.items)return i("handleData: wrong data, undefined or no items!"),void(this.loading=!1);for(var o=t.items.length-1;o>=0;o--){var n=t.items[o],a=this.getBlockData(n.blockId),s=a.element;if(this.removeOneFromList(n.blockId),s)if(""!==n.html){if(s.innerHTML=n.html,""!=n.css){var u=document.createElement("style");u.type="text/css",u.styleSheet?u.styleSheet.cssText=n.css:u.appendChild(document.createTextNode(n.css)),s.appendChild(u)}d==n.typeId?r.excludeProduct():l==n.typeId&&r.excludeNews();for(var c=s.getElementsByTagName("a"),f=0;f<c.length;f++)c[f].setAttribute("data-type-id",n.typeId),c[f].addEventListener("click",function(t){var i=t.currentTarget.getAttribute("data-type-id"),o=t.currentTarget.getAttribute("data-id");o&&i&&(o=parseInt(o,10),i=parseInt(i,10),isNaN(o)||isNaN(i)||e(i,o))})}else a.emptyCallback&&a.emptyCallback(s);else i("Block with data-id "+n.blockId+" not found")}this.loading=!1,this.loadLoop()}},window.yv6Ky8pO9yZXff_WY4nGmmADa_oVfdKk_blockLoader.init()}}();