var online= new Array ();
var urlroot = "images/";
var tout =-1;
var drag = false;
var g_safenode = null;
lastscrolly = 0;
var Kfguin;
var ws;
var CompanyName;
var Welcomeword;
var type;
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, ' RN ');
Welcomeword = kf_getsafehtml (Welcomeword);
Welcomeword = Welcomeword.replace (/r/g, ""). Replace (/n/g, "<br>");
Window.settimeout ("Kf_sleepshow ()", 2000);
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-he ight:17px; " > ' +companyname+ ' </h1><a href= ' # "onclick=" Kf_hidekfpopup (); return false; "style=" Background-image:url ( ' +urlroot+ ' close.gif); float:right;height:19px;width:42px; "Onmouseo tutorial ver=" 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; > ';
temp = ' <a onclick= ' kf_hidekfpopup (); return false; "href=" # "style=" Float:right;background-image:url (' +urlroot+ ') btn_1.gif); margin:0 0 0 5px;padding:0px;border:0px;height:21px;width:69px; " ></a> ';
temp = ' <a onclick= ' Kf_openchatwindow (1) "href=" # "style=" Float:right;background-image:url (' +urlroot+ ' btn_2.gif ); margin:0px;padding:0px;border:0px;height:21px;width:69px; " ></a></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 class= ' Wpa_popup "style=" width:90px; height:150px; " > ';
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; " >&nbsp;</h1></div> ';
Temp + = ' <div style= ' height:83px; padding:0 0 0 2px; Clear:both; " ><div style= "width:70px; height:70px; Float:left; Background:url (' +urlroot+ ' face.jpg); " ></div></div> ';
temp = ' <div style= ' clear:both; ><a href= "#" onclick= "Kf_openchatwindow (0)" style= "WIDTH:69PX; height:21px; Background:url (' +urlroot+ ' btn_2.gif); margin:0 0 0 2px; Display:block; " ></a></div></div> ';
Temp + = ' <div style= ' width:8px; height:150px; Float:left; Background:url (' +urlroot+ ' bg_1.gif) right; " ></div></div> ';
return temp;
}
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.getmillise Conds ());
}
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) + 170;
popupdivhtml = ' <div id= ' kfpopupdiv ' onmousedown= ' mymove.move (' Kfpopupdiv ', event,1); " Style= "Z-index:10000;filter:alpha (opacity=90);p Osition:absolute; Top: ' +position+ ' px; Right:500px;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 ();
function Tong_movediv ()
{
This.move=function (id,evt,t)
{
if (id = = "")
{
Return
}
var o = document.getElementById (ID);
if (!o)
{
Return
}
EVT = evt? Evt:window.event;
O.style.position = "absolute";
O.style.zindex = 200;
var obj = evt.srcelement? Evt.srcelement:evt.target;
var w = o.offsetwidth;
var h = o.offsetheight;
var L = o.offsetleft;
var t = o.offsettop;
var div = document.createelement ("div");
Document.body.appendchild (DIV);
Div.style.css Tutorial Text = "Filter:alpha (opacity=10,style=0); Opacity:0.2;width:" +w+ "Px;height:" +h+ "Px;top:" +t+ "PX; Left: "+l+" Px;position:absolute;background: #000 ";
Div.setattribute ("id", ID + "temp");
This.move_onlymove (id,evt,t);
}
This.move_onlymove = function (id,evt,t)
{
var o = document.getElementById (id+ "temp");
if (!o)
{
Return
}
EVT = evt?evt:window.event;
var relleft = Evt.clientx-o.offsetleft;
var reltop = evt.clienty-o.offsettop;
if (!window.captureevents)
{
O.setcapture ();
}
Else
{
Window.captureevents (Event.mousemove|event.mouseup);
}
Document.onmousemove = function (e)
{
if (!o)
{
Return
}
E = e? E:window.event;
var bh = Math.max (document.body.scrollheight,document.body.clientheight,document.body.offsetheight,
Document.documentelement.scrollheight,document.documentelement.clientheight, Document.documentelement.offsetheight);
var bw = Math.max (Document.body.scrollwidth,document.body.clientwidth,document.body.offsetwidth,
Document.documentelement.scrollwidth,document.documentelement.clientwidth,document.documentelement.offsetwidth );
var SBW = 0;
if (Document.body.scrollwidth < BW)
SBW = Document.body.scrollwidth;
if (Document.body.clientwidth < bw && SBW < document.body.clientwidth)
SBW = document.body.clientwidth;
if (Document.body.offsetwidth < bw && SBW < document.body.offsetwidth)
SBW = Document.body.offsetwidth;
if (Document.documentelement.scrollwidth < bw && SBW < Document.documentelement.scrollwidth)
SBW = Document.documentelement.scrollwidth;
if (Document.documentelement.clientwidth < bw && SBW < Document.documentelement.clientwidth)
SBW = Document.documentelement.clientwidth;
if (Document.documentelement.offsetwidth < bw && SBW < Document.documentelement.offsetwidth)
SBW = Document.documentelement.offsetwidth;
if (e.clientx-relleft <= 0)
{
O.style.left = 0 + "px";
}
else if (e.clientx-relleft >= bw-o.offsetwidth-2)
{
O.style.left = (sbw-o.offsetwidth-2) + "px";
}
Else
{
O.style.left = e.clientx-relleft + "px";
}
if (e.clienty-reltop <= 1)
{
O.style.top = 1 + "px";
}
else if (e.clienty-reltop >= bh-o.offsetheight-30)
{
O.style.top = (bh-o.offsetheight) + "px";
}
Else
{
O.style.top = e.clienty-reltop + "px";
}
}
Document.onmouseup = function ()
{
if (!o) return;
if (!window.captureevents)
{
O.releasecapture ();
}
Else
{
Window.releaseevents (Event.mousemove|event.mouseup);
}
var O1 = document.getElementById (ID);
if (!O1)
{
Return
}
var l0 = O.offsetleft;
var t0 = o.offsettop;
var L = o1.offsetleft;
var t = o1.offsettop;
Alert (L0 + "" + t0 + "" + L + "" +t);
Mymove.move_e (ID, L0, t0, L, t,t);
Document.body.removechild (o);
o = null;
}
}
This.move_e = function (ID, l0, t0, L, t,t)
{
if (typeof (window["CT" + id])!= "undefined")
{
Cleartimeout (window["CT" + id]);
}
var o = document.getElementById (ID);
if (!o) return;
var SL = st = 8;
var s_l = Math.Abs (l0-l);
var s_t = Math.Abs (T0-T);
if (s_l-s_t > 0)
{
if (s_t)
{
SL = Math.Round (s_l/s_t) > 8? 8:math.round (s_l/s_t) * 6;
}
Else
{
SL = 0;
}
}
Else
{
if (s_l)
{
st = Math.Round (s_t/s_l) > 8? 8:math.round (s_t/s_l) * 6;
}
Else
{
st = 0;
}
}
if (L0-l < 0)
{
SL *=-1;
}
if (T0-t < 0)
{
St *=-1;
}
if (Math.Abs (L + sl-l0) < && SL)
{
SL = SL > 0? 2:-2;
}
if (Math.Abs (t + st-t0) < && St)
{
st = st > 0? 2:-2;
}
if (Math.Abs (L + sl-l0) < && SL)
{
SL = SL > 0? 1:-1;
}
if (Math.Abs (t + st-t0) < && St)
{
st = st > 0? 1:-1;
}
if (s_l = = 0 && s_t = 0)
{
Return
}
if (t)
{
O.style.left = l0 + "px";
O.style.top = t0 + "px";
Return
}
Else
{
if (Math.Abs (L + sl-l0) < 2)
{
O.style.left = l0 + "px";
}
Else
{
O.style.left = l + SL + "px";
}
if (Math.Abs (t + st-t0) < 2)
{
O.style.top = t0 + "px";
}
Else
{
O.style.top = t + st + "px";
}
window["CT" + id] = Window.settimeout ("mymove.move_e (' + ID +" ', "+ L0 +", "+ t0 +", "+ (L + SL) +", "+ (T + st) +", "+t+") ", 1);
}
}
}
function Wpa_count ()
{
var BODY = document.getelementsbytagname (' body '). Item (0);
var img = document.createelement (' img ');
var now = new Date ();
IMG.SRC = "http://bizapp.qq.com/cgi/wpac?kfguin=" + Kfguin + "&ext=0" + "&time=" + now.gettime () + "ip=172.23.30.1" 5& ";
Img.style.display = "None";
Body.appendchild (IMG);
}