﻿// JScript 文件

document.write("<link rel='stylesheet' type='text/css' href='/style/QQ.css'>");
document.write("<div class='QQbox' id='divQQbox' >");
document.write("	<div class='Qlist' id='divOnline'>");
document.write("		<div class='t'></div>");



document.write("<table width='97' border='0' cellpadding='0' cellspacing='1' bgcolor='#adadad'>");
document.write("  <tr>");
document.write("    <td bgcolor='#FFFFFF' style='padding:5px;'><table width='85' border='0' cellspacing='0' cellpadding='0'>");
document.write("      <tr>");
document.write("        <td align=center><img src='/images/Zx.jpg' alt='' border=''/></td>");
document.write("        <td align=center><a href='#'><img src='/images/Gb.jpg' alt='' border=''   onclick='OnlineOut();'/></a></td>");
document.write("      </tr>");
document.write("    </table>");
document.write("      <table width='85' border='0' cellspacing='0' cellpadding='0'>");
document.write("        <tr>");
document.write("          <td><img src='/images/Img_6.jpg' width='85' height='71' /></td>");
document.write("        </tr>");
document.write("      </table>");
document.write("      <div width='85' style='text-align:center;'><ul style='list-style-type:none;padding:0;font-size:12px;'>");
document.write("       <li style='margin-top:5px;text-align:center;margin-bottom:10px;'>QQ</li>");
document.write("        <li style='margin-bottom:10;'><a target='_blank' href='http://wpa.qq.com/msgrd?v=1&uin=879896115&site=qq&menu=yes'><img border='0' src='http://wpa.qq.com/pa?p=2:879896115:5' alt='879896115' title='879896115' /></a></li>");
document.write("          </ul></div></td>");
document.write("  </tr>");
document.write("</table>");

document.write("</div>");
document.write("<div id='divMenu' onmouseover='OnlineOver();' style='display : none;'><img src='/images/serverPanelSmall.gif' class='press' alt='在线客服'></div>");
document.write("</div>");

//<![CDATA[
var tips; 
var theTop = 200;/*这是默认高度,越大越往下*/; 
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 = "110px";
		//document.getElementById("divOnline").style.left="1059px";
	}
	
	function OnlineOut(){
		document.getElementById("divMenu").style.display = "block";
		document.getElementById("divOnline").style.display = "none";
		//document.getElementById("divQQbox").style.left = 890;
		//document.getElementById("divQQbox").style.top = 300;
		document.getElementById("divQQbox").style.width = "20px";
		//document.getElementById("divOnline").style.left="968px";

	}

 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";
 }


drag("divQQbox",0);
function drag(o,s)  
{  
    if (typeof o == "string") o = document.getElementById(o);  
    o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;  
    o.orig_y = parseInt(o.style.top) - document.body.scrollTop;  
    o.orig_index = o.style.zIndex;  
          
    o.onmousedown = function(a)  
    {  
        this.style.cursor = "move";  
        this.style.zIndex = 10000;  
        var d=document;  
        if(!a)a=window.event;  
        var x = a.clientX+d.body.scrollLeft-o.offsetLeft;  
        var y = a.clientY+d.body.scrollTop-o.offsetTop;  
        //author: www.longbill.cn  
        d.ondragstart = "return false;"  
        d.onselectstart = "return false;"  
        d.onselect = "document.selection.empty();"  
                  
        if(o.setCapture)  
            o.setCapture();  
        else if(window.captureEvents)  
            window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);  

        d.onmousemove = function(a)  
        {  
            if(!a)a=window.event;  
            o.style.left = a.clientX+document.body.scrollLeft-x;  
            o.style.top = a.clientY+document.body.scrollTop-y;  
            o.orig_x = parseInt(o.style.left) - document.body.scrollLeft;  
            o.orig_y = parseInt(o.style.top) - document.body.scrollTop;  
        }  

        d.onmouseup = function()  
        {  
            if(o.releaseCapture)  
                o.releaseCapture();  
            else if(window.captureEvents)  
                window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);  
            d.onmousemove = null;  
            d.onmouseup = null;  
            d.ondragstart = null;  
            d.onselectstart = null;  
            d.onselect = null;  
            o.style.cursor = "normal";  
            o.style.zIndex = o.orig_index;  
        }  
    }  
      
    if (s)  
    {  
        var orig_scroll = window.onscroll?window.onscroll:function (){};  
        window.onscroll = function ()  
        {  
            orig_scroll();  
            o.style.left = o.orig_x + document.body.scrollLeft;  
            o.style.top = o.orig_y + document.body.scrollTop;  
        }  
    }  
}  

