/**
 * Title: Converion Support - v1.0.1
 * Date: 2015-07-20 5:31:46 PM
 * Licence: WebChat
 * Copyright (c) 2015
 */
/**
 * Minified File
 */


function checkingAnalytics(){console.log("checking analytics"),console.log(window._gaq&&_gaq.push?"analytics is there":"sorry no analytics is present")}var _wcsPopUpWin="";void 0==window.isMessageListenerAttached&&(window.isMessageListenerAttached=!1),function(){function a(){try{var a=(new Date).getTime();return localStorage.setItem(a,a),localStorage.removeItem(a),!0}catch(b){return!1}}function b(a){if(-1!=a.origin.indexOf("webchat")){var b=JSON.parse(a.data);"pagepush"==b.invoke?B.pushPage(b.url):"showInvitation"==b.invoke?z.build(h):"startchat"==b.invoke?M("Chat",document.URL):"update"==b.invoke&&(y.state=b.state,y.condition=b.condition,y.timeStamp=(new Date).getTime(),null!=b.chat&&""!=b.chat&&"null"!=b.chat&&"undefined"!=typeof b.chat&&(y.chatTranscript=y.chatTranscript+b.chat),"leave"==b.action?(y.chatTranscript="",y.inProgress=!1,"on"!=m&&B.closeChannel()):("show"==b.action||"offlineform"==b.action)&&(y.inProgress=!0,null!=document.getElementById("csContainer")&&(document.getElementById("csContainer").style.display="block"),A.hide(),z.hide()),B.update(B.key,y))}}var c;window.console&&"undefined"!=typeof window.console&&null!=window.console&&void 0!=window.console?console.debug||(console.debug=function(){}):console={log:function(){},info:function(){},warn:function(){},error:function(){},trace:function(){},debug:function(){}};var d="1773736738",e="http://webchat.conversionsupport.com:80",f="https://commondatastorage.googleapis.com/docs.webchat.a-cti.com/images/chatBanners/green_white_border.png",g="Right Center",h="null",i="null",j="false",k="on",l="onpage",m="on",n="984gaa3qvgr21qwr838b8p82j"+(new Date).getTime(),o="We are currently not available.Please leave your details and we will get in touch with you as soon as possible.",p="Live Chat",q="Questions, Concerns, Feedback? We're ready to help you!",r="Your Message...",s="#d7e0cb",t="false";console.log("tabTitle::"+p+" tabInstruction::"+q+" placeholderText::"+r+" headerColour ::"+s+" newDesign ::"+t);var u="#wge24jj";language="null";var v="null";console.log("language is :::"+language),console.log("whitelabel is :::"+v);var w=document.createElement("link"),c="192.99.32.115";w.setAttribute("rel","stylesheet"),w.setAttribute("type","text/css"),w.setAttribute("href",e+"/css/proactivechat.css"),document.getElementsByTagName("head")[0].appendChild(w);var x=function(a,b,c){return(x=document.getElementsByClassName?function(a,b,c){c=c||document;for(var d,e=c.getElementsByClassName(a),f=b?new RegExp("\\b"+b+"\\b","i"):null,g=[],h=0,i=e.length;i>h;h+=1)d=e[h],(!f||f.test(d.nodeName))&&g.push(d);return g}:document.evaluate?function(a,b,c){b=b||"*",c=c||document;for(var d,e,f=a.split(" "),g="",h="https://www.w3.org/1999/xhtml",i=document.documentElement.namespaceURI===h?h:null,j=[],k=0,l=f.length;l>k;k+=1)g+="[contains(concat(' ', @class, ' '), ' "+f[k]+" ')]";try{d=document.evaluate(".//"+b+g,c,i,0,null)}catch(m){d=document.evaluate(".//"+b+g,c,null,0,null)}for(;e=d.iterateNext();)j.push(e);return j}:function(a,b,c){b=b||"*",c=c||document;for(var d,e,f=a.split(" "),g=[],h="*"===b&&c.all?c.all:c.getElementsByTagName(b),i=[],j=0,k=f.length;k>j;j+=1)g.push(new RegExp("(^|\\s)"+f[j]+"(\\s|$)"));for(var l=0,m=h.length;m>l;l+=1){d=h[l],e=!1;for(var n=0,o=g.length;o>n&&(e=g[n].test(d.className),e);n+=1);e&&i.push(d)}return i})(a,b,c)},y={channelName:null,state:null,condition:null,timeStamp:null,chatTranscript:null,isConnected:!1,inProgress:!1,joinedtime:null,init:function(a,b,c,d,e,f,g,h){this.channelName=a,this.state=b,this.condition=c,this.timeStamp=d,this.chatTranscript=e,this.inProgress=f,this.isConnected=g,this.joinedtime=h},reInit:function(a){this.channelName=a.channelName,this.state=a.state,this.condition=a.condition,this.timeStamp=a.timeStamp,this.chatTranscript=a.chatTranscript,this.inProgress=a.inProgress,this.isConnected=a.isConnected,this.joinedtime=a.joinedtime}},z={fallbackbanner:"https://commondatastorage.googleapis.com/docs.webchat.a-cti.com/images/chatBanners/chatBg1_black.png",noShow:!1,timer:null,key:"",build:function(a){if(!(document.documentElement.clientWidth<450)){var b=document.createElement("div");b.setAttribute("id","csproBlackScreen"),b.setAttribute("style","display:none;background: black;top:0px;left:0px;width:100%;height:100%;border:none;padding:0px;position: fixed;z-index:999999;opacity:.7;filter:alpha(opacity=70);"),document.body.insertBefore(b,document.body.childNodes[0]);var c=document.createElement("div"),d=document.documentElement.clientWidth<450?"display:none;zoom:76%;":"display:none;";c.setAttribute("id","proActiveWrapper"),c.setAttribute("style",d);var e=document.createElement("div");e.setAttribute("id","closeButton"),e.setAttribute("style","z-index:999999"),e.onclick=function(){document.getElementById("proActiveWrapper").style.display="none",document.getElementById("csproBlackScreen").style.display="none"};var f=document.createElement("div");f.setAttribute("id","startWrapper"),f.onclick=function(){$conversion.startChat(),document.getElementById("proActiveWrapper").style.display="none",document.getElementById("csproBlackScreen").style.display="none"};var g=document.createElement("div");g.setAttribute("id","startChat"),f.appendChild(g),c.appendChild(e),c.appendChild(f),document.body.insertBefore(c,document.body.childNodes[0]),(null==a||""==a||"null"==a||"undefined"==typeof a)&&(a=this.fallbackbanner),this.show(a)}},show:function(a){var b=document.getElementById("proActiveWrapper");null!=b&&0==this.noShow&&(document.getElementById("csproBlackScreen").style.display="block",b.style.background="transparent url("+a+") no-repeat",b.style.display="block",this.setCookie(this.key)),M("Proactive chat",document.URL)},hide:function(){null!=document.getElementById("proActiveWrapper")&&(document.getElementById("proActiveWrapper").style.display="none",document.getElementById("csproBlackScreen").style.display="none")},startTimer:function(a,b){""!=b&&null!=b&&"null"!=b&&"undefined"!=typeof b&&b>0&&"off"!=b&&(this.timer=setTimeout(function(){z.build(a)},b))},stopTimer:function(){clearTimeout(this.timer)},setCookie:function(b){0!=a()&&localStorage.setItem(b,(new Date).getTime())},removeCookie:function(b){0!=a()&&localStorage.removeItem(b)},verify:function(){if(0!=a()){var b=localStorage.getItem(this.key);return null==b||"null"==b||"undefined"==typeof b||(new Date).getTime()-b>36e5?(this.removeCookie(this.key),!0):!1}}},A={id:"conversionChatTab",fallbackimage:"https://commondatastorage.googleapis.com/docs.webchat.a-cti.com/images/chatBanners/black_white_border.png",fallbackpos:"Right Center",fallbackcolor:"FCFCFC",noshow:!1,build:function(a,b,c){(""==a||null==a||"undefined"==typeof a||"null"==a)&&(a=A.fallbackimage),(""==b||null==b||"undefined"==typeof b||"null"==b)&&(b=A.fallbackpos),"custom"==b&&(this.noshow=!0);var d=document.createElement("div");d.setAttribute("id","conversionChatTab"),d.setAttribute("class","chatIcon"),d.setAttribute("style",this.getStyle(b)),d.onclick=function(){$conversion.startChat()};var e=document.createElement("img");e.setAttribute("src",a),e.setAttribute("alt","Live Chat"),e.setAttribute("style","maring:0px;padding:0px;border:0px;"),(null==c||""==c||"undefined"==typeof u||"null"==c)&&(c=A.fallbackcolor),e.style.background="#"+c,d.appendChild(e),document.body.appendChild(d),"custom"!=b&&(d.style.display="block")},show:function(){null!=document.getElementById(this.id)&&0==this.noshow&&(document.getElementById(this.id).style.display="block")},checkAndShow:function(){null!=document.getElementById(this.id)&&0==this.noshow?document.getElementById(this.id).style.display="block":this.build(f,g,u)},hide:function(){null!=document.getElementById(this.id)&&(document.getElementById(this.id).style.display="none")},getStyle:function(a){var b="display:none;position: fixed; z-index: 99999; cursor: pointer;",c="Microsoft Internet Explorer"==window.navigator.appName&&-1!=window.navigator.userAgent.indexOf("MSIE 8.0")?!0:!1;switch(a){case"custom":b+="";break;case"Right Center":b+="top: 40%;",b+=-1!=window.navigator.userAgent.indexOf("Opera Mini")&&"1667099495"==d?"left: "+(document.documentElement.clientWidth-30)+"px;":"right: -3px;";break;case"Left Center":b+="left: -3px; top: 40%;";break;case"Bottom Right":b+="-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);;-o-transform:rotate(90deg);transform:rotate(90deg);zoom:1;",b+=c?"right: 10%;filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);bottom: -102px":"right: 6%;-ms-transform:rotate(90deg);bottom: -51px;";break;case"Bottom Left":b+="left: 6%; bottom: -51px;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);zoom: 1;-ms-transform:rotate(90deg);",b+=c?"filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);bottom: -102px":"-ms-transform:rotate(90deg);bottom: -51px;";break;default:b+="right: -3px; top: 40%;"}return b}},B={hidecsBrand:!1,whiteLabelVal:!1,wcs:null,subacctno:null,updateTimer:null,key:null,targetWindow:null,init:function(a){this.subacctno=a,this.key="csmd-"+a,z.key="pc-"+a,this.verify()},store:function(a,b,c,d,e,f,g,h){y.init(a,b,c,d,e,f,g,h),localStorage.setItem(this.key,JSON.stringify(y)),this.startUpdater()},retreive:function(a){try{var b=localStorage.getItem(a);return JSON.parse(b)}catch(c){return null}},remove:function(a){localStorage.removeItem(a)},update:function(a,b){localStorage.setItem(a,JSON.stringify(b))},flush:function(){localStorage.clear()},startUpdater:function(){var a=this.retreive(this.key);null!=a&&"null"!=a&&(a.timeStamp=(new Date).getTime(),this.update(this.key,a),this.updateTimer=setTimeout(function(){B.startUpdater()},6e4))},stopUpdater:function(){clearTimeout(this.updateTimer)},verify:function(){var a=(new Date).getTime(),b=B.retreive(B.key);if("undefined"==typeof b||""==b||null==b||"null"==b||(a-b.timeStamp)/1e3>63||"popup"==l){if(A.build(f,g,u),"on"!=k&&1!=j&&"true"!=j||1!=z.verify()||z.startTimer(h,i),"popup"!=l)if("on"!=m||1!=j&&"true"!=j){var c={clientId:d,offlineMessage:o};this.postMessage(c)}else{"undefined"==typeof demoskill?demoskill=null:n=demoskill+"/"+n,this.store("/visitor/"+d+"/"+n,"Looking Around","viewing",(new Date).getTime(),"",!1,!0,(new Date).getTime()),window.localStorage.setItem(B.key+"-prevLink",document.URL);var e=new Object;e.connectionName="/visitor/"+d+"/"+n,e.connectionGuid=n,e.previousPage=window.localStorage.getItem(B.key+"-prevLink"),e.pageUrl=document.URL,e.pageTitle=document.title,e.state="Looking Around",e.condition="viewing",e.timeinmillisec=(new Date).getTime(),e.clientId=d,e.offlineMessage=o,e.action="start",e.joinedtime=(new Date).getTime(),this.postMessage(e)}}else{y.reInit(b),localStorage.setItem(this.key,JSON.stringify(y)),this.startUpdater();var e=new Object;e.connectionName=b.channelName,null!=b.channelName&&"undefined"!=typeof b.channelName&&(e.connectionGuid=b.channelName.split("/")[3]),e.previousPage=window.localStorage.getItem(B.key+"-prevLink"),e.pageUrl=document.URL,e.pageTitle=document.title,e.state=b.state,e.condition=b.condition,e.time=(new Date).getTime(),e.timeinmillisec=(new Date).getTime(),e.chatHistory=b.chatTranscript,e.clientId=d,e.offlineMessage=o,e.action="resume",e.joinedtime=b.joinedtime,this.postMessage(e),window.localStorage.setItem(B.key+"-prevLink",document.URL),y.inProgress&&(document.getElementById("csContainer").style.display="block"),("done"==b.condition||"viewing"==b.condition)&&A.checkAndShow()}},startChat:function(){if(z.stopTimer(),z.setCookie(z.key),z.hide(),"popup"==l){var a=e+"/livechat/loadpopchat?clientid="+d+"&clienturl="+document.URL;return _wcsPopUpWin=window.open(a,"LiveChat","width=450,height=450"),void M("Chat-popup",document.URL)}if(1==y.inProgress&&1==y.isConnected)return void(null!=document.getElementById("csContainer")&&(document.getElementById("csContainer").style.display="block"));A.hide();var b=document.createElement("script");b.setAttribute("type","text/javascript"),"undefined"!=typeof demoskill&&null!=demoskill&&"null"!=demoskill?b.setAttribute("src",e+"/livechat/getstatus/"+demoskill+"."+d+"?callback=$conversion.startChatCb"):b.setAttribute("src",e+"/livechat/getstatus/"+d+"?callback=$conversion.startChatCb"),document.body.appendChild(b)},startChatCb:function(a){var b="",c="";if(1==a){if(y.isConnected){var a=new Object;a.action="publishStartChatMessage",this.postMessage(a)}else{this.store("/visitor/"+d+"/"+n,"Looking Around","viewing",(new Date).getTime(),"",!1,!0);var a=new Object;a.connectionName="/visitor/"+d+"/"+n,a.connectionGuid=n,a.previousPage=window.localStorage.getItem(B.key+"-prevLink"),a.pageUrl=document.URL,a.pageTitle=document.title,a.state="Trying to initiate a chat",a.condition="incoming",a.time=(new Date).getTime(),a.joinedtime=(new Date).getTime(),a.action="start",this.postMessage(a),window.localStorage.setItem(B.key+"-prevLink",document.URL),a.action="publishStartChatMessage",this.postMessage(a)}b="Trying to initiate a chat",c="incoming",M("Chat",document.URL)}else if(2==a){if(y.isConnected);else{this.store("/visitor/"+d+"/"+n,"Looking Around","viewing",(new Date).getTime(),"",!1,!0);var a=new Object;a.connectionName="/visitor/"+d+"/"+n,a.connectionGuid=n,a.previousPage=window.localStorage.getItem(B.key+"-prevLink"),a.pageUrl=document.URL,a.pageTitle=document.title,a.state="Showing prechat survey form",a.condition="prechatsurvey",a.time=(new Date).getTime(),a.action="start",this.postMessage(a),window.localStorage.setItem(B.key+"-prevLink",document.URL)}var a=new Object;a.state="Showing prechat survey form",a.condition="incoming",a.action="prechatsurvey",this.postMessage(a),b="Showing prechat survey form",c="prechatsurvey",M("Pre-chat survey",document.URL)}else if(3==a){if(y.isConnected){var a=new Object;a.action="publishStartChatMessage",this.postMessage(a)}else{var a=new Object;a.clientId=d,a.offlineMessage=o,a.action="showofflineform",this.postMessage(a)}b="Showing Offline Form",c="offlineform",M("Offline form",document.URL)}y.inProgress=!0,y.state=b,y.condition=c,null!=document.getElementById("csContainer")&&(document.getElementById("csContainer").style.display="block"),y.timeStamp=(new Date).getTime(),this.update(this.key,y)},sendMetaDataAndStartChat:function(a){console.info("inside sendMetaData And StartChat");var b=new Object;b.action="sendMetaData",b.metaData=a,this.postMessage(b)},stopChat:function(){if(null!=document.getElementById("csContainer")&&(document.getElementById("csContainer").style.display="none"),"on"==m){var a=new Object;a.action="publishStopMessage",this.postMessage(a),y.state="done",y.condition="done",y.inProgress=!1,y.chatTranscript="",this.update(this.key,y)}else this.closeChannel();A.checkAndShow(),M("End Chat",document.URL)},openChannel:function(){},closeChannel:function(){null!=document.getElementById("csContainer")&&(document.getElementById("csContainer").style.display="none");var a=new Object;a.connectionName=y.channelName,a.action="leave",this.postMessage(a),y.state="done",y.condition="done",y.inProgress=!1,y.isConnected=!1,y.chatTranscript="",this.remove(this.key),this.stopUpdater(),A.checkAndShow()},pushPage:function(a){window.location=a},showChatSurvey:function(){},postMessage:function(a){null==this.targetWindow?this.targetWindow=document.getElementById("monitor").contentWindow:null,null!=this.targetWindow&&this.targetWindow.postMessage(JSON.stringify(a),"*")}};window.$conversion||(window.$conversion=B),window.$conversion.metaData||(window.$conversion.metaData=y);var C=window.postMessage?"noprobs":"issues";if("popup"==l||0==a()||"issues"==C)l="popup",$conversion.init(d);else{var D=document.createElement("div");D.setAttribute("class","csContainer"),D.setAttribute("id","csContainer"),D.setAttribute("style","position:fixed;bottom:0px;right:0px;height:347px;width:290px;display:none;z-index:9999999;"),document.body.appendChild(D);var E=document.createElement("img");E.setAttribute("src","https://commondatastorage.googleapis.com/docs.webchat.a-cti.com/dev/templates/close_icon.png"),E.setAttribute("alt","Close Chat"),E.setAttribute("style","position: absolute;top: -14px;z-index: 99999;width:20px;right:3px;cursor: pointer;"),E.onclick=function(){$conversion.stopChat()},D.appendChild(E);var F=document.createElement("iframe");F.setAttribute("frameBorder","0"),F.setAttribute("id","monitor"),F.setAttribute("style","display:block;height:350px;width:280px;border: none;position: absolute;right: 10px;bottom: 4px; background: transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0px 0px 8px #000;-moz-box-shadow:0px 0px 8px #000;box-shadow:0px 0px 8px #000;");var G=function(){if("undefined"!=typeof window.csConfig&&null!=window.csConfig)try{var a={};a.fb=csConfig.fbPageName,a.twitter=csConfig.twitterHandle,a.font=csConfig.fontType,a.fontSize=csConfig.textsize,a.fontTabSize=csConfig.textTabsize,a.showPhoneField=csConfig.showPhoneField||!1,a.phoneRequired=csConfig.phoneRequired||!1,a.metaJson=csConfig.metaJson,a.action="initSettings",B.postMessage(a)}catch(b){}$conversion.init(d)};if(F.setAttribute("src",e+"/pages/BrandedChatWindow-exp.html#"+d+"#"+language+"#"+c),window.addEventListener?F.addEventListener("load",G,!1):F.attachEvent("onload",G),D.appendChild(F),"undefined"!=typeof window.csConfig&&null!=window.csConfig){console.info("inside cs config for hiding powered by");try{this.hidecsBrand=csConfig.hidePoweredBy||!1}catch(H){}}this.whiteLabelVal="true"===v?!0:!1,console.log("whiteLabelVal :: "+whiteLabelVal);var I=document.createElement("a");I.setAttribute("href","http://www.conversionsupport.com"),I.setAttribute("target","_blank"),I.innerHTML="Powered By Conversion Support",console.info("hide cs brand "+this.hidecsBrand),checkingAnalytics(),this.hidecsBrand||this.whiteLabelVal?I.setAttribute("style","font-size:10px;color:#fafafa;text-decoration:none;position:absolute;padding:9px;display:none;bottom:4px;right:12px;font-weight:normal;line-height: 0px;"):I.setAttribute("style","font-size:10px;color:#fafafa;text-decoration:none;position:absolute;padding:9px;display:block;bottom:4px;right:12px;font-weight:normal;line-height: 0px;"),D.appendChild(I)}if(window.onload){var J=window.onload;window.onload=function(){J();for(var a=x("chatIcon"),b=0;b<a.length;b++)a[b].onclick=function(){$conversion.startChat()},a[b].style.cursor="pointer"}}else window.onload=function(){for(var a=x("chatIcon"),b=0;b<a.length;b++)a[b].onclick=function(){$conversion.startChat()},a[b].style.cursor="pointer";try{if("undefined"==typeof a||null==a||a.length<=0){var c=document.getElementById("chatIcon");null!=c&&(c.onclick=function(){$conversion.startChat()},c.style.cursor="pointer")}}catch(d){}};if(window.onunload){var K=window.onunload;window.onunload=function(){K();var a=$conversion.retreive();null!=a&&"null"!=a&&(a.timeStamp=(new Date).getTime(),$conversion.update($conversion.key,a))}}else window.onunload=function(){var a=$conversion.retreive();null!=a&&"null"!=a&&(a.timeStamp=(new Date).getTime(),$conversion.update($conversion.key,a))};var L={key:"csAutoStartChat",start:function(){if(1!=y.inProgress||1!=y.isConnected){if("on"==k)return void this.startCb("true");var a=document.createElement("script"),b=e+"/livechat/checkforreadyusers/"+d+"?callback=$conversion.autoChat.startCb";a.setAttribute("type","text/javascript"),a.setAttribute("src",b),document.body.appendChild(a)}},startCb:function(a){("true"==a||1==a)&&($conversion.startChat(),this.setCookie(this.key,1343301486066,.0833))},check:function(){var a=this.readCookie(this.key);("undefined"==typeof a||null==a||"null"==a||""==a)&&this.start()},setCookie:function(a,b,c){var d=new Date,e=new Date;(null==c||0==c)&&(c=1),e.setTime(d.getTime()+864e5*c),document.cookie=a+"="+escape(b)+";expires="+e.toGMTString()},readCookie:function(a){var b=" "+document.cookie,c=b.indexOf(" "+a+"=");if(-1==c&&(c=b.indexOf(";"+a+"=")),-1==c||""==a)return"";var d=b.indexOf(";",c+1);return-1==d&&(d=b.length),unescape(b.substring(c+a.length+2,d))}};window.$conversion.autoChat||(window.$conversion.autoChat=L),window.isMessageListenerAttached||(window.addEventListener?window.addEventListener("message",b,!1):window.attachEvent("onmessage",b),window.isMessageListenerAttached=!0);var M=function(){var a="ConversionSupport-"+d;return function(b,c){console.log("triggering analytics for "+b+"and"+c),window._gaq&&_gaq.push?_gaq.push(["_trackEvent",a,b,c]):"",window._gaq&&_gaq.push?(console.log("analytics is there"),_gaq.push(["_trackEvent",a,b,c])):console.log("sorry no analytics is present");try{window.ga?ga("send","event",a,b,c):"",window.ga?ga("agg_Track.send","event",a,b,c):""}catch(d){console.error("Error pushing data to universal analytics : "+d)}}}()}(),"function"==typeof conversionReady&&conversionReady();