﻿window.onerror=function(){return true;}
document.write("<div class='QQbox' id='divQQbox' ><form action='/Home/GuestBook?######' method='post' onsubmit='return qqjsck()' >");
document.write("<div class='Qlist' id='divOnline' onmouseout='hideMsgBox(event)'>"); // onmouseout='hideMsgBox(event);'
document.write("<div class='infobox'>");
document.write("<ul>");
document.write("<li class=qqfont> <A target='blank' href='tencent://message/?uin=635386609&amp;Site=丽夫心灵&amp;Menu=yes'>QQ在线</A></li>");
document.write("<li class=qqfont> <A target='blank' href='tencent://message/?uin=1741712716&amp;Site=丽夫心灵&amp;Menu=yes'>QQ在线</A></li>");
document.write("<li class=msnfont> <A title=点击这里给我发消息 href=msnim:chat?contact=leafush@hotmail.com target=blank>MSN在线</A></li>");
document.write("<li class=msnfont> <A title=点击这里给我发消息 href=msnim:chat?contact=shleafu@hotmail.com target=blank>MSN在线</A></li>");
document.write("<li style='text-align:left;height:15px'>&nbsp;&nbsp;&nbsp;&nbsp;</li>");
document.write("<li style='text-align:right;'><a href='javascript:hideMsgBox(event);' style='color:#fff'>关闭</a></li>");
document.write("</ul>");
document.write("</div>");
document.write("</div>"); 
document.write("<div id='divMenu' onmouseover='OnlineOver();' style='display : none;'><img src='/img/qq_1.jpg' class='press' alt='在线咨询'></div></form>");
document.write("</div>");
//<![CDATA[
var tips; var theTop = 260/*这是默认高度,越大越往下*/; var old = theTop;
var divd=null;
function showgb(){
    var d=document.getElementById("divgb");
    divd=d;
    var t=document.getElementById("textarea");
    var nt=document.getElementById("body");
    d.style.visibility='';
    nt.value=t.value;    
}
function qqjsck(){
    var c=document.getElementById("contact");
    var t=document.getElementById("tel");
    var co=document.getElementById("body");
    if (c.value.length==0 || t.value.length==0 || co.value.length==0 ){
        alert('请填写姓名，手机、电话，和留言内容。');
        return false;
    }
    var p1 = /\d{3,4}-?\d{6,8}/;
    if (p1.test(t.value) == false) {
        alert("电话格式错误");
        return false;
    }
        return true;
    
}
function hidegb(){
    if(!divd)divd=document.getElementById("divgb");
    divd.style.visibility='hidden';
}
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 = "";//145px
}
function OnlineOut(){
document.getElementById("divMenu").style.display = "block";
document.getElementById("divOnline").style.display = "none";
}
if(typeof(HTMLElement)!="undefined")    //给firefox定义contains()方法，ie下不起作用
{   
      HTMLElement.prototype.contains=function(obj)   
      {   
          while(obj!=null&&typeof(obj.tagName)!="undefind"){ //通过循环对比来判断是不是obj的父元素
   　　　　if(obj==this) return true;   
   　　　　obj=obj.parentNode;
   　　}   
          return false;   
      };   
} 
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";
}
