function CheckSameDomainTabs(){tabCount.onTabChange(function(n){var i=0,r,t;typeof n!="undefined"&&n!=""&&(i=n,setCookie(n,7,"tru_tc"));r=0;t=CheckCookie("tru_cc");r=typeof t=="undefined"||t==""?0:parseInt(t);i<=10&&r<=10?(setCookie(i,7,"tru_cc"),canChat=1):canChat=0},!0)}function isMobile(){var n=!1;return((/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(n=!0),window.innerWidth<=768||n)?!0:!1}function addOrUpdateUrlParam(n,t,i){var r,f,u,e;i||(i=window.location.href);r=i.indexOf("#");f=r===-1?"":i.substr(r);i=r===-1?i:i.substr(0,r);u=new RegExp("([?&])"+n+"=.*?(&|$)","i");e=i.indexOf("?")!==-1?"&":"?";i=i.match(u)?i.replace(u,"$1"+n+"="+t+"$2"):i+e+n+"="+t;history.pushState(null,null,i+f)}var TabCount=function(){function n(){var n=this;this.updateInterval=2e3;this.tabId=Math.random().toString(36).substring(7);this.tabsCounter=0;this.onTabCountUpdate=[];this.updateActiveInterval=0;this.tabsCount=function(t){t===void 0&&(t=!0);var r=n.getData(),u=Object.keys(r.list),f=Date.now(),i=0;return u.forEach(function(t){r.list[t].lastActive+n.updateInterval*1.2>f&&i++}),t||n.tabsCounter===i||n.onTabCountUpdate.forEach(function(n){n(i)}),n.tabsCounter=i};this.updateActive=function(){var t=n.getData(),i=Date.now();t.list[n.tabId]===undefined&&(t.list[n.tabId]={TabOpenedTimeStamp:i});t.list[n.tabId].url=window.location.href;t.list[n.tabId].lastActive=i;(undefined===t.lastCleaned||+t.lastCleaned+2e4<i)&&(t=n.clearList(t));n.updateData(t);n.tabsCount(!1)};this.clearList=function(t){var r=Object.keys(t.list),i=Date.now();return r.forEach(function(r){t.list[r].lastActive+Math.max(8e3,n.updateInterval*1.5)<i&&delete t.list[r]}),t.lastCleaned=i,t};this.onTabChange=function(t,i){i===void 0&&(i=!1);typeof t=="function"&&(n.onTabCountUpdate.push(t),i&&t(n.tabsCount()))};this.updateData=function(n){localStorage.setItem("tabCountData",typeof n=="string"?n:JSON.stringify(n))};this.getData=function(){var n=localStorage.getItem("tabCountData");return n==null?{list:{},lastCleaned:0}:JSON.parse(n)};this.getUrls=function(t){t===void 0&&(t=!1);var i=n.getData(),r=[];return Object.keys(i.list).forEach(function(n){t&&r.indexOf(i.list[n].url)!==-1||r.push(i.list[n].url)}),r};this.setUpdateInterval=function(t){t===void 0&&(t=n.updateInterval);null!==n.updateActiveInterval&&n.pause();n.start(t)};this.pause=function(){clearInterval(n.updateActiveInterval);n.updateActiveInterval=0};this.start=function(t){t===void 0&&(t=n.updateInterval);n.updateActiveInterval=setInterval(function(){n.updateActive()},n.updateInterval=t)};this.updateActive();this.start();window.onbeforeunload=function(){var t=n.getData();delete t.list[n.tabId];n.updateData(t)}}return n}(),tabCount=new TabCount,canChat;$(document).ready(function(){CheckSameDomainTabs()});canChat=0;!function(){var n=function(n){"use strict";function nt(n){if(n.paused||n.ended||w)return!1;try{i.clearRect(0,0,u,r);i.drawImage(n,0,0,u,r)}catch(t){}ft=setTimeout(function(){nt(n)},f.duration);p.setIcon(l)}function tt(n){var t;return n=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(n,t,i,r){return t+t+i+i+r+r}),t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n),t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:!1}function rt(n,t){var i,r={};for(i in n)r[i]=n[i];for(i in t)r[i]=t[i];return r}function ot(){return h.hidden||h.msHidden||h.webkitHidden||h.mozHidden}var t,c,r,u,l,i,e,y,k,d,v,w,o,ut,ft,h,g,a,et,s,b,it,f;n=n?n:{};g={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:!1,dataUrl:!1,win:window};o={};o.ff="undefined"!=typeof InstallTrigger;o.chrome=!!window.chrome;o.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0;o.ie=/*@cc_on!@*/!1;o.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;o.supported=o.chrome||o.ff||o.opera;a=[];v=function(){};y=w=!1;et=function(){var v,y,a,o;if(t=rt(g,n),t.bgColor=tt(t.bgColor),t.textColor=tt(t.textColor),t.position=t.position.toLowerCase(),t.animation=f.types[""+t.animation]?t.animation:g.animation,h=t.win.document,v=t.position.indexOf("up")>-1,y=t.position.indexOf("left")>-1,v||y)for(a=0;a<f.types[""+t.animation].length;a++)o=f.types[""+t.animation][a],v&&(o.y=o.y<.6?o.y-.4:o.y-2*o.y+(1-o.w)),y&&(o.x=o.x<.6?o.x-.4:o.x-2*o.x+(1-o.h)),f.types[""+t.animation][a]=o;t.type=b[""+t.type]?t.type:g.type;c=p.getIcon();l=document.createElement("canvas");e=document.createElement("img");c.hasAttribute("href")?(e.setAttribute("crossOrigin","anonymous"),e.onload=function(){r=e.height>0?e.height:32;u=e.width>0?e.width:32;l.height=r;l.width=u;i=l.getContext("2d");s.ready()},e.setAttribute("src",c.getAttribute("href"))):(e.onload=function(){r=32;u=32;e.height=r;e.width=u;l.height=r;l.width=u;i=l.getContext("2d");s.ready()},e.setAttribute("src",""))};s={};s.ready=function(){y=!0;s.reset();v()};s.reset=function(){y&&(a=[],k=!1,d=!1,i.clearRect(0,0,u,r),i.drawImage(e,0,0,u,r),p.setIcon(l),window.clearTimeout(ut),window.clearTimeout(ft))};s.start=function(){var i,n;y&&!d&&(i=function(){k=a[0];d=!1;a.length>0&&(a.shift(),s.start())},a.length>0&&(d=!0,n=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(n){n in a[0].options&&(t[n]=a[0].options[n])});f.run(a[0].options,function(){i()},!1)},k?f.run(k.options,function(){n()},!0):n()))};b={};it=function(n){return n.n="number"==typeof n.n?Math.abs(0|n.n):n.n,n.x=u*n.x,n.y=r*n.y,n.w=u*n.w,n.h=r*n.h,n.len=(""+n.n).length,n};b.circle=function(n){n=it(n);var f=!1;2===n.len?(n.x=n.x-.4*n.w,n.w=1.4*n.w,f=!0):n.len>=3&&(n.x=n.x-.65*n.w,n.w=1.65*n.w,f=!0);i.clearRect(0,0,u,r);i.drawImage(e,0,0,u,r);i.beginPath();i.font=t.fontStyle+" "+Math.floor(n.h*(n.n>99?.85:1))+"px "+t.fontFamily;i.textAlign="center";f?(i.moveTo(n.x+n.w/2,n.y),i.lineTo(n.x+n.w-n.h/2,n.y),i.quadraticCurveTo(n.x+n.w,n.y,n.x+n.w,n.y+n.h/2),i.lineTo(n.x+n.w,n.y+n.h-n.h/2),i.quadraticCurveTo(n.x+n.w,n.y+n.h,n.x+n.w-n.h/2,n.y+n.h),i.lineTo(n.x+n.h/2,n.y+n.h),i.quadraticCurveTo(n.x,n.y+n.h,n.x,n.y+n.h-n.h/2),i.lineTo(n.x,n.y+n.h/2),i.quadraticCurveTo(n.x,n.y,n.x+n.h/2,n.y)):i.arc(n.x+n.w/2,n.y+n.h/2,n.h/2,0,2*Math.PI);i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+n.o+")";i.fill();i.closePath();i.beginPath();i.stroke();i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+n.o+")";"number"==typeof n.n&&n.n>999?i.fillText((n.n>9999?9:Math.floor(n.n/1e3))+"k+",Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-.2*n.h)):i.fillText(n.n,Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-.15*n.h));i.closePath()};b.rectangle=function(n){n=it(n);var f=!1;2===n.len?(n.x=n.x-.4*n.w,n.w=1.4*n.w,f=!0):n.len>=3&&(n.x=n.x-.65*n.w,n.w=1.65*n.w,f=!0);i.clearRect(0,0,u,r);i.drawImage(e,0,0,u,r);i.beginPath();i.font=t.fontStyle+" "+Math.floor(n.h*(n.n>99?.9:1))+"px "+t.fontFamily;i.textAlign="center";i.fillStyle="rgba("+t.bgColor.r+","+t.bgColor.g+","+t.bgColor.b+","+n.o+")";i.fillRect(n.x,n.y,n.w,n.h);i.fillStyle="rgba("+t.textColor.r+","+t.textColor.g+","+t.textColor.b+","+n.o+")";"number"==typeof n.n&&n.n>999?i.fillText((n.n>9999?9:Math.floor(n.n/1e3))+"k+",Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-.2*n.h)):i.fillText(n.n,Math.floor(n.x+n.w/2),Math.floor(n.y+n.h-.15*n.h));i.closePath()};var st=function(n,t){t=("string"==typeof t?{animation:t}:t)||{};v=function(){try{if("number"==typeof n?n>0:""!==n){var i={type:"badge",options:{n:n}};if("animation"in t&&f.types[""+t.animation]&&(i.options.animation=""+t.animation),"type"in t&&b[""+t.type]&&(i.options.type=""+t.type),["bgColor","textColor"].forEach(function(n){n in t&&(i.options[n]=tt(t[n]))}),["fontStyle","fontFamily"].forEach(function(n){n in t&&(i.options[n]=t[n])}),a.push(i),a.length>100)throw new Error("Too many badges requests in queue.");s.start()}else s.reset()}catch(r){throw new Error("Error setting badge. Message: "+r.message);}};y&&v()},ht=function(n){v=function(){try{var f=n.width,e=n.height,t=document.createElement("img"),o=e/r>f/u?f/u:e/r;t.setAttribute("crossOrigin","anonymous");t.onload=function(){i.clearRect(0,0,u,r);i.drawImage(t,0,0,u,r);p.setIcon(l)};t.setAttribute("src",n.getAttribute("src"));t.height=e/o;t.width=f/o}catch(s){throw new Error("Error setting image. Message: "+s.message);}};y&&v()},ct=function(n){v=function(){try{if("stop"===n)return w=!0,s.reset(),void(w=!1);n.addEventListener("play",function(){nt(this)},!1)}catch(t){throw new Error("Error setting video. Message: "+t.message);}};y&&v()},lt=function(n){if(window.URL&&window.URL.createObjectURL||(window.URL=window.URL||{},window.URL.createObjectURL=function(n){return n}),o.supported){var t=!1;navigator.getUserMedia=navigator.getUserMedia||navigator.oGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia;v=function(){try{if("stop"===n)return w=!0,s.reset(),void(w=!1);t=document.createElement("video");t.width=u;t.height=r;navigator.getUserMedia({video:!0,audio:!1},function(n){t.src=URL.createObjectURL(n);t.play();nt(t)},function(){})}catch(i){throw new Error("Error setting webcam. Message: "+i.message);}};y&&v()}},p={};return p.getIcon=function(){var n=!1,i=function(){for(var t=h.getElementsByTagName("head")[0].getElementsByTagName("link"),i=t.length,n=i-1;n>=0;n--)if(/(^|\s)icon(\s|$)/i.test(t[n].getAttribute("rel")))return t[n];return!1};return t.element?n=t.element:t.elementId?(n=h.getElementById(t.elementId),n.setAttribute("href",n.getAttribute("src"))):(n=i(),n===!1&&(n=h.createElement("link"),n.setAttribute("rel","icon"),h.getElementsByTagName("head")[0].appendChild(n))),n.setAttribute("type","image/png"),n},p.setIcon=function(n){var i=n.toDataURL("image/png"),u,r;(t.dataUrl&&t.dataUrl(i),t.element)?(t.element.setAttribute("href",i),t.element.setAttribute("src",i)):t.elementId?(u=h.getElementById(t.elementId),u.setAttribute("href",i),u.setAttribute("src",i)):o.ff||o.opera?(r=c,c=h.createElement("link"),o.opera&&c.setAttribute("rel","icon"),c.setAttribute("rel","icon"),c.setAttribute("type","image/png"),h.getElementsByTagName("head")[0].appendChild(c),c.setAttribute("href",i),r.parentNode&&r.parentNode.removeChild(r)):c.setAttribute("href",i)},f={},f.duration=40,f.types={},f.types.fade=[{x:.4,y:.4,w:.6,h:.6,o:0},{x:.4,y:.4,w:.6,h:.6,o:.1},{x:.4,y:.4,w:.6,h:.6,o:.2},{x:.4,y:.4,w:.6,h:.6,o:.3},{x:.4,y:.4,w:.6,h:.6,o:.4},{x:.4,y:.4,w:.6,h:.6,o:.5},{x:.4,y:.4,w:.6,h:.6,o:.6},{x:.4,y:.4,w:.6,h:.6,o:.7},{x:.4,y:.4,w:.6,h:.6,o:.8},{x:.4,y:.4,w:.6,h:.6,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],f.types.none=[{x:.4,y:.4,w:.6,h:.6,o:1}],f.types.pop=[{x:1,y:1,w:0,h:0,o:1},{x:.9,y:.9,w:.1,h:.1,o:1},{x:.8,y:.8,w:.2,h:.2,o:1},{x:.7,y:.7,w:.3,h:.3,o:1},{x:.6,y:.6,w:.4,h:.4,o:1},{x:.5,y:.5,w:.5,h:.5,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],f.types.popFade=[{x:.75,y:.75,w:0,h:0,o:0},{x:.65,y:.65,w:.1,h:.1,o:.2},{x:.6,y:.6,w:.2,h:.2,o:.4},{x:.55,y:.55,w:.3,h:.3,o:.6},{x:.5,y:.5,w:.4,h:.4,o:.8},{x:.45,y:.45,w:.5,h:.5,o:.9},{x:.4,y:.4,w:.6,h:.6,o:1}],f.types.slide=[{x:.4,y:1,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.9,w:.6,h:.6,o:1},{x:.4,y:.8,w:.6,h:.6,o:1},{x:.4,y:.7,w:.6,h:.6,o:1},{x:.4,y:.6,w:.6,h:.6,o:1},{x:.4,y:.5,w:.6,h:.6,o:1},{x:.4,y:.4,w:.6,h:.6,o:1}],f.run=function(n,i,r,u){var e=f.types[ot()?"none":t.animation];return u=r===!0?"undefined"!=typeof u?u:e.length-1:"undefined"!=typeof u?u:0,i=i?i:function(){},u<e.length&&u>=0?(b[t.type](rt(n,e[u])),ut=setTimeout(function(){r?u-=1:u+=1;f.run(n,i,r,u)},f.duration),p.setIcon(l),void 0):void i()},et(),{badge:st,video:ct,image:ht,webcam:lt,reset:s.reset,browser:{supported:o.supported}}};"undefined"!=typeof define&&define.amd?define([],function(){return n}):"undefined"!=typeof module&&module.exports?module.exports=n:this.Favico=n}()