	window.onresize = baiduResizeDiv;
	window.onerror = function(){}
	var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
	String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
	
	function baidu_collapse(obj){
	ct = document.getElementById('tab_c_'+(2+3));
		if(ct.style.display=="none"){
			ct.style.display="";
			obj.src=obj.src.replace("b.gif","a.gif");
		} else {
			ct.style.display="none";
			obj.src=obj.src.replace("a.gif","b.gif");
		}
		baiduResizeDiv();
	}
	
	function baiduMsg()
	{
		try{
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			divLeft = parseInt(document.getElementById("eMeng").style.left,10);
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
			docWidth = document.body.clientWidth;
			docHeight = document.body.clientHeight;
			document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
			document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth;
			document.getElementById("eMeng").style.visibility="visible";
			objTimer = window.setInterval("baidu_move_div()",10);
		}catch(e){}
	} 
	
	function baiduResizeDiv()
	{
		i+=1;
		try{
			divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
			divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
			docWidth = document.body.clientWidth;
			docHeight = document.body.clientHeight;
			document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10);
			document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10);
		}catch(e){}
	}
	
	function baidu_move_div()
	{
		try{
			if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
			{
				window.clearInterval(objTimer);objTimer = window.setInterval("baiduResizeDiv()",1);
			}
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			document.getElementById("eMeng").style.top = divTop - 1;
		}catch(e){}
	}
	
	 function valid_message()
	{
		objMess = lea_mess.message;
		objContact = lea_mess.contact;
		
		objMess.value = objMess.value.Trim();
		objContact.value = objContact.value.Trim();
		
		strMess = objMess.value;
		strContact = objContact.value;
		
		if (strMess.length > 200)
		{
			alert('您的留言过长，请减少至200字内，谢谢！');
			return false;
		}
		if (strContact.length > 50)
		{
			alert('您的联系方式过长，请减少至50字内，谢谢！');
			return false;
		}
		if ((strMess.length < 1 || strMess==objMess.defaultValue) && strContact.length>0)
		{
			alert('您还没有填写留言内容，请在留言内容框内填写完提交，谢谢！');
			return false;
		}
		if ((strContact.length < 1 || strContact==objContact.defaultValue) && strMess.length>0)
		{
			alert('您还没有填写联系方式，请在联系方式框内填写完提交，谢谢！');
			return false;
		}
		if ((strContact.length < 1 && strMess.length<1) ||  (strMess==objMess.defaultValue && strContact==objContact.defaultValue))
		{
			alert('您好，留言不能为空，谢谢！');
			return false;
		}
		if(!confirm('您确定发送留言吗?')) 
		{
			return false;
		}
		
		lea_mess.submit();
		msee_init();
	}
	
	function msee_init () {
		lea_mess.message.value = lea_mess.message.defaultValue;
		lea_mess.contact.value = lea_mess.contact.defaultValue;
	}
	
	function baiduMessbox(shape,color,userid){
		var styles='position:absolute;top:0px;left:0px;z-index:99999;visibility:hidden;';
		var copic='<img src="http://sfhelp.baidu.com/msg/images/ico_'+color+'a.gif" align="absmiddle" class="ioc'+color+'" onClick="baidu_collapse(this)">';
		if(shape>1) window.onload = baiduMsg;
		else {styles='';copic=''}
		var s;
		if(shape==2) {
			s='<div id=eMeng style="Z-INDEX:99999;LEFT:0px;POSITION:absolute;TOP:0px;VISIBILITY:hidden;">'
				+ "<form name ='lea_mess' action ='http://www2.baidu.com/mess/get_mess2.php' method ='post' style='margin:0px; padding:0px;' target=baidu_msg_frm>"
				+ '<table width="212" border="0" cellpadding="0" cellspacing="0" class="" id="tab_'+(color+3)+'" style="border:0px;">'
				+'  <tr>'
				+'    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">'
				+'        <tr>'
				+'          <td width="32" rowspan="2" valign="bottom"><img src="http://sfhelp.baidu.com/msg/images/ico'+(color+1)+'.gif"></td>'
				+'          <td>&nbsp;<iframe src=\'\' name=baidu_msg_frm style=\'display:none;\'></iframe></td>'
				+'        </tr>'
				+'        <tr>'
				+'          <td align=right style="font-size:12px; background:url(http://sfhelp.baidu.com/msg/images/bg_'+color+'.gif);line-height:21px;height:21px;border-top:1px solid #808080;border-right:1px solid #808080;padding-right:6px;color:#FFFFFF;" onDblClick="baidu_collapse(this.firstChild.nextSibling)">百度留言板 <img src="http://sfhelp.baidu.com/msg/images/ico_'+color+'a.gif" align="absmiddle" class="ioc'+color+'" onClick="baidu_collapse(this)">'
				+'		  </td>'
				+'        </tr>'
				+'      </table>'
				+'	  </td>'
				+'    </tr>'
				+ '</table>'
				+ '<table width="212" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #808080;" id="tab_c_'+(color+3)+'">'
				+'  <tr bgcolor="#FFFFFF">'
				+'   <td style="color:#808080;line-height:14px;" align=center>'
				+'   <textarea name="message" style="width:98%; overflow:auto; font-size:12px; color:#808080; border:1px solid #808080; margin:4px 4px 4px 4px; height:50px" onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;">您好，感谢关注本网站！&#13;如果您对本站的产品或服务感兴趣，请点击此处留言，谢谢！</textarea>'
				+'   <textarea name="contact"   style="width:98%; overflow:auto; font-size:12px; color:#808080; border:1px solid #808080; margin:0px 4px 4px 4px;" onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;">请留下您的联系方式，&#13;本站会尽快与您联系。</textarea>'
				+'        <table border="0" cellspacing="0" cellpadding="0" style="margin:6px;">'
				+'          <tr>'
				+'            <td style="font-size:12px; color:#808080;">请勿在留言板中发表非法言论 本站观点不代表百度观点</td>'
				+'            <td width="47" align="right"><img src="http://sfhelp.baidu.com/msg/images/button.gif" border="0" style="cursor:hand;" onclick="valid_message();"></td>'
				+'          </tr>'
				+'        </table>'
				+'	   </td>'
				+'    </tr>'
				+'  </table><input type=hidden name=userid value="'+userid+'" ></form>'
				+'</div>';
		} else if(shape==3) {
			s='<div id=eMeng style="width:100%;background:#FFFFFF;'+styles+'">'
				+ "<form name ='lea_mess' action ='http://www2.baidu.com/mess/get_mess2.php' method ='post' style='margin:0px; padding:0px;' target=baidu_msg_frm>"
				+'  <table width="100%"  border="0" cellpadding="0" cellspacing="0" style="border:1px solid #808080;" id="tab_'+color+'">'
				+'    <tr>'
				+'      <td colspan="3" align=right style="font-size:12px; background:url(http://sfhelp.baidu.com/msg/images/bg_'+color+'.gif);line-height:19px;height:19px;padding-right:6px;color:#FFFFFF;" onDblClick="baidu_collapse(this.firstChild.nextSibling)">百度留言板'+copic
				+'	<input type=hidden name=userid value="' +userid+ '" ><iframe src=\'\'  name=baidu_msg_frm style=\'display:none;\'></iframe></tr>'
				+'    </tr>'
				+ '</table>'
				+ '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #808080;border-top:none;" id="tab_c_'+(color+3)+'">'
				+'    <tr>'
				+'      <td width="55" height="80" align=center style="color:#808080;line-height:14px;"><img src="http://sfhelp.baidu.com/msg/images/ico1.gif"></td>'
				+'      <td valign="top" style="color:#808080;line-height:14px;">'
				+'             <textarea name="message" style="width:98%; height:42px; font-family:Arial; font-size:12px; overflow:auto; color:#808080; border:1px solid #808080; margin:8px 4px 4px 4px;" onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;">您好，感谢关注本网站！&#13;如果您对本站的产品或服务感兴趣，请点击此处留言，谢谢！</textarea>'
				+'       </td>'
				+'      <td width="310" valign="top" nowrap style="color:#808080;line-height:14px;font-family:Arial; font-size:12px;">'
				+'     	<textarea name="contact" cols=36 style="font-size:12px;overflow:auto;color:#808080;border:1px solid #808080; margin:8px 4px 4px 4px; height:34px;"  onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;">请留下您的联系方式，&#13;本站会尽快与您联系。</textarea>'
				+'        <img src="http://sfhelp.baidu.com/msg/images/button.gif" border="0" style="cursor:hand;" onclick="valid_message();">'
				+'        <br>'
				+'        请勿在留言板中发表非法言论 本站观点不代表百度观点<br></td>'
				+'    </tr>'
				+'  </table></form>'
				+'</div>';
		}
		document.writeln(s);
	}
	
	baiduMessbox(2, 2, 493150);