
	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 (document.all.checknum.length <1 || document.all.checknum.value=='请输入验证码')
		{
			alert('请输入验证码！');
			return false;
		}
		if (document.all.checknum.value!=talk_chnum1)
		{
			alert('验证码输入不正确！');
			return false;
		}
		if (strMess.length > 20)
		{
			alert('您的评论过长，请减少至20字内，谢谢！');
			return false;
		}
		if (strContact.length > 200)
		{
			alert('您的名称方式过长，请减少至200字内，谢谢！');
			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;
		}
		
		
		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 ='../save_talk.asp?id="+gsid1+"' method ='post' style='margin:0px; padding:0px;'>"
				+ '<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="../../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(../../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)">发表评论 &nbsp;&nbsp;&nbsp;&nbsp;最小化窗口→<a href="#"><img border=0 src="../../images/ico_'+color+'a.gif" align="absmiddle" class="ioc'+color+'" onClick="baidu_collapse(this)"></a>'
				+'		  </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>'
				+'   <input name="message" type="text" style="width:98%; overflow:auto; font-size:12px; color:#808080; border:1px solid #808080; margin:4px 4px 4px 4px; height:20px" onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;" value="请填写上您的名称。" />'
				+'   <textarea name="contact"   style="width:98%; overflow:auto; font-size:12px; color:#808080; border:1px solid #808080; margin:0px 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>'
				+'<table width="100%" border="0" cellspacing="2" cellpadding="0"><tr><td width="60%"><input name="checknum" type="text" style="width:100%; overflow:auto; font-size:12px; color:#808080; border:1px solid #808080; margin:0px 4px 4px 4px;height=20px;" onfocus="if (this.value == this.defaultValue) this.value=\'\';" onblur="this.value=this.value.Trim(); if (this.value==\'\') this.value=this.defaultValue;" value="请输入验证码" /></td><td width="40%"><font color="red">'+talk_chnum1+'</font></td></tr></table>'
				+'        <table border="0" cellspacing="0" cellpadding="0" style="margin:0px;">'
				+'          <tr>'
				+'            <td style="font-size:12px; color:#808080;">共条<font color=red>'+talk_count1+'</font>评论</td>'
				+'            <td width="130" align="right"><img src="../../images/viewtalk.gif" border="0" style="cursor:hand;" onclick=javascript:window.open("../viewtalk_all.asp?id='+gsid1+'");>&nbsp;&nbsp;<img src="../../images/sendbutton.gif" border="0" style="cursor:hand;" onclick="valid_message();"></td>'
				+'          </tr>'
				+'        </table>'
				+'<tr> <td height=6 bgcolor="#FFFFFF"></td></tr>'
				+'	   </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 ='../save_talk.asp?id="+gsid1+"' method ='post' style='margin:0px; padding:0px;' >"
				+'  <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;">请填写上您的名称。</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, 545224);
