/*===============================================*\
|| ############################################# ||
|| # JAKWEB.CH / Version 3.6.1                 # ||
|| # ----------------------------------------- # ||
|| # Copyright 2021 JAKWEB All Rights Reserved # ||
|| ############################################# ||
\*===============================================*/

var ltint=null;var clatency=10000;var otyping="false";function ltJAK(ticketid,oid){liveTicket(ticketid,oid);ltint=setInterval(function(){liveTicket(ticketid,oid)},clatency)}function ticketTyping(ticketid,oid){otyping="true";var request=$.ajax({async:true,url:ls.main_url+'ajax/liveticket.php',type:"GET",data:"case=typing&ticketid="+ticketid+"&oid="+oid,dataType:"json",cache:false})}function ticketNotTyping(ticketid,oid){otyping="false";var request=$.ajax({async:true,url:ls.main_url+'ajax/liveticket.php',type:"GET",data:"case=nottyping&ticketid="+ticketid+"&oid="+oid,dataType:"json",cache:false})}function liveTicket(ticketid,oid){var request;if(typeof request!=='undefined')request.abort();request=new XMLHttpRequest();request.open('GET',ls.main_url+'ajax/liveticket.php?case=live&ticketid='+ticketid+'&oid='+oid,true);request.timeout=clatency;request.onload=function(){if(request.status>=200&&request.status<400){var data=JSON.parse(request.responseText);handleTicketStatus(data)}else{}};request.onerror=function(){};request.ontimeout=function(e){};request.send()}function handleTicketStatus(data){if(data.onlineList){$('#ticket_live_status_container').fadeIn();$('#ticket_live_status').html(data.onlineList)}else{$("#ticket_live_status_container").fadeOut();$('#ticket_live_status').html("")}}
