!function(e,t){"use strict";var i={EMBEDDED:0,FLOATING:1,MOBILE_FULL:2};e.RumbleTalkChat||(e.RumbleTalkChat={init:function(a){if(e.RumbleTalkChat[a.hash])throw new Error("Trying to create a duplicate chat with code: "+a.hash);var n,r="__rtc-"+(new Date).getTime();try{t.write('<div id="'+r+'"></div>'),n=t.getElementById(r)}catch(e){}var l=navigator.userAgent.toUpperCase(),o={mainDiv:null,parent:null,chatDiv:null,counterDiv:null,iframe:null,protocol:"https://",server:"",hash:"",messageInterval:0,userCount:0,embedType:0,width:0,height:0,image:"https://d1pfint8izqszg.cloudfront.net/images/toolbar/toolbar.png",counter:!0,counterTop:14,counterLeft:23,floatingToggleInterval:0,baseWebUrl:"https://rumbletalk.com/",serviceRelativeUrl:"client/service.php?hash=",mobile:-1!=l.indexOf("MOBILE")||-1!=l.indexOf("ANDROID")||-1!=l.indexOf("IOS"),cdn:"",init:function(e){switch(o.mainDiv=t.getElementById(e.divId),o.mainDiv?n&&n.parentNode.removeChild(n):o.mainDiv=n,o.parent=o.mainDiv.parentNode,e.baseWebUrl&&(o.baseWebUrl=e.baseWebUrl),o.server=e.server,o.hash=e.hash,o.cdn=e.cdn,o.embedType=e.embedType,o.width=e.width,o.height=e.height,o.image=e.image,o.counter=e.showDetails,o.side=0==e.side?"right":"left",o.parseDivData(),o.mobile||o.embedType!=i.MOBILE_FULL||(o.embedType=i.EMBEDDED),o.embedType){case i.EMBEDDED:o.mainDiv.className="rumbletalk-embed",o.buildIframe(o.mainDiv),o.size();break;case i.FLOATING:o.mainDiv.className="rumbletalk-floating rumbletalk-floating-"+o.side,o.drawFloatingImage(o.side),o.mobile?o.openChat(o.mainDiv):(o.buildFloatingDiv(o.side),o.buildIframe(o.chatDiv));break;case i.MOBILE_FULL:o.mainDiv.className="rumbletalk-embed-image",o.drawImage(o.mainDiv),o.openChat(o.mainDiv)}o.addListeners(),o.instantiateQuery()},parseDivData:function(){var e,t,a=["width","height"];for(e=0;e<a.length;e++)(t=o.mainDiv.getAttribute("data-"+a[e]))&&(o[a[e]]=t);if(null!==(t=o.mainDiv.getAttribute("data-floating"))&&"false"!=t){if(o.embedType=i.FLOATING,null!=(t=o.mainDiv.getAttribute("data-image"))&&(o.image=t),null!=(t=o.mainDiv.getAttribute("data-side"))&&(o.side="left"==t?"left":"right"),null===(t=o.mainDiv.getAttribute("data-counter"))||"false"===t)return void(o.counter=!1);if(o.counter=!0,-1==t.indexOf(","))return;(t=t.split(","))[0]=Number(t[0]),isNaN(t[0])||(o.counterTop=t[0]),t[1]=Number(t[1]),isNaN(t[1])||(o.counterLeft=t[1])}},buildIframe:function(e){e.style.overflow="hidden",o.iframe=t.createElement("iframe"),o.iframe.src=o.protocol+o.server+"/"+o.hash+"/",o.iframe.setAttribute("allow","microphone; camera; fullscreen; autoplay"),o.iframe.style.width=o.width+"px",o.iframe.style.height="100%",o.iframe.style.overflow="hidden",o.iframe.style.border=0,o.iframe.style.backgroundColor="transparent",e.appendChild(o.iframe)},drawImage:function(e){var i=new Image;e.style.textAlign="center",i.src=o.cdn+"images/mobile-redirect.png",i.style.cursor="pointer",i.alt="Click here to join the chat",i.setAttribute("role","link"),e.appendChild(i);var a=t.createElement("h3");a.innerHTML="Click here to join the chat",a.setAttribute("role","link"),e.appendChild(a)},drawFloatingImage:function(e){o.mainDiv.style.position="fixed",o.mainDiv.style.bottom="5px",o.mainDiv.style[e]="5px",o.mainDiv.style.zIndex=2147483647;var i=new Image;if(i.onload=function(){o.mainDiv.style.height=i.height+"px",o.mainDiv.style.width=i.width+"px",o.mobile||(o.chatDiv.style.bottom=i.height+"px")},i.src=o.image,i.style.maxWidth="none",i.style.position="absolute",i.style.bottom=0,i.style[e]=0,i.alt="Click to join the conversation",i.title="Click to join the conversation",o.mainDiv.appendChild(i),o.counter){if(o.counterDiv=t.createElement("div"),o.counterDiv.style.position="absolute",o.counterDiv.style.top=o.counterTop+"px",o.counterDiv.style.left=o.counterLeft+"px",o.counterDiv.style.width="28px",o.counterDiv.style.textAlign="center",o.counterDiv.style.font="bold 12px arial",o.counterDiv.style.color="#000",o.counterDiv.style.userSelect="none",!o.mobile){var a=new Image;a.src=o.cdn+"images/toolbar/mini_wait.gif",a.alt="loading",o.counterDiv.appendChild(a)}o.mainDiv.appendChild(o.counterDiv)}return i},buildFloatingDiv:function(e){o.chatDiv=t.createElement("div"),o.chatDiv.style.position="absolute",o.chatDiv.style.bottom="75px",o.chatDiv.style[e]=0,o.chatDiv.style.visibility="hidden",o.chatDiv.style.overflow="hidden",o.chatDiv.style.padding=0,o.chatDiv.style.height=0,o.mainDiv.appendChild(o.chatDiv),o.mainDiv.onclick=o.toggleFloatingChatStart,o.mainDiv.style.cursor="pointer";var i=new Image,a="right"==e?"left":"right";i.src=o.cdn+"images/c.png",i.style.cursor="pointer",i.style.position="absolute",i.style.top="-9px",i.style[a]="-8px",i.onclick=function(){o.toggleFloatingChatStart(!0)},o.chatDiv.appendChild(i)},openChat:function(t){var i,a=o.baseWebUrl+"client/chat.php?"+o.hash;t.onclick=function(){o.iframe?o.iframe.focus():(o.iframe=e.open(a),i=setInterval(function(){o.iframe.closed&&(clearInterval(i),delete o.iframe)},100))}},summarizedStyleValues:function(t,i){var a,n,r=0;for(a=0;a<i.length;a+=1)n=e.getComputedStyle?e.getComputedStyle(t,"")[i[a]]:t.currentStyle[i[a]],isNaN(parseInt(n))&&(n=0),r+=parseInt(n);return r},size:function(){var i=0,a=0;if(o.iframe){if("rumbletalk-chat-fullscreen"===o.parent.id&&e.innerWidth>0&&e.innerHeight>0?(i=e.innerWidth,a=e.innerHeight):o.parent.clientWidth>0&&o.parent.clientHeight>0?(i=o.parent.clientWidth,a=o.parent.clientHeight):o.summarizedStyleValues(o.parent,["width"])>0&&o.summarizedStyleValues(o.parent,["height"])>0?(i=o.summarizedStyleValues(o.parent,["width"]),a=o.summarizedStyleValues(o.parent,["height"])):parseInt(o.parent.width)>0&&parseInt(o.parent.height)>0&&(i=parseInt(o.parent.width),a=parseInt(o.parent.height)),i>0&&a>0){var n="CSS1Compat"===t.compatMode?0:o.summarizedStyleValues(o.parent,["marginLeft","marginRight","paddingLeft","paddingRight"]);i=i-n+"px",n=o.mainDiv.childNodes.length>1?28:0,a=a-o.summarizedStyleValues(o.parent,["marginTop","marginBottom","paddingTop","paddingBottom"])-n+"px"}else i="100%",a="100%";o.iframe.style&&(o.iframe.style.width=i,o.iframe.style.height=a)}},instantiateQuery:function(){o.messageInterval=setInterval(o.query,1e3)},query:function(){try{var e,t;o.iframe instanceof HTMLIFrameElement?(e=o.iframe.contentWindow,t=o.protocol+o.server):(e=o.iframe,t=o.baseWebUrl),e.postMessage("toolbar",t)}catch(e){}},info:function(e){o.validateOrigin(e.origin)&&(isFinite(e.data)?(clearInterval(o.messageInterval),o.userCount=e.data,o.counterDiv&&(o.counterDiv.innerHTML=o.userCount.toString())):"object"==typeof e.data&&e.data.reload&&o.reload())},reload:function(){var t=new XMLHttpRequest;t.open("GET",o.baseWebUrl+o.serviceRelativeUrl+o.hash,!0),t.onreadystatechange=function(){if(4==t.readyState)try{var i=JSON.parse(t.responseText);if(i.status){if(void 0!==e.rumbleTalkMessageQueueName)return void location.reload();o.server=i.address;var a=o.protocol+o.server+"/"+o.hash+"/";o.iframe instanceof HTMLIFrameElement?o.iframe.src=a:o.iframe.location.href=a,o.instantiateQuery()}}catch(e){location.reload()}},t.send()},addListeners:function(){e.addEventListener("message",o.info,!1),o.embedType==i.EMBEDDED&&e.addEventListener("resize",o.size,!1),o.mobile||o.embedType!=i.FLOATING||e.addEventListener("keyup",o.escClose,!1)},toggleFloatingChatStart:function(e){clearInterval(o.floatingToggleInterval);var t=-100;"hidden"===o.chatDiv.style.visibility&&!0!==e&&(t*=-1,o.chatDiv.style.width=0,o.chatDiv.style.height=0,o.chatDiv.style.visibility="visible",o.chatDiv.style.overflow="visible"),o.floatingToggleInterval=setInterval(function(){o.toggleFloatingChat(t)},1)},toggleFloatingChat:function(e){var t=o.chatDiv.offsetWidth+e,i=o.chatDiv.offsetHeight+e,a=0;t<0&&(t=0),i<0&&(i=0),t>=0&&i>=0&&(t<=o.width?a=1:t=o.width,i<=o.height?a=1:i=o.height,o.chatDiv.style.width=t+"px",o.chatDiv.style.height=i+"px"),(!a||t<=0||i<=0)&&(clearInterval(o.floatingToggleInterval),t<o.width&&(o.chatDiv.style.visibility="hidden",o.chatDiv.style.overflow="hidden"))},escClose:function(e){27===(e.keyCode||e.which)&&o.toggleFloatingChatStart(!0)},validateOrigin:function(e){return/^https:\/\/.+\.rumbletalk\.(net|com)(:4433)?$/.test(e)}};return o.init(a),o}})}(window,document);RumbleTalkChat['MalN0_6O'] = RumbleTalkChat.init({"hash":"MalN0_6O","server":"service60.rumbletalk.net","divId":"rt-d589c8676a5e92f53fb0435c99d4163f","side":0,"embedType":0,"cdn":"https:\/\/d1pfint8izqszg.cloudfront.net\/","baseWebUrl":"https:\/\/rumbletalk.com\/","width":750,"height":500,"bounce":4,"image":"https:\/\/d1pfint8izqszg.cloudfront.net\/images\/toolbar\/toolbar.png","showDetails":1});