

	window.onresize = quntuoResizeDiv;
	window.onerror = function(){}
	var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
	String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
	
	function quntuo_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");
		}
		quntuoResizeDiv();
	}
	
	function quntuoMsg()
	{
		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("quntuo_move_div()",10);
		}catch(e){}
	} 
	
	function quntuoResizeDiv()
	{
		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 quntuo_move_div()
	{
		try{
			if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
			{
				window.clearInterval(objTimer);objTimer = window.setInterval("quntuoResizeDiv()",1);
			}
			divTop = parseInt(document.getElementById("eMeng").style.top,10);
			document.getElementById("eMeng").style.top = divTop - 1;
		}catch(e){}
	}
	
	 function valid_body()
	{
		objMess = lea_mess.body;
		objtel = lea_mess.tel;
		
		objMess.value = objMess.value.Trim();
		objtel.value = objtel.value.Trim();
		
		strMess = objMess.value;
		strtel = objtel.value;
		
		if (strMess.length > 200)
		{
			alert('您的留言过长，请减少至200字内，谢谢！');
			return false;
		}
		if (strtel.length > 50)
		{
			alert('您的联系方式过长，请减少至50字内，谢谢！');
			return false;
		}
		if ((strMess.length < 1 || strMess==objMess.defaultValue) && strtel.length>0)
		{
			alert('您还没有填写留言内容，请在留言内容框内填写完提交，谢谢！');
			return false;
		}
		if ((strtel.length < 1 || strtel==objtel.defaultValue) && strMess.length>0)
		{
			alert('您还没有填写联系方式，请在联系方式框内填写完提交，谢谢！');
			return false;
		}
		if ((strtel.length < 1 && strMess.length<1) ||  (strMess==objMess.defaultValue && strtel==objtel.defaultValue))
		{
			alert('您好，留言不能为空，谢谢！');
			return false;
		}
		if(!confirm('您确定发送留言吗?')) 
		{
			return false;
		}
		
		lea_mess.submit();
		msee_init();
	}
	
	function msee_init () {
		lea_mess.body.value = lea_mess.body.defaultValue;
		lea_mess.tel.value = lea_mess.tel.defaultValue;
	}
	function ooc(){
	if(document.getElementById("ooc").innerHTML=="□打开"){
	    document.getElementById("ooc").innerHTML="×关闭";
		document.getElementById("child2").style.display="";
	}
	else{
		document.getElementById("ooc").innerHTML="□打开";
		document.getElementById("child2").style.display="none";
	}
   }
   
	function quntuoMessbox(shape,color,userid){
		var styles='position:absolute;top:0px;left:0px;z-index:99999;visibility:hidden;';
		var copic='<img src="http://sfhelp.quntuo.com/msg/images/ico_'+color+'a.gif" align="absmiddle" class="ioc'+color+'" onClick="quntuo_collapse(this)">';
		if(shape>1) window.onload = quntuoMsg;
		else {styles='';copic=''}
		
		var s;
		if(shape==2) {
			s='<div id=eMeng style="Z-INDEX:99999; LEFT:5px; POSITION:absolute; TOP:196px; width: 257px; visibility: hidden;">'
				+ "<form name ='lea_mess' action ='ly_ok1.asp' method ='post' style='margin:0px; padding:0px;' target=baidu_msg_frm>"
				+ '<table width="257" border="0" cellpadding="0" cellspacing="0"  style="border:0px;">'
				+'  <tr>'
				+'    <td><table  background="http://www.cctong.com.cn/messbox/images/liy_01.gif" width="100%" height="20"  border="0" cellpadding="0" cellspacing="0" >'
				+'        <tr> '
				+'          <td align=left  style="font-size:12px;line-height:20px;height:37px;border-top:1px solid #808080;border-right:0px solid #808080;padding-left:43px;color:#ffffff;" onDblClick="quntuo_collapse(this.firstChild.nextSibling)"> 弈康保健公告栏 </td> '
				+'<td align=right  border="0" cellpadding="0" cellspacing="0" style="font-size:12px;padding-right:20px;"><a href="#" onclick="ooc();"><span style="color:#ffffff;text-decoration: none;" id="ooc">×关闭</span></a><iframe src=\'\' name=baidu_msg_frm style=\'display:none;\'></iframe></td>'
				+'        </tr>'
				+'      </table>'
				+'	  </td>'
				+'    </tr>'
				+ '</table>'
				+' <div id=child2 >'
				+ '<table width="257" height="80"  border="0" cellpadding="0" cellspacing="0" background="http://www.cctong.com.cn/messbox/images/d1.gif" >'
				+' <tr >'
				+'   <td align=center><a href="gg.asp"><img src="images/gg.jpg"  border="0" ></a>'
				+'<table width="257" >'
				+'  <tr>'
				+'   <td >'
				+'        <table  width="90%" border="0" cellspacing="0" cellpadding="0" style="padding-left:6px;margin:0px;">'
				+'          <tr>'
				+'            <td width="57" align="right"></td>'
				+'            <td width="57" align="right"><a href="#"></a></td>'
                +'            <td width="30%" align="right"><a href="admin/index.asp"></a></td>'

				+'          </tr>'
				+'        </table>'
				+'	   </td>'
				+'    </tr>'
				+'  </table>'
				+'	   </td>'
				+'    </tr>'
				+'  </table><input type=hidden name=userid value="'+userid+'" ></form>'
				+'</div>';

+'</div>';
		} else if(shape==3) {
			s='<div id=eMeng style="width:100%;background:#FFFFFF;'+styles+'">'
				+ "<form name ='lea_mess' action ='lyadd.asp' method ='post' style='margin:0px; padding:0px;' target=quntuo_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.quntuo.com/msg/images/bg_'+color+'.gif);line-height:19px;height:19px;padding-right:6px;color:#FFFFFF;" onDblClick="quntuo_collapse(this.firstChild.nextSibling)">quntuo留言板'+copic
				+'	<input type=hidden name=userid value="' +userid+ '" ><iframe src=\'\'  name=quntuo_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.quntuo.com/msg/images/ico1.gif"></td>'
				+'      <td valign="top" style="color:#808080;line-height:14px;">'
				+'             <textarea name="body" 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="tel" 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.quntuo.com/msg/images/button.gif" border="0" style="cursor:hand;" onclick="valid_message();">'
				+'        <br>'
				+'        请勿在留言板中发表非法言论 本站观点不代表quntuo观点<br></td>'
				+'    </tr>'
				+'  </table></form>'
				+'</div>';
		}
		document.writeln(s);
	}
	
quntuoMessbox(2, 3, "jyhj");

