
var lastScrollY = 0;

function heartBeat(){ 
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}
    
//alert(diffY);
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
//document.getElementById("OnlineService").style.top=parseInt(document.getElementById("OnlineService").style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
//alert(lastScrollY);
}
var ImpagePath = "../images/float.jpg";
var webCallUrl = "";
var sIFramURL  = "";

var suspendcode12 = "<div id=\"OnlineService\" style=\"width: 118px;right:1px !important;_right:1px;\">";
var recontent = "<div id=\"float_small\" style=\"right:0px;POSITION:absolute;z-index:100;\"><a href=\"javascript:MM_openBrWindow()\" style=\"color: #0000FF;text-decoration: none;line-height: 20px;font-size:12px;\"><img src=\"" + ImpagePath + "\" border=0/></a></div><div id=\"float_big\" style=\"display:none; background-color:#FFF; border:1px solid #9bbff1; width:325px;right:0px;POSITION:absolute;z-index:100;\"><div style='width:325px;'><table width='325' style=' background-image:url(../images/floatmsgbg.jpg);'><tr><td style='padding-left:3px;'><B'>联系我们</B></td><td align='right'><A href=\"javascript:MM_closeBrWindow()\"><img height=13 alt=\"\" src=\"../images/lunhuan.gif\" width=13></A></td></tr></table><form name='kfform' onsubmit='return checkkf();' mentod='post' action='index.php'><div align='left' style='padding-left:5px;'><LABEL class=beizhu for=comment>需求内容：</LABEL><br /><TEXTAREA id=kf_content style=\"WIDTH: 310px; HEIGHT: 120px; border:1px solid #CCC\" name=kf_content rows=20 cols=1000></TEXTAREA></div><table><tr><td width='60px'><LABEL for=Company><SPAN>主题：</SPAN></LABEL></td><td><INPUT id=\"kf_title\" name=\"kf_title\" style='border:1px solid #CCC' value=\"\"></td></tr><tr><td width='60px'><LABEL for=user><SPAN>姓名：</SPAN></LABEL></td><td><INPUT id=\"kf_user\" style='border:1px solid #CCC' name=\"kf_user\" value=\"\"></td></tr><tr><td width='60px'><LABEL for=email><SPAN>联系邮箱：</SPAN></LABEL></td><td><INPUT id=\"kf_email\" style='border:1px solid #CCC' name=\"kf_email\" value=\"\"></td></tr><tr><td width='60px'><LABEL for=Phone><SPAN>联系电话：</SPAN></LABEL></td><td><INPUT id=\"kf_phone\"  style='border:1px solid #CCC'name=\"kf_phone\" value=\"\"></td></tr><tr><td width='60px'><LABEL for=Address><SPAN>联系地址：</SPAN></td><td><INPUT id=\"kf_address\" name=\"kf_address\" style='border:1px solid #CCC' value=\"\"></td></tr><tr><td></td><td><input type='hidden' name='cid' value=17 /><INPUT class=liuyan_submit id=sendbutton  type=submit value=提交></td></tr></table></FORM></div></div>";
document.write(suspendcode12); 
document.write(recontent);
document.write("</div>"); 
window.setInterval("heartBeat()",1);

function far_close()
{
	document.getElementById("OnlineService").innerHTML="";
}

function setfrme()
{
	var tr=document.getElementById("OnlineService");
	var twidth=tr.clientWidth;
	var theight=tr.clientHeight;
	var fr=document.getElementById("kf");
	fr.width=twidth-1;
	fr.height=theight-30;
}

function MM_openBrWindow() { //v2.0
	document.getElementById("float_small").style.display = 'none';
	document.getElementById("float_big").style.display = 'block';
    document.getElementById("float_big").style.top=document.documentElement.scrollTop + document.documentElement.clientHeight-350+'px';
}

function MM_closeBrWindow() { //v2.0
	var sheight = document.getElementById("float_big").style.top;
	document.getElementById("float_small").style.top=document.documentElement.scrollTop + document.documentElement.clientHeight-110-sheight.replace('px', '') +'px';
	document.getElementById("float_small").style.display = 'block';
	document.getElementById("float_big").style.display = 'none';
}


 var csdnClientHeight=function(){
        return document.documentElement.clientHeight;
    };
var csdnScrollTop=function(){
        return document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
        };
        function mymove21789(){

        document.getElementById("float_big").style.top=document.documentElement.scrollTop + document.documentElement.clientHeight-350+'px';
        document.getElementById("float_big").style.right=1+'px';
        setTimeout("mymove21789();",0);
        }
        mymove21789();

        
        function mymove21790(){
			document.getElementById("float_small").style.top=document.documentElement.scrollTop + document.documentElement.clientHeight-110 + 'px';
			document.getElementById("float_small").style.right=1+'px';
			setTimeout("mymove21790();",0);
        }
        mymove21790()

function checkkf() {
	var title   = document.getElementById("kf_title");
	var user    = document.getElementById("kf_user");
	var phone   = document.getElementById("kf_phone");
	var email   = document.getElementById("kf_email");
	var content = document.getElementById("kf_content");
	var address = document.getElementById("kf_address");
	
	if(content.value=="" || content.value==null )
	{
		alert("请输入内容。");
		content.focus();
		return false;
	}
	if(title.value=="" || title.value==null )
	{
		alert("请输入标题。");
		title.focus();
		return false;
	}
	if(user.value=="" || user.value==null )
	{
		alert("请输入姓名。");
		user.focus();
		return false;
	}
	if(!isEmail(email.value))
	{
		alert("请输入正确的邮箱地址。");
		email.focus();
		return false;
	}
	if(phone.value=="" || phone.value==null )
	{
		alert("请输入联系电话。");
		phone.focus();
		return false;
	}
	if(address.value=="" || address.value==null )
	{
		alert("请输入联系地址。");
		address.focus();
		return false;
	}

function isEmail(vEMail)
{
    var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	return (!regInvalid.test(vEMail)&&regValid.test(vEMail));
}
}
