"); printWindow.document.close(); printWindow.focus(); } function lz_chat_close() { var windowName = window.name; if(lz_chat_data.GetParameters.indexOf("mp") == -1) lz_chat_change_url("./chat.php?"+lz_chat_data.GetParameters + "&mp=0"); else lz_chat_change_url("./chat.php?"+lz_chat_data.GetParameters); window.name = windowName; } function lz_chat_geo_result(_lat,_long,_region,_city,_tz,_ctryi2,_isp) { lz_chat_data.GeoResolution.OnTimeoutEvent = null; lz_chat_data.ExternalUser.Session.GeoResolved = Array(_lat,_long,_region,_city,_tz,_ctryi2,_isp); lz_chat_data.ExternalUser.Session.Save(); lz_chat_startup(); } function lz_chat_geo_resolute() { lz_chat_data.GeoResolution.SetStatus(1); lz_chat_data.GeoResolution.OnEndEvent = "lz_chat_geo_result"; lz_chat_data.GeoResolution.OnTimeoutEvent = lz_chat_geo_failure; lz_chat_data.GeoResolution.OnSpanEvent = "lz_chat_set_geo_span"; lz_chat_data.GeoResolution.ResolveAsync(); } function lz_chat_set_geo_span(_timespan) { lz_chat_data.GeoResolution.SetSpan(_timespan); } function lz_chat_geo_failure() { lz_chat_data.GeoResolution.SetSpan(45); lz_chat_data.GeoResolution.SetStatus(4); lz_chat_startup(); } function lz_chat_file_changed() { lz_chat_file_unset_images(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_name').value = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_base').value; } function lz_chat_file_request_upload() { if(lz_chat_data.Status.Status == lz_chat_data.STATUS_STOPPED) { lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } if(!lz_chat_data.InternalUser.Available) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } if(!lz_chat_data.FileUpload.Running) { lz_chat_file_unset_images(); if(lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_name').value.length == 0) { lz_chat_chat_alert(lz_chat_data.Language.SelectFile,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } lz_chat_data.FileUpload.Filename = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_name').value lz_chat_data.FileUpload.Permitted = false; lz_chat_data.FileUpload.Running = true; lz_chat_data.FileUpload.Error = false; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_load').style.visibility = "visible"; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_load').src = "./images/lz_circle.gif?acid=" + lz_global_microstamp(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_name').disabled = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_select').disabled = true; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_send').value = "Abort"; lz_chat_focus_textbox(); lz_chat_shout(2); } else { lz_chat_file_stop(); } } function lz_chat_file_start_upload(_file) { lz_chat_data.PermittedFrames++; lz_chat_data.FileUpload.Permitted = true; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_upload_form_userid').value = lz_chat_data.ExternalUser.Session.UserId; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_upload_form_browser').value = lz_chat_data.ExternalUser.Session.BrowserId; lz_chat_data.FileUpload.Filename = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_base').value; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','').document.lz_file_form.submit(); } function lz_chat_file_error(_value) { lz_chat_file_stop(); if(_value > 1) lz_chat_data.FileUpload.Error = _value; if(_value == lz_chat_data.FILE_UPLOAD_REJECTED) lz_chat_chat_alert(lz_chat_data.Language.FileUploadRejected,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); else if(_value == lz_chat_data.FILE_UPLOAD_OVERSIZED) lz_chat_chat_alert(lz_chat_data.Language.FileUploadOversized,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_error').style.visibility = "visible"; } function lz_chat_file_ready() { lz_chat_data.FileUpload.Error = lz_chat_data.FileUpload.Running = false; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_success').style.visibility = "visible"; lz_chat_chat_alert(lz_chat_data.Language.FileProvided,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); } function lz_chat_file_clear() { lz_chat_data.PermittedFrames++; lz_chat_get_frame_object('','lz_chat_file_upload_frame').src = lz_chat_get_frame_object('','lz_chat_file_upload_frame').src + "&acid=" + lz_global_microstamp(); } function lz_chat_file_stop() { if(lz_chat_data.Status.Status < lz_chat_data.STATUS_START || lz_chat_data.Status.Status == lz_chat_data.STATUS_STOPPED) return; if(lz_chat_data.FileUpload.Running && lz_chat_data.FileUpload.Permitted) lz_chat_file_clear(); lz_chat_data.FileUpload.Running = lz_chat_data.FileUpload.Permitted = false; lz_chat_data.FileUpload.Error = true; lz_chat_shout(3); lz_chat_file_unset_images(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_send').disabled = true; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_name').disabled = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_select').disabled = false; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_send').value = "Send"; setTimeout("lz_chat_file_reactivate();",lz_chat_data.ChatFrequency*2*1000); } function lz_chat_file_reactivate() { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_send').disabled = false; } function lz_chat_file_unset_images() { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_load').style.visibility = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_success').style.visibility = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.1.0','lz_chat_file_error').style.visibility = "hidden"; } function lz_chat_file_reset() { lz_chat_data.FileUpload.Running = false; lz_chat_data.FileUpload.Error = false; } function lz_chat_data_box() { this.Id = ''; this.Language = new lz_chat_data_language(); this.Templates = new lz_chat_data_templates(); this.InternalUser = new lz_chat_internal_user(); this.ExternalUser = new lz_chat_external_user(); this.Status = new lz_chat_status(); this.LastSender = -2; this.LastSound = 0; this.AlternateRow = true; this.SetupError = lz_global_utf8_decode(lz_global_base64_decode('VGhpcyBzZXJ2aWNlIGlzIG5vdCBhdmFpbGFibGUuIFdlIGFwb2xvZ2l6ZSBmb3IgYW55IGluY29udmVuaWVuY2UgdGhpcyBtYXkgY2F1c2Uu')); this.FileUpload = new lz_chat_file_upload(); this.PermittedFrames = 16; this.LastConnection = 0; this.CurrentApplication = "chat"; this.ChatFrequency = 4; this.PollTimeout = 118; this.PollHash = ''; this.PollAcid = ''; this.ShoutNeeded = false; this.ShoutRunning = false; this.ConnectionBroken = false; this.ConnectionRunning = false; this.LastConnectionFailed = false; this.DirectLogin = false; this.SoundsAvailable = false; this.IECompatible = false; this.Groups = null; this.TimerTyping = null; this.TimerWaiting = null; this.GetParameters = ''; this.TempImage = new Image(); this.TimezoneOffset = (new Date().getTimezoneOffset() / 60) * -1; this.ActiveAlertFrame = null; this.NoPreChatMessages = false; this.GeoResolution; this.QueueMessageAppended = false; this.ConnectedMessageAppended = false; this.WaitingMessageAppended = false; this.WindowUnloaded = false; this.WindowNavigating = false; this.WindowAnnounce = null; this.MessageCount = 1; this.SoundObject = null; this.InputFieldIndices = new Array('0','1','2','3','4','5','6','7','8','9','111','112','113','114'); this.SYSTEM = -1; this.INTERNAL = 0; this.EXTERNAL = 1; this.MAXCHATLENGTH = 1500; this.STATUS_STOPPED = 4; this.STATUS_ACTIVE = 3; this.STATUS_ALLOCATED = 2; this.STATUS_INIT = 1; this.STATUS_START = 0; this.FILE_UPLOAD_OVERSIZED = 2; this.FILE_UPLOAD_REJECTED = 1; this.IMAGE_FILE_UPLOAD_SUCCESS = './images/file_upload_success.gif'; function lz_chat_status() { this.Status = 0; this.Loaded = false; } function lz_chat_data_language() { this.FillMandatoryFields = "Please fill all mandatory fields."; this.SelectValidGroup = "Please select valid department."; this.LanguageLeaveMessageShort = "Leave message"; this.StartChat = "Start Chat"; this.StartSystem = "System is getting started."; this.ConnectionBroken = "Connection error, trying to reconnect. Please be patient ..."; this.MessageTooLong = "This message is too long. In order to send this message it must be shortened."; this.MessageReceived = "Thank you! We will get in touch with you soon."; this.MessageFlood = "You have sent too many messages. Please wait some time and try again."; this.RequestPermission = "Requesting permission for upload ..."; this.StartUpload = "Click on SEND to upload selected file"; this.SelectFile = "Please select file for upload."; this.FileProvided = "Your file has been provided to our representative!"; this.WaitForRepresentative = "Please wait for a representative!"; this.RepresentativeLeft = "The representative has already left this conversation."; this.SelectRating = "Please select rating first!"; this.FileUploadRejected = "The representative did not accept your request!"; this.FileUploadOversized = "Your file was not accepted by the server (filesize too large or forbidden extension)!"; this.TransmittingFile = "Transmitting your file ..."; this.Guest = "Guest"; this.ClientForwarding = "You will be forwarded to another representative, please be patient."; this.ClientInternArrives = " enters the chatroom."; this.ClientErrorUnavailable = "This service is not available. We apologize for any inconvenience this may cause."; this.ClientIntLeft = "The representative has left the conversation. If you have further questions please leave a message:"; this.ClientIntDeclined = "All available representatives are currently occupied. Your request could not be served. We apologize for any inconvenience this may cause. Please try again later or leave a message:"; this.ClientStillWaitingInt = "We are still trying to connect you, please be patient. If you don"t want to wait please leave a message:"; this.ClientThankYou = "Thank you!"; this.ClientIntIsConnected = "A representative will be connected, please be patient."; this.ClientNoInternUsers = "No representative of this department is available. Please try again later or switch to another department. You can also leave a message:"; this.ClientNoInternUsersShort = "No representative of this department is available. Please try again later or switch to another department."; this.ClientErrorGroups = "This service is deactivated for the following reason: No department is allowed to accept external chats. We apologize for any inconvenience this may cause."; this.RateSuccess = "Thank you, we received your rating. Your response helps us to improve this service. We greatly appreciate your feedback."; this.RateMax = "You are not allowed to rate our service more than 3 times a day."; this.System = "System"; this.QueueMessage = "Your current position in the queue is . Approximate waiting time: minute(s)."; this.NextOperator = "The next representative available is reserved for you."; } function lz_chat_data_templates() { this.MessageInternal = 'PHRhYmxlIHdpZHRoPSI5NyUiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIiBhbGlnbj0iY2VudGVyIiBzdHlsZT0ibWFyZ2luLXRvcDo2cHg7Ij4KCTx0cj4KCQk8dGQ+CgkJCTx0YWJsZSB3aWR0aD0iMTAwJSIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIiBoZWlnaHQ9IjIwIj4KCQkJCTx0cj4KCQkJCQk8dGQgd2lkdGg9IjYiIGJhY2tncm91bmQ9Ii4vaW1hZ2VzL2NoYXRfYmdfZ3JlZW5fbGVmdC5naWYiPjwvdGQ+CgkJCQkJPHRkIHdpZHRoPSI2IiBiYWNrZ3JvdW5kPSIuL2ltYWdlcy9jaGF0X2JnX2dyZWVuX2NlbnRlci5naWYiPjwvdGQ+CgkJCQkJPHRkIHZhbGlnbj0ibWlkZGxlIiBiYWNrZ3JvdW5kPSIuL2ltYWdlcy9jaGF0X2JnX2dyZWVuX2NlbnRlci5naWYiIHN0eWxlPSJwYWRkaW5nLWJvdHRvbToycHg7IiBOT1dSQVA+PHNwYW4gY2xhc3M9Imx6X21lc3NhZ2VfYV90aXRsZSI+PGI+PCEtLW5hbWUtLT48L2I+PC9zcGFuPjwvdGQ+CgkJCQkJPHRkIGFsaWduPSJyaWdodCIgdmFsaWduPSJtaWRkbGUiIGJhY2tncm91bmQ9Ii4vaW1hZ2VzL2NoYXRfYmdfZ3JlZW5fY2VudGVyLmdpZiIgc3R5bGU9InBhZGRpbmctYm90dG9tOjJweDsiPjxzcGFuIGNsYXNzPSJsel9tZXNzYWdlX2FfdGltZSI+PCEtLXRpbWUtLT48L3NwYW4+PC90ZD4KCQkJC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j0iMiI+CgkJCTx0YWJsZSB3aWR0aD0iMTAwJSIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSI0Ij4KCQkJCTx0cj4KCQkJCQk8dGQgd2lkdGg9IjIiPjwvdGQ+CgkJCQkJPCEtLWljb24tLT4KCQkJCQk8dGQgYWxpZ249IjwhLS1hbGlnbi0tPiI+PHNwYW4gY2xhc3M9Imx6X21lc3NhZ2VfdGV4dCI+PCEtLW1lc3NhZ2UtLT48L3NwYW4+PC90ZD4KCQkJCQk8dGQgd2lkdGg9IjIiPjwvdGQ+CgkJCQk8L3RyPgoJCQk8L3RhYmxlPgoJCTwvdGQ+CgkJPHRkIHdpZHRoPSIzIiBhbGlnbj0icmlnaHQiIHZhbGlnbj0idG9wIj48aW1nIHNyYz0iLi9pbWFnZXMvY2hhdF9iZ19jb250aW51ZV9yaWdodF90b3AuZ2lmIiBhbHQ9IiIgd2lkdGg9IjMiIGhlaWdodD0iMyIgYm9yZGVyPSIwIj48L3RkPgoJPC90cj4KCTx0cj4KCQk8dGQgaGVpZ2h0PSIzIiB2YWxpZ249ImJvdHRvbSI+PGltZyBzcmM9Ii4vaW1hZ2VzL2NoYXRfYmdfY29udGludWVfbGVmdF9ib3R0b20uZ2lmIiBhbHQ9IiIgd2lkdGg9IjMiIGhlaWdodD0iMyIgYm9yZGVyPSIwIj48L3RkPgoJCTx0ZCB2YWxpZ249ImJvdHRvbSI+PGltZyBzcmM9Ii4vaW1hZ2VzL2NoYXRfYmdfY29udGludWVfcmlnaHRfYm90dG9tLmdpZiIgYWx0PSIiIHdpZHRoPSIzIiBoZWlnaHQ9IjMiIGJvcmRlcj0iMCI+PC90ZD4KCTwvdHI+CjwvdGFibGU+'; } function lz_chat_internal_user() { this.Id = ''; this.Fullname = ''; this.Available = false; this.TextAlign = 'left'; this.ProfilePictureTime = 0; this.Language = "en"; } function lz_chat_external_user() { this.Id = ''; this.Username = ''; this.Email = ''; this.Company = ''; this.Question = ''; this.CustomFields = new Array('','','','','','','','','',''); this.MailText = ''; this.Group = ''; this.Typing = false; this.MessagesSent = new Array(); this.MessagesReceived = new Array(); this.Session; this.TextAlign = 'left'; } function lz_chat_file_upload() { this.Filename; this.Running; this.Permitted; this.Error; } } function lz_chat_post() { this.MessageText = ''; this.MessageTranslation = ''; this.MessageId = ''; this.MessageTime = 0; this.Received = false; } var lz_translator = null; function lz_chat_show_waiting_message() { if(lz_chat_data.Status.Status != lz_chat_data.STATUS_ACTIVE && lz_chat_data.Status.Status != lz_chat_data.STATUS_CLOSED && lz_chat_data.Status.Status != lz_chat_data.STATUS_STOPPED && !lz_chat_data.WaitingMessageAppended) { lz_chat_add_system_text(5,""); lz_chat_data.WaitingMessageAppended = true; } } function lz_chat_set_signature(_userId) { lz_chat_data.ExternalUser.Session.UserId = _userId; lz_chat_data.ExternalUser.Session.Save(); } function lz_chat_initiate_forwarding(_group) { if(lz_chat_data.QueueMessageAppended) { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_position').id = "oq_a" + lz_global_timestamp(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_waiting_time').id = "oq_b" + lz_global_timestamp(); lz_chat_data.QueueMessageAppended = false } lz_chat_data.ConnectedMessageAppended = false; lz_chat_data.WaitingMessageAppended = false; lz_chat_set_intern('','','','',false,false); if(lz_chat_data.FileUpload.Running) lz_chat_file_stop(); lz_chat_add_system_text(0,null); lz_chat_set_intern_image(0,'',false); lz_chat_set_group(_group); lz_chat_set_status(lz_chat_data.STATUS_ALLOCATED); } function lz_chat_message(_translation,_original) { if(_original=='') { var msg = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.5.0','lz_chat_text').value; } if(_original != "") msg = _original; if(lz_chat_data.Status.Status == lz_chat_data.STATUS_STOPPED) return lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); else if(msg.length > 0 && lz_global_trim(msg).length > 0 && msg.length <= lz_chat_data.MAXCHATLENGTH) { if(lz_chat_get_frame_object('lz_chat_frame.3.2.chat.6.0','lz_translation_service_active').checked && _original=='') { if(!lz_chat_data.InternalUser.Available) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return false; } lz_translator.language.translate(msg, lz_chat_get_frame_object('lz_chat_frame.3.2.chat.6.0','lz_chat_translation_target_language').options[lz_chat_get_frame_object('lz_chat_frame.3.2.chat.6.0','lz_chat_translation_target_language').selectedIndex].value, lz_chat_data.InternalUser.Language, function(result) {lz_chat_message(result.translation,msg);}); } else { var message = new lz_chat_post(); message.MessageText = msg; message.MessageTranslation = _translation; message.MessageId = lz_chat_data.MessageCount++; lz_chat_data.ExternalUser.Typing = false; lz_chat_add_extern_text(msg,_translation); lz_chat_data.ExternalUser.MessagesSent[lz_chat_data.ExternalUser.MessagesSent.length] = message; lz_chat_shout(10); } } else if(msg.length > lz_chat_data.MAXCHATLENGTH) return lz_chat_chat_alert(lz_chat_data.Language.MessageTooLong,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); setTimeout("lz_chat_clear_field()",1); return false; } function lz_chat_clear_field() { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.5.0','lz_chat_text').value = ""; lz_chat_focus_textbox(); } function lz_chat_focus_textbox() { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.5.0','').focus(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.5.0','lz_chat_text').focus(); } function lz_chat_chat_alert_move() { if(lz_chat_data.ActiveAlertFrame != null && lz_chat_data.ActiveAlertFrame.document.getElementById('lz_chat_alert_box').style.display == 'inline') lz_chat_chat_alert_set_position(lz_chat_data.ActiveAlertFrame); } function lz_chat_chat_alert_set_position(_frame) { if(lz_chat_get_frame_object('','lz_chat_frameset_chat') != null) var frame_rows = lz_chat_get_frame_object('','lz_chat_frameset_chat').rows.split(","); else var frame_rows = Array(0,0,0,0,0); var top = (_frame.document.body.clientHeight-_frame.document.getElementById('lz_chat_alert_box').offsetHeight-frame_rows[2]-frame_rows[3]) / 2; var left = (_frame.document.body.scrollWidth-_frame.document.getElementById('lz_chat_alert_box').offsetWidth+20) / 2; _frame.document.getElementById('lz_chat_alert_box').style.top = top + _frame.document.body.scrollTop; _frame.document.getElementById('lz_chat_alert_box').style.left = left; } function lz_chat_chat_alert(_text,_frame,_event) { _frame.document.getElementById('lz_chat_alert_box_text').innerHTML = _text; _frame.document.getElementById('lz_chat_alert_box').style.display = 'inline'; _frame.document.getElementById("lz_chat_alert_button").onclick = function(){_frame.document.getElementById('lz_chat_alert_box').style.display = 'none';}; lz_chat_chat_alert_set_position(_frame); if(_event == -1) _frame.document.getElementById('lz_chat_alert_button').disabled = true; else if(_event != null) _frame.document.getElementById('lz_chat_alert_button').onclick = _event; lz_chat_data.ActiveAlertFrame = _frame; } function lz_chat_take_smiley(_smiley) { var sign = ""; switch(_smiley) { case"smile":sign = ":-)";break; case"sad":sign = ":-(";break; case"neutral":sign = ":-|";break; case"tongue":sign = ":-P";break; case"cry":sign = ":'-(";break; case"lol":sign = ":-]";break; case"shocked":sign = ":-O";break; case"wink":sign = ";-)";break; case"cool":sign = "8-)";break; case"sick":sign = ":-\\\\";break; case"question":sign = ":?";break; case"sleep":sign = "zzZZ";break; } lz_chat_switch_smiley_box(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.5.0','lz_chat_text').value += sign; lz_chat_focus_textbox(); } function lz_chat_set_intern(_id,_fullname,_groupname,_language,_typing,_vcard) { if(_id.length > 0) { lz_chat_data.InternalUser.Id = lz_global_utf8_decode(lz_global_base64_decode(_id)); lz_chat_data.InternalUser.Fullname = (_fullname.length > 0) ? lz_global_utf8_decode(lz_global_base64_decode(_fullname)) : lz_chat_data.InternalUser.Id; lz_chat_data.InternalUser.Language = _language; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_internal_fullname').innerHTML = lz_chat_data.InternalUser.Fullname; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_internal_groupname').innerHTML = lz_global_utf8_decode(lz_global_base64_decode(_groupname)); frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_vcard_image').href = frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_vcard_text').href = "./visitcard.php?intid=" + encodeURIComponent(lz_chat_data.InternalUser.Id); } lz_chat_data.InternalUser.Available = (_id.length > 0); frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_internal_typing').style.visibility = (_id.length > 0 && _typing) ? "visible" : "hidden"; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_vcard_image').style.visibility = (_id.length > 0 && _vcard) ? "visible" : "hidden"; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_vcard_text').style.visibility = (_id.length > 0 && _vcard) ? "visible" : "hidden"; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_top_bg').style.visibility = (_id.length == 0) ? "visible" : "hidden"; frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_representative').style.visibility = (_id.length > 0) ? "visible" : "hidden"; } function lz_chat_set_intern_image(_edited,_file,_filtered) { if(_edited == 0 || _filtered) { lz_chat_data.TempImage.src = "./images/nopic.jpg"; } else if(_edited != lz_chat_data.InternalUser.ProfilePictureTime) { lz_chat_data.TempImage.src = "./" + _file; lz_chat_data.InternalUser.ProfilePictureTime = _edited; } } function lz_chat_show_intern_image() { frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_intern_image').src = lz_chat_data.TempImage.src; if(lz_chat_data.TempImage.height > 0) frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_pic').style.width = (lz_chat_data.TempImage.width > 80) ? lz_chat_data.TempImage.width : 80; } function lz_chat_switch_extern_typing(_typing) { var announce = (_typing != lz_chat_data.ExternalUser.Typing); if(_typing) { if(lz_chat_data.TimerTyping != null) clearTimeout(lz_chat_data.TimerTyping); lz_chat_data.TimerTyping = setTimeout("lz_chat_switch_extern_typing(false);",5000); lz_switch_title_mode(false); } lz_chat_data.ExternalUser.Typing = _typing; if(announce) lz_chat_shout(11); } function lz_chat_show_connected() { if(!lz_chat_data.ConnectedMessageAppended) { lz_chat_data.ConnectedMessageAppended = true; lz_chat_add_system_text(6,null); } } function lz_chat_show_queue_position(_position,_time) { if(!lz_chat_data.QueueMessageAppended) { var qmessage = lz_chat_data.Language.QueueMessage.replace("","-1"); qmessage = qmessage.replace("","-1"); lz_chat_add_system_text(-1,qmessage); lz_chat_data.QueueMessageAppended = true; } var cposition = parseInt(lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_position').innerHTML); var cwtime = parseInt(lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_waiting_time').innerHTML); if(_position == 1 && (cposition != _position)) lz_chat_add_system_text(9,""); if(cposition == -1 || (_position > 0 && _position <= cposition)) lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_position').innerHTML = _position; if(cwtime == -1 || (_time > 0 && _time <= cwtime)) lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_queue_waiting_time').innerHTML = _time; } function lz_chat_add_system_text(_type,_texta) { var text = ""; if(_type == 0) text = lz_chat_data.Language.ClientForwarding; else if(_type == 1) text = lz_chat_data.Language.ClientInternArrives.replace("",lz_global_utf8_decode(lz_global_base64_decode(_texta))); else if(_type == 2) text = lz_chat_data.Language.ClientErrorUnavailable + lz_global_utf8_decode(lz_global_base64_decode(_texta)); else if(_type == 3) text = lz_chat_data.Language.ClientIntLeft + " " + lz_chat_data.Language.LanguageLeaveMessageShort + ". " + lz_chat_data.Language.ClientThankYou; else if(_type == 4) text = lz_chat_data.Language.ClientIntDeclined + " " + lz_chat_data.Language.LanguageLeaveMessageShort + ". " + lz_chat_data.Language.ClientThankYou; else if(_type == 5) text = lz_chat_data.Language.ClientStillWaitingInt + " " + lz_chat_data.Language.LanguageLeaveMessageShort + ". " + lz_chat_data.Language.ClientThankYou; else if(_type == 6) text = lz_chat_data.Language.ClientIntIsConnected; else if(_type == 8) text = lz_chat_data.Language.ClientNoInternUsers + " " + lz_chat_data.Language.LanguageLeaveMessageShort + ". " + lz_chat_data.Language.ClientThankYou; else if(_type == 9) text = lz_chat_data.Language.NextOperator; else text = _texta; text = lz_global_replace_smilies(text,true); if(lz_chat_data.LastSender != lz_chat_data.SYSTEM) { text = lz_global_base64_decode(lz_chat_data.Templates.MessageExternal).replace("",text); lz_chat_data.AlternateRow = true; } else { if(lz_chat_data.AlternateRow) text = lz_global_base64_decode(lz_chat_data.Templates.MessageAddAlt).replace("",text); else text = lz_global_base64_decode(lz_chat_data.Templates.MessageAdd).replace("",text); lz_chat_data.AlternateRow = !lz_chat_data.AlternateRow; } text = text.replace("",lz_chat_get_locale_time()); text = text.replace("",lz_chat_data.Language.System); lz_chat_append_text(text); lz_chat_data.LastSender = lz_chat_data.SYSTEM; } function lz_chat_add_internal_text(_text, _acid) { _text = lz_global_utf8_decode(lz_global_base64_decode(_text)); _acid = lz_global_utf8_decode(lz_global_base64_decode(_acid)); var message = new lz_chat_post(); message.MessageId = _acid; message.MessageText = _text; message.MessageTime = lz_global_timestamp(); if(!lz_chat_message_is_received(message)) { if(lz_chat_data.LastSender != lz_chat_data.INTERNAL) { _text = lz_global_base64_decode(lz_chat_data.Templates.MessageInternal).replace("",_text); lz_chat_data.AlternateRow = true; } else { if(lz_chat_data.AlternateRow) _text = lz_global_base64_decode(lz_chat_data.Templates.MessageAddAlt).replace("",_text); else _text = lz_global_base64_decode(lz_chat_data.Templates.MessageAdd).replace("",_text); lz_chat_data.AlternateRow = !lz_chat_data.AlternateRow; } _text = _text.replace("",lz_chat_get_locale_time()); _text = _text.replace("",lz_chat_data.InternalUser.TextAlign); _text = _text.replace("",lz_chat_data.InternalUser.Fullname); _text = lz_global_replace_smilies(_text,true); var re = new RegExp(']*>(.*)', 'gim'); var matches = _text.match(re); var icon = ""; if(matches) icon = "\"\""; _text = _text.replace("",icon); lz_switch_title_mode(true); lz_chat_append_text(_text); if(lz_chat_data.LastSound < (lz_global_timestamp()-1)) { lz_chat_data.LastSound = lz_global_timestamp(); lz_chat_data.TimerSound = setTimeout(lz_chat_play_sound,30); } lz_chat_data.LastSender = lz_chat_data.INTERNAL; } } function lz_chat_message_is_received(_message) { for(var mIndex in lz_chat_data.ExternalUser.MessagesReceived) if(lz_chat_data.ExternalUser.MessagesReceived[mIndex].MessageId == _message.MessageId) return true; lz_chat_data.ExternalUser.MessagesReceived[lz_chat_data.ExternalUser.MessagesReceived.length] = _message; lz_chat_shout(12); var mNewMessages = new Array(); for(var mIndex in lz_chat_data.ExternalUser.MessagesReceived) if(lz_chat_data.ExternalUser.MessagesReceived[mIndex].MessageTime >= (lz_global_timestamp()-3600)) mNewMessages[mNewMessages.length] = lz_chat_data.ExternalUser.MessagesReceived[mIndex]; lz_chat_data.ExternalUser.MessagesReceived = mNewMessages; return false; } function lz_chat_message_set_received(_id) { for(var mIndex in lz_chat_data.ExternalUser.MessagesReceived) if(lz_chat_data.ExternalUser.MessagesReceived[mIndex].MessageId == _id) return (lz_chat_data.ExternalUser.MessagesReceived[mIndex].Received = true); return true; } function lz_chat_set_id(_id) { lz_chat_data.Id = _id; return true; } function lz_chat_add_extern_text(_text,_translation) { _text = lz_global_htmlentities(_text); _text = lz_global_replace_breaks(_text); if(_translation != '') { _translation = lz_global_htmlentities(_translation); _translation = lz_global_replace_breaks(_translation); _text = _translation + "
"+_text+"
"; } if(lz_chat_data.LastSender != lz_chat_data.EXTERNAL) { _text = lz_global_base64_decode(lz_chat_data.Templates.MessageExternal).replace("",_text); lz_chat_data.AlternateRow = true; } else { if(lz_chat_data.AlternateRow) _text = lz_global_base64_decode(lz_chat_data.Templates.MessageAddAlt).replace("",_text); else _text = lz_global_base64_decode(lz_chat_data.Templates.MessageAdd).replace("",_text); lz_chat_data.AlternateRow = !lz_chat_data.AlternateRow; } _text = lz_global_replace_smilies(_text,true); _text = _text.replace("",lz_chat_get_locale_time()); _text = _text.replace("",lz_global_htmlentities(lz_chat_data.ExternalUser.Username)); _text = _text.replace("",lz_chat_data.ExternalUser.TextAlign); lz_chat_append_text(_text); lz_chat_data.LastSender = lz_chat_data.EXTERNAL; } function lz_chat_append_text(_html) { window.focus(); if(!lz_chat_data.Status.Loaded) return; var newMessage = lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','').document.createElement("DIV"); newMessage.innerHTML = _html; lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','lz_chat_main').appendChild(newMessage); setTimeout("lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','').scroll(0,1000000000)",10); if(lz_chat_data.Status.Status < lz_chat_data.STATUS_STOPPED) lz_chat_focus_textbox(); } function lz_chat_print() { lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','').focus(); lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0','').print(); } function lz_chat_release_post(_id) { if(lz_chat_data.Status.Status < lz_chat_data.STATUS_STOPPED) { newMessageList = new Array(); for (var mIndex in lz_chat_data.ExternalUser.MessagesSent) if(lz_chat_data.ExternalUser.MessagesSent[mIndex].MessageId != _id) newMessageList[newMessageList.length] = lz_chat_data.ExternalUser.MessagesSent[mIndex]; lz_chat_data.ExternalUser.MessagesSent = newMessageList; } } function lz_chat_change_window_state(_minimized) { lz_switch_title_mode(_minimized); } function lz_chat_set_status(_status) { if(_status == lz_chat_data.STATUS_ACTIVE && lz_chat_data.TimerWaiting != null) clearTimeout(lz_chat_data.TimerWaiting); else if(_status != lz_chat_data.STATUS_ACTIVE && lz_chat_data.TimerWaiting == null) lz_chat_data.TimerWaiting = setTimeout("lz_chat_show_waiting_message();",75000); if(lz_chat_data.Status.Status < lz_chat_data.STATUS_STOPPED) lz_chat_data.Status.Status = _status; } function lz_chat_handle_response(_status, _response) { lz_chat_data.LastConnectionFailed = false; lz_chat_data.ConnectionRunning = false; lz_chat_process_xml(_response); } function lz_chat_handle_shout_response(_status, _response) { lz_chat_process_xml(_response); setTimeout("lz_chat_reshout()",lz_chat_data.ChatFrequency * 1000); } function lz_chat_process_xml(_xml) { try { if(_xml.length > 0 && _xml.indexOf("") != -1) { lz_chat_data.LastConnection = lz_global_timestamp(); var lzTstart = ""; var lzTend = ""; eval(lz_global_base64_decode(_xml.substr(_xml.indexOf(lzTstart) + lzTstart.length,_xml.indexOf(lzTend)-_xml.indexOf(lzTstart)-lzTstart.length))); } else if(lz_chat_data.Status.Status < lz_chat_data.STATUS_INIT) setTimeout("lz_chat_handle_connection_error(null,null);",2000); } catch(ex){} } function lz_chat_handle_connection_error(_status, _response) { lz_chat_data.ShoutNeeded = true; lz_chat_data.ConnectionRunning = lz_chat_data.ShoutRunning = false; lz_chat_data.LastConnectionFailed = true; if(lz_chat_data.Status.Status < lz_chat_data.STATUS_INIT) setTimeout("lz_chat_reload_groups();",5000); } function lz_chat_release_frame(_name) { lz_chat_data.PermittedFrames--; if(lz_chat_data.PermittedFrames==-1) lz_chat_close(); if(lz_chat_data.PermittedFrames == 0 && lz_chat_data.Status.Status == lz_chat_data.STATUS_START) { lz_chat_set_parentid(); setTimeout("lz_chat_detect_sound();",30); if(!lz_chat_data.SetupError) { if(lz_geo_resolution_needed && lz_chat_data.ExternalUser.Session.GeoResolved.length != 7) lz_chat_geo_resolute(); else { lz_chat_data.GeoResolution.SetStatus(7); setTimeout("lz_chat_startup();",500); } } else lz_chat_release(false,lz_chat_data.SetupError); } else if(lz_chat_data.PermittedFrames == 0 && lz_chat_data.Status.Status == lz_chat_data.STATUS_INIT) lz_chat_loaded(); } function lz_chat_switch_file_upload() { var frame_rows = lz_chat_get_frame_object('','lz_chat_frameset_chat').rows.split(","); if(frame_rows[2] != 0) frame_rows[2] = 0; if(frame_rows[3] != 0) frame_rows[3] = 0; if(frame_rows[1] == 0 && lz_chat_data.Status.Status == lz_chat_data.STATUS_STOPPED) { lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } if(!lz_chat_data.InternalUser.Available) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } frame_rows[1] = (frame_rows[1] == 0) ? 57 : 0; lz_chat_get_frame_object('','lz_chat_frameset_chat').rows = frame_rows.join(","); } function lz_chat_switch_rating() { if(!lz_chat_data.InternalUser.Id.length > 0) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,lz_chat_get_frame_object('lz_chat_frame.3.2.chat.4.0',''),null); return; } var frame_rows = lz_chat_get_frame_object('','lz_chat_frameset_chat').rows.split(","); if(frame_rows[1] != 0) frame_rows[1] = 0; if(frame_rows[3] != 0) frame_rows[3] = 0; frame_rows[2] = (frame_rows[2] == 0) ? 57 : 0; lz_chat_get_frame_object('','lz_chat_frameset_chat').rows = frame_rows.join(","); } function lz_chat_switch_smiley_box() { var frame_rows = lz_chat_get_frame_object('','lz_chat_frameset_chat').rows.split(","); if(frame_rows[1] != 0) frame_rows[1] = 0; if(frame_rows[2] != 0) frame_rows[2] = 0; frame_rows[3] = (frame_rows[3] == 0) ? 57 : 0; lz_chat_get_frame_object('','lz_chat_frameset_chat').rows = frame_rows.join(","); } function lz_chat_release(_groupAvailable, _groupError) { lz_chat_set_status(lz_chat_data.STATUS_START); lz_chat_data.Status.Loaded = true; var goMessage = (!_groupAvailable && 0 != 2 && !lz_chat_data.NoPreChatMessages); if(goMessage && lz_chat_data.GetParameters.indexOf("mp") != -1) goMessage = false; if(_groupError.length == 0) { if(lz_chat_data.DirectLogin) lz_chat_login(lz_chat_data.Groups.GetGroupById(lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','lz_chat_form_groups').value).Id); else if(!goMessage) { lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','lz_chat_login').style.visibility = 'visible'; lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','lz_form_button').disabled = false; } } if(!goMessage || _groupError.length != 0) { lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','').document.body.removeChild(lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','lz_chat_loading')); lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0','lz_form_details').style.display = ""; if(_groupError.length != 0) lz_chat_chat_alert(_groupError,lz_chat_get_frame_object('lz_chat_frame.3.2.login.1.0',''),-1); } else lz_chat_goto_message(false,false); } function lz_chat_get_frame_object(_frame,_id) { try { if(_id == "") return frames['lz_chat_frame.3.2'].frames[_frame]; else if(_frame == "") return frames['lz_chat_frame.3.2'].document.getElementById(_id); else return frames['lz_chat_frame.3.2'].frames[_frame].document.getElementById(_id); } catch(ex) { alert(ex+_frame); } } function lz_chat_change_url(_url) { lz_chat_remove_from_parent(); lz_chat_data.WindowNavigating = true; window.location.href = _url; } var lz_title_timer; var lz_title_step = 0; var lz_title_modes = new Array(document.title,"New Messages"); var lz_standard_title = document.title; var lz_document_head = document.getElementsByTagName("head")[0]; var lz_geo_resolution; var lz_geo_resolution_needed = false; if(typeof(encodeURIComponent) == 'undefined') { encodeURIComponent = function(uri) { return (escape(uri)); } } function lz_array_indexOf(_hsa,_needle) { for(var i=0; i<_hsa.length; i++) if(_hsa[i]==_needle) return i; return -1; } function lz_jssess() { this.Save = lz_jssess_save; this.Load = lz_jssess_load; this.DelimiterStart = "LZSDS"; this.DelimiterEnd = "LZSDE"; this.GeoResolutions = 0; this.GeoResolved = Array(); this.BrowserId = "1ec500935e"; this.UserId = "c4a34cee08"; this.ServerId = ""; function lz_jssess_save() { var data = this.DelimiterStart + lz_global_base64_url_encode(this.BrowserId + ";" + this.UserId + ";" + this.GeoResolved + ";" + this.GeoResolutions+ ";" + this.ServerId + ";") + this.DelimiterEnd; if(window.name == null || window.name == "undefinded" || window.name == "" || (window.name == null && window.name.indexOf(this.DelimiterStart) == -1)) { if(window.name == null || window.name == "undefinded" || window.name == "") window.name = data; else window.name += data; } else { var regex = new RegExp(/\LZSDS.*?LZSDE/g); window.name = window.name.replace(regex,""); window.name += data; } } function lz_jssess_load() { var data = window.name; if(data.indexOf(this.DelimiterStart) != -1) { data = lz_global_base64_url_decode(data.split(this.DelimiterStart)[1].split(this.DelimiterEnd)[0]).split(";"); if(this.ServerId == data[4]) { this.BrowserId = data[0]; this.UserId = data[1]; this.GeoResolved = data[2].split(","); this.GeoResolutions = data[3]; } } } } function lz_chat_window() { this.BrowserId = ""; this.LastActive = 0; this.Closed = false; this.Deleted = false; } function lz_geo_resolver() { this.ResolveAsync = lz_resolver_connect_async; this.TimeoutConnection = lz_resolver_timeout_connection; this.SetStatus = lz_resolver_set_status; this.SetSpan = lz_resolver_set_span; this.Status = 0; this.Span = 0; this.OnEndEvent; this.OnTimeoutEvent; this.OnSpanEvent; var OnEnd; var OnTimeout; var OnSpan; var lz_resolver_request; var lz_resolver_timeout_timer; function lz_resolver_connect_async() { OnEnd = this.OnEndEvent; OnTimeout = this.OnTimeoutEvent; OnSpan = this.OnSpanEvent; lz_resolver_timeout_timer = setTimeout(this.TimeoutConnection,15000); lz_resolver_request = document.createElement("script"); lz_resolver_request.id = "livezilla_geoscript"; var oak = ''; lz_resolver_request.src = "http://ssl.livezilla.net/geo/resolute/?aid=&dbp=0&gv=1021&method=" + OnEnd + "&spanm=" + OnSpan + "&oak=" + oak; lz_document_head.appendChild(lz_resolver_request); } function lz_resolver_timeout_connection() { if(OnTimeout != null) OnTimeout(); } function lz_resolver_set_status(_status) { this.Status = _status; } function lz_resolver_set_span(_span) { this.Span = _span; } } function lz_global_replace_breaks(_text) { _text = _text.replace(/[\r\n]+/g, "
"); return _text.replace(/[\t]+/g, "   "); } function lz_global_base64_url_encode(_text) { if(_text.length == 0) return ""; _text = lz_global_base64_encode(lz_global_utf8_encode(_text.toString())); _text = _text.replace(/=/g, "_"); _text = _text.replace(/\+/g, "-"); _text = _text.replace(/\//g, ","); return _text; } function lz_global_base64_url_decode(_text) { if(!(_text != null && _text.length > 0)) return ""; _text = _text.replace("_","="); _text = _text.replace("-","+"); _text = _text.replace(",","/"); _text = lz_global_utf8_decode(lz_global_base64_decode(_text)); return _text; } function lz_global_base64_decode(_text) { var base64_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var bits; var decOut = ''; var i = 0; for(; i<_text.length; i += 4) { bits = (base64_chars.indexOf(_text.charAt(i)) & 0xff) <<18 | (base64_chars.indexOf(_text.charAt(i +1)) & 0xff) <<12 | (base64_chars.indexOf(_text.charAt(i +2)) & 0xff) << 6 | base64_chars.indexOf(_text.charAt(i +3)) & 0xff; decOut += String.fromCharCode((bits & 0xff0000) >>16, (bits & 0xff00) >>8, bits & 0xff); } if(_text.charCodeAt(i -2) == 61) return(decOut.substring(0, decOut.length -2)); else if(_text.charCodeAt(i -1) == 61) return(decOut.substring(0, decOut.length -1)); else return(decOut); } function lz_global_base64_encode(_input) { var base64_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; do { chr1 = _input.charCodeAt(i++); chr2 = _input.charCodeAt(i++); chr3 = _input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) enc3 = enc4 = 64; else if (isNaN(chr3)) enc4 = 64; output = output + base64_chars.charAt(enc1) + base64_chars.charAt(enc2) + base64_chars.charAt(enc3) + base64_chars.charAt(enc4); } while (i < _input.length); return output; } function lz_global_utf8_encode(_string,_encodeuri) { _string = _string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < _string.length; n++) { var c = _string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } if(_encodeuri) return encodeURIComponent(utftext); else return utftext; } function lz_global_utf8_decode(utftext) { var string = ""; var i = 0; var c, c1, c2 c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } function lz_set_title_mode() { document.title = lz_title_modes[lz_title_step++ % 2]; } function lz_switch_title_mode(_active) { if(_active) { if(lz_title_timer == null) lz_title_timer = setInterval("lz_set_title_mode()",800); } else { clearInterval(lz_title_timer); lz_title_timer = null; document.title = lz_standard_title; lz_title_step = 0; } } function lz_global_replace_smilies(_text) { var shorts = new Array(/:-\)/g,/::smile/g,/:\)/g,/:-\(/g,/::sad/g,/:\(/g,/:-]/g,/::lol/g,/;-\)/g,/::wink/g,/;\)/g,/:'-\(/g,/::cry/g,/:-O/g,/::shocked/g,/:-\\\\/g,/::sick/g,/:-p/g,/::tongue/g,/:-P/g,/:\?/g,/::question/g,/8-\)/g,/::cool/g,/zzZZ/g,/::sleep/g,/:-\|/g,/::neutral/g); var images = new Array("smile","smile","smile","sad","sad","sad","lol","lol","wink","wink","wink","cry","cry","shocked","shocked","sick","sick","tongue","tongue","tongue","question","question","cool","cool","sleep","sleep","neutral","neutral"); for(var i = 0;i "); return _text; } function lz_global_timestamp() { var now = new Date(); var ts = Math.round((now.getTime()/1000)); return (ts); } function lz_global_microstamp() { var now = new Date(); var ts = now.getTime(); return (ts); } function lz_global_get_long_poll_runtime() { if(lz_chat_data.LastConnectionFailed) return 20; var value = lz_chat_data.PollTimeout - lz_chat_data.ChatFrequency - 25; if(value >= 60) value = 65; return value; } function lz_chat_get_locale_time() { var time = new Date().toLocaleTimeString() time = time.split(" ("); return time[0]; } function lz_chat_get_locale_date() { var date = new Date().toLocaleString(); date = date.split(" ("); return date[0]; } function lz_global_handle_exception(exception,file,line) { //alert(exception); return true; } function lz_global_trim(_str) { return _str.replace(/^\s+|\s+$/g,""); } function lz_global_htmlentities(_value) { _value = _value.replace(/\/g,">"); return _value; } function lz_global_get_page_offset_y() { if(window.pageYOffset != null) return window.pageYOffset; else return Math.max(document.documentElement.scrollTop, document.body.scrollTop); } function lz_global_get_page_offset_x() { if(window.pageXOffset != null) return window.pageXOffset; else return Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); } function lz_global_get_doctype() { var dc = ""; if(typeof document.namespaces != "undefined") dc = document.all[0].nodeType==8 ? document.all[0].nodeValue.toLowerCase() : ""; else dc = document.doctype != null ? document.doctype.publicId.toLowerCase() : ""; return (dc.indexOf("xhtml") != -1) ? "XHTML" : (dc.indexOf("loose")!=-1) ? "HTML_4_TRANSITIONAL" : "HTML_4"; } function lz_connector(_url,_post,_timeout) { this.Url = _url; this.Post = _post; this.Timeout = _timeout; this.ChangeState = lz_connector_change_state; this.ConnectAsync = lz_connector_connect_async; this.ConnectSync = lz_connector_connect_sync; this.TimeoutConnection = lz_connector_timeout_connection; this.OnEndEvent; this.OnErrorEvent; this.OnTimeoutEvent; var OnEnd; var OnError; var OnTimeout; var lz_connector_request; var lz_connector_timeout_timer; var lz_connector_aborted = false; function lz_connector_connect_async() { OnEnd = this.OnEndEvent; OnError = this.OnErrorEvent; OnTimeout = this.OnTimeoutEvent; if(this.Timeout > 0) lz_connector_timeout_timer = setTimeout(this.TimeoutConnection,this.Timeout); lz_connector_request = lz_connector_create_request_object(); lz_connector_request.open('POST', this.Url, true); lz_connector_request.onreadystatechange = lz_connector_change_state; lz_connector_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); lz_connector_request.setRequestHeader("Content-length", this.Post.length); lz_connector_request.setRequestHeader('Connection', 'close'); lz_connector_request.send(this.Post); } function lz_connector_connect_sync() { lz_connector_request=lz_connector_create_request_object(); lz_connector_request.open('POST', this.Url, true); lz_connector_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); lz_connector_request.setRequestHeader("Content-length", this.Post.length); lz_connector_request.setRequestHeader('Connection', 'close'); lz_connector_request.send(this.Post); return lz_connector_request.responseText; } function lz_connector_change_state() { if (lz_connector_request.readyState == 4) { if(lz_connector_request.status == 100 || lz_connector_request.status == 200) lz_connector_end_connection(lz_connector_request.status,lz_connector_request.responseText); else lz_connector_error_connection(lz_connector_request.status,lz_connector_request.responseText); } } function lz_connector_is_running() { return ( lz_connector_request.readyState > 0 && lz_connector_request.readyState < 4); } function lz_connector_end_connection(_status, _response) { clearTimeout(lz_connector_timeout_timer); if(!lz_connector_aborted && OnEnd != null) OnEnd(_status, _response); } function lz_connector_error_connection(_status, _response) { clearTimeout(lz_connector_timeout_timer); if(!lz_connector_aborted && OnError != null) OnError(_status, _response); } function lz_connector_timeout_connection() { lz_connector_aborted = true; if(lz_connector_is_running()) lz_connector_request.abort(); if(OnTimeout != null) OnTimeout(); } function lz_connector_create_request_object() { var requestObject = null; try { requestObject = new ActiveXObject("MSXML2.XMLHTTP"); } catch (err_MSXML2) { try { requestObject = new ActiveXObject("Microsoft.XMLHTTP"); } catch (err_Microsoft) { if (typeof XMLHttpRequest != "undefined") requestObject = new XMLHttpRequest; } } return requestObject; } } function lz_group(_id,_amount,_description,_email,_document,_cihidden,_cimandatory,_tihidden,_timandatory) { this.Id = _id; this.Amount = _amount; this.Description = (_description.length > 0) ? _description : _id; this.Email = _email; this.Option = null; this.ActiveDocument = _document; this.UpdateOption = lz_group_create_option; this.Update = lz_group_update; this.Changed = false; this.UpdateOption(); this.ChatInputsHidden = _cihidden; this.ChatInputsMandatory = _cimandatory; this.TicketInputsHidden = _tihidden; this.TicketInputsMandatory = _timandatory; function lz_group_create_option() { if(this.Option == null) { this.Option = this.ActiveDocument.createElement('option'); } this.Option.value = this.Id; this.Option.name = this.Email; this.Option.group = this; if(this.Amount == 0) { this.Option.style.color = "#808080"; this.Option.style.background = "#eeeeee"; this.Option.label = " " + this.Description; this.Option.text = " " + this.Description; if(!lz_chat_data.NoPreChatMessages) { this.Option.label += " (" + lz_chat_data.Language.LanguageLeaveMessageShort + ")"; this.Option.text += " (" + lz_chat_data.Language.LanguageLeaveMessageShort + ")"; } } else { this.Option.style.color = "#000000"; this.Option.style.background = "#f5ffec"; this.Option.label = " " + this.Description + " (Online)"; this.Option.text = " " + this.Description + " (Online)"; } } function lz_group_update(_id,_amount,_description,_email) { if(this.Id != _id || this.Amount != _amount || this.Description != ((_description.length > 0) ? _description : _id) || this.Email != _email) { this.Id = _id; this.Amount = _amount; this.Description = (_description.length > 0) ? _description : _id; this.Email = _email this.Changed = true; } else this.Changed = false; } } function lz_group_list(_document,_selectBox) { this.HeaderOnline; this.HeaderOffline; this.Groups = Array(); this.SelectBox = _selectBox; this.ActiveDocument = _document; this.GroupOnline = false; this.GroupOffline = null; this.Add = lz_group_list_add; this.Update = lz_group_list_update; this.Place = lz_group_list_place_group; this.CreateHeader = lz_group_list_create_header; this.PlaceGroup = lz_group_list_place_group; this.GetGroupById = lz_group_list_get_group_by_id; function lz_group_list_add(_id,_amount,_description,_email,_cihidden,_cimandatory,_tihidden,_timandatory) { var existing = false; var currentGroup; var lastGroup; for(var i=0;i 0); this.GroupOffline = (this.GroupOffline || lz_global_base64_decode(contents[1]) == 0); this.Add(lz_global_utf8_decode(lz_global_base64_decode(contents[0])),lz_global_utf8_decode(lz_global_base64_decode(contents[1])),lz_global_utf8_decode(lz_global_base64_decode(contents[2])),lz_global_utf8_decode(lz_global_base64_decode(contents[3])),eval(lz_global_base64_decode(contents[4])),eval(lz_global_base64_decode(contents[5])),eval(lz_global_base64_decode(contents[6])),eval(lz_global_base64_decode(contents[7]))); } if(!this.GroupOnline && this.HeaderOnline.parentNode == this.SelectBox) this.SelectBox.removeChild(this.HeaderOnline); else if(this.GroupOnline && (this.HeaderOnline.parentNode == null || (this.HeaderOnline.parentNode != null && this.HeaderOnline.parentNode != this.SelectBox))) this.SelectBox.insertBefore(this.HeaderOnline,this.SelectBox.childNodes[0]); if(!this.GroupOffline && this.HeaderOffline.parentNode == this.SelectBox) this.SelectBox.removeChild(this.HeaderOffline); if(this.Groups.length > addedGroups.length) { var existing; for(var i = 0;i 0) { this.SelectBox.insertBefore(_group.Option,this.HeaderOffline); } else { this.SelectBox.appendChild(_group.Option); } _group.UpdateOption(); } function lz_group_list_create_header() { if(this.SelectBox.childNodes.length == 0) { this.HeaderOnline = this.ActiveDocument.createElement('option'); this.SelectBox.appendChild(this.HeaderOnline); this.HeaderOnline.text = "Online"; this.HeaderOnline.style.color = "#FFFFFF"; this.HeaderOnline.style.background = "#8C8C8C"; this.HeaderOffline = this.ActiveDocument.createElement('option'); this.SelectBox.appendChild(this.HeaderOffline); this.HeaderOffline.text = "Offline"; this.HeaderOffline.style.color = "#FFFFFF"; this.HeaderOffline.style.background = "#8C8C8C"; } } function lz_group_list_get_group_by_id(_id) { for(var i = 0;i