//function $(id)
//{
// return document.getElementById(id);
//}
if(kfguin)
{
rightDivHtml = '<div id="rightDiv" style="position:absolute; top:160px; right:1px;">';
rightDivHtml += kf_getPopupRightDivHtml(kfguin,ws);
rightDivHtml += '</div>';
document.write(rightDivHtml);
if(type==1 && kf_getCookie('hasshown')==0)
{
companyname = companyname.substr(0,15);
welcomeword = kf_processWelcomeword(welcomeword);
kfguin = kf_getSafeHTML(kfguin);
companyname = kf_getSafeHTML(companyname);
welcomeword = welcomeword.replace(/<brT>/g,'\r\n');
welcomeword = kf_getSafeHTML(welcomeword);
welcomeword = welcomeword.replace(/\r/g, "").replace(/\n/g, "<BR>");
window.setTimeout("kf_sleepShow()",10000);
//kf_sleepShow();
}
window.setTimeout("kf_moveWithScroll()",1);
//window.setInterval("wpa_count()",10000);
}
function kf_getSafeHTML(s)
{
var html = "";
var safeNode = g_safeNode;
if(!safeNode)
{
safeNode = document.createElement("TEXTAREA");
}
if(safeNode)
{
safeNode.innerText = s;
html = safeNode.innerHTML;
safeNode.innerText = "";
g_safeNode = safeNode;
}
return html;
}
function kf_moveWithScroll()
{
if(typeof window.pageYOffset != 'undefined') {
nowY = window.pageYOffset;
}
else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
nowY = document.documentElement.scrollTop;
}
else if(typeof document.body != 'undefined') {
nowY = document.body.scrollTop;
}
percent = .1*(nowY - lastScrollY);
if(percent > 0)
{
percent=Math.ceil(percent);
}
else
{
percent=Math.floor(percent);
}
document.getElementById("rightDiv").style.top = parseInt(document.getElementById("rightDiv").style.top) + percent+"px";
if(document.getElementById("kfpopupDiv"))
{
document.getElementById("kfpopupDiv").style.top = parseInt(document.getElementById("kfpopupDiv").style.top) + percent+"px";
}
lastScrollY = lastScrollY + percent;
tOut = window.setTimeout("kf_moveWithScroll()",1);
}
function kf_hide()
{
if(tOut!=-1)
{
clearTimeout(tOut);
tOut=-1;
}
document.getElementById("rightDiv").style.visibility = "hidden";
}
function kf_hidekfpopup()
{
if(tOut!=-1)
{
clearTimeout(tOut);
tOut=-1;
}
document.getElementById("kfpopupDiv").style.visibility = "hidden";
tOut=window.setTimeout("kf_moveWithScroll()",1);
}
//中间漂浮框
function kf_getPopupDivHtml(kfguin,reference,companyname,welcomeword)
{
var temp = '';
temp += '<div style="float: left;height: 150px;width: 8px;background-image: url('+urlroot+'bg_1.gif);"></div>';
temp += '<div style="font-family: Tahoma;text-align:left;float: left;height: 150px;width: 324px;background-image: url('+urlroot+'bg_2.gif);background-repeat: repeat-x;">';
temp += '<div><h1 style=" float:left;font-size: 14px;color: #FFFFFF;margin: 0px;padding: 10px 0 13px 2px;line-height:17px;">'+companyname+'</h1><a href="#" onclick="kf_hidekfpopup();return false;" style="background-image: url('+urlroot+'close.gif);float: right;height: 19px;width: 42px;" onmouseover="javascript:this.style.backgroundPosition=\'bottom\'" onmouseleave="javascript:this.style.backgroundPosition=\'top\'"></a></div>';
temp += '<div style="height:83px;padding: 0 0 0 2px;clear:both;">';
temp += '<div style="background-image: url('+urlroot+'face.jpg);height: 70px;width: 70px;float:left;"></div>';
temp += '<p style="font-family:Tahoma;font-size:12px;line-height:24px;width: 240px;margin:0px;padding: 0 0 0 12px;display:block;float:left;margin-top:2px;word-wrap:break-word;">'+welcomeword+'</p></div>';
temp += '<div style="clear: both;">';
//4
temp += '<a href="http://www.918kf.com/client.aspx?worker_id=605390" target="_blank" style="TEXT-DECORATION: none;"><div style=" background:url(/images/btnbg.gif);background-repeat:no-repeat;font-family: Tahoma;font-size:11px;height:21px;padding-top:3px;color:#0C4E7C;width:69px;cursor:pointer;float:right;text-align:center;margin-left:4px;">在线客服</div></a>';
//3
temp +='<div style=\"float:right;margin-left:5px;\">';
if(online[0]==0)
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/jsoffline.gif' alt=\"点击这里给我发消息\"></a>"
}
else
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/jsonline.gif' alt=\"点击这里给我发消息\"></a>";
}
temp+='</div>';
//2
temp +='<div style=\"float:right;margin-left:5px;\">';
temp +='<a href="msnim:chat?contact=veelink@hotmail.com" target="_blank" style="TEXT-DECORATION: none;" onclick="alert(\'需安装MSN软件才能启动MSN聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件\')"><div style=" background:url(/images/btnbg.gif);background-repeat:no-repeat;font-family: Tahoma;font-size:11px;height:21px;padding-top:5px;color:#0C4E7C;width:69px;cursor:pointer;text-align:center;">在线MSN</div></a>';
temp+='</div>';
//1
temp +='<div style=\"float:right;\">';
if(online[0]==0)
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/offline.gif' alt=\"点击这里给我发消息\"></a>"
}
else
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/online.gif' alt=\"点击这里给我发消息\"></a>";
}
temp+='</div>';
temp +='</div>';
temp += '</div><div style="float: left;height: 150px;width: 8px;background-image: url('+urlroot+'bg_1.gif);background-position: right;"></div>';
return temp;
}
//右边漂浮框
function kf_getPopupRightDivHtml(kfguin,reference)
{
var temp = "";
temp+='<div><div style="float:right;width:24px"><div><img onmousemove="displist()" src="/images/k01.gif" /></div><div style="cursor:pointer;" onclick="hidelist()"><img src="/images/k02.gif" /></div></div><div style="float:right">';
temp += '<div class="wpa_popup" style="width:90px; height:150px;display:none;" id="divright">';
temp += '<div style="width:8px; height:150px; float:left; background:url('+urlroot+'bg_1.gif);"></div>';
temp += '<div style="float:left; width:74px; height:150px; background:url('+urlroot+'middle.jpg); background-position: center;">';
temp += '<div ><h1 style="line-height:17px; font-size:14px; color:#FFF; margin:0px; padding:10px 0 13px 8px;"> </h1></div>';
temp += '<div style="height:83px; padding:0 0 0 2px; clear:both;"><div style="width:70px; height:70px; float:left; ">';
//商务QQ
temp +='<div style="margin-bottom:5px;">';
if(online[0]==0)
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/offline.gif' alt=\"点击这里给我发消息\"></a>"
}
else
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=bbcb074f77ec0ce812026e86bb68736421e31934aa1a5c944409ab4051c05365';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/online.gif' alt=\"点击这里给我发消息\"></a>";
}
temp += '</div>';
//MSN
temp +='<a href="msnim:chat?contact=veelink@hotmail.com" target="_blank" style="TEXT-DECORATION: none;" onclick="alert(\'需安装MSN软件才能启动MSN聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件\')"><div style=" background:url(/images/btnbg.gif);background-repeat:no-repeat;font-family: Tahoma;font-size:11px;height:21px;padding-top:5px;color:#0C4E7C;width:69px;cursor:pointer;">在线MSN</div></a>';
//技术QQ
if(online[0]==0)
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/jsoffline.gif' alt=\"点击这里给我发消息\"></a>"
}
else
{
temp +="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e\"; target=_blank; onclick=\"alert('需安装QQ软件才能启动QQ聊天,如不想安装,您可以选择下面的在线客服进行咨询,无需安装任何软件');var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=56ba594b68170c3b41476007a1ae54ef2e17479aea2d68b9660ede91fc6b468e';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border=\"0\" SRC='http://www.veelink.com/images/jsonline.gif' alt=\"点击这里给我发消息\"></a>";
}
temp +='</div></div>';
//客服
temp += '<a href="http://www.918kf.com/client.aspx?worker_id=605390" target="_blank" style="TEXT-DECORATION: none;"><div style=" background:url(/images/btnbg.gif);background-repeat:no-repeat;font-family: Tahoma;font-size:11px;height:21px;padding-top:5px;color:#0C4E7C;width:69px;cursor:pointer;">在线客服</div></a></div>';
temp+='';
temp += '<div style="width:8px; height:150px; float:left; background:url('+urlroot+'bg_1.gif) right;"></div></div>';
temp+='</div></div>';
return temp;
}
function hidelist()
{
document.getElementById('divright').style.display="none";
}
function displist()
{
document.getElementById('divright').style.display="";
}
//added by simon 2008-11-04
function kf_openChatWindow(flag)
{
window.open('http://bizapp.qq.com/webc.htm?new=0&sid='+kfguin+'&o=&q=7', '_blank', 'height=544, width=644,toolbar=no,scrollbars=no,menubar=no,status=no');
if(flag==1)
{
kf_hidekfpopup();
}
return false;
}
//added by simon 2008-11-04 end
function kf_validateWelcomeword(word)
{
var count = 0;
for(var i=0;i<word.length;i++)
{
if(word.charAt(i)=='\n')
{
count++;
}
if(count>2)
{
return 2;
}
}
if(word.length > 57+2*count)
{
return 1;
}
count = 0;
var temp = word.indexOf('\n');
while(temp!=-1)
{
word = word.substr(temp+1);
if(temp-1<=19)
{
count += 19;
}
else if(temp-1<=38)
{
count += 38;
}
else if(temp-1<=57)
{
count += 57;
}
temp = word.indexOf('\n');
}
count+=word.length;
if(count>57)
{
return 3;
}
return 0;
}
function kf_processWelcomeword(word)
{
word = word.substr(0,57+10);
var result = '';
var count = 0;
var temp = word.indexOf('<brT>');
while(count<57 && temp!=-1)
{
if(temp<=19)
{
count += 19;
if(count<=57)
{
result += word.substr(0,temp+5);
}
else
{
result += word.substr(0,57-count>word.length?word.length:57-count);
}
}
else if(temp<=38)
{
count += 38;
if(count<=57)
{
result += word.substr(0,temp+5);
}
else
{
result += word.substr(0,57-count>word.length?word.length:57-count);
}
}
else if(temp<=57)
{
count += 57;
if(count<=57)
{
result += word.substr(0,temp+5);
}
else
{
result += word.substr(0,57-count>word.length?word.length:57-count);
}
}
word = word.substr(temp+5);
temp = word.indexOf('<brT>');
}
if(count<57)
{
result += word.substr(0,57-count>word.length?word.length:57-count);
}
return result;
}
function kf_setCookie(name, value, exp, path, domain)
{
var nv = name + "=" + escape(value) + ";";
var d = null;
if(typeof(exp) == "object")
{
d = exp;
}
else if(typeof(exp) == "number")
{
d = new Date();
d = new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes() + exp, d.getSeconds(), d.getMilliseconds());
}
if(d)
{
nv += "expires=" + d.toGMTString() + ";";
}
if(!path)
{
nv += "path=/;";
}
else if(typeof(path) == "string" && path != "")
{
nv += "path=" + path + ";";
}
if(!domain && typeof(VS_COOKIEDM) != "undefined")
{
domain = VS_COOKIEDM;
}
if(typeof(domain) == "string" && domain != "")
{
nv += "domain=" + domain + ";";
}
document.cookie = nv;
}
function kf_getCookie(name)
{
var value = "";
var cookies = document.cookie.split("; ");
var nv;
var i;
for(i = 0; i < cookies.length; i++)
{
nv = cookies[i].split("=");
if(nv && nv.length >= 2 && name == kf_rTrim(kf_lTrim(nv[0])))
{
value = unescape(nv[1]);
}
}
return value;
}
function kf_sleepShow()
{
kf_setCookie('hasshown', 1, '', '/', 'bizapp.qq.com');
var position = parseInt(document.getElementById("rightDiv").style.top) + 0;
popupDivHtml = '<div id="kfpopupDiv" onmousedown="MyMove.Move(\'kfpopupDiv\',event,1);" style="z-index:10000;filter:alpha(opacity=90);position: absolute; top: '+position+'px; right: 300px;color:#000;font-size: 12px;cursor:move;height: 150px;width: 340px;">';
popupDivHtml += kf_getPopupDivHtml(kfguin,ws,companyname,welcomeword);
popupDivHtml += '</div>';
document.body.insertAdjacentHTML("beforeEnd",popupDivHtml);
}
function kf_dealErrors()
{
kf_hide();
return true;
}
function kf_lTrim(str)
{
while (str.charAt(0) == " ")
{
str = str.slice(1);
}
return str;
}
function kf_rTrim(str)
{
var iLength = str.length;
while (str.charAt(iLength - 1) == " ")
{
str = str.slice(0, iLength - 1);
iLength--;
}
return str;
}
window.onerror = kf_dealErrors;
var MyMove = new Tong_MoveDiv();