livechatoo={};livechatoo.d=document;livechatoo.w=window;livechatoo.gEBI=function(id){return this.d.getElementById(id);};livechatoo.ua=navigator.userAgent;livechatoo.is_ie=livechatoo.d.all?true:false;livechatoo.is_ie6=/MSIE 6\.0/i.test(livechatoo.ua);livechatoo.is_quirks=livechatoo.d.compatMode&&livechatoo.d.compatMode=='BackCompat'?true:false;livechatoo.is_bot=/AdsBot-Google|Ask Jeeves\/Teoma|bingbot|BingPreview|Ezooms|facebookexternalhit|Googlebot|Google Web Preview|ia_archiver|Jyxobot|MSNBot|nuhk|Openbot|SeznamBot|Slurp|YandexBot|Yammybot/i.test(livechatoo.ua);livechatoo.is_mobile=((typeof window.orientation != 'undefined'||/Android|avantgo|BlackBerry|blazer|IEMobile|iPhone|iPad|iPod|kindle|pocket|psp|maemo|midori|mobile|Opera Mini|Palm|plucker|phone|symbian|Tablet|webOS|Windows Phone|ZuneWP7/i.test(navigator.userAgent))&&(!window.screen||screen.width<700));livechatoo.tz_offset=(new Date()).getTimezoneOffset() * -1;livechatoo.time=function(){return Math.round((new Date()).getTime() / 1000);};livechatoo.to_int=function(num){num=parseInt(num)||0;return num;};livechatoo.show=function(id){var element=this.gEBI(id);element.style.display='block';};livechatoo.hide=function(id){var element=this.gEBI(id);element.style.display='none';};(function(cs){var src='';if(cs) src=cs.src;else{var i,scripts=document.getElementsByTagName('script');for(i in scripts){if(scripts[i].src&&/\/js\/web\.min\.js/.test(scripts[i].src)){src=scripts[i].src;break;}}}livechatoo.script_src=src;livechatoo.domain=src.replace(/\/js\/web\.min\.js.*/,'');})(document.currentScript);if(typeof JSON !=='object'){JSON={};}(function(){'use strict';function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON !=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object' &&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case 'string':return quote(value);case 'number':return isFinite(value)?String(value):'null';case 'boolean':case 'null':return String(value);case 'object':if(!value){return 'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?':':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?':':':')+v);}}}}v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}if(typeof JSON.stringify !=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}rep=replacer;if(replacer&&typeof replacer !=='function' &&(typeof replacer !=='object'||typeof replacer.length !=='number')){throw new Error('JSON.stringify');}return str('',{'':value});};}if(typeof JSON.parse !=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v !==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return '\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}throw new SyntaxError('JSON.parse');};}}());livechatoo.dad=function(){function dad(n,obj){this.side=livechatoo.embed.options.side;this.st=livechatoo.is_ie&&livechatoo.is_quirks?livechatoo.d.body.scrollTop:0;this.sl=livechatoo.is_ie&&livechatoo.is_quirks?(livechatoo.d.body.scrollLeft * (this.side=='right'?1:-1) ):0;this.valy=0;this.valx=0;this.n=n;livechatoo.w[n]=this;this.b=livechatoo.gEBI(obj.box);this.dragger=livechatoo.gEBI(obj.element);this.dragger.onmousedown=new Function('event',this.n+'.resize(event);return false;');this.dragger.onselectstart=function(){return false };this.b.style.bottom=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posy'))+this.st+'px';this.b.style[this.side]=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posx')) - this.sl+'px';};dad.prototype.resize=function(e){this.side=livechatoo.embed.options.side;this.dragger_backup=[this.dragger.style.height,this.dragger.style.width];this.dragger.style.height='99%';this.dragger.style.width='99%';this.b.bcsy=livechatoo.cursor.top(e);this.b.bcsx=livechatoo.cursor.left(e);this.ymax=(livechatoo.is_quirks)?livechatoo.d.body.clientHeight:livechatoo.d.documentElement.clientHeight;this.xmax=(livechatoo.is_quirks)?livechatoo.d.body.clientWidth:livechatoo.d.documentElement.clientWidth;this.st=livechatoo.is_ie&&livechatoo.is_quirks?livechatoo.d.body.scrollTop:0;this.sl=livechatoo.is_ie&&livechatoo.is_quirks?(livechatoo.d.body.scrollLeft * (this.side=='right'?1:-1) ):0;delete livechatoo.embed.qtemp;this.height=parseInt(this.b.style.height);this.width=parseInt(this.b.style.width);this.mv=new Function('event',this.n+'.move(event)');this.sr=new Function(this.n+'.freeze()');if(livechatoo.d.addEventListener){livechatoo.d.addEventListener('mousemove',this.mv,true);livechatoo.d.addEventListener('mouseup',this.sr,true);}else if(livechatoo.d.attachEvent){livechatoo.d.attachEvent('onmousemove',this.mv);livechatoo.d.attachEvent('onmouseup',this.sr);livechatoo.d.documentElement.onselectstart=function(){return false;};}livechatoo.d.body.style.cursor='help';},dad.prototype.move=function(e){var posy=livechatoo.cursor.top(e);var posx=livechatoo.cursor.left(e);this.valy=livechatoo.to_int(this.b.style.bottom)+(this.b.bcsy - posy)+this.st;this.valx=livechatoo.to_int(this.b.style[this.side])+((this.b.bcsx - posx) * (this.side=='right'?1:-1) )+this.sl;this.valy=(this.valy<10&&this.b.bcsy<posy)?0:this.valy;this.valy=(this.ymax - this.valy - this.height<10&&this.b.bcsy>posy)?this.ymax - this.height:this.valy;if(this.valy>=0&&this.valy+this.height<=this.ymax){this.valy=this.valy - this.st;this.b.style.bottom=this.valy+'px';this.b.bcsy=posy;}if(livechatoo.embed.options.side=='right'){this.valx=(this.valx<10&&this.b.bcsx<posx)?0:this.valx;this.valx=(this.xmax - this.valx - this.width<10&&this.b.bcsx>posx)?this.xmax - this.width:this.valx;}else{this.valx=(this.valx<10&&this.b.bcsx>posx)?0:this.valx;this.valx=(this.xmax - this.valx - this.width<10&&this.b.bcsx<posx)?this.xmax - this.width:this.valx;}if(this.valx>=0&&this.valx+this.width<=this.xmax){this.valx=this.valx - this.sl;this.b.style[this.side]=this.valx+'px';this.b.bcsx=posx;}},dad.prototype.freeze=function(){if(livechatoo.d.removeEventListener){livechatoo.d.removeEventListener('mousemove',this.mv,true);livechatoo.d.removeEventListener('mouseup',this.sr,true);}else if(livechatoo.d.detachEvent){livechatoo.d.detachEvent('onmousemove',this.mv);livechatoo.d.detachEvent('onmouseup',this.sr);livechatoo.d.documentElement.onselectstart=function(){return true;};}this.dragger.style.height=this.dragger_backup[0];this.dragger.style.width=this.dragger_backup[1];livechatoo.d.body.style.cursor='default';livechatoo.subcookie.set('lctpref','posy',this.valy+this.st,30);livechatoo.subcookie.set('lctpref','posx',this.valx+this.sl,30);};return{dad:dad }}();livechatoo.cursor=function(){return{top:function(e){return livechatoo.is_ie?livechatoo.w.event.clientY+livechatoo.d.documentElement.scrollTop+livechatoo.d.body.scrollTop:e.clientY+livechatoo.w.scrollY;},left:function(e){return livechatoo.is_ie?livechatoo.w.event.clientX+livechatoo.d.documentElement.scrollLeft+livechatoo.d.body.scrollLeft:e.clientX+livechatoo.w.scrollX;}}}();livechatoo.subcookie={get: function(name,sub_name){var sub_cookies=this.get_all(name);return(sub_cookies)?sub_cookies[sub_name]:null;},get_all: function(name){var cookie_str=document.cookie,cookie_name=encodeURIComponent(name)+'=',cookie_start=cookie_str.indexOf(cookie_name),cookie_value=null,result={};if(cookie_start>0){cookie_name=' '+encodeURIComponent(name)+'=';cookie_start=cookie_str.indexOf(cookie_name);}if(cookie_start>-1){var cookie_end=cookie_str.indexOf(';',cookie_start);if(cookie_end==-1) cookie_end=cookie_str.length;cookie_value=cookie_str.substring(cookie_start+cookie_name.length,cookie_end);if(cookie_value.length>0){var sub_cookies=cookie_value.split('&');for(var i=0,len=sub_cookies.length;i<len;i++){var parts=sub_cookies[i].split('=');result[decodeURIComponent(parts[0])]=decodeURIComponent(parts[1]);}return result;}}return [];},set: function(name,sub_name,value,expires,path,domain,secure){var sub_cookies=this.get_all(name)||{};sub_cookies[sub_name]=value;this.set_all(name,sub_cookies,expires,path,domain,secure);},set_all: function(name,sub_cookies,expires,path,domain,secure){var cookie_text=encodeURIComponent(name)+'=';var sub_cookie_parts=[];for(var sub_name in sub_cookies){if(sub_name.length>0&&sub_cookies.hasOwnProperty(sub_name)) sub_cookie_parts.push(encodeURIComponent(sub_name)+'='+encodeURIComponent(sub_cookies[sub_name]));}if(sub_cookie_parts.length>0){cookie_text+=sub_cookie_parts.join('&');if(typeof expires=='number'){var date=new Date();date.setDate(date.getDate()+expires);cookie_text+=';expires='+date.toUTCString();}else if(expires instanceof Date) cookie_text+=';expires='+expires.toGMTString();cookie_text+=(path)?';path='+path:';path=/';if(domain) cookie_text+=';domain='+domain;if(secure) cookie_text+=';secure';}else{cookie_text+=";expires="+(new Date(0)).toGMTString();cookie_text+=(path)?';path='+path:';path=/';}document.cookie=cookie_text;}};livechatoo.xdc=function(){var last_hash,attached_callback;return{src:null,set:function(obj,message){if(obj.contentWindow.postMessage){message=JSON.stringify(message);obj.contentWindow.postMessage(message,'*');}else{message._xrand=new Date().getMilliseconds();message=JSON.stringify(message);obj.src=(this.src||obj.src).split('#')[0]+'#'+encodeURIComponent(message);}},get:function(callback,source_origin){if(window.postMessage){attached_callback=function(e){var regex=new RegExp('^'+e.origin.replace(/\./g,'\\.'),'g');if(source_origin != '*'&&!regex.test(source_origin))return false;callback(e);};if(window.addEventListener) window.addEventListener('message',attached_callback,false);else if(window.attachEvent) window.attachEvent('onmessage',attached_callback);}else{var that=this;setInterval(function(){var hash=document.location.hash;if(!hash)return;if(hash != last_hash){last_hash=hash;hash=decodeURIComponent(hash.split('#')[1]);callback({data:hash},that);}},100);}},controller:function(){this.get(function(message,that){try{var data=JSON.parse(message.data);}catch(e){var data={};};if(that&&data._xisrc) that.src=data._xisrc;if(typeof data.page != 'undefined') livechatoo.embed.data.page=data.page;livechatoo.embed.data.on_chat=(data.on_chat)?true:false;if(typeof data.online != 'undefined') livechatoo.embed.data.online=data.online;if(typeof data.departments_online != 'undefined') livechatoo.embed.data.departments_online=data.departments_online;if(typeof data.operators_online != 'undefined') livechatoo.embed.data.operators_online=data.operators_online;if(data.gateway&&data.uniqid){livechatoo.subcookie.set('lctpref','gateway',data.gateway,30);livechatoo.subcookie.set('lctpref','uniqid',data.uniqid,30);}if(data.page){var side=livechatoo.embed.options.side;var st=livechatoo.is_ie&&livechatoo.is_quirks?livechatoo.d.body.scrollTop:0;var sl=livechatoo.is_ie&&livechatoo.is_quirks?(livechatoo.d.body.scrollLeft * (side=='right'?1:-1) ):0;delete livechatoo.embed.qtemp;livechatoo.gEBI('IMS_box1').style.width='262px';livechatoo.gEBI('IMS_iframe1').style.width='262px';if(data.page=='hidden'){livechatoo.gEBI('IMS_box1').style.height=0;livechatoo.gEBI('IMS_iframe1').style.height=0;livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';}else if(data.page=='mini'){livechatoo.gEBI('IMS_box1').style.height='43px';livechatoo.gEBI('IMS_iframe1').style.height='43px';livechatoo.gEBI('IMS_box1').style.width='112px';livechatoo.gEBI('IMS_iframe1').style.width='112px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';if(data.on_chat){if(!livechatoo.gEBI('IMS_iframe2').src){var url_ifr2=livechatoo.domain+'/'+livechatoo.embed.options.account+'/client-embed/bubble'+(livechatoo.embed.options.session_per_host?'?session_cookie_name='+encodeURIComponent(livechatoo.d.location.hostname.replace(/^www\./,'').replace(/\./g,'')):'');livechatoo.gEBI('IMS_iframe2').src=url_ifr2;}setTimeout(function(){livechatoo.gEBI('IMS_iframe2').style.display='block';},100);}livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';}else if(data.page=='start-offline'){livechatoo.gEBI('IMS_box1').style.height=(data.hidden_ques)?'43px':'107px';livechatoo.gEBI('IMS_iframe1').style.height=(data.hidden_ques)?'43px':'107px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';}else if(data.page=='start-online'){livechatoo.gEBI('IMS_box1').style.height=(data.hidden_ques)?'43px':'107px';livechatoo.gEBI('IMS_iframe1').style.height=(data.hidden_ques)?'43px':'107px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';}else if(data.page=='offline'){livechatoo.gEBI('IMS_box1').style.height=(livechatoo.to_int(data.height)+8)+'px';livechatoo.gEBI('IMS_iframe1').style.height=(livechatoo.to_int(data.height)+8)+'px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='block';livechatoo.instance.b.style.bottom=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posy')) - st+'px';livechatoo.instance.b.style[side]=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posx')) - sl+'px';}else if(data.page=='online'){livechatoo.gEBI('IMS_box1').style.height=(livechatoo.to_int(data.height)+8)+'px';livechatoo.gEBI('IMS_iframe1').style.height=(livechatoo.to_int(data.height)+8)+'px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';}else if(data.page=='chat'){livechatoo.gEBI('IMS_box1').style.height=(data.chat_status=='min')?'43px':'408px';livechatoo.gEBI('IMS_iframe1').style.height=(data.chat_status=='min')?'43px':'408px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='block';if(data.chat_status=='min'){if(data.on_chat){if(!livechatoo.gEBI('IMS_iframe2').src){var url_ifr2=livechatoo.domain+'/'+livechatoo.embed.options.account+'/client-embed/bubble'+(livechatoo.embed.options.session_per_host?'?session_cookie_name='+encodeURIComponent(livechatoo.d.location.hostname.replace(/^www\./,'').replace(/\./g,'')):'');livechatoo.gEBI('IMS_iframe2').src=url_ifr2;}setTimeout(function(){livechatoo.gEBI('IMS_iframe2').style.display='block';},100);}livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=- sl+'px';livechatoo.gEBI('IMS_box_dad').style.display='none';}else if(data.chat_status=='res'){livechatoo.instance.b.style.bottom=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posy')) - st+'px';livechatoo.instance.b.style[side]=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posx')) - sl+'px';livechatoo.gEBI('IMS_box_dad').style.display='block';}else if(data.chat_status=='max'){livechatoo.gEBI('IMS_box1').style.height='100%';livechatoo.gEBI('IMS_iframe1').style.height='100%';livechatoo.instance.b.style.bottom=- st+'px';livechatoo.instance.b.style[side]=livechatoo.to_int(livechatoo.subcookie.get('lctpref','posx')) - sl+'px';livechatoo.gEBI('IMS_box_dad').style.display='none';}} else if(data.page=='bye'){livechatoo.gEBI('IMS_box1').style.height='232px';livechatoo.gEBI('IMS_iframe1').style.height='232px';livechatoo.gEBI('IMS_iframe2').style.display='none';livechatoo.gEBI('IMS_box_dad').style.display='none';}}if(data.event=='clone_operators'){var clone_operators=livechatoo.embed.options.clone_operators;if(typeof clone_operators=='object'){var message={cmd:'clone_operators',clone_operators:clone_operators };livechatoo.xdc.set(livechatoo.gEBI('IMS_iframe1'),message);}}if(data.height){livechatoo.gEBI('IMS_box1').style.height=(livechatoo.to_int(data.height)+8)+'px';livechatoo.gEBI('IMS_iframe1').style.height=(livechatoo.to_int(data.height)+8)+'px';}if(data.event){var onload=livechatoo.embed.options.onload;if(data.event=='load'&&typeof onload=='function') onload({page:data.page,online:data.online,hidden_ques:data.hidden_ques,chat_status:data.chat_status});var onchange=livechatoo.embed.options.onchange;if(data.event=='change'&&typeof onchange=='function') onchange({page:data.page,online:data.online,hidden_ques:data.hidden_ques,chat_status:data.chat_status});var onchatstart=livechatoo.embed.options.onchatstart;if(data.event=='chat_start'&&typeof onchatstart=='function') onchatstart({initiator:data.initiator,ticket:data.ticket});var onchatopened=livechatoo.embed.options.onchatopened;if(data.event=='load'&&data.on_chat&&!data.fake_chat&&typeof onchatopened=='function') onchatopened({initiator:data.initiator,ticket:data.ticket});var onchatrating=livechatoo.embed.options.onchatrating;if(data.event=='chat_rating'&&typeof onchatrating=='function') onchatrating({ticket:data.ticket,name:data.name,email:data.email,phone:data.phone,rating:data.rating,message:data.message,operator_id:data.operator_id,department_id:data.department_id});var onofflinemessage=livechatoo.embed.options.onofflinemessage;if(data.event=='offline_message'&&typeof onofflinemessage=='function') onofflinemessage({name:data.name,email:data.email,phone:data.phone,message:data.message,operator_id:data.operator_id});var onnamerequired=livechatoo.embed.options.onnamerequired;if(data.event=='require_name'&&typeof onnamerequired=='function') onnamerequired({accepted:data.accepted,name:data.name});var onemailrequired=livechatoo.embed.options.onemailrequired;if(data.event=='require_email'&&typeof onemailrequired=='function') onemailrequired({accepted:data.accepted,email:data.email});var onphonerequired=livechatoo.embed.options.onphonerequired;if(data.event=='require_phone'&&typeof onphonerequired=='function') onphonerequired({accepted:data.accepted,phone:data.phone});}if(data.event=='load'){livechatoo.embed.data.loads++;if(livechatoo.activity.timeout2) clearTimeout(livechatoo.activity.timeout2);livechatoo.activity.timeout2=setTimeout(function(){livechatoo.activity.send(true);},5000);livechatoo.activity.run();}if(data.event=='load'&&data.triggers){livechatoo.triggers.init(data.triggers,data.gau_global_object_name,data.gau_tracker_objects_names,data.gaea_trigger);}if(data.event=='chat_start'&&livechatoo.triggers.enabled){livechatoo.triggers.storage.data.chats_session++;livechatoo.triggers.storage.data.chats_total++;livechatoo.triggers.storage.set();}if(data.event=='chat_start'&&data.gaea_chat_start){var labels={client:'by Client',operator:'by Operator',api:'by API',trigger:'by Trigger'};if(labels[data.initiator]) livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Chat Start',labels[data.initiator]);}else if(data.event=='chat_rating'&&data.gaea_chat_rating){var labels={1:'One Star',2:'Two Stars',3:'Three Stars',4:'Four Stars',5:'Five Stars'};if(labels[data.rating]) livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Chat Rating',labels[data.rating],data.rating);}else if(data.event=='require_name'&&data.gaea_require_name){var label=(data.accepted)?'Accepted':'Declined';livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Required Name',label);}else if(data.event=='require_email'&&data.gaea_require_email){var label=(data.accepted)?'Accepted':'Declined';livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Required Email',label);}else if(data.event=='require_phone'&&data.gaea_require_phone){var label=(data.accepted)?'Accepted':'Declined';livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Required Phone',label);}else if(data.event=='offline_message'&&data.gaea_offline_message) livechatoo.embed.ga_event(data.gau_global_object_name,data.gau_tracker_objects_names,'Offline Message');if(data.event=='webrtc'){if(data.status=='active') livechatoo.webrtc.script(data.room,data.mode,data.type,data.lang);}},livechatoo.domain);}};}();livechatoo.activity={status:true,init:function(){if(window.addEventListener){window.addEventListener('mousemove',this.listener,true);window.addEventListener('scroll',this.listener,true);window.addEventListener('click',this.listener,true);}else if(document.attachEvent){document.attachEvent('onmousemove',this.listener);document.attachEvent('onscroll',this.listener);document.attachEvent('onclick',this.listener);}this.run();},stop:function(){if(window.removeEventListener){window.removeEventListener('mousemove',this.listener,true);window.removeEventListener('scroll',this.listener,true);window.removeEventListener('click',this.listener,true);}else if(document.detachEvent){document.detachEvent('onmousemove',this.listener);document.detachEvent('onscroll',this.listener);document.detachEvent('onclick',this.listener);}clearTimeout(livechatoo.activity.timeout1);clearTimeout(livechatoo.activity.timeout2);this.send(false);},listener:function(){if(!livechatoo.activity.status) livechatoo.activity.send(true);livechatoo.activity.run();},send:function(status){this.status=status;var message={cmd:'activity',status:status };livechatoo.xdc.set(livechatoo.gEBI('IMS_iframe1'),message);},run:function(){if(livechatoo.activity.timeout1) clearTimeout(livechatoo.activity.timeout1);livechatoo.activity.timeout1=setTimeout(function(){livechatoo.activity.send(false);},30000);}};livechatoo.triggers={session:livechatoo.subcookie.get('lctsess','id'),enabled:false,storage:{ data:{},set:function(){try{localStorage.setItem('lctdata',JSON.stringify(this.data));return true;}catch(e){return false;}},get:function(){try{this.data=JSON.parse(localStorage.getItem('lctdata')||'{}');}catch(e){this.data={};if(!this.set())return false;}this.data=(typeof this.data=='object')?this.data:{};this.data.pages=(typeof this.data.pages=='object')?this.data.pages:[];this.data.no_repeat_triggers=(typeof this.data.no_repeat_triggers=='object')?this.data.no_repeat_triggers:{};this.data.referrer=(typeof this.data.referrer=='string')?this.data.referrer:'';this.data.chats_session=(typeof this.data.chats_session=='number')?this.data.chats_session:0;this.data.chats_total=(typeof this.data.chats_total=='number')?this.data.chats_total:0;return true;},clear:function(){this.data={};if(!this.set())return false;if(!this.get())return false;return this.set();}},init:function(triggers,gau_global_object_name,gau_tracker_objects_names,gaea_trigger){if(typeof triggers != 'object')return;if(!(triggers instanceof Array))return;if(!triggers.length)return;if(!window.localStorage)return;if(!this.storage.get())return;livechatoo.subcookie.set('lctsess','ctest',1);if(!livechatoo.subcookie.get('lctsess','ctest'))return;if(typeof this.session != 'string'||!/^[0-9a-f]{8,10}$/.test(this.session)){this.session=livechatoo.time().toString(16);livechatoo.subcookie.set('lctsess','id',this.session);if(document.referrer) this.storage.data.referrer=document.referrer;this.storage.data.chats_session=0;}this.enabled=true;if(livechatoo.embed.data.loads==1){this.storage.data.pages.unshift([this.session,livechatoo.time(),livechatoo.d.location.href,livechatoo.d.title]);this.storage.data.pages=this.storage.data.pages.slice(0,100);}this.clear_no_repeat_triggers();if(!this.storage.set())return;for(var i=0;i<triggers.length;i++){var callback,trigger=triggers[i];if(!trigger.enabled) continue;if(trigger.checkon=='parent'&&livechatoo.embed.data.loads>1) continue;if(this.check_conditions(trigger)){callback=function(trigger,gau_global_object_name,gau_tracker_objects_names,gaea_trigger,delay){setTimeout(function(){livechatoo.triggers.run_actions(trigger,gau_global_object_name,gau_tracker_objects_names,gaea_trigger);},delay * 1000);};callback(trigger,gau_global_object_name,gau_tracker_objects_names,gaea_trigger,trigger.delay);}}},compare:function(operator,a,b){if(operator=='equal'&&(a==b||this.check_wildcard(operator,a,b)))return true;else if(operator=='!equal'&&a != b&&!this.check_wildcard(operator,a,b))return true;else if(operator=='less'&&a<b)return true;else if(operator=='more'&&a>b)return true;else if(operator=='contain'&&(a.indexOf(b) != -1||this.check_wildcard(operator,a,b)))return true;else if(operator=='!contain'&&a.indexOf(b)==-1&&!this.check_wildcard(operator,a,b))return true;else if(operator=='regexp'&&this.check_regexp(a,b))return true;else if(operator=='!regexp'&&!this.check_regexp(a,b))return true;else return false;},check_wildcard:function(operator,a,b){b=b.toString();if(b.indexOf('*')==-1)return false;b=b.replace(/([-()\[\]{}+?.$\^|,:#<!\\])/g,'\\$1').replace(/\x08/g,'\\x08');b=b.replace(/\*/g,'.*');try{if(operator=='equal'||operator=='!equal') var reg=new RegExp('^'+b+'$','g');else if(operator=='contain'||operator=='!contain') var reg=new RegExp('^.*'+b+'.*$','g');}catch(e){return false;}return reg.test(a);},check_regexp:function(a,b){var parts=b.match(/^\/(.*?)\/([gim]*)$/);try{if(parts) var reg=new RegExp(parts[1],parts[2]);else var reg=new RegExp(b);}catch(e){return false;}return reg.test(a);},views_count:function(type,value){var count=0,pages=this.storage.data.pages;if(type=='title'){for(var i=0,title='';i<pages.length;i++){title=pages[i][3];if(title==value) count++;}} else if(type=='url'){for(var i=0,url='';i<pages.length;i++){url=pages[i][2];if(url==value) count++;}}return count;},to_seconds:function(unit,value){if(unit=='minute') value=value * 60;else if(unit=='hour') value=value * 60 * 60;else if(unit=='day') value=value * 60 * 60 * 24;return value;},is_mobile_device:function(){if(livechatoo.embed.options)return livechatoo.embed.options.mobile;else if(livechatoo.popup.options)return livechatoo.popup.options.mobile;else return livechatoo.is_mobile;},has_action:function(trigger,action_name){this.has_action_id=null;for(var i=0;i<trigger.actions.length;i++){var action=trigger.actions[i];if(action.name==action_name){this.has_action_id=i;return true;}}return false;},intersect:function(array1,array2){var result=[];if(!(array1 instanceof Array)||!(array2 instanceof Array))return result;for(var i=0;i<array1.length;i++){for(var j=0;j<array2.length;j++){if(array1[i]==array2[j]){result.push(array1[i]);break;}}}return result;},clear_no_repeat_triggers:function(){var items=this.storage.data.no_repeat_triggers,curr_time=livechatoo.time();for(var id in items){if(!items.hasOwnProperty(id)||typeof items[id] != 'object') continue;var item=items[id];if(item.name=='no_repeat_until'&&item.until<curr_time){delete items[id];this.storage.set();}else if(item.name=='no_repeat_session'&&item.session != this.session){delete items[id];this.storage.set();}}},check_no_repeat_trigger:function(trigger){var items=this.storage.data.no_repeat_triggers,item=items[trigger.id],removed=true;if(!item)return false;for(var i=0;i<trigger.actions.length;i++){var action=trigger.actions[i];if(action.name==item.name){removed=false;break;}}if(removed){delete items[trigger.id];this.storage.set();return false;}else return true;},check_conditions:function(trigger){if(typeof trigger != 'object'||typeof trigger.conditions != 'object')return false;else if(trigger.fireon != 'one'&&trigger.fireon != 'all')return false;else if(livechatoo.embed.data.on_chat&&this.has_action(trigger,'visitor_message'))return false;for(var i=0,count=0;i<trigger.conditions.length;i++){var condition=trigger.conditions[i];if(this.check_condition(trigger,condition)) count++;if((trigger.fireon=='one'&&count==1)||(trigger.fireon=='all'&&count==trigger.conditions.length))return true;}return false;},check_condition:function(trigger,condition){if(typeof condition != 'object')return false;if(condition.name=='day'){if(typeof condition.timezone != 'object')return false;if(condition.from<=condition.to&&condition.timezone.day>=condition.from&&condition.timezone.day<=condition.to)return true;else if(condition.from>condition.to&&(condition.timezone.day>=condition.from||condition.timezone.day<=condition.to))return true;else return false;}else if(condition.name=='time'){if(typeof condition.timezone != 'object')return false;if(condition.from<condition.to&&condition.timezone.time>=condition.from&&condition.timezone.time<=condition.to - 1)return true;else if(condition.from>condition.to&&(condition.timezone.time>=condition.from||condition.timezone.time<=condition.to - 1))return true;else return false;}else if(condition.name=='current_page_title'){var title=document.title;if(!this.compare(condition.operator,title,condition.value))return false;else if(typeof condition.views != 'object')return true;else if(this.compare(condition.views.operator,this.views_count('title',title),condition.views.value))return true;else return false;}else if(condition.name=='previous_page_title'){var pages=this.storage.data.pages;var title=(pages[1])? pages[1][3]:'';if(!this.compare(condition.operator,title,condition.value))return false;else if(typeof condition.views != 'object')return true;else if(this.compare(condition.views.operator,this.views_count('title',title),condition.views.value))return true;else return false;}else if(condition.name=='referrer_url'){var url=this.storage.data.referrer;if(!this.compare(condition.operator,url,condition.value))return false;else if(typeof condition.views != 'object')return true;else if(this.compare(condition.views.operator,this.views_count('url',url),condition.views.value))return true;else return false;}else if(condition.name=='current_page_url'){var url=document.location.href;if(!this.compare(condition.operator,url,condition.value))return false;else if(typeof condition.views != 'object')return true;else if(this.compare(condition.views.operator,this.views_count('url',url),condition.views.value))return true;else return false;}else if(condition.name=='previous_page_url'){var pages=this.storage.data.pages;var url=(pages[1])? pages[1][2]:'';if(!this.compare(condition.operator,url,condition.value))return false;else if(typeof condition.views != 'object')return true;else if(this.compare(condition.views.operator,this.views_count('url',url),condition.views.value))return true;else return false;}else if(condition.name=='seconds_since_pageview'){trigger.delay=condition.value;return true;}else if(condition.name=='session_pageviews'){var count=0,pages=this.storage.data.pages,page_sess='',curr_sess=(pages[0])?pages[0][0]:'';for(var i=0;i<pages.length;i++){page_sess=pages[i][0];if(page_sess==curr_sess) count++;else break;}return this.compare(condition.operator,count,condition.value);}else if(condition.name=='total_pageviews'){var pages=this.storage.data.pages;return this.compare(condition.operator,pages.length,condition.value);}else if(condition.name=='pageviews_period'){if(typeof condition.period != 'object')return false;var count=0,pages=this.storage.data.pages,page_time=0,curr_time=livechatoo.time(),seconds=this.to_seconds(condition.period.unit,condition.period.value);for(var i=0;i<pages.length;i++){page_time=pages[i][1];if(curr_time - page_time<seconds) count++;else break;}return this.compare(condition.operator,count,condition.value);}else if(condition.name=='chats_session'){return this.compare(condition.operator,this.storage.data.chats_session,condition.value);}else if(condition.name=='chats_total'){return this.compare(condition.operator,this.storage.data.chats_total,condition.value);}else if(condition.name=='sessions'){var count=0,pages=this.storage.data.pages,page_sess='',temp_sess='';for(var i=0;i<pages.length;i++){page_sess=pages[i][0];if(page_sess != temp_sess){count++;temp_sess=page_sess;}}return this.compare(condition.operator,count,condition.value);}else if(condition.name=='session_duration'){var count=0,pages=this.storage.data.pages,page_sess='',curr_sess=(pages[0])?pages[0][0]:'',page_time=0,curr_time=livechatoo.time(),seconds=this.to_seconds(condition.unit,condition.value);for(var i=0;i<pages.length;i++){page_sess=pages[i][0];if(page_sess==curr_sess) page_time=pages[i][1];else break;}return this.compare(condition.operator,curr_time - page_time,seconds);}else if(condition.name=='country_code'){return this.compare(condition.operator,condition.country_code,condition.value);}else if(condition.name=='country_name'){return this.compare(condition.operator,condition.country_name,condition.value);}else if(condition.name=='region'){return this.compare(condition.operator,condition.region,condition.value);}else if(condition.name=='city'){return this.compare(condition.operator,condition.city,condition.value);}else if(condition.name=='ip'){return this.compare(condition.operator,condition.ip,condition.value);}else if(condition.name=='host'){return this.compare(condition.operator,condition.host,condition.value);}else if(condition.name=='language'){return this.compare(condition.operator,condition.language,condition.value);}else if(condition.name=='desktop'){return !this.is_mobile_device();}else if(condition.name=='mobile'){return this.is_mobile_device();}else if(condition.name=='os'){return this.compare(condition.operator,condition.os,condition.value);}else if(condition.name=='browser'){return this.compare(condition.operator,condition.browser,condition.value);}else if(condition.name=='user_agent'){return this.compare(condition.operator,livechatoo.ua,condition.value);}else if(condition.name=='account_status'){var status=(livechatoo.embed.data.online)?'online':'offline';return this.compare(condition.operator,status,condition.value);}else if(condition.name=='departments_status'){if(!(condition.departments instanceof Array))return false;var departments_required=condition.departments,departments_online=livechatoo.embed.data.departments_online,intersect=this.intersect(departments_required,departments_online);if(condition.value=='online'&&intersect.length)return true;else if(condition.value=='offline'&&intersect.length != departments_required.length)return true;else return false;}else if(condition.name=='operators_status'){if(!(condition.operators instanceof Array))return false;var operators_required=condition.operators,operators_online=livechatoo.embed.data.operators_online,intersect=this.intersect(operators_required,operators_online);if(condition.value=='online'&&intersect.length)return true;else if(condition.value=='offline'&&intersect.length != operators_required.length)return true;else return false;}else if(condition.name=='embedded_client_page'){return this.compare(condition.operator,livechatoo.embed.data.page,condition.value);}else return true;},run_actions:function(trigger,gau_global_object_name,gau_tracker_objects_names,gaea_trigger){if(typeof trigger != 'object'||typeof trigger.actions != 'object')return false;if(this.check_no_repeat_trigger(trigger))return false;for(var i=0;i<trigger.actions.length;i++){var action=trigger.actions[i];this.run_action(trigger,action);}if(gaea_trigger&&trigger.title) livechatoo.embed.ga_event(gau_global_object_name,gau_tracker_objects_names,'Trigger',trigger.title);},run_action:function(trigger,action){if(typeof action != 'object')return false;if(action.name=='visitor_message'){var params={initiator:'trigger'};if(this.has_action(trigger,'chat_box_status')) params.chat_box_status=trigger.actions[this.has_action_id].value;if(action.message) params.message=action.message;if(action.departments.length) params.departments=action.departments.join(',');if(action.operators.length) params.operators=action.operators.join(',');if(action.department_name) params.department_name=action.department_name;if(action.operator_name) params.operator_name=action.operator_name;if(action.operator_photo) params.operator_photo=action.operator_photo;livechatoo.embed.page('chat',params);}else if(action.name=='chat_box_status'){if(this.has_action(trigger,'visitor_message'))return;var message={cmd:'chat_box_status',status:action.value };livechatoo.xdc.set(livechatoo.gEBI('IMS_iframe1'),message);}else if(action.name=='no_repeat_until'){var curr_time=livechatoo.time(),seconds=this.to_seconds(action.unit,action.value);this.storage.data.no_repeat_triggers[trigger.id]={name:action.name,until:curr_time+seconds};this.storage.set();}else if(action.name=='no_repeat_session'){this.storage.data.no_repeat_triggers[trigger.id]={name:action.name,session:this.session};this.storage.set();}else if(action.name=='no_repeat_visitor'){this.storage.data.no_repeat_triggers[trigger.id]={name:action.name};this.storage.set();}else if(action.name=='js_callback'){var code=action.value+"({id:'"+trigger.id+"',title:'"+trigger.title.replace(/\'/g,'\\\'')+"'})";try{eval(code);}catch(e) {}}else if(action.name=='js_code'){try{eval(action.value);}catch(e) {}}}};livechatoo.embed={data:{ loads:0,page:'',on_chat:false,online:false,departments_online:[],operators_online:[] },init:function(options){if(typeof options=='object') this.options=options;else if(typeof this.options=='object') this.options=this.options;else this.options={};this.options.side=this.options.side=='left'?'left':'right';if(!this.options.account){var matches=livechatoo.script_src.match(/\?account=([a-z0-9]{2,20})/);if(matches) this.options.account=matches[1];}this.options.mobile=typeof this.options.mobile=='undefined'?livechatoo.is_mobile:!!this.options.mobile;if(this.options.mobile&&this.options.page&&this.options.page != 'hidden') this.options.page='mini';livechatoo.subcookie.set('lctpref','ctest',1,30);if(livechatoo.is_ie6)return;else if(livechatoo.is_bot)return;else if(!livechatoo.subcookie.get('lctpref','ctest'))return;else if(!this.options.account||!/^[a-z0-9]{2,20}$/.test(this.options.account))return;else if(!livechatoo.d.body) setTimeout(function(){livechatoo.embed.init(this.options);},100);else if(livechatoo.gEBI('IMS_box1')){livechatoo.show('IMS_box1');livechatoo.activity.init();}else{var html,css;html=' \ <div id="IMS_box1" class="IMS_fixChatBox" style="display: block;width: 0;height: 0;"> \ <div class="IMS_moveBox" id="IMS_box_dad"></div> \ <iframe id="IMS_iframe1" class="IMS_iframeBox" scrolling="no" frameborder="0" allowtransparency="true"></iframe> \ <iframe id="IMS_iframe2" class="IMS_bubble" scrolling="no" frameborder="0" allowtransparency="true"></iframe> \ </div> \ ';css=' \ .IMS_fixChatBox{position: fixed;bottom: 0;z-index: 2147483647;padding: 0;margin: 0;margin-top: -17px\\9;margin-left: -9px\\9;}\ .IMS_moveBox{display: none;position: absolute;height: 50px;width: 190px;top: 0;cursor: move;float: left;}\ .IMS_iframeBox{width: 262px;height: 0;z-index: 1;}\ .IMS_bubble{display: none;height: 31px;width: 19px;background: transparent;position: absolute;bottom: 30px;left: 25px;}\ ';var head=livechatoo.d.getElementsByTagName('head')[0];var style=livechatoo.d.createElement('style');var rules=livechatoo.d.createTextNode(css);style.type='text/css';if(style.styleSheet) style.styleSheet.cssText=rules.nodeValue;else style.appendChild(rules);head.appendChild(style);var h=livechatoo.d.createElement('div');h.innerHTML=html;livechatoo.d.body.insertBefore(h,livechatoo.d.body.firstChild);livechatoo.instance=new livechatoo.dad.dad('lctdad',{box:'IMS_box1',element:'IMS_box_dad' });livechatoo.gEBI('IMS_iframe1').src=this.url();if(livechatoo.is_ie&&livechatoo.is_quirks){livechatoo.instance.b.style.position='absolute';livechatoo.d.body.onscroll=function(){if(typeof livechatoo.embed.qtemp=='undefined'){livechatoo.embed.qtemp=[];livechatoo.embed.qtemp['y']=livechatoo.to_int(livechatoo.instance.b.style.bottom)+livechatoo.d.body.scrollTop;livechatoo.embed.qtemp['x']=livechatoo.to_int(livechatoo.instance.b.style[livechatoo.embed.options.side])+(livechatoo.d.body.scrollLeft * (livechatoo.embed.options.side=='right'?1:-1) );}livechatoo.instance.b.style.bottom=livechatoo.embed.qtemp['y'] - livechatoo.d.body.scrollTop+'px';livechatoo.instance.b.style[livechatoo.embed.options.side]=livechatoo.embed.qtemp['x'] - (livechatoo.d.body.scrollLeft * (livechatoo.embed.options.side=='right'?1:-1) )+'px';}} else livechatoo.instance.b.style.position='fixed';livechatoo.xdc.controller();livechatoo.activity.init();}},reload:function(){if(!livechatoo.gEBI('IMS_box1'))return;this.data.loads=0;livechatoo.gEBI('IMS_iframe1').src=this.url();},stop:function(){if(!livechatoo.gEBI('IMS_box1'))return;livechatoo.hide('IMS_box1');livechatoo.activity.stop();},status:function(){if(!livechatoo.gEBI('IMS_box1'))return false;return livechatoo.gEBI('IMS_box1').style.display=='block'?true:false;},flip:function(options){this.status()?this.stop():this.init(options);},bubble:function(enable){var message={cmd:'bubble',enable:enable };livechatoo.xdc.set(livechatoo.gEBI('IMS_iframe1'),message);},url:function(){var url_par=livechatoo.d.location.href.split('#')[0];url_par=url_par.length>1500?url_par.substr(0,1497)+'...':url_par;var url_ref=livechatoo.d.referrer;url_ref=url_ref.length>1500?url_ref.substr(0,1497)+'...':url_ref;var tit_par=livechatoo.d.title;tit_par=tit_par.length>80?tit_par.substr(0,77)+'...':tit_par;if(tit_par=='') tit_par=url_par.length>80?url_par.substr(0,77)+'...':url_par;var target_inp=typeof this.options.target,target_out=0;if(target_inp=='string'&&(this.options.target==url_par||livechatoo.triggers.check_wildcard('equal',url_par,this.options.target))) target_out=1;else if(target_inp=='object'){for(var i in this.options.target){if(this.options.target[i]==url_par||livechatoo.triggers.check_wildcard('equal',url_par,this.options.target[i])){target_out=1;break;}}}var x_s=livechatoo.subcookie.get('lctpref','gateway');var x_u=livechatoo.subcookie.get('lctpref','uniqid');x_s=(!x_s||x_s=='undefined')?'':x_s;x_u=(!x_u||x_u=='undefined')?'':x_u;var url_ifr1=livechatoo.domain+'/'+this.options.account+'/client-embed/'+(this.options.lang||'')+'?session='+x_s+'&uniqid='+x_u+'&tz_offset='+livechatoo.tz_offset+'&page='+(this.options.page||'')+'&mobile='+(this.options.mobile?1:'')+(this.options.session_per_host?'&session_cookie_name='+encodeURIComponent(livechatoo.d.location.hostname.replace(/^www\./,'').replace(/\./g,'')):'')+(typeof this.options.bubble != 'undefined'?(this.options.bubble?'&view_ques=1':'&view_ques=0'):'')+'&layout='+(this.options.layout||'')+'&target='+target_out+'&c_name='+encodeURIComponent(this.options.c_name||'')+'&c_name_byop='+encodeURIComponent(this.options.c_name_byop||'')+'&c_email='+encodeURIComponent(this.options.c_email||'')+'&c_phone='+encodeURIComponent(this.options.c_phone||'')+'&custom='+encodeURIComponent(this.options.custom||'')+'&departments='+encodeURIComponent(this.options.departments||'')+'&operators='+encodeURIComponent(this.options.operators||'')+'&css_text='+encodeURIComponent(this.options.css_text||'')+'&css_file='+encodeURIComponent(this.options.css_file||'')+'&url_contact='+encodeURIComponent(this.options.url_contact||'')+'&url_faq='+encodeURIComponent(this.options.url_faq||'')+'&url_privacy='+encodeURIComponent(this.options.url_privacy||'')+'&purl='+encodeURIComponent(url_par)+'&ptitle='+encodeURIComponent(tit_par)+'&referrer='+encodeURIComponent(url_ref);return url_ifr1;},page:function(page,params){if(!livechatoo.gEBI('IMS_box1'))return false;if(livechatoo.embed.data.on_chat||this.data.page==page)return false;var query='';if(typeof params=='object'){for(var key in params){if(!params.hasOwnProperty(key)) continue;query+='&params'+encodeURIComponent('['+key+']')+'='+encodeURIComponent(params[key]);}} var url=livechatoo.domain+'/'+this.options.account+'/client-embed/'+(this.options.lang||'')+'?session='+(livechatoo.subcookie.get('lctpref','gateway')||'')+'&uniqid='+(livechatoo.subcookie.get('lctpref','uniqid')||'')+'&tz_offset='+livechatoo.tz_offset+'&page='+page+'&opener=parent&mobile='+(this.options.mobile?1:0)+(this.options.session_per_host?'&session_cookie_name='+encodeURIComponent(livechatoo.d.location.hostname.replace(/^www\./,'').replace(/\./g,'')):'')+(typeof this.options.bubble != 'undefined'?(this.options.bubble?'&view_ques=1':'&view_ques=0'):'')+'&layout='+(this.options.layout||'')+'&departments='+encodeURIComponent(this.options.departments||'')+'&operators='+encodeURIComponent(this.options.operators||'')+'&css_text='+encodeURIComponent(this.options.css_text||'')+'&css_file='+encodeURIComponent(this.options.css_file||'')+query;if(page != 'mini'&&page != 'chat'&&page != 'hidden'&&this.options.mobile){if(window.lct_client_embed_window) lct_client_embed_window.close();lct_client_embed_window=window.open(url+'&popup=1','lct_client_embed_window');}else livechatoo.gEBI('IMS_iframe1').contentWindow.location.replace(url);return true;},switch_side:function(side){if(side=='left') livechatoo.instance.b.style.right='auto';else livechatoo.instance.b.style.left='auto';this.options.side=side;livechatoo.instance.b.style.bottom=0;livechatoo.instance.b.style[side]=0;livechatoo.subcookie.set('lctpref','posy',0,30);livechatoo.subcookie.set('lctpref','posx',0,30);},ga_event:function(gau_global_object_name,gau_tracker_objects_names,action,label,value){setTimeout(function(){var ga=window[gau_global_object_name];if(ga&&typeof ga=='function'&&ga.getAll&&typeof ga.getAll=='function'){if(gau_tracker_objects_names=='default'){var trackers=ga.getAll();ga(trackers[0].get('name')+'.send','event','Livechatoo',action,label,value);}else if(gau_tracker_objects_names=='all'){var trackers=ga.getAll();for(var tracker,i=0;i<trackers.length;i++){tracker=trackers[i].get('name');ga(tracker+'.send','event','Livechatoo',action,label,value);}} else{var trackers=gau_tracker_objects_names.split(',');for(var tracker,i=0;i<trackers.length;i++){tracker=trackers[i];ga(tracker+'.send','event','Livechatoo',action,label,value);}}}var _gaq=window._gaq;if(_gaq&&typeof _gaq=='object'&&_gaq.push){_gaq.push(['_trackEvent','Livechatoo',action,label,value]);}},1000);}};livechatoo.popup={open:function(){var lang=this.options.lang||'',query='';if(this.options.mobile) query+='&mobile=1';if(this.options.session_per_host) query+='&session_cookie_name='+encodeURIComponent(livechatoo.d.location.hostname.replace(/^www\./,'').replace(/\./g,''));if(this.options.layout) query+='&layout='+encodeURIComponent(this.options.layout);if(this.options.c_name) query+='&c_name='+encodeURIComponent(this.options.c_name);if(this.options.c_name_byop) query+='&c_name_byop='+encodeURIComponent(this.options.c_name_byop);if(this.options.c_email) query+='&c_email='+encodeURIComponent(this.options.c_email);if(this.options.c_phone) query+='&c_phone='+encodeURIComponent(this.options.c_phone);if(this.options.departments) query+='&departments='+encodeURIComponent(this.options.departments);if(this.options.operators) query+='&operators='+encodeURIComponent(this.options.operators);if(this.options.css_text) query+='&css_text='+encodeURIComponent(this.options.css_text);if(this.options.css_file) query+='&css_file='+encodeURIComponent(this.options.css_file);if(this.options.url_contact) query+='&url_contact='+encodeURIComponent(this.options.url_contact);if(this.options.url_faq) query+='&url_faq='+encodeURIComponent(this.options.url_faq);if(this.options.url_privacy) query+='&url_privacy='+encodeURIComponent(this.options.url_privacy);if(!this.win||this.win.closed){this.win=window.open(livechatoo.domain+'/'+this.options.account+'/client-popup/'+lang+'?tz_offset='+livechatoo.tz_offset+query,'lct_client_popup_window','location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=yes,height=555,width=510');return true;}else{try{this.win.focus();}catch(e) {};return true;}},close:function(){try{this.win.close();}catch(e) {}},init:function(options){if(typeof options=='object') this.options=options;else if(typeof this.options=='object') this.options=this.options;else this.options={};if(!this.options.account){var matches=livechatoo.script_src.match(/\?account=([a-z0-9]{2,20})/);if(matches) this.options.account=matches[1];}this.options.mobile=typeof this.options.mobile=='undefined'?livechatoo.is_mobile:!!this.options.mobile;if(!livechatoo.d.body) setTimeout(function(){livechatoo.popup.init(this.options);},100);else if(!this.options.account||!/^[a-z0-9]{2,20}$/.test(this.options.account))return;else{var css=' \ .IMS_right1{background: url('+livechatoo.domain+'/images/bubble/right1.png);width: 105px;height: 60px;}\ .IMS_right2{background: url('+livechatoo.domain+'/images/bubble/right2.png);width: 150px;height: 90px;}\ .IMS_right3{background: url('+livechatoo.domain+'/images/bubble/right3.png);width: 182px;height: 110px;}\ .IMS_left1{background: url('+livechatoo.domain+'/images/bubble/left1.png);width: 105px;height: 60px;}\ .IMS_left2{background: url('+livechatoo.domain+'/images/bubble/left2.png);width: 150px;height: 90px;}\ .IMS_left3{background: url('+livechatoo.domain+'/images/bubble/left3.png);width: 182px;height: 110px;}\ \ .IMS_right1,.IMS_right2,.IMS_right3,.IMS_left1,.IMS_left2,.IMS_left3{cursor: pointer;position: fixed;z-index: 9999 !important;*position: absolute;top: expression(eval(document.compatMode&&document.compatMode==\'CSS1Compat\')?documentElement.scrollTop +((documentElement.clientHeight - this.clientHeight) / 1):document.body.scrollTop+((document.body.clientHeight - this.clientHeight) / 1));}\ .IMS_left1,.IMS_left2,.IMS_left3{bottom: 0;left: 0;}\ .IMS_right1,.IMS_right2,.IMS_right3{bottom: 0;right: 0;}\ ';if(this.options.mode=='custom') this.open();else if(this.options.mode=='bubble'){if(!livechatoo.gEBI('IMS_popup_type')){var head=livechatoo.d.getElementsByTagName('head')[0];var style=livechatoo.d.createElement('style');var rules=livechatoo.d.createTextNode(css);style.type='text/css';if(style.styleSheet) style.styleSheet.cssText=rules.nodeValue;else style.appendChild(rules);head.appendChild(style);var a=livechatoo.d.createElement('a');a.href='#';a.target='_blank';a.id='IMS_popup_type';livechatoo.d.body.appendChild(a);}livechatoo.gEBI('IMS_popup_type').className='IMS_'+this.options.btype;livechatoo.gEBI('IMS_popup_type').onclick=function(){livechatoo.popup.open();return false;};livechatoo.show('IMS_popup_type');}}},stop:function(){if(livechatoo.gEBI('IMS_popup_type')) livechatoo.hide('IMS_popup_type');try{this.win.close();}catch(e) {}},status:function(){try{return !this.win.closed?true:false;}catch(e){return false;}}};livechatoo.webrtc={closed:false,script:function(room,mode,type,lang){var basehref='https://videochat.livechatoo.com';if(!livechatoo.gEBI('parent_script')){onLctWebrtcScriptReady=function(){lctwebrtc.init_video_box(basehref,room,mode,lang);};var l=document.createElement('script');l.type='text/javascript';l.async=!0;l.id='parent_script',l.src=basehref+'/assets/js/parent.min.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(l,s);}else if(!livechatoo.gEBI('parent_container')&&(!this.closed||type=='click')) lctwebrtc.init_video_box(basehref,room,mode,lang);}};if(typeof livechatooCmd=='function') livechatooCmd();