﻿
document.write("<div class='QQbox' id='divQQbox' >");

document.write("<div class='Qlist' id='divOnline' onmouseout='hideMsgBox(event);' style='display : none;'>");

document.write("<div class='t'></div>");

document.write("<div class='con'>");

document.write("<h2></h2>");

document.write("<ul>");

document.write("<li class=odd><a onclick='return check(0)' href='http://wpa.qq.com/msgrd?V=1&amp;Uin=1322595160&amp;Site=兴图科技欢迎您!&amp;Menu=yes' target='_blank'><img  src='http://wpa.qq.com/pa?p=1:1322595160:4'  border='0' alt='QQ' />兴图客服1</a></li>");

document.write("<li><a onclick='return check(1)' href=' http://wpa.qq.com/msgrd?V=1&amp;Uin=1336598835&amp;Site=兴图科技欢迎您&amp;Menu=yes' target='_blank'><img src=' http://wpa.qq.com/pa?p=1:1336598835:4'  border='0' alt='QQ' />兴图客服2</a></li>");

document.write('<tr><td><li><a target="_blank" href="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=3fbc0e82dce067f2@apps.messenger.live.com&mkt=zh-CN"><img style="border-style: none;" src="http://messenger.services.live.com/users/3fbc0e82dce067f2@apps.messenger.live.com/presenceimage?mkt=zh-CN" width="16" height="16" />兴图欢迎您!</a></li></td></tr>');


document.write('<tr><td><li><a target="_blank" href="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=95d9ae68e73c6087@apps.messenger.live.com&mkt=zh-CN"><img style="border-style: none;" src="http://messenger.services.live.com/users/95d9ae68e73c6087@apps.messenger.live.com/presenceimage?mkt=zh-CN" width="16" height="16" />兴图欢迎您!</a></li></td></tr>');
//在线留言
//document.write('<tr><td><li><a href="javascript:;" onclick ="showLiu()"><img style="border-style: none;" src="/images/Online.gif" width="16" height="16" />在线留言</a></li></td></tr>');

document.write("</ul>"); document.write("</div>");

document.write("<div class='b'></div>");

document.write("</div>");

document.write("<div id='divMenu' onmouseover='OnlineOver();'><img src='/qq/qq_1.png' class='press' alt='QQ客服热线'></div>");

document.write("</div>");



//<![CDATA[

var tips; var theTop = 60/*这是默认高度,越大越往下*/; var old = theTop;

function initFloatTips() {
    tips = document.getElementById('divQQbox');
    moveTips();
};

function check(index) {
    if (online[index] == 0) {
        showLiu(0);
        return false;
    }
    return true;
}

var winCpLiu;

function showLiu(id) {
    winCpLiu = new Ext.Window({
        title: '在线留言 ',
        maximizable: false,
        width: 600,
        height: 518,
        autoScroll: true,
        isTopContainer: true,
        constrain: true,
        modal: true,
        resizable: false,
        closeAction: 'close',
        plain: true,
        contentEl: Ext.DomHelper.append(document.body, {
            tag: 'iframe',
            id: "ifraLiu",
            style: "border 0px none;scrollbar:true;margin:0px 0px 0px 0px;",
            frameborder: 0,
            height: "100%",
            width: "100%"
        })
    });
    if (document.getElementById("ifraLiu") != null) {
        document.getElementById("ifraLiu").src = "/Message.aspx?ruan=" + Math.random()+"&id="+id;
    }
    winCpLiu.setPosition(window.innerwidth, 150);
    winCpLiu.show();
}
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 = "89px";

}



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";

}
