﻿// JScript 文件

var menuTopMargin = -139; 
var menuSpeed = 15;
var timerSpeed = 200;
var timer;
var heightLimit = 0;

function checkMenu() {
var eMenu = document.getElementById('floater'); 

if(document.body.offsetHeight > heightLimit) {
   var reTimer = timerSpeed;
   //alert(eMenu.style.top +":"+document.body.scrollTop)
   var startPoint = parseInt(eMenu.style.top,10);
   var endPoint = document.body.scrollTop;
   
   if (window.innerHeight) { 
        endPoint = window.pageYOffset; 
    } 
    else if (document.documentElement && document.documentElement.scrollTop) { 
        endPoint = document.documentElement.scrollTop; 
    } 
    else if (document.body) { 
        endPoint = document.body.scrollTop; 
    } 
    
   endPoint = (menuTopMargin <= endPoint ) ? endPoint - menuTopMargin : 0;
   if(startPoint != endPoint) {
    moveAmount = Math.ceil(Math.abs(endPoint - startPoint) / 15);
    eMenu.style.top = parseInt(eMenu.style.top,10) + ((endPoint<startPoint) ? -moveAmount : moveAmount);
    reTimer = menuSpeed;
   }
} else eMenu.style.top = 0;
timer = setTimeout("checkMenu();",reTimer);
}

function initKeFu() {

if(document.body.offsetHeight > heightLimit){
document.getElementById('floater').style.top = document.body.scrollTop;
}
if(document.getElementById("floater").innerHTML==""){
            document.getElementById("floater").innerHTML='            <div class="service_2">\
<table id="__01" width="118"  border="0" cellpadding="0" cellspacing="0">\
	<tr>\
		<td>\
			<a href="" onclick="document.getElementById(\'floater\').style.display=\'none\';return false;"><img src="index/index_res/kefu_01.jpg" width="118" height="34" alt=""></a></td>\
	</tr>\
	<tr>\
		<td style="background-image:url(index/index_res/kefu_02.jpg); background-repeat:repeat-y;width:118px;height:215px;padding-left:10px;" class="tdkefu">\
			<div> <a href="tencent://message/?uin=798682182&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:798682182:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=1215304813&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:1215304813:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=969819597&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:969819597:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=1002893081&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:1002893081:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=943020899&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:943020899:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=10194562&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:10194562:4 alt="点击发送消息给对方"></span> 在线客服</a></div>\
			<div> <a href="tencent://message/?uin=52447522&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:52447522:4 alt="点击发送消息给对方"></span> 业务洽谈</a></div>\
			<div> <a href="tencent://message/?uin=14996415&Site=www.51yey.cn&Menu=yes"><span><img border="0" SRC=http://wpa.qq.com/pa?p=1:14996415:4 alt="点击发送消息给对方"></span> 技术支持</a></div>\
			</td>\
	</tr>\
	<tr>\
		<td>\
			<img src="index/index_res/kefu_04.jpg" width="118" height="7" alt=""></td>\
	</tr>\
	<tr>\
		<td>\
			<a href="tencent://message/?uin=52447522&Site=www.51yey.cn&Menu=yes"><img src="index/index_res/kefu_05.jpg" width="118" height="30" alt=""></a></td>\
	</tr>\
	<tr>\
		<td>\
			<img src="index/index_res/kefu_06.jpg" width="118" height="3" alt=""></td>\
	</tr>\
	<tr>\
		<td>\
			<a href="tencent://message/?uin=10194562&Site=www.51yey.cn&Menu=yes"><img src="index/index_res/kefu_07.jpg" width="118" height="30" alt=""></a></td>\
	</tr>\
	<tr>\
		<td>\
			<img src="index/index_res/kefu_08.jpg" width="118" height="24" alt=""></td>\
	</tr>\
</table>\
                            </div>';
}
checkMenu();
}
