document.write('
'); var QYT = new Object(); var JQload=0; QYT.main = document.getElementById("qyt_main"); document.onkeydown=function() { QYT.setting.refurbish=event.Code; } /*********通用函数库*********/ QYT.Common = { getRnd : function() { var rnd = Math.random() * 1000000; return rnd; }, includeJS : function(src, id) { var script = document.getElementById("qyt_script_"+id); if(script) QYT.main.removeChild(script); src += (src.match(/\?/) ? '&' : '?'); //+ "rnd=" + QYT.Common.getRnd(); if(QYT.main) { var scriptNew = document.createElement("script"); scriptNew.src = src; scriptNew.id = "qyt_script_"+id; scriptNew.type = "text/javascript"; QYT.main.appendChild(scriptNew); } else { document.write(''); } }, includeStyle : function(src) { if(document.createStyleSheet) { document.createStyleSheet(src); } else { var link = ''; document.getElementsByTagName("head")[0].innerHTML += link; } }, setCookie : function(sName, sValue) { var nextYear = new Date(); nextYear.setFullYear(nextYear.getFullYear()+2); document.cookie = sName + "=" +escape(sValue)+ ";path=/;expires="+ nextYear.toGMTString(); }, getCookie : function(sName) { var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++) { var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } return null; } } /**********End*********/ //焦点判断 /*********系统设置数据*********/ QYT.setting = { home : "http://www.qyt.com:9999/", //需服务端打 //home : "http://192.168.0.31/QYT/BookSir.QYTV3.Web.Visit/", //需服务端打 siteId : "10332", //需服务端打 position : "left", //需服务端打 //scroll : true //需服务端打 scroll : true, skin : "green", mode : "list", autoRefuse : 60, //邀请框自动拒绝 ppcallkey: 'U2oFbwRrUG5VbQU9UDhUdlMj', wiseid : '530046102', iconMode:"A" , yaoQing:"1" , refurbish:0 } QYT.stat = { url : escape(document.URL), urlReferrer : escape(document.referrer), title : escape(document.title.substr(0,40)), screenWidth : screen.width, screenHeight : screen.height, siteId : QYT.setting.siteId, visitorId : (QYT.Common.getCookie("visitorId"))?QYT.Common.getCookie("visitorId"):"a94ef78311dd496684f790d1b3cf4a2a", codepage : document.charset || document.characterSet, language : 'en-us' } QYT.loaded = { base : 0, templet : 0, data : 0, js : 0, stat: 0, resources : 0, servicescount :0 } /**********End*********/ if(QYT.main) { QYT.Common.includeJS(QYT.setting.home + "js/QYT_Jquery.js","base"); } /*********控制*********/ QYT.preRender = function() { if(QYT.setting.mode=="icon") { QYT.main.innerHTML = QYT.templet.icon.replace(/\[HOME\]/g,QYT.setting.home); //图标模式需要更改图片大小,不能限制宽度 document.getElementById("qyt_main").className = "qyt_main2"; //document.getElementById("qyt_titleheader").className = "qyt_titleheader2"; var tempLang = QYT.stat.language.toLowerCase(); switch (tempLang) { case "zh-cn": document.getElementById("qyt_icon_online").src = QYT.setting.home + "images/icon/online_"+QYT.setting.iconMode+"_zh-cn.gif"; document.getElementById("qyt_icon_offline").src = QYT.setting.home + "images/icon/offline_" +QYT.setting.iconMode+"_zh-cn.gif"; break; default: document.getElementById("qyt_icon_online").src = QYT.setting.home + "images/icon/online_"+QYT.setting.iconMode+"_en.gif"; document.getElementById("qyt_icon_offline").src = QYT.setting.home + "images/icon/offline_" +QYT.setting.iconMode+"_en.gif"; break; } } else { QYT.main.innerHTML = QYT.templet.container.replace(/\[HOME\]/g,QYT.setting.home).replace(/\[SKIN\]/g,QYT.setting.skin); switch(QYT.stat.language) { case "zh-cn": document.getElementById("img_qyt_ppcall").src = QYT.setting.home+ "Skins/" +QYT.setting.skin+ "/QYT_ppcall_zhcn.gif"; break; case "zh-tw": document.getElementById("img_qyt_ppcall").src = QYT.setting.home+ "Skins/" +QYT.setting.skin+ "/QYT_ppcall_zhcn.gif"; break; case "en-us": document.getElementById("img_qyt_ppcall").src = QYT.setting.home+ "Skins/" +QYT.setting.skin+ "/QYT_ppcall_enus.gif"; break; case "ja-jp": document.getElementById("img_qyt_ppcall").src = QYT.setting.home+ "Skins/" +QYT.setting.skin+ "/QYT_ppcall_enus.gif"; break; default: document.getElementById("img_qyt_ppcall").src = QYT.setting.home+ "Skins/" +QYT.setting.skin+ "/QYT_ppcall_zhcn.gif"; break; } } QYT.position(); } QYT.render = function() { if(QYT.setting.mode=="icon") { QYT.buildIcon(); if(QYT.setting.wiseid ==""||QYT.setting.wiseid =="0") { QYT$("#qyt_icon_bottom").hide(); } else { QYT$("#qyt_icon_bottom").show(); } } else { QYT.buildDept(); QYT.buildCs(); if(QYT$("#qyt_list").html() == "") { var divAtt = document.createElement("div"); divAtt.id = "qyt_attention"; divAtt.innerHTML = '

'+QYT.templet.resource[4]+ '

'; QYT$("#qyt_list").append(divAtt); } if(QYT.setting.wiseid ==""||QYT.setting.wiseid =="0") { QYT$("#qyt_bottom").hide(); } else { QYT$("#qyt_bottom").show(); } } QYT.loaded.data = 0; var action = QYT.setting.mode=="icon" ? 6 : 2; QYT.Common.includeJS(QYT.setting.home +"GetData.aspx?action=" +action+ "&id="+QYT.stat.visitorId+"&lang="+QYT.stat.language+ "&rnd=" + QYT.Common.getRnd(), "data"); //QYT.Common.includeJS(QYT.setting.home +"json/update.js", "data"); setTimeout(QYT.update, 3000); //setTimeout(QYT.update, 3000); } QYT.update = function() { if(QYT.loaded.data) { if(QYT.setting.mode=="icon") { QYT.buildIcon(); } else { QYT.updateDept(); QYT.updateCs(); if(QYT$("#qyt_list").html() == "") { var divAtt = document.createElement("div"); divAtt.id = "qyt_attention"; divAtt.innerHTML = '

'+QYT.templet.resource[4]+ '

'; QYT$("#qyt_list").append(divAtt); QYT.loaded.servicescount = 0; } else { if(!document.getElementById("qyt_attention")) { QYT.loaded.servicescount = 1; } else { QYT.loaded.servicescount = 0; } } } QYT.handleMessages(); QYT.loaded.data = 0; var action = QYT.setting.mode=="icon" ? 5 : 2; QYT.Common.includeJS(QYT.setting.home +"GetData.aspx?action=" +action+ "&id="+QYT.stat.visitorId+"&lang="+QYT.stat.language+ "&rnd=" + QYT.Common.getRnd(), "data"); //QYT.Common.includeJS(QYT.setting.home +"json/update.js", "data"); QYT.getfocu=setTimeout(QYT.update, 3000); } else { setTimeout(QYT.update, 500); } } /**********End*********/ /*********图标模式*********/ QYT.buildIcon = function() { //第一次数据 if(QYT.online) { QYT$("#qyt_icon_online").show(); QYT$("#qyt_icon_offline").hide(); } else { QYT$("#qyt_icon_offline").show(); QYT$("#qyt_icon_online").hide(); } } /**********End*********/ /*********部门列表*********/ QYT.buildDept = function() { //第一次数据 if(QYT.dept) { for(var i = 0;i'; QYT$("#qyt_list").append(div); } } QYT.dept = null; } QYT.updateDept = function() { if(QYT.dept) location.reload(); } /**********End*********/ /*********客服列表*********/ QYT.buildCs = function() { //第一次数据 if(QYT.cs) { for(var i = 0; i"+QYT.templet.resource[3]+""; } else { return ''; } //} //else //{ //if(cs.seatid) //{ //var title = cs.state ? QYT.templet.resource[0] : QYT.templet.resource[1]; //return ""; //} //else //{ // return ''; //} //} } //方法 QYT.buildItem = function(cs) { var li = document.createElement("li"); li.id = "qyt_cs" + cs.id; li.className = 'li' + cs.sex + cs.state; var title = cs.state ? QYT.templet.resource[0] : QYT.templet.resource[1]; var action=cs.state?"dialog":"board"; li.innerHTML = '' +cs.name+ ''+ isTel(cs); return li; } QYT.updateItem = function(li, cs) { li.className = 'li' + cs.sex + cs.state; var title = cs.state ? QYT.templet.resource[0] : QYT.templet.resource[1]; var action = cs.state ? "dialog":"board"; li.innerHTML = '' +cs.name+ ''+ isTel(cs); } /**********End*********/ /*********消息处理*********/ QYT.handleMessages = function() { if(QYT.messages) { for(var i=0;i