javascript商务通

//左侧就医服务新
document.write("<style type='text/css'>");
document.write(".left_swt{background:url(/swt/left_swt11.png) no-repeat;width:140px;}");
document.write("</style>");

document.write("<div id='ShowAD' style='left:5px;POSITION:absolute;TOP:200px;z-index:99999;width:140px;'>");
document.writeln("  <div class='left_swt'>");
document.writeln("    <a href='/swt/' target='blank' ><img src='/swt/left_swt11.png' /></a>");
document.writeln("  </div>");
document.write("</div>");

function heartBeat(){
lastScrollY=0;
  var tt=20;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }
  pos=pos-document.getElementById("ShowAD").offsetTop+80;//theTop;
  pos=document.getElementById("ShowAD").offsetTop+pos/10;

  if (pos < lastScrollY) pos = lastScrollY;
  if (pos != old) {
    document.getElementById("ShowAD").style.top = pos+"px";
    tt=20;
  //alert(tips.style.top);
  }

  old = pos;
}
window.setInterval("heartBeat()",1);




//右侧就医服务新
document.writeln("<div class=\"QQbox\" id=\"divQQbox\" style='right:5px;POSITION:absolute;TOP:50px;'>");
document.writeln("<div class='Qlist' id='divOnline'>");
document.writeln("<div onclick='OnlineOut();' style='cursor: pointer;'><img border=0 src=/swt/guan.gif /></div>");
document.writeln("<div><a href='/swt/' target='_blank' title='在线咨询'><img border=0 src=/swt/right_swt.gif /></a></div>");
document.writeln("<\/div>");
document.write("<div id='divMenu' onmouseover='OnlineOver();' style='display:none; right:2px; width: 31px; POSITION:absolute;'><img src='/swt/huaguo.gif' class='press' alt='就医服务'></div>");
document.writeln("<\/div>");

//<![CDATA[
var tips; var theTop = 130;
 var old = theTop;
function initFloatTips() {
  tips = document.getElementById('divQQbox');
  moveTips();
};

function moveTips() {
    var tt=50;
    if (window.innerHeight) {
        pos = window.pageYOffset
    }
    else if (document.documentElement && document.documentElement.scrollTop) {
        pos = document.documentElement.scrollTop
    }
    else if (document.body) {
        pos = document.body.scrollTop;
    }
    pos=pos-tips.offsetTop+theTop;
    pos=tips.offsetTop+pos/10;
    
    if (pos < theTop) pos = theTop;
    if (pos != old) {
        tips.style.top = pos+"px";
        tt=10;
        //alert(tips.style.top);
    }
    
    old = pos;
    setTimeout(moveTips,tt);
}
//!]]>
initFloatTips();

function OnlineOver(){
    document.getElementById("divMenu").style.display = "none";
    document.getElementById("divOnline").style.display = "block";
    document.getElementById("divQQbox").style.width = "135px";
}

function OnlineOut(){
    document.getElementById("divMenu").style.display = "block";
    document.getElementById("divOnline").style.display = "none";

}

function hideMsgBox(theEvent){  //theEvent用来传入事件,Firefox的方式
    if (theEvent){
        var browser=navigator.userAgent;   //取得浏览器属性
        if (browser.indexOf("Firefox")>0){  //如果是Firefox
            if (document.getElementById('divOnline').contains(theEvent.relatedTarget)) {  //如果是子元素
                return;   //结束函式
            }
        }
        if (browser.indexOf("MSIE")>0){  //如果是IE
            if (document.getElementById('divOnline').contains(event.toElement)) {  //如果是子元素
                return;  //结束函式
            }
        }
    }
    document.getElementById("divMenu").style.display = "block";
    document.getElementById("divOnline").style.display = "none";
}

var LR_next_invite_seconds = 20;
var LrinviteTimeout=1;
var LiveAutoInvite0='\u60a8\u597d\uff0c\u6765\u81ea%IP%\u7684\u670b\u53cb';
var LiveAutoInvite1=window.location.href;
var LiveAutoInvite2='';
document.write('<script language="javascript" src="http://kft.zoosnet.net/JS/LsJS.aspx?siteid=KFT27042564&float=0&lng=cn"></script>');

function update_swt_wee() {
    var o = document.getElementById("LRfloater0");
    /*
    if (o) {
        var ims = o.getElementsByTagName("IMG");
        var src = "/swt/online_cn.gif";
        if (ims[1].src.indexOf(src) == -1) {
            ims[1].src = src;
        }
    }
    */
    var o = document.getElementById("LRfloater1");
    if (o) {
        if (o.innerHTML.indexOf("new_swt_wee") == -1) {
            o.innerHTML = '<div id="new_swt_wee" style="width:420px; height:231px; overflow:hidden; position:relative; z-index:900;" > <div style="width:450px; height:331px; overflow:hidden; z-index:901;" onclick="LR_HideInvite();openZoosUrl();return false;"><a href="javascript:void(0)" onClick="LR_HideInvite();LR_RefuseChat();return false;"><img src="/swt/xdnk.gif" border="0"></a></div><div style="position:absolute; top:3px; left:405px; z-index:904;"><a href="javascript:void(0)" onClick="LR_HideInvite();LR_RefuseChat();return false;"><img src="/swt/closs.gif" border="0"></a></div></div>';
        }
    }
}
setInterval("update_swt_wee()", 100);

function open_swt() {
    var b = document.getElementById("LRdiv0");
    var o = document.getElementById("LRdiv1");
    if (o.style.display=='none') {
        o.style.display='block';
        //b.style.display='none';
    }
}
setInterval("open_swt()",25000);

function open_dialog(){
    if(document.getElementById("LRdiv1")){
        LR_HideInvite();
        //openZoosUrl();
        ShowDialog("http://kft.zoosnet.net/LR/Chatpre.aspx?id=KFT27042564&e=auto.cnwan.net&p=auto.cnwan.net");
    }
}

function ShowDialog(url) {
     var iWidth=760;
     var iHeight=480;
     var iTop=(window.screen.height-iHeight)/2;
     var iLeft=(window.screen.width-iWidth)/2;
     window.showModalDialog(url,window,"dialogHeight:"+iHeight+"px;dialogWidth:"+iWidth+"px;dialogTop:"+iTop+";dialogLeft:"+iLeft+";resizable:no;status: no;scroll:no");
}

var referrer = document.referrer;
if (!referrer) {
    try {
        if (window.opener) {
            referrer = window.opener.location.href;
        }
    }
    catch (e) {}
}
 
if(referrer){
    var rf_domain = referrer.split('/')[2];
}else{
    var rf_domain = '';
}

if(rf_domain == "so.360.cn" || rf_domain == "www.baidu.com" || rf_domain == "www.soso.com" || rf_domain == "www.sogou.com" || rf_domain == "www.youdao.com" || rf_domain == "www.google.com.hk"){
    open_dialog();
}

document.write('<script src="http://s21.cnzz.com/stat.php?id=4977496&web_id=4977496&show=pic" language="JavaScript"></script>');

 

你可能感兴趣的:(JavaScript)