<!--{if(Get("style")=="new_style")}-->
<!--#include file="_header.html"-->
<script language='javascript' src='templates/<%=Dvbbs.Utils.TemplateInfo.CurrentTemplateName%>/scripts/message_send.js'></script>
<script type="text/javascript" language="javascript">
	function chkPost()
{
	var f = document.forms[0];
	if (f.recipient.value.trim() == '')
	{
		alert('没有填写接收者的昵称!');
		f.recipient.focus();
		return false;
	}
	if (len(f.recipient.value) > 16)
	{
		alert('接收者的昵称长度应该在8个汉字或16个字母以内!');
		f.recipient.focus();
		return false;
	}
	if (f.recipient.value.trim() == f.self.value)
	{
		alert('不要自言自语，接收者不能是自己!');
		f.recipient.focus();
		return false;
	}
	if (f.title.value.trim() == '')
	{
		alert('没有填写短消息标题!');
		f.title.focus();
		return false;
	}
	if (len(f.title.value) > 50)
	{
		alert('消息标题不得超过50个英文字符或25个中文字符!');
		f.title.focus();
		return false;
	}
	if (f.content.value.trim() == '')
	{
		alert('没有填写短消息内容!');
		f.content.focus();
		return false;
	}
	
	if (f.verification)
	{
		if (!f.verification.disabled && f.verification.value=='')
		{
			alert('请正确输入验证码');
			f.verification.focus();
			return false;
		}
	}
	return true;
}
//显示验证码<%=Fetch.ValidateCodeFileName%>
function showVerify(obj, ValidateCodeFileName)
{
	var l = getOffsetLeft(obj) - 40;
	var t = getOffsetTop(obj) - 70;
	$("verifyCode").innerHTML = "<img src='" + ValidateCodeFileName + "?time="+ new Date()+"' alt='看不清图片请点空白处' border='1' style='cursor:hand; margin-top:-1px'>";
	$("verifyCode").style.left = l + "px";
	$("verifyCode").style.top  = t + "px";
	$("verifyCode").style.display = 'block';
}
//隐藏验证码
function hiddenVerify()
{	
	$("verifyCode").innerHTML = "";
}
</script>
<div class="mainbox">
  <div class="notice">
     <span><!--#include file="_nav.html"--></span>
  </div>
</div>
<div style="clear:both"></div>
<form name="delete" method="post" action="message_send.aspx?style=new_style&name=<%=Get("recipient")%>" id="Form1">
	<input name="self" id="Hidden2" type="hidden" value="<%=base.user.Name%>" />
	<table class="tablebox tableborder" cellspacing="0" cellpadding="0" ID="Table2">
		<tr>
			<th colspan="2">
				短消息发送中心</th>
		</tr>
		<tr>
			<td>接收者昵称</td>
			<td><input name="recipient" id="Text2" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this);" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" type="text" style="width:120px" maxlength="12" value="<%=recipient%>" />
				目前设置不支持同时发送给多人</td>
		</tr>
		<tr>
			<td>消息标题</td>
			<td><input name="title" id="Text3"  onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this);" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" type="text"  style="width:420px" maxlength="50" value="<%=title%>" /></td>
		</tr>
		<tr>
			<td valign='top'>消息内容<br /><br />1000字以内</td>
			<td><textarea name="content" id="Textarea1" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this);"	onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" style="width:99%" rows="8"><%=Server.HtmlEncode(content)%></textarea>
			</td>
		</tr>
		<!--{if(isCheckVerifyCode)}-->
		<tr>
			<td>验证码</td>
			<td><input type='text' name='verification' autocomplete="Off" onFocus="IEvent('focus',this);showVerify(this, '<%=Fetch.ValidateCodeFileName%>');" onBlur="IEvent('blur',this);hiddenVerify();" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" maxlength='6' size="10" />
				<div id="verifyCode" style="display:none;position:absolute;"></div>
			</td>
		</tr>
		<!--{endif}-->
		<tr align="center">
			<td colspan="2"><input type='submit' class="button_off" onmouseover="this.className='button_on'" onmouseout="this.className='button_off'"
					value='发 送' onclick='return chkPost()' ID="Submit2" NAME="Submit1" /> &nbsp;
					<input type='reset' class="button_off" onmouseover="this.className='button_on'" onmouseout="this.className='button_off'" value='取 消' onclick="location.href='javascript:history.back()'" ID="Reset1" NAME="Reset1"/>
			</td>
		</tr>
		<tr align="center">
			<td colspan="2">
				<p class='t2'>本功能只为方便论坛会员之沟通和联系，请不要在短消息中发送个人隐私、保密数据等重要信息，本论坛不承担任何责任。</p>
			</td>
		</tr>
	</table>
</form>
<!--#include file="_footer.html"-->
<!--{else}-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
		<title>
			<%=Property.bbsName%>
		</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<link href="<%=CurrentSkinPath%>style.css" rel="stylesheet" type="text/css" />
		<script src="templates/<%=CurrentTemplateName%>/scripts/common.js"></script>
		<script src="templates/scripts/dvajax.js"></script>
		<script type="text/javascript" language="javascript">
		function chkPost()
		{
			var form = document.forms['messend'];
			var ajax = new DvAjax();
			ajax.SubmitForm(form, function (xmlHttp) {
				var resp_text = xmlHttp.responseText;
				if ('0' === resp_text)
				{
					alert('恭喜您,操作成功!');
					window.parent.TB_remove();
					//window.parent.location.reload();
				}
				else
				{
					alert('操作失败,错误信息:' + resp_text);
				}
			});
			return false;
		}
		//显示验证码<%=Fetch.ValidateCodeFileName%>
		function showVerify(obj, ValidateCodeFileName)
		{
			var l = getOffsetLeft(obj) - 40;
			var t = getOffsetTop(obj) - 70;	
			$("verifyCode").innerHTML = "<img src='" + ValidateCodeFileName + "?time="+ new Date()+"' alt='看不清图片请点空白处' border='1' style='cursor:hand; margin-top:-1px'>";
			$("verifyCode").style.left = l + "px";
			$("verifyCode").style.top  = t + "px";
			$("verifyCode").style.display = 'block';
		}
		//隐藏验证码
		function hiddenVerify()
		{	
			$("verifyCode").innerHTML = "";
		}
		</script>
	</head>
	<body MS_POSITIONING="GridLayout">
	<br />
		<form name="messend" method="post" action="message_send.aspx" id="messend">
			<input type="hidden" value="newstyle" id="newstyle" name="newstyle" /> <input name="self" id="self" type="hidden" value="<%=base.user.Name%>" />
			<table class="tablebox tableborder" style="font-size:12px;text-align: left; " width="100%" border="0" cellspacing="0" cellpadding="0" ID="Table1">
				<tr>
					<td>接收者昵称</td>
					<td><input name="recipient" id="recipient" type="text" style="width:120px" maxlength="12" value="<%=recipient%>"<!--{if(recipient!=null)}-->  readonly="readonly"<!--{endif}--> /> 目前设置不支持同时发送给多人</td>
				</tr>
				<tr>
					<td>消息标题</td>
					<td><input name="title" id="title" onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this);" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"  type="text"  style="width:420px" maxlength="50" value="<%=title%>" /></td>
				</tr>
				<tr>
					<td valign='top'>消息内容<br />
						<br />
						1000字以内</td>
					<td>
						<textarea onFocus="IEvent('focus',this);" onBlur="IEvent('blur',this);" onMouseOver="IEvent('mouseover',this)"	onMouseOut="IEvent('mouseout',this)" name="content" id="content" style="width:99%" rows="8"><%=Server.HtmlEncode(content)%></textarea>
					</td>
				</tr>
				<!--{if(isCheckVerifyCode)}-->
				<tr>
					<td>验证码</td>
					<td>
						<input type='text' name='verification' maxlength='6' size="10" autocomplete="Off" onFocus="IEvent('focus',this);showVerify(this, '<%=Fetch.ValidateCodeFileName%>');" onBlur="IEvent('blur',this);hiddenVerify();" onMouseOver="IEvent('mouseover',this)"
						onMouseOut="IEvent('mouseout',this)"  ID="Text1"/>
						<div id="verifyCode" style="display:none;position:absolute;"></div>
					</td>
				</tr>
				<!--{endif}-->
				<tr>
					<td colspan="2" align="center">
						<input type="checkbox" class="checkbox" name="draft" value="draft">存为草稿 <input type='submit' class="button_off" onmouseover="this.className='button_on'" onmouseout="this.className='button_off'"	onclick="return chkPost();" value='发 送' ID="Submit1" NAME="Submit1" /> &nbsp;&nbsp;&nbsp;
						<input type='reset'onclick="window.parent.TB_remove()"  class="button_off" onmouseover="this.className='button_on'" onmouseout="this.className='button_off'"' value='取 消'  ID="Reset1" NAME="Reset1" ID="Reset1" NAME="Reset1"/>					
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
<!--{endif}-->
