var onWebChat_=onWebChat_||function(){function e(){c('chattext')&&c('chattext').endsWith(at('max_gone',U)+"
")&&(K=!1,w&&console.log("isAbleToWrite to false!"),document.getElementById('onwbtxtarea').style.pointerEvents='none',document.getElementById('wb-send-image').style.pointerEvents='none',document.getElementById('wb-smile-image').style.pointerEvents='none',document.getElementById("onwbtxtarea").style.opacity="0.42",document.getElementById("wb-send-image").style.opacity="0.42",document.getElementById("wb-smile-image").style.opacity="0.42",It('#onwbtxtarea').attr('placeholder',''),disableMenuItem("uploadfileid"))}function t(){K=!0,w&&console.log("isAbleToWrite to true!");try{document.getElementById('onwbtxtarea').style.pointerEvents='auto',document.getElementById('wb-send-image').style.pointerEvents='auto',document.getElementById('wb-smile-image').style.pointerEvents='auto'}catch(e){}document.getElementById("onwbtxtarea").style.opacity="1",document.getElementById("wb-send-image").style.opacity="0.73",document.getElementById("wb-smile-image").style.opacity="0.78",It('#onwbtxtarea').attr('placeholder',at('max_placeholder',U)),enableMenuItem("uploadfileid")}function o(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function n(){if(ft){var e=document.getElementById("onwebchataudio");try{e.play()}catch(t){w&&console.log("exception in audio.play:"+t)}w&&console.log("play sound!!! : ")}}function a(e,t,o){w&&console.log("set cookie! cname:"+e+" value:"+t+" exdays:"+o);var n=new Date;n.setTime(n.getTime()+24*o*60*60*1e3);var a="expires="+n.toGMTString();document.cookie=e+"="+t+"; "+a+";path=/"}function i(e){a(e,'',-1)}function s(e){for(var t=e+"=",o=document.cookie.split(';'),n=0;n'+d+''+at('max_agent',U).replace('{{operator}}',t)+' '+o(e).replace(/({{newline}})/gm,"
")+'
'+at('max_me',U)+" [loading...]
"),1==t&&It("#onwbchtUploadForm").submit(),!0); },SaveToFile=function(e){try{if(""!=c('chattext')){It(".onwebchat-widget-settings-submenu").hide();var t=new Date,o=t.getFullYear()+'-'+(t.getMonth()+1)+'-'+t.getDate(),n=t.getHours()+':'+t.getMinutes()+':'+t.getSeconds();strBy="\n## by www.onwebchat.com ",1==se&&(strBy=""),r('chat_'+o+'.txt','## Chat transcipt on '+o+' '+n+strBy+'\n\n'+i(It(e).html()))}}catch(a){console.log(a)}},PrintElem2Printer=function(e){try{""!=c('chattext')&&(It(".onwebchat-widget-settings-submenu").hide(),Popup2Print(It(e).html()))}catch(t){console.log(t)}},Popup2Print=function(e){var t=window.open('','onWebChat live chat - Print ','height=600,width=800');return t.document.write('
',"
',"'+at('max_me',U)+' '+o(e)+'
'),G="me",setTimeout(function(){rt.emit('sendchat',e)},300),Q="chat",$(),!1}),It('input#onwc_consent_checkbox_offline').change(function(){1==document.getElementById("onwc_consent_checkbox_offline").checked&&document.getElementById("onwc_consent_l_offline").style.setProperty("color","#545454")}),It('input#onwc_consent_checkbox_prechat').change(function(){1==document.getElementById("onwc_consent_checkbox_prechat").checked&&document.getElementById("onwc_consent_l_prechat").style.setProperty("color","#545454")}),It('input#onwebchatoffemail').keyup(function(){h(It("input#onwebchatoffemail").val())&&(document.getElementById("onwebchatoffemail").style.setProperty("border","1px solid #ccc","important"),oe())}),It('textarea#onwebchatemailtext').keyup(function(){It("textarea#onwebchatemailtext").val().length>=1&&(document.getElementById("onwebchatemailtext").style.setProperty("border","1px solid #ccc","important"),oe())}),It('input#onwebchatofftel').keyup(function(){It("input#onwebchatofftel").val().length>=4&&(document.getElementById("onwebchatofftel").style.setProperty("border","1px solid #ccc","important"),oe())}),It('input#onwebchatoffname').keyup(function(){It("input#onwebchatoffname").val().length>=2&&(document.getElementById("onwebchatoffname").style.setProperty("border","1px solid #ccc","important"),oe())}),It('input#onprechatemail').keyup(function(){h(It("input#onprechatemail").val())&&(document.getElementById("onprechatemail").style.setProperty("border","1px solid #ccc","important"),oe())}),It('textarea#onprechattext').keyup(function(){It("textarea#onprechattext").val().length>=1&&(document.getElementById("onprechattext").style.setProperty("border","1px solid #ccc","important"),oe())}),It('input#onprechattel').keyup(function(){It("input#onprechattel").val().length>=4&&(document.getElementById("onprechattel").style.setProperty("border","1px solid #ccc","important"),oe())}),It('input#onprechatname').keyup(function(){It("input#onprechatname").val().length>=2&&(document.getElementById("onprechatname").style.setProperty("border","1px solid #ccc","important"),oe())}),loadEmoticons=function(){""==It('#onwebchat-emoticons-div').html()&&It('#onwebchat-emoticons-div').append(''+at('max_me',U)+' '+o(t)+'
'),G="me",w&&console.log("send normal text, msg:"+t),clearTimeout(y),c('mustSendTriggerText')&&1==_?(rt.emit('sendchat',t,c('triggerText')),e(),l('mustSendTriggerText',!1),_=!1,r('triggerText')):(rt.emit('sendchat',t),e())}Z=0}function x(){var e=It('#onwbtxtarea').val();w&&console.log("onwebSendTextInsights:: msg:"+e),""!=e.trim()&&rt.emit('sendchat',e,void 0,1)}function P(){isRTLlanguage(at('max_placeholder',U).trim().substring(0,2))?W("rtl","right"):W("","left")}function W(e,t){It('.chat_message textarea')[0].style.setProperty("direction",e,"important"),It('.chat_message textarea')[0].style.setProperty("text-align",t,"important")}function B(){window.removeEventListener('mousemove',$,!0)}function A(e){var t;e.target?t=e.target:e.srcElement&&(t=e.srcElement),w&&console.log("onwbmouseDown: e:"+t.id),"onweb_minimize_btn_icon_id"!=t.id&&1==c('maxChat')&&(se=1,window.addEventListener('mousemove',$,!0),It("#webchat_header").css('cursor','move'))}function $(e){var t=It(window).height(),o=It(window).width(),n=parseInt(It("#onwbchat_window").css('height')),a=e.clientX,i=e.clientY;if(1==se){var s=It(window).scrollTop(),c=It(window).scrollLeft();divTop=It("#webchat_header").offset().top-s,divLeft=It("#webchat_header").offset().left-c,oe=a-divLeft,ae=i-divTop}se=0,f=1;var l=document.getElementById('onwbchat_window');l.style.position='absolute',p=i-ae,0>i-ae&&(p=0),i-ae>t-n&&(p=t-n),l.style.top=p+'px',g=a-oe,0>a-oe&&(g=0),a-oe>o-ce&&(g=o-ce),l.style.left=g+'px'}var J={query:{server:dt},reconnectionAttempts:40};rt=u?io.connect('http://'+serverIP+ct,J):io.connect('https://'+serverIP+ct,J),w&&console.log('call connect ..'),rt.on('disconnect',function(){ht=!1,w&&console.log("on socket disconnect.."+new Date)}),rt.on('error',function(e){w&&console.log('Unable to connect Socket.IO'+e)}),rt.on('connect_error',function(e){w&&console.log('on connect_error: '+e)}),rt.on('connect_timeout',function(){w&&console.log('on connect_timeout')}),rt.on('reconnect',function(){w&&console.log('on reconnect')}),rt.on('reconnecting',function(e){w&&console.log('on reconnecting , attempt:'+e)}),8!=m()&&(lt=setTimeout(function(){rt.io.disconnect(),minimizeChatWindow()},wt)),rt.on('connect',function(){X++,X>10&&(rt.io.disconnect(),rt.disconnect(),rt=null),ht=!0,gt=!1,w&&console.log("on connect..."+new Date),sessionrandom=s('onwbchtsessionrandom'),'null'!=sessionrandom&&null!=sessionrandom&&''!=sessionrandom&&'undefined'!=sessionrandom||(sessionrandom=Math.floor(1e6*Math.random()+1),a("onwbchtsessionrandom",Math.floor(1e6*Math.random()+1),365));var e=document.referrer,t=0;if(!pt&&(null==c('chattext')||''==c('chattext')))var t=Math.floor(11e3*Math.random())+1e4;setTimeout(function(){rt.emit('userconnect',bt,I,k,C,E,Re,Ve,screen.width,sessionrandom,Me,qe,He,ne,N,e,s('onwbchtlastvisit'),$e,Xe,vt,pt,le,Be,Se)},t),pt=!1}),rt.on('onwcemailtranscript_ok',function(){toggleModal('onwcEmailOkModal')}),rt.on('addvisited1',function(e){He++,a("onwbchttimesVisited",He,93),a("onwbchtlastvisit",e,93)}),rt.on('setCookie',function(e,t){"onwbchtclientid"==e&&(''!=s('onwbchtclientid')&&null!=s('onwbchtclientid')&&(w&&console.log("vrika kai palio cookie onwbchtclientid me timi:"+s('onwbchtclientid')+" o server esteile:"+t+" (pithano visitor deleted)"),s('onwbchtclientid')!=t&&(deleteAllCookies(),l('chattext',''),It('#onwbchat_window .chat_area p').remove(),It("#onwbchat_window .onwebchat_title2").css("display","block"))),bt=t),a(e,t,365),w&&console.log('set cookie...')}),rt.on('chatWindowMax',function(e){w&&console.log("on chatWindowMax max!!:"+e),1==e?maximizeChatWindow():0==e&&minimizeChatWindow()}),rt.on('updateagents',function(e){w&&console.log("on updateagents agentsdata:"+e),T(e)}),rt.on('newChatEvent',function(e){nt('onWebChat','Chat started','by '+e)}),rt.on('setAgentOnlineHideOffline',function(o,n,a,i){if(1!=q){void 0==a&&(a=0),ee=a;try{w&&console.log(" on setAgentOnlineHideOffline, setAgentOnline: "+o+" setHideOffline:"+n+" blocked:"+vt+" sessionStorage.chattext.length:"+sessionStorage.chattext.length)}catch(s){console.log(s)}if(w&&console.log(" realAgentOnlineTemp: "+a),1==o&&void 0!=i&&''!=i&&(D=i,It('#operatorImage').attr('src',st+'//'+serverIP+'/filesUpload/operatorImages/'+i)),void 0!=o&&null!=o&&(le!=o&&(1==o?(It("#div_chat_min_title_span").text(at('min_online',U)),It('#onweb-offline-icon').hide(),It('#onweb-online-icon').show(),""!=F&&It('#webchat_header')[0].style.setProperty('background-color',F,'important')):setTimeout(function(){It("#div_chat_min_title_span").text(at('min_offline',U)),It('#onweb-offline-icon').show(),It('#onweb-online-icon').hide(),""!=j&&It('#webchat_header')[0].style.setProperty('background-color',j,'important'),""!=j&&It('#offlineform_btn')[0].style.setProperty('background-color',j,'important')},300)),le=o,re=n,(1==le||1!=re||c('chattext').length>0)&&0==vt?(w&&console.log("show........."),0!=V&&showChatWindow()):(w&&console.log("hide........."),hideChatWindow()),c('chattext').endsWith(at('max_gone',U)+"")&&1==le&&0!=ee&&(It('p:last-child','#onwbchat_window .chat_area').remove(),l('chattext',c('chattext').substring(0,c('chattext').lastIndexOf(''))),t()),1==le&&0!=ee&&t(),1!=le&&0==ee&&c('chattext').length>0&&!c('chattext').endsWith(at('max_gone',U)+""))){var r=2e3;1==b&&(r=5e3),setTimeout(function(){1==le||0!=ee||c('chattext').endsWith(at('max_gone',U)+"")||printChat(''),e()},r)}}}),rt.on('setIsBlocked',function(e){w&&console.log(" on setIsBlocked, set isBlocked: "+e),void 0==e&&(e=0,w&&console.log("isBlocked undefined , so set it to 0")),vt=e,a("onwbchtblocked",e,183),1==vt?hideChatWindow():0==vt&&(1!=le&&1==re||0!=V&&showChatWindow())}),rt.on('visitordeleted',function(){w&&console.log(" on visitordeleted"),l('chattext',''),It('#onwbchat_window .chat_area p').remove(),setTimeout(function(){It("#onwbchat_window").fadeOut(700,'swing')},200),deleteAllCookies(),rt.disconnect()}),deleteAllCookies=function(){i("onwbchtclientid"),i("inChatC"),i("onwbchtSound"),i("onwbchtblocked"),i("onwbchtexpress.sid"),i("onwbchtlastvisit"),i("onwbchtsessionrandom"),i("onwbchttimesVisited")},rt.on('servercommand',function(e,t,o,n,i){null!=o&&""!=o||(o="operator"),w&&console.log(" on servercommand: "+e+" agentinfo:"+n+" agentImage:"+i),'close_dialog'==e?(w&&console.log('close_dialog get... clear chatdialogid cookie...'),w&&console.log('clear chatdialogid cookie...'),1==s('inChatC')&&""!=at('max_closed',U)&&printChat(''),l("servingOpImage",""),D="",a('inChatC',0,.166),l('hasTriggeredNoReply',0),a('hasTriggeredNoReplyC',0,.166)):'serve_dialog'==e?(b="androidapp"==n?1:0,w&&console.log("served_by command.. isAgentFromAndroid:"+b+" agentImage:"+i),""!=at('max_served',U)&&(c('hasWrSeByTr')||printChat('')),w&&console.log("agent name:"+o),void 0!=i&&''!=i&&(D=i,l("servingOpImage",i),It('#operatorImage').attr('src',st+'//'+serverIP+'/filesUpload/operatorImages/'+i))):'no_agent'==e&&printChat('')}),rt.on('updatechat',function(e,i,s,l){if(null!=l&&""!=l||(l="operator"),w&&console.log(" on updatechat: data: "+s+" agentname:"+l+" showChatApi:"+V),'command:typing...'==s)It('#agenttypingimage').remove(),It('#onwbchat_window .chat_area').append("
"),It('#onwbchat_window .chat_area').animate({scrollTop:9999999},200);else if('command:notyping...'==s)try{null!=document.getElementById('agenttypingimage')&&(document.getElementById('agenttypingimage').style.visibility='hidden')}catch(r){}else if(0==V)w&&console.log("den emfanizetai epeidi showchatapi=0");else{n(),clearTimeout(y),t(),It('#agenttypingimage').remove();var d="",m='',h="";1==H&&(d=" agent-bubble "),'agent'!=G&&(d+=" agent-first ",1==R&&(m=''+m+''+at('max_agent',U).replace('{{operator}}',l)+' '+o(s)+'
'),G="agent",""!=e&&1!=c('maxChat')&&(w&&console.log(" MaximizeWindowInit , giati: fromSocket!=0 kai maxChat!=1! fromSocket:"+e+" maxChat:"+c("maxChat")),MaximizeWindowInit()),1!=le&&(w&&console.log("agentOnline!=1 !!!"),null!=c('chattext')&&''!=c('chattext')&&w&&console.log("sessionstorage.chattext!=null"),showChatWindow()),w&&console.log(" prechatform -> display:"+It("#onwbchat_window").find("#prechat_form").css("display")),'block'==It("#onwbchat_window").find("#prechat_form").css("display")&&showChatWindow()}}),printChat=function(e){It("#onwbchat_window .onwebchat_title2").css("display","none"),It("#onwbchat_window #triangle_down").css("display","none");var t=/(\b(https?|ftp|file):\/\/(?![-A-Z0-9+\/:.]*filesUpload\/operatorImages)[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,o=t.exec(e);if(null!=o){o=o[0];var n=d(o);w&&console.log("urlDomain (a): "+n+" url:"+o),e=n==d(window.location.href)?e.replace(t,"$1"):e.replace(t,"$1")}var t=/(^|[^\/])(www\.[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,a=t.exec(e);if(null!=a){a=a[0];var n=d(a);e=n==d(window.location.href)?e.replace(t,"$1$2"):e.replace(t,"$1$2")}for(var i=!1;e.indexOf("{{fileuploaded:")>-1;){var s=(e.indexOf("{{fileuploaded:")+1,e.indexOf("{{fileuploaded:")+15),r=e.indexOf("}}",s),h=e.substring(s,r),g=h.replace(/^.*[\\\/]/,'');w&&console.log("filename:"+g);var p="";g.toLowerCase().endsWith(".png")||g.toLowerCase().endsWith(".jpg")||g.toLowerCase().endsWith(".jpeg")||g.toLowerCase().endsWith(".svg")||g.toLowerCase().endsWith(".gif")?(i=!0,Y++,p='
'),null!=document.getElementById('agenttypingimage')?It('#onwbchat_window .chat_area #agenttypingimage').before(e):It('#onwbchat_window .chat_area').append(e),It('#onwbchat_window .chat_area').animate({scrollTop:9999999},200),c('chattext')?l('chattext',c('chattext')+e):l('chattext',e),8!=m()&&(clearTimeout(lt),lt=setTimeout(function(){rt.io.disconnect(),minimizeChatWindow()},wt)),enableMenuItem("onwebchat-print-li"),enableMenuItem("onwebchat-savetofile-li"),6>De&&enableMenuItem("onwebchat-email-li"),enableMenuItem('onwebchat-endchat-li'),340>he&&It(".operatorImageSmallClass").css("zoom","0.9"),checkMobileChatHeight()},removeLoadingImage=function(e){It('#'+e).css('background','none')};var Z=0,K=0,Q=0,te="";It('.chat_message textarea').on('paste',function(e){w&&console.log(" on paste.."),0==ht&&0==gt&&(w&&console.log(" isConnected = false , so try to connect now.."),S())}),It('.chat_message textarea').on('keypress',function(e){13!=e.keyCode||e.shiftKey?(1!=L&&1!=c('hasStartedWriting')&&(O(),l('hasStartedWriting',1)),L=1,0==ht&&0==gt&&(w&&console.log(" isConnected = false , so try to connect now.."),S()),0==Z&&(rt.emit('sendchat','command:typing...'),Z=1),'free'!=ie&&0==Q&&(Q=setTimeout(function(){x(),Q=0},500)),clearTimeout(K),K=setTimeout(function(){Z=0,clearTimeout(Q),rt.emit('sendchat','command:notyping...')},1800)):(e.preventDefault(),h(),clearTimeout(Q),Q=0)}),It('#wb-send-image').on('click',function(e){h(),It("#onwbtxtarea").focus(),checkText2ShowSendButton()}),isRTLlanguage=function(e){var t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\uFB50-\uFC3F\uFE70-\uFEFC]/;return result=t.test(e),result},P(),It('.chat_message textarea').on('keyup',function(e){38==e.keyCode&&''==It(this).val()&&It(this).val(te),""!=It('#onwbtxtarea').val().trim().substring(0,2)?isRTLlanguage(It('#onwbtxtarea').val().trim().substring(0,2))?W("rtl","right"):W("","left"):""==It('#onwbtxtarea').val()&&P(),1==Be&&1!=s('consentvalue')&&2!=s('consentvalue')&&toggleModal("onwcConsentModal",!0),checkText2ShowSendButton()}),checkText2ShowSendButton=function(){""==It('#onwbtxtarea').val()&&1==v?document.getElementById("wb-send-image").style.visibility="hidden":document.getElementById("wb-send-image").style.visibility="visible"},checkText2ShowSendButton(),It('#onwebchatemailtext').on('keyup',function(e){isRTLlanguage(It('#onwebchatemailtext').val().substring(0,2))?(It('#onwebchatemailtext')[0].style.setProperty("direction","rtl","important"),It('#onwebchatemailtext')[0].style.setProperty("text-align","right","important")):(It('#onwebchatemailtext')[0].style.setProperty("direction","","important"),It('#onwebchatemailtext')[0].style.setProperty("text-align","left","important"))}),It('#onprechattext').on('keyup',function(e){isRTLlanguage(It('#onprechattext').val().substring(0,2))?(It('#onprechattext')[0].style.setProperty("direction","rtl","important"),It('#onprechattext')[0].style.setProperty("text-align","right","important")):(It('#onprechattext')[0].style.setProperty("direction","","important"),It('#onprechattext')[0].style.setProperty("text-align","left","important"))});var oe,ae,se=0,ce=parseInt(It("#onwbchat_window").css('width'));try{document.getElementById('webchat_header').addEventListener('mousedown',A,!1),document.getElementById('onweb_minimize_btn_icon_id').removeEventListener('mousedown',A),window.addEventListener('mouseup',B,!1)}catch(de){w&&console.log("error on 11112 : "+de)}z()}It=jQuery.noConflict(!0),w&&console.log("jquery loaded!"),'undefined'==typeof JSON&&(w&&console.log(" JSON: undefined!!! mallon ie8 me html 4 ?"),mt=!0);var Te=!1;10705==ne&&d()&&(Te=!0),w&&console.log(" getName at begining :"+I),'function'!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,'')}),maximizeChatWindow=function(){if(w&&console.log(" maximizeChatWindow() .. showOnlyImage: "+Z+" mobile:"+Xe),It("#onwbchat_window").css("animation-iteration-count","0"),document.getElementById("onwbchat_window").style.setProperty("box-shadow","rgba(0, 0, 0, 0.43) 0px 0em 1.2em","important"),(1==Z||Xe)&&(w&&console.log(" if --> showOnlyImage: "+Z+" mobile:"+Xe),It("#onwbchat_window").fadeIn(100,'swing')),"none"==It("#onwbchat_window #div_chat_max_title").css("display")&&W(),It("#onweb_chatimage_div #onweb_chatimage").css("display","none"),It("#onwbchat_window .onweb_chatimage_x").css("display","none"),1==re||0!=le||null!=c('chattext')&&''!=c('chattext')?1==te&&0===c('chattext').length?(Q="prechat",It("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display","none"),It("#onwbchat_window").find("#offline_form").css("display","none"),It("#onwbchat_window").find("#prechat_form").css("display","block"),It("#onwbchat_window #div_chat_max_title_span").text(at('max_title',U))):(Q="chat",It("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display","block"),It("#onwbchat_window").find("#offline_form").css("display","none"),It("#onwbchat_window").find("#prechat_form").css("display","none"),It("#onwbchat_window #div_chat_max_title_span").text(at('max_title',U))):(Q="offline",It("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display","none"),It("#onwbchat_window").find("#offline_form").css("display","block"),It("#onwbchat_window #div_chat_max_title_span").text(at('off_title',U)),It("#onwbchat_window").find("#prechat_form").css("display","none")),Xe){It("#onwbchat_window").css("height","95%");var e=It("#onwbchat_window").width();It("#onwbtxtarea")[0].style.setProperty("width",e-48-23*v+"px","important"),It("#chat_area_id").css("width",e-0+"px","important"),It("#webchat_header")[0].style.setProperty("width",e-40+"px","important")}else It("#onwbchat_window").css("height",de),It("#onwbchat_window").css("top",p+"px"),It("#onwbchat_window").css("left",g+"px"),1==v&&document.getElementById("onwbchat_window").style.setProperty("bottom","20px","important");return 1==v?(document.getElementById("div_chat_min_title").style.setProperty("line-height","42px","important"),document.getElementById("webchat_header").style.setProperty("height",me+"px","important")):document.getElementById("webchat_header").style.setProperty("height",me-0+4+"px","important"),It("#onwbchat_window").find(".onweb_minimize_btn").css("display","inline"),It("#onwbchat_window").find(".onweb_minimize_btn").css("position","absolute"),It("#onwbchat_window").find(".onweb_minimize_btn").css("right","0px"),It("#onwbchat_window .webchat_header").css("cursor","move"),It("#onwbchat_window #div_chat_max_title").css("display","block"),It("#onwbchat_window #div_chat_min_title").css("display","none"),It("#onwbchat_window #off-form-onwebchat-logo").css("display","block"),It("#onwbchat_window #onwebchat-logo-span").css("display","block"),It("#onwbchat_window .webchat_header").hover(function(){It("#onwbchat_window .webchat_header").css("opacity","1")},function(){It("#onwbchat_window .webchat_header").css("opacity","1")}),l('maxChat',1),loadEmoticons(),oe(),$(),!1},minimizeChatWindow=function(){return(1==Z||Xe)&&(w&&console.log("showOnlyImage:"+Z+" mobile:"+Xe),It("#onwbchat_window").fadeOut(0)),"block"==It("#onwbchat_window #div_chat_max_title").css("display")&&B(),w&&console.log("minimizeChatWindow.."),l('maxChat',0),w&&console.log("sessionStorage.maxChat:"+c('maxChat')+" sessionStorage.hideImage:"+c('hideImage')),setTimeout(function(){It("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").hide(),It(".onwebchatbox").css("height","60px"),It("#onwbchat_window .webchat_header").css("cursor","pointer"),0==c('hideImage')&&(It("#onweb_chatimage_div #onweb_chatimage").css("display","inline"),It("#onweb_chatimage_div #onweb_chatimage").css("cursor","pointer"),It("#onweb_chatimage").css("animation-iteration-count","0")),It("#onwbchat_window .onweb_chatimage_x").css("display","inline"),It("#onwbchat_window #div_chat_min_title").css("display","block"),It("#onwbchat_window #div_chat_max_title").css("display","none"),It("#onwbchat_window #off-form-onwebchat-logo").css("display","none"),It("#onwbchat_window #onwebchat-logo-span").css("display","none"),document.getElementById("onwbchat_window").style.setProperty("box-shadow","0px 0px 5px 0px #777","important"),It("#onwbchat_window").find(".onweb_maximize_btn").css("display","inline"),Xe||(It("#onwbchat_window").css("top","initial"),It("#onwbchat_window").css("left","initial"),It("#onwbchat_window").css(ge,pe+"px"),1==v?(document.getElementById("webchat_header").style.setProperty("height","40px","important"),document.getElementById("onwbchat_window").style.setProperty("height","40px","important"),document.getElementById("onwbchat_window").style.setProperty("bottom","0px","important")):(document.getElementById("webchat_header").style.setProperty("height",me+"px","important"),document.getElementById("onwbchat_window").style.setProperty("height",me+"px","important"),document.getElementById("onwbchat_window").style.setProperty("bottom","0px","important")))},100),!1},hideChatWindow=function(){It("#onwbchat_window").fadeOut(300,'swing'),It("#onweb_chatimage_div #onweb_chatimage").fadeOut(300,'swing'),w&&console.log("hideChatWindow..")},showChatWindow=function(){try{w&&console.log("showChatWindow.. hideOffline:"+re+" sessionStorage.hideImage:"+c('hideImage'))}catch(e){console.log(e)}0==Z&&0==Xe&&(w&&console.log("showOnlyImage:::: "+Z+" mobile:"+Xe),It("#onwbchat_window").css("display","block")),1==c('hideImage')&&(w&&console.log("hide image..."),It("#onweb_chatimage_div #onweb_chatimage").css("display","none")),0==c('hideImage')&&(w&&console.log("show image now.."),It("#onweb_chatimage_div #onweb_chatimage").css("display","inline")),1==c('maxChat')?(w&&console.log("sessionStorage.maxChat==1"),maximizeChatWindow()):(w&&console.log("sessionStorage.maxChat!=1"),It("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").hide())};var Me,qe,$e,Xe;w&&console.log(" jquery version in demochat.js: "+It.fn.jquery),It.ajaxSetup({cache:!0}),mt||Te||(""!=A?It.when(It.getScript(st+"//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js",function(e,t,o){w&&console.log(t),w&&console.log(" just now (with lang file) load file socket.js , data:"+e)}).done(function(e,t){w&&console.log("just load socket.io ... ")}).fail(function(){w&&console.log("fail loading socket.io .. ...: "+exception)}),It.get(A,function(e){if(w&&console.log("onwebchatLanguages.txt Load was performed. , data: "),""!=e)try{It.extend(!0,x,JSON.parse(e))}catch(t){console.log("exception parsing lang text file : "+t),console.log("lang text file data: "+e.substring(0,100)+" ...")}w&&console.log(x)}).fail(function(){console.log("Error: language file failed to load! filename: "+A),console.log("Ensure that language file url is correct and is not blocked as cross-origin request."),'l1'!=U&&'l2'!=U&&(U='l1'),w&&console.log(" ****final language::"+U)}),It('head').append("")).done(function(){we()}):It.when(It.getScript(st+"//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js",function(e,t,o){w&&console.log(t),w&&console.log(" just now ( no lang file) load file socket.js , data:"+e)}).done(function(e,t){w&&console.log("just load socket.io ... ")}).fail(function(){w&&console.log("fail loading socket.io .. ...: "+exception)}),It('head').append("")).done(function(){we()})),enableMenuItem=function(e){It("#"+e).css("opacity",.84),It("#"+e).hover(function(e){It(this).css("opacity","mouseenter"===e.type?1:.84)}),document.getElementById(e)&&document.getElementById(e).style.setProperty("cursor","pointer","important")},disableMenuItem=function(e){It("#"+e).css("opacity",.5),It("#"+e).hover(function(e){It(this).css("opacity",("mouseenter"===e.type,.5))}),document.getElementById(e)&&document.getElementById(e).style.setProperty("cursor","initial","important")},function(e){var t='-',o=navigator.appVersion,n=navigator.userAgent,a=navigator.appName,i=''+parseFloat(navigator.appVersion),s=parseInt(navigator.appVersion,10);$e=o+" -- "+n+" -- "+a+" -- "+i+" -- "+s+" -- "+navigator.platform+" -- "+navigator.oscpu;var c,l,r;-1!=(l=n.indexOf('Opera'))?(a='Opera',i=n.substring(l+6),-1!=(l=n.indexOf('Version'))&&(i=n.substring(l+8))):-1!=(l=n.indexOf('MSIE'))?(a='Internet Explorer',i=n.substring(l+5)):-1!=(l=n.indexOf('Edge'))?(a='Edge',i=''):-1!=(l=n.indexOf('Chrome'))?(a='Chrome',i=n.substring(l+7)):-1!=(l=n.indexOf('Safari'))?(a='Safari',i=n.substring(l+7),-1!=(l=n.indexOf('Version'))&&(i=n.substring(l+8))):-1!=(l=n.indexOf('Firefox'))?(a='Firefox',i=n.substring(l+8)):-1!=n.indexOf('Trident/')?(a='Internet Explorer',i=n.substring(n.indexOf('rv:')+3)):(c=n.lastIndexOf(' ')+1)<(l=n.lastIndexOf('/'))&&(a=n.substring(c,l),i=n.substring(l+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!=(r=i.indexOf(';'))&&(i=i.substring(0,r)),-1!=(r=i.indexOf(' '))&&(i=i.substring(0,r)),-1!=(r=i.indexOf(')'))&&(i=i.substring(0,r));var d=i.indexOf('.');if(d>0){var m=i.indexOf('.',i.indexOf('.')+1);m>0&&(i=i.substring(0,m))}s=parseInt(''+i,10),isNaN(s)&&(i=''+parseFloat(navigator.appVersion),s=parseInt(navigator.appVersion,10)),'Edge'==a&&(i=''),Xe=!1,(/(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(n)||/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(n.substr(0,4)))&&(Xe=!0),w&&console.log(" nVer: "+o),w&&console.log(" nAgt: "+n),w&&console.log(" mobile: "+Xe);var h=!!navigator.cookieEnabled;'undefined'!=typeof navigator.cookieEnabled||h||(document.cookie='testcookie',h=-1!=document.cookie.indexOf('testcookie'));var g=t,p=[{s:'Windows 3.11',r:/Win16/},{s:'Windows 95',r:/(Windows 95|Win95|Windows_95)/},{s:'Windows ME',r:/(Win 9x 4.90|Windows ME)/},{s:'Windows 98',r:/(Windows 98|Win98)/},{s:'Windows CE',r:/Windows CE/},{s:'Windows 2000',r:/(Windows NT 5.0|Windows 2000)/},{s:'Windows XP',r:/(Windows NT 5.1|Windows XP)/},{s:'Windows Server 2003',r:/Windows NT 5.2/},{s:'Windows Vista',r:/Windows NT 6.0/},{s:'Windows 7',r:/(Windows 7|Windows NT 6.1)/},{s:'Windows 8.1',r:/(Windows 8.1|Windows NT 6.3)/},{s:'Windows 8',r:/(Windows 8|Windows NT 6.2)/},{s:'Windows 10',r:/(Windows 10|Windows NT 10.0)/},{s:'Windows NT 4.0',r:/(Windows NT 4.0|WinNT4.0)/},{s:'Windows',r:/(WinNT|Windows NT)/},{s:'Windows ME',r:/Windows ME/},{s:'Windows Phone',r:/Windows Phone/},{s:'Android',r:/Android/},{s:'Open BSD',r:/OpenBSD/},{s:'Sun OS',r:/SunOS/},{s:'Linux',r:/(Linux|X11)/},{s:'iOS',r:/(iPhone|iPad|iPod)/},{s:'Mac OS X',r:/Mac OS X/},{s:'Mac OS',r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:'QNX',r:/QNX/},{s:'UNIX',r:/UNIX/},{s:'BeOS',r:/BeOS/},{s:'OS/2',r:/OS\/2/},{s:'BlackBerry OS',r:/BlackBerry/},{s:'Search Bot',r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var u in p){var b=p[u];if(b.r.test(n)){g=b.s;break}}var f=t;switch(/Windows/.test(g)&&(f=/Windows (.*)/.exec(g)[1],g='Windows'),g){case'Mac OS X':f=/Mac OS X (10[\.\_\d]+)/.exec(n)[1];break;case'Android':f=/Android ([\.\_\d]+)/.exec(n)[1];break;case'iOS':f=/OS (\d+)_(\d+)_?(\d+)?/.exec(o),f=f[1]+'.'+f[2]+'.'+(0|f[3])}var _='no check';if('undefined'!=typeof swfobject){var y=swfobject.getFlashPlayerVersion();_=y.major>0?y.major+'.'+y.minor+' r'+y.release:t}e.jscd={browser:a,browserVersion:i,mobile:Xe,os:g,osVersion:f,cookies:h,flashVersion:_}}(this),qe=jscd.os+' '+jscd.osVersion,Me=jscd.browser+' '+jscd.browserVersion;var He=s('onwbchttimesVisited');''!=He&&void 0!=He&&'NaN'!=He||(He=0,a("onwbchttimesVisited",1,93)),It.support.cors=!0}),{init:function(e){ut=e},set:function(e,t){if("name"==e){I=t,w&&console.log("set name:"+t);try{rt.emit('setclientdetails',bt,ne,I,"","","")}catch(o){w&&console.log("error on set : "+o)}}else if("email"==e){k=t;try{rt.emit('setclientdetails',bt,ne,"",k,"","")}catch(o){w&&console.log("error on set : "+o)}}else if("phone"==e){C=t;try{rt.emit('setclientdetails',bt,ne,"","",C,"")}catch(o){w&&console.log("error on set : "+o)}}else if("notes"==e){E=t;try{rt.emit('setclientdetails',bt,ne,"","","",E)}catch(o){w&&console.log("error on set : "+o)}}else if("pageUrl"==e)try{rt.emit('setclientpageurl',bt,ne,"",t)}catch(o){w&&console.log("error on set : "+o)}else if("pageTitle"==e)try{rt.emit('setclientpageurl',bt,ne,t,"")}catch(o){w&&console.log("error on set : "+o)}else"max"==e?1==t?(maximizeChatWindow(),It("#onwbtxtarea").focus()):0==t&&minimizeChatWindow():"show"==e?1==t?(V=1,showChatWindow()):0==t&&(V=0,hideChatWindow()):"online"==e?1==t?(le=1,showChatWindow()):0==t&&(le=0,showChatWindow()):"hideImage"==e?1==t?w&&console.log(" set hideImage: )!!! : "+t):0==t&&w&&console.log(" set hideImage: )!!! : "+t):"language"==e?(U=t,w&&console.log(" setLanguage (2)!!! : "+U),'gr'!=U&&'el'!=U||(U='l1'),'en'==U&&(U='l2'),'l1'!=U&&'l2'!=U&&(U='l1'),w&&console.log(" final language : "+U)):"languageFile"==e?(A="",w&&console.log("prosoxi !! languageFile set (set function..) : "+A+" mallon me opera, opote den to ipostririzo pros to paron ")):"onClick"==e?P=t:"onMaximize"==e?W=t:"onMinimize"==e?B=t:"onTrigger"==e?S=t:"onStartWriting"==e?O=t:"onUpdateOperators"==e?T=t:"onNewMessage"==e?M=t:"onWebChatLoaded"==e?z=t:"onlineColor"==e?(F=t,1==le&&""!=F&&It('#webchat_header')[0].style.setProperty('background-color',F,'important')):"offlineColor"==e&&(j=t,1!=le&&""!=j&&(It('#webchat_header')[0].style.setProperty('background-color',j,'important'),It('#offlineform_btn')[0].style.setProperty('background-color',j,'important')))},get:function(e){return"name"==e?(w&&console.log(" get name:"+I),I):"email"==e?k:"phone"==e?C:"notes"==e?E:"status"==e?1==le?"online":"offline":""}}}();
"),It('#onwbchat_window .chat_area').animate({scrollTop:9999999},200);else if('command:notyping...'==s)try{null!=document.getElementById('agenttypingimage')&&(document.getElementById('agenttypingimage').style.visibility='hidden')}catch(r){}else if(0==V)w&&console.log("den emfanizetai epeidi showchatapi=0");else{n(),clearTimeout(y),t(),It('#agenttypingimage').remove();var d="",m='',h="";1==H&&(d=" agent-bubble "),'agent'!=G&&(d+=" agent-first ",1==R&&(m='