"); printWindow.document.close(); printWindow.focus(); } function lz_chat_close() { var windowName = window.name; if( lz_chat_data.GetParameters.indexOf("reset") == -1) window.location = "./livezilla.php?"+lz_chat_data.GetParameters + "&reset=true"; else window.location = "./livezilla.php?"+lz_chat_data.GetParameters; window.name = windowName; } function lz_tracking_geo_result(_lat,_long,_region,_city,_tz,_ctryi2) { lz_geo_resolution.OnTimeoutEvent = null; lz_chat_data.ExternalUser.Session.GeoResolved = Array(_lat,_long,_region,_city,_tz,_ctryi2); lz_chat_data.ExternalUser.Session.Save(); lz_chat_startup(); } function lz_tracking_geo_resolute() { lz_geo_resolution = new lz_geo_resolver(); lz_geo_resolution.OnEndEvent = "lz_tracking_geo_result"; lz_geo_resolution.OnTimeoutEvent = lz_chat_startup; lz_geo_resolution.ResolveAsync(); } function lz_chat_file_changed() { lz_chat_file_unset_images(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_name').value = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_base').value; } function lz_chat_file_request_upload() { if(lz_chat_data.Status.Login == lz_chat_data.STATUS_STOPPED) { lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } if(!lz_chat_data.InternalUser.Available) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } if(!lz_chat_data.FileUpload.Running) { lz_chat_file_unset_images(); if(frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_name').value.length == 0) { lz_chat_chat_alert(lz_chat_data.Language.SelectFile,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } lz_chat_data.FileUpload.Filename = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_name').value lz_chat_data.FileUpload.Permitted = false; lz_chat_data.FileUpload.Running = true; lz_chat_data.FileUpload.Error = false; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_load').style.visibility = "visible"; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_load').src = "./images/lz_circle.gif?acid=" + lz_global_microstamp(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_name').disabled = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_select').disabled = true; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_send').value = "Abort"; lz_chat_focus_textbox(); } else { lz_chat_file_stop(); } lz_chat_shout(); } function lz_chat_file_start_upload(_file) { lz_chat_data.PermittedFrames++; lz_chat_data.FileUpload.Permitted = true; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_upload_form_userid').value = lz_chat_data.ExternalUser.Session.UserId; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_upload_form_browser').value = lz_chat_data.ExternalUser.Session.BrowserId; lz_chat_data.FileUpload.Filename = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_base').value; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.lz_file_form.submit(); } function lz_chat_file_error(_value) { lz_chat_file_stop(); lz_chat_data.FileUpload.Error = _value; if(_value == lz_chat_data.FILE_UPLOAD_REJECTED) lz_chat_chat_alert(lz_chat_data.Language.FileUploadRejected,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); else if(_value == lz_chat_data.FILE_UPLOAD_OVERSIZED) lz_chat_chat_alert(lz_chat_data.Language.FileUploadOversized,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_error').style.visibility = "visible"; } function lz_chat_file_ready() { lz_chat_data.FileUpload.Error = lz_chat_data.FileUpload.Running = false; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_success').style.visibility = "visible"; lz_chat_chat_alert(lz_chat_data.Language.FileProvided,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); } function lz_chat_file_clear() { lz_chat_data.PermittedFrames++; frames['lz_chat_frame.3.2'].document.getElementById('lz_chat_file_upload_frame').src = frames['lz_chat_frame.3.2'].document.getElementById('lz_chat_file_upload_frame').src + "&acid=" + lz_global_microstamp(); } function lz_chat_file_stop() { 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(); lz_chat_file_unset_images(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_send').disabled = true; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_name').disabled = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_select').disabled = false; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_send').value = "Send"; setTimeout("lz_chat_file_reactivate();",lz_chat_data.ChatFrequency*2*1000); } function lz_chat_file_reactivate() { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_send').disabled = false; } function lz_chat_file_unset_images() { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_load').style.visibility = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_success').style.visibility = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.1.0'].document.getElementById('lz_chat_file_error').style.visibility = "hidden"; } function lz_chat_file_reset() { lz_chat_data.FileUpload.Running = false; lz_chat_file_stop(); lz_chat_data.FileUpload.Error = false; } function lz_chat_data_box() { 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.AlternateRow = true; this.SetupError = lz_global_utf8_decode(lz_global_base64_decode('')); this.FileUpload = new lz_chat_file_upload(); this.PermittedFrames = 16; this.LastConnection = 0; this.ChatFrequency = 3; this.PollTimeout = 96; 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; this.GetParameters = 'reset=true'; this.TempImage = new Image(); this.TimezoneOffset = (new Date().getTimezoneOffset() / 60) * -1; this.ActiveAlertFrame = null; this.NoPreChatMessages = false; this.SYSTEM = -1; this.INTERNAL = 0; this.EXTERNAL = 1; this.MAXCHATLENGTH = 750; this.STATUS_STOPPED = 3; this.STATUS_ACTIVE = 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.Login = 0; this.Loaded = false; this.Poll = 0; } function lz_chat_data_language() { this.NameAndEmail = "Please enter your name and your email address!"; 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.ClientIntsAreBusy = "All representatives are busy at the moment, please wait. The next representative available is already reserved for you."; 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"; } function lz_chat_data_templates() { this.MessageInternal = 'PHRhYmxlIHdpZHRoPSI5NyUiIGJvcmRlcj0iMCIgY2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSI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kPgoJCTx0ZCB3aWR0aD0iMyIgYWxpZ249InJpZ2h0Ij48aW1nIHNyYz0iLi9pbWFnZXMvY2hhdF9iZ19jb250aW51ZV9yaWdodF90b3AuZ2lmIiBhbHQ9IiIgd2lkdGg9IjMiIGhlaWdodD0iMyIgYm9yZGVyPSIwIj48L3RkPgoJPC90cj4KCTx0cj4KCQk8dGQgaGVpZ2h0PSIzIiB2YWxpZ249ImJvdHRvbSI+PGltZyBzcmM9Ii4vaW1hZ2VzL2NoYXRfYmdfY29udGludWVfbGVmdF9ib3R0b20uZ2lmIiBhbHQ9IiIgd2lkdGg9IjMiIGhlaWdodD0iMyIgYm9yZGVyPSIwIj48L3RkPgoJCTx0ZCB2YWxpZ249ImJvdHRvbSI+PGltZyBzcmM9Ii4vaW1hZ2VzL2NoYXRfYmdfY29udGludWVfcmlnaHRfYm90dG9tLmdpZiIgYWx0PSIiIHdpZHRoPSIzIiBoZWlnaHQ9IjMiIGJvcmRlcj0iMCI+PC90ZD4KCTwvdHI+CjwvdGFibGU+'; } function lz_chat_internal_user() { this.Id = ''; this.Webcam = -1; this.Fullname = ''; this.Available = false; } function lz_chat_external_user() { this.Id = ''; this.Username = ''; this.Email = ''; this.Company = ''; this.MailText = ''; this.Group = ''; this.Typing = false; this.Messages = Array(); this.MessagesBackup = Array(); this.Session; } function lz_chat_file_upload() { this.Filename; this.Running; this.Permitted; this.Error; } } function lz_chat_post() { this.MessageText = ''; this.MessageId = ''; } function lz_chat_message() { var msg = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.5.0'].document.getElementById('lz_chat_text').value; if(lz_chat_data.Status.Login == lz_chat_data.STATUS_STOPPED) return lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); else if(msg.length > 0 && lz_global_trim(msg).length > 0 && msg.length <= lz_chat_data.MAXCHATLENGTH) { var message = new lz_chat_post(); message.MessageText = lz_global_utf8_encode(msg,true); message.MessageId = Math.floor(Math.random()*100001)+100000; lz_chat_data.ExternalUser.Typing = false; lz_chat_add_extern_text(msg); lz_chat_data.ExternalUser.Messages[lz_chat_data.ExternalUser.Messages.length] = message; lz_chat_shout(); } else if(msg.length > lz_chat_data.MAXCHATLENGTH) return lz_chat_chat_alert(lz_chat_data.Language.MessageTooLong,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); setTimeout("lz_chat_clear_field()",1); return false; } function lz_chat_clear_field() { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.5.0'].document.getElementById('lz_chat_text').value = ""; lz_chat_focus_textbox(); } function lz_chat_focus_textbox() { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.5.0'].focus(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.5.0'].document.getElementById('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.visibility == "visible") lz_chat_chat_alert_set_position(lz_chat_data.ActiveAlertFrame); } function lz_chat_chat_alert_set_position(_frame) { if(frames['lz_chat_frame.3.2'].document.getElementById('lz_chat_frameset_chat') != null) var frame_rows = frames['lz_chat_frame.3.2'].document.getElementById('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.visibility = "visible"; _frame.document.getElementById("lz_chat_alert_button").onclick = function(){_frame.document.getElementById('lz_chat_alert_box').style.visibility = 'hidden';}; 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(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.5.0'].document.getElementById('lz_chat_text').value += sign; lz_chat_focus_textbox(); } function lz_chat_set_intern(_id,_fullname,_groupname,_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; 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?vcardid=" + 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(_ispic,_update,_webcam,_filtered,_wcfile,_prfile) { if(_filtered) { frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_intern_image').src = "./intern_images/filtered.jpg"; return; } if(_webcam) lz_chat_data.InternalUser.Webcam = 5; else if(lz_chat_data.InternalUser.Webcam > -1) { lz_chat_data.InternalUser.Webcam--; return; } var current_picture = frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_intern_image').src; if(_ispic && (_webcam || current_picture.indexOf("nopic.jpg") != -1 || _update || (current_picture.indexOf("wc.jpg") != -1 && !_webcam))) lz_chat_data.TempImage.src = (_webcam) ? _wcfile+"?"+ Math.random() : _prfile+"?"+ Math.random(); else if(!_ispic) frames['lz_chat_frame.1.1'].document.getElementById('lz_chat_intern_image').src = "./intern_images/nopic.jpg"; } 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(); } 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 == 7) text = "" + lz_chat_data.Language.ClientIntsAreBusy + " " + lz_chat_data.Language.ClientThankYou + "
"; else if(_type == 8) text = lz_chat_data.Language.ClientNoInternUsers + " " + lz_chat_data.Language.LanguageLeaveMessageShort + ". " + lz_chat_data.Language.ClientThankYou; 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_intern_text(_text, _title, _type, _acid) { _title = lz_global_utf8_decode(lz_global_base64_decode(_title)); _text = lz_global_utf8_decode(lz_global_base64_decode(_text)); 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.Fullname); _text = lz_global_replace_smilies(_text,true); var icon = ""; if(_type == "file") icon = "\"\""; else if(_type == "url") icon = "\"\""; _text = _text.replace("",icon); lz_switch_title_mode(true); lz_chat_append_text(_text); clearTimeout(lz_chat_data.TimerSound); lz_chat_data.TimerSound = setTimeout(lz_chat_play_sound,30); lz_chat_data.LastSender = lz_chat_data.INTERNAL; } function lz_chat_add_extern_text(_text) { _text = _text.replace(/\/g,">"); _text = lz_global_replace_breaks(_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_chat_data.ExternalUser.Username); 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 = frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0'].document.createElement("DIV"); newMessage.innerHTML = _html; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0'].document.getElementById('lz_chat_main').appendChild(newMessage); setTimeout("frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0'].scroll(0,1000000000)",10); if(lz_chat_data.Status.Login < lz_chat_data.STATUS_STOPPED) lz_chat_focus_textbox(); } function lz_chat_print() { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0'].focus(); frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0'].print(); } function lz_chat_release_posts() { if(lz_chat_data.Status.Poll < 2) lz_chat_data.ExternalUser.MessagesBackup = new Array(); } function lz_chat_change_window_state(_minimized) { lz_switch_title_mode(_minimized); } function lz_chat_set_status(_status) { lz_chat_data.Status.Poll = _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.Login < 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.Login < lz_chat_data.STATUS_INIT) lz_chat_reload_groups(); } 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.Login == 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 != 6) lz_tracking_geo_resolute(); else 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.Login == lz_chat_data.STATUS_INIT) lz_chat_loaded(); } function lz_chat_switch_file_upload() { var frame_rows = frames['lz_chat_frame.3.2'].document.getElementById('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.Login == lz_chat_data.STATUS_STOPPED) { lz_chat_chat_alert(lz_chat_data.Language.RepresentativeLeft,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } if(!lz_chat_data.InternalUser.Available) { lz_chat_chat_alert(lz_chat_data.Language.WaitForRepresentative,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } frame_rows[1] = (frame_rows[1] == 0) ? 57 : 0; frames['lz_chat_frame.3.2'].document.getElementById('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,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.chat.4.0']); return; } var frame_rows = frames['lz_chat_frame.3.2'].document.getElementById('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; frames['lz_chat_frame.3.2'].document.getElementById('lz_chat_frameset_chat').rows = frame_rows.join(","); } function lz_chat_switch_smiley_box() { var frame_rows = frames['lz_chat_frame.3.2'].document.getElementById('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; frames['lz_chat_frame.3.2'].document.getElementById('lz_chat_frameset_chat').rows = frame_rows.join(","); } function lz_chat_release(_groupAvailable, _groupError) { lz_chat_data.Status.Login = lz_chat_data.STATUS_START; lz_chat_data.Status.Loaded = true; var goMessage = (!_groupAvailable && 0 != 2 && !lz_chat_data.NoPreChatMessages); if(_groupError.length == 0) { if(lz_chat_data.DirectLogin) lz_chat_login(lz_chat_data.Groups.GetGroupById(frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'].document.getElementById('lz_chat_login_groups').value).Id); else if(!goMessage) { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'].document.getElementById('lz_chat_login').style.visibility = 'visible'; frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'].document.getElementById('lz_chat_login_button').disabled = false; } } if(!goMessage || _groupError.length != 0) { frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'].document.body.removeChild(frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'].document.getElementById('lz_chat_loading')); if(_groupError.length != 0) lz_chat_chat_alert(_groupError,frames['lz_chat_frame.3.2'].frames['lz_chat_frame.3.2.login.1.0'],-1); } else lz_chat_goto_message(false); } 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; var lz_geo_retries = 1; if (typeof(encodeURIComponent) == 'undefined') { encodeURIComponent = function(uri) { return (escape(uri)); } } function lz_jssess() { this.Save = lz_jssess_save; this.Load = lz_jssess_load; this.GeoResolutions = 0; this.GeoResolved = Array(); this.BrowserId = "c116b9a"; this.UserId = "ad7b170"; function lz_jssess_save() { var data = "" + this.BrowserId + ";" + this.UserId + ";" + this.GeoResolved + ";" + this.GeoResolutions + ""; if(window.name == null || window.name == "undefinded" || window.name == "" || (window.name == null && window.name.indexOf("") == -1)) { if(window.name == null || window.name == "undefinded" || window.name == "") window.name = data; else window.name += data; } else { var regex = new RegExp(/\.*?<\/LiveZilla>/g); window.name = window.name.replace(regex,""); window.name += data; } } function lz_jssess_load() { var data = window.name; if(data.indexOf("") != -1) { data = data.split("")[1].split("")[0].split(";"); this.BrowserId = data[0]; this.UserId = data[1]; this.GeoResolved = data[2].split(","); this.GeoResolutions = data[3]; } } } function lz_geo_resolver() { this.ResolveAsync = lz_resolver_connect_async; this.TimeoutConnection = lz_resolver_timeout_connection; this.OnEndEvent; this.OnTimeoutEvent; var OnEnd; var OnTimeout; var lz_resolver_request; var lz_resolver_timeout_timer; function lz_resolver_connect_async() { OnEnd = this.OnEndEvent; OnTimeout = this.OnTimeoutEvent; lz_resolver_timeout_timer = setTimeout(this.TimeoutConnection,15000); lz_resolver_request = document.createElement("script"); lz_resolver_request.id = "livezilla_geoscript"; lz_resolver_request.src = "https://ssl.livezilla.net/geo/resolute/?aid=&method=" + OnEnd + "&spanm=lz_tracking_set_geo_span"; lz_document_head.appendChild(lz_resolver_request); } function lz_resolver_timeout_connection() { if(OnTimeout != null) OnTimeout(); } } function lz_global_replace_breaks(_text) { _text = _text.replace(/[\r\n]+/g, "
"); return _text.replace(/[\t]+/g, "   "); } function lz_global_base64_url_encode(_text) { _text = lz_global_base64_encode(lz_global_utf8_encode(_text.toString())); _text = _text.replace("=", "_"); _text = _text.replace("+", "-"); _text = _text.replace("/", ","); 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_replacements(_text,_smileys) { _text = _text.replace(/\\'/g,"'"); _text = _text.replace(/\"/g,"\""); if(_smileys) _text = lz_global_replace_smilies(_text); 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_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) { 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(); 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) { 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]))); } 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