var mid=new Date(); var xmsgimg; var xs=false; var ol=false; var sn=true; var ivop=false; var tout=15000; var ct=0; var mac = (navigator.platform) && (navigator.platform.toLowerCase().indexOf("mac") >= 0); function startchat(f){ str=lssiteurl+'inc/bizlivechat?svc='+svcname; if(ol){ if(f==1) str+="&v=msg"; if(f==6) str+="&v=invite"; } else str=str+"&v=email"; window.open(str,'chatwin',wsize+',toolbar=no,menubar=no,directories=no,status,resizable=false'); //window.open(str,'chatwin'); } function sendData(msg,data,svc){ if(xs==true && xmsgimg.complete!=true) window.setTimeout('sendData("'+msg+'","'+data+'","'+svc+'")',250); else{ if(sn) xmsgimg=new Image(); else xmsgimg=document.xsend; var r = escape(document.referrer); if(r==null) r=""; var xsrc=lsurl+"/bizlivestats/x.gif?sc=1&svc="+svc+"&ix="+mid+"&ref="+escape(r)+"&xmsg="+escape(msg+":admin:"+data) xmsgimg.src=xsrc; xs=true; mid++; window.setTimeout('statusCheck("'+svc+'")',100); } } function sendcart(c){ sendData("CART",c,svcname);} function statusCheck(svc){ if(xs==true) { if(xmsgimg.complete) {xs=false; setStatus(xmsgimg.width,svc); } else window.setTimeout('statusCheck("'+svc+'")',100); } } function chwidth() {window.setTimeout('chwidth();',10000);} function hb(svc){ sendData("H"," ",svc); ct=ct+1; if(ct==5) tout=30000; window.setTimeout('hb("'+svc+'")',tout);} function init(svc){ if(mac) sn=false; if(sn) xmsgimg=new Image(); else { document.writeln("
"); xmsgimg=document.xsend; } var pid=location.href; if(pid.indexOf(":")) pid=pid.substring(7); d=new Date(); mid=d.getTime(); sendData("P",pid,svc); window.setTimeout('hb("'+svc+'")',tout); } function initchat() { ivop=true if(document.getElementById) { wind=document.getElementById("invite"); if(wind) { pdiv(wind); wind.style.visibility="visible"; } } else { startchat(); } } function openchat() { startchat(); closeinvite(); } function closeinvite() { if(document.getElementById) { wind=document.getElementById("invite"); wind.style.visibility="hidden"; } else document.all.invite.style.visibility="hidden"; ivop=false; } function setStatus(c,svc){ var gr=false; //alert(document.images['chatlink'].src); if(document.chatlink && imgsrc!=null) gr=true; if(c==3) { ol=false; if(gr) document.chatlink.src=imgsrc+'_off.gif'; return; } if(c==4 || c==5 || c==6) { ol=true; if(gr) document.chatlink.src=imgsrc+'_on.gif'; if(c==5) initchat(1); if(c==6) initchat(6); return; } if(gr) document.chatlink.src=imgsrc+'_off.gif'; } init(svcname);