var opid = 0; var deptid = 0; function Get_Cookie(name) { var start = document.cookie.indexOf(name+"="); var len = start+name.length+1; if ((!start) && (name != document.cookie.substring(0,name.length))) return null; if (start == -1) return null; var end = document.cookie.indexOf(";",len); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(len,end)); } function Set_Cookie(name,value,expires,path,domain,secure) { var cookieString = name + "=" +escape(value) + ( (expires) ? ";expires=" + expires.toGMTString() : "") + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ( (secure) ? ";secure" : ""); document.cookie = cookieString; } function launch_support_popup() { var request_url = "http://corp.aloweb.com.br/atendimento.php?action=request&operador_id="+opid+"&display_width="+screen.width+"&display_height="+screen.heigth+"&x=41&l=interserv&deptid="+deptid+"&from_screen_name=Visitante&email=usuario@usuario.com.br&question=Visitante vindo do site"; newwin = window.open( request_url, 'unique', 'top=10,left=10,width=450,height=380') ; newwin.focus() ; DoClose() ; } function remove_retorno() { var request_url = "http://corp.aloweb.com.br/atendimento.php?action=request&operador_id="+opid+"&display_width="+screen.width+"&display_height="+screen.heigth+"&x=41&l=interserv&deptid="+deptid+"&from_screen_name=Visitante&email=usuario@usuario.com.br&question=Visitante vindo do site"; window.open( request_url, 'unique', 'top=10,left=10,width=450,height=380') ; } function retorno_imagem() { var tracker_refresh = 10000 ; // 1000 = 1 second var do_tracker_flag = 1 ; var start_tracker = dounique() ; var time_elapsed ; var refer = escape( document.referrer ) ; var aloweb_base_url = 'http://corp.aloweb.com.br' ; var initiate = chat_opened = 0 ; var pullimage = new Image ; var date = new Date() ; var unique = dounique() ; var url = escape( location.toString() ) ; var naoMostrar = 0; var scriptpad = "" ; var ns=(document.layers); var ie=(document.all); var w3=(document.getElementById && !ie); var ProactiveDiv ; var browser_width ; var backtrack = 0 ; var isclosed = 0 ; var repeat = 1 ; var timer = 20 ; var halt = 0 ; // write external style here.. it won't work if we put it directly in the DIV style = "" ; document.write( style ) ; browser_width = 600 ; WriteChatDiv() ; do_tracker() ; checkinitiate(); } function refresh_retorno(new_data) { dados = new_data.split(","); var call = dados[0]; var tipo_call = dados[1]; var operadorID = dados[2]; var deptoID = dados[3]; if (call != 0) { if (tipo_call == 1) { //alert opid = operadorID; deptid = deptoID; launch_support_alert(operadorID, deptoID); } if (tipo_call == 2) { //popup opid = operadorID; deptid = deptoID; x_remove_call(launch_support_popup); } if (tipo_call == 3) { //img x_remove_call(retorno_imagem); } } setTimeout("_on_load()",1000); } function launch_support_alert(operadorID, deptoID) { opid = operadorID; deptid = deptoID; if (confirm('Você está recebendo um convite para atendimento on line. Você aceita?')) { chat_opened = 1 ; x_remove_call(remove_retorno); } else { x_remove_call(); } } function _on_load() { resolution = screen.width+"x"+screen.height; x_refresh_log(this.location, resolution, refresh_retorno); } // remote scripting library // (c) copyright 2005 modernmethod, inc var sajax_debug_mode = false; var sajax_request_type = "GET"; function sajax_debug(text) { if (sajax_debug_mode) alert("RSD: " + text) } function sajax_init_object() { sajax_debug("sajax_init_object() called..") var A; try { A=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { A=new ActiveXObject("Microsoft.XMLHTTP"); } catch (oc) { A=null; } } if(!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest(); if (!A) sajax_debug("Could not create connection object."); return A; } function sajax_do_call(func_name, args) { var i, x, n; var uri; var post_data; uri = "/monitoramento/monitoramento.php"; if (sajax_request_type == "GET") { if (uri.indexOf("?") == -1) uri = uri + "?rs=" + escape(func_name); else uri = uri + "&rs=" + escape(func_name); for (i = 0; i < args.length-1; i++) uri = uri + "&rsargs[]=" + escape(args[i]); uri = uri + "&rsrnd=" + new Date().getTime(); post_data = null; } else { post_data = "rs=" + escape(func_name); for (i = 0; i < args.length-1; i++) post_data = post_data + "&rsargs[]=" + escape(args[i]); } x = sajax_init_object(); x.open(sajax_request_type, uri, true); if (sajax_request_type == "POST") { x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } x.onreadystatechange = function() { if (x.readyState != 4) return; sajax_debug("received " + x.responseText); var status; var data; status = x.responseText.charAt(0); data = x.responseText.substring(2); if (status == "-") alert("Error: " + data); else args[args.length-1](data); } x.send(post_data); sajax_debug(func_name + " uri = " + uri + "/post = " + post_data); sajax_debug(func_name + " waiting.."); delete x; } // wrapper for refresh_log function x_refresh_log() { sajax_do_call("refresh_log", x_refresh_log.arguments); } // wrapper for remove_call function x_remove_call() { sajax_do_call("remove_call", x_remove_call.arguments); } _on_load();