// JavaScript Document
	var ie = (document.defaultCharset && document.getElementById && !window.home);
	window.onresize = mouldResizeDiv;
	window.onscroll=mouldResizeDiv;
	window.onerror = function(){}
	var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
	var docWidth_1,docWidth_2,docHeight_1,docHeight_2;
	var mould_url = "http://www.2mould.com/images/message/";
	String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
	
	function mouldMsg()
	{
		try{
			divTop = parseInt(document.getElementById("mould_mess").style.top,10);
			divLeft = parseInt(document.getElementById("mould_mess").style.left,10);
			divHeight = parseInt(document.getElementById("mould_mess").offsetHeight,10);
			divWidth = parseInt(document.getElementById("mould_mess").offsetWidth,10);
			docWidth = document.documentElement.clientWidth;
			docHeight = document.documentElement.clientHeight;			
			document.getElementById("mould_mess").style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10 +"px";// divHeight
			document.getElementById("mould_mess").style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth+"px";
			document.getElementById("mould_mess").style.visibility="visible";
			objTimer = window.setInterval("mould_move_div()",10);			
		}catch(e){}
	}
	
	function mould_move_div()
	{
		try{
			if(parseInt(document.getElementById("mould_mess").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
			{
				window.clearInterval(objTimer);
				objTimer1 = window.setInterval("mouldResizeDiv()",1);
			}
			divTop = parseInt(document.getElementById("mould_mess").style.top,10);
			document.getElementById("mould_mess").style.top = divTop - 1+"px";
		}catch(e){}
	}
	
	function mouldResizeDiv()
	{		
		window.clearInterval(objTimer);
		i+=1;
		try{
			divHeight = parseInt(document.getElementById("mould_mess").offsetHeight,10);
			divWidth = parseInt(document.getElementById("mould_mess").offsetWidth,10);
			docWidth_1 = document.body.clientWidth;
			docHeight_1 = document.body.clientHeight;
			docWidth_2 = document.documentElement.clientWidth;
			docHeight_2 = document.documentElement.clientHeight;
			if(docHeight_2 > 0)
			{
				docWidth = docWidth_2;
				docHeight = docHeight_2;
				document.getElementById("mould_mess").style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)+"px";
				document.getElementById("mould_mess").style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)+"px";
			}
			else
			{
				docWidth = docWidth_1;
				docHeight = docHeight_1;
				document.getElementById("mould_mess").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)+"px";
				document.getElementById("mould_mess").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)+"px";
			}
		}catch(e){}
	}
	
	function mould_collapse(obj)
	{
		ct = document.getElementById("tbl_msg");
		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");
		}
		mouldResizeDiv();
	}
	
	function send_message()
	{
		if(!ie)
		{messForm=document.getElementById("messForm");
		}
		objMess = messForm.content;
		objContact = messForm.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;
		}
		
		messForm.submit();
		msee_init();
	}
	
	function msee_init () {
		messForm.content.value = messForm.content.defaultValue;
		messForm.contact.value = messForm.contact.defaultValue;
	}
	
	var s;
	s = '<div id="mould_mess" style="position:absolute; z-index:99999; left:600px; top:600px; visibility:hidden;">'
	+'<iframe src="" name="mould_msg_frm" style="display:none;"></iframe>'
	+'<form id="messForm" name="messForm" method="post" action="submit.asp?action=message" target="mould_msg_frm" style="margin: 0px; padding: 0px;">'
	+'<table width="210" border="0" cellspacing="0" cellpadding="0">'
	+'  <tr>'
	+'	<td width="32" height="20" rowspan="2" valign="bottom"><img src="'+ mould_url +'LyIcon_01.gif" width="32" height="30" /></td>'
	+'	<td width="178" height="9"></td>'
	+'  </tr>'
	+'  <tr>'
	+'	<td width="178" height="21" align="right" background="'+ mould_url +'LyTitBg.gif" style="border-top: #808080 1px solid; border-right: #808080 1px solid; font-size: 12px; color: #808080;" onDblClick="mould_collapse(this.firstChild.nextSibling)">天网网络留言板 <img src="'+ mould_url +'LyIcon_02a.gif" width="15" height="18" align="absmiddle" onclick="mould_collapse(this);" />&nbsp;</td>'
	+'  </tr>'
	+'</table>'
	+'<table width="210" border="0" cellspacing="0" cellpadding="0" style="border: #808080 1px solid;" bgcolor="#FFFFFF" id="tbl_msg">'
	+'  <tr>'
	+'	<td><textarea name="content" id="centent" style="width: 94%; overflow: auto; font-size: 12px; color: #808080; border: #808080 1px solid; margin: 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></td>'
	+'  </tr>'
	+'  <tr>'
	+'	<td><textarea name="contact" id="contact" style="width: 94%; overflow: auto; font-size: 12px; color: #808080; border: #808080 1px solid; margin: 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>'
	+'  </tr>'
	+'  <tr>'
	+'	<td><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">'
	+'	  <tr>'
	+'		<td width="74%" height="40" style="font-size: 12px; color: #808080;">请勿在留言板中发表非法言论，本站观点不代表天网网络观点</td>'
	+'		<td width="26%" height="40" align="right"><img src="'+ mould_url +'LySubmitBtn.gif" width="42" height="31" border="0" style="cursor:pointer;" onclick="send_message();" /></td>'
	+'	  </tr>'
	+'	</table></td>'
	+'  </tr>'
	+'</table>'
	+'<input name="mess_id" type="hidden" id="mess_id" value="'+ mess_id +'" />'
	+'</form>'
	+'</div>';
	
	//if(ie)
	//{
		document.writeln(s);
		mouldMsg();
	//}
	
