');
kf_loadCss(homepage+'skins/kefu/tip/001/style.css');
kfHtml +=(''
+'
'
+'
'+im_invitetitle+'
'
+'
'
+'
'
+'
'+im_invitecontent+'
'
+'
'
+'
'
+'
'
+'
'
+'
');
kf_loadCss(homepage+'skins/kefu/list/A002/style.css');
if (!document.layers)
kfHtml += ("");
kfHtml += ("");
kfHtml += ('');kfHtml += ("
");
if (!document.layers)
//创建背景透明
function showbg(){
var re = {};
if (document.documentElement && document.documentElement.clientHeight) {
var doc = document.documentElement;
re.width = (doc.clientWidth > doc.scrollWidth) ? doc.clientWidth - 1 : doc.scrollWidth;
re.height = (doc.clientHeight > doc.scrollHeight) ? doc.clientHeight : doc.scrollHeight;
}
else {
var doc = document.body;
re.width = (window.innerWidth > doc.scrollWidth) ? window.innerWidth : doc.scrollWidth;
re.height = (window.innerHeight > doc.scrollHeight) ? window.innerHeight : doc.scrollHeight;
}
document.getElementById("dami_ly").style.display="block";
document.getElementById("invite_div").style.display="block";
//document.getElementById("dami_ly").style.cssText = "position:absolute;left:0px;top:0px;width:100%;height:"+re.height+"px;filter:Alpha(Opacity=20);opacity:0.2;background-color:#000000;z-index:1;";
}
kfHtml += ('');
if(im_autoinvite == '1'){
//监听信息
var callback = function(data) {
var myword = String(data.message);
if(myword.length > 3){
var warr = new Array();
warr = myword.split('###');
console.log(warr.length);
if(warr.length >=4){
console.log(im_opennew);
if(im_opennew != '1'){
im_wid= warr[1];
G('invite_top').innerHTML= warr[2] + ':';
G('invite_text').innerHTML= warr[3];
NewInvite();
}else{
console.log('open dialog'+warr[1]);
OpenDialog(warr[1]);
}
}
}
}
XD.receiveMessage(callback);
}
function OpenDialog(wid){
if (im_urlkg==0 && im_url!="")
{
homeindex=im_url+"?act=/";
}
else
{
homeindex=homepage;
}
var curDialog = artDialog({id:'dmkf'+wid,title:'与客服对话', url:homeindex+"kf.js?mod=client&cid="+im_cid+"&wid="+wid+"&uid="+im_sessionid+"&lang="+im_lang, width:700, height:472,lock:false});
if(curDialog){
curDialog.close(function(){
var tmp='action=bye';
tmp+='&cid='+im_cid;
tmp+='&uuid='+im_sessionid;
tmp+='&datatype=get';
console.log('bye bye '+tmp);
var x=new dmkfAjax('HTML','');
x.get(homepage+'getdata/content/client.php?'+tmp,function(s){});
});
}
document.getElementById("invite_div").style.visibility = "hidden";
}
function Accept(){
OpenDialog(im_wid);
document.getElementById("dami_ly").style.display="none";
}
function Next(){
document.getElementById("dami_ly").style.display="none";
document.getElementById("invite_div").style.display="none";
NotAgree=true;
}
function CloseDiv(){
document.getElementById("dami_ly").style.display="none";
document.getElementById("frame_div").style.visibility = "hidden";
floatstop=true;
}
function eqmk_onload(){
if(im_autoinvite=='2'){setTimeout("NewInvite()",im_thecount*1000);}}
lastScrollY = 0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
//document.getElementById("frame_div").style.top = '40%';
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat()",1);
lastScrollY2 = 0;
function heartBeat2(){
var diffY2;
if (document.documentElement && document.documentElement.scrollTop)
diffY2 = document.documentElement.scrollTop;
else if (document.body)
diffY2 = document.body.scrollTop
else
{/*Netscape stuff*/}
percent2=.1*(diffY2-lastScrollY2);
if(percent2>0)percent2=Math.ceil(percent2);
else percent2=Math.floor(percent2);
//document.getElementById("invite_div").style.top = parseInt(document.getElementById("invite_div").style.top)+percent2+"px";
lastScrollY2=lastScrollY2+percent2;
}
window.setInterval("heartBeat2()",1);
var expDays = 1;
var page = homepage+"kf.php?mod=client&cid="+im_cid+"&wid="+im_wid+"&uid="+im_sessionid+"&lang=" + im_lang;
//var windowprops = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=700,height=472";
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*1*60*1*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
}
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);
windowopennewkf=artDialog({title:'与客服对话', url:page, width:700, height:472});
}
else {
count++;
SetCookie('count', count, exp);
}
}
function NewInvite(){
if(im_autoinvite=='0'){
return false;
}
if(G("invite_div").style.display!=='none'){
return false;
}
if(NotAgree){
return false;
}
if(G("invite_div").style.display=='none'){
G("invite_div").style.display='';
if(im_effect==1)
{
showbg();
}
}
}
document.body.appendHTML(kfHtml);