var IMAGEURL = "https://templateshares-ue.net/livechat/themes/default/images/", FULLURL = "https://templateshares-ue.net/livechat/", AJAXLOADER = ''; var type_your_msg_here = "type your message here and press ENTER to send"; var loading = "Loading..."; var you_got_a_new_message = "You got a new message!"; var need_help_chat_now = "Need help? Chat now!"; var end_chat = "End Chat"; var chat_session_end = "This chat session has been end."; function _unixtimestamp() { return Math.round(+new Date()/1000); } $.ajaxSetup({type: "POST", dataType: "json", contentType: "application/x-www-form-urlencoded; charset=UTF-8", encoding: "UTF-8", cache: false, timeout: 25000}); $(document).ready(function() { onlineVisitors(); setInterval(function(){agentWantChat();}, 5000); $(document).on("click", ".liveChatHeader,#yeshelpme", function(e) { e.preventDefault(); if($("#liveChatContainer").css("margin-bottom").charAt(0) == "-") { $("#liveChatContainer").animate({"margin-bottom": 0}, "slow", "easeOutBounce").fadeTo("fast", 1); $(".showHide").attr("src", IMAGEURL+"minimize.png"); $(".alert").html("").hide(); $(".liveChatHeader span").html(' '+need_help_chat_now); clearInterval(docTitleInterval); document.title = orjDocTitle; totalNewMessages=0; $(".endChat").show(); $("#yourName").focus(); } else { $("#liveChatContainer").animate({"margin-bottom": -420}, "slow", "easeOutBounce").fadeTo("fast", 0.6); $(".showHide").attr("src", IMAGEURL+"maximize.png"); $(".endChat").hide(); } return false; }); $(document).on("submit", "#startChat", function(e) { e.preventDefault(); $(".ajaxError").remove(); var $form = $(this), $data = "isAjax=1&"+$form.serialize(); $form.hide(); $('