<ad:set name="classid" value="$word(request("id"),"id")$" />
<form name="form1" method="post" action="$sitepath$PostSubmit.aspx">
<input type="hidden" name="table" value="c_guestbook">
<input type="hidden" name="isinputip" value="true">
<input type="hidden" name="returnurl" value="$url("default.aspx?diy=message")$">
<input type="hidden" name="codeerror" value="$url("default.aspx?diy=message&type=codeerror")$">
<input type="hidden" name="C_ClassID" value="$classid$">
<table class="table" width="100%">
<tr>
	<td style="text-align:center;">留言内容</td>
	<td><textarea name="c_content" rows="2" cols="20" id="c_content" style="height:80px;width:99%;"></textarea></td>
</tr>
<tr>
	<td style="text-align:center;">您的姓名</td>
	<td><input name="c_name" type="text" id="c_name" style="width:80px" />&nbsp;&nbsp;Email&nbsp;&nbsp;<input name="c_email" type="text" id="c_email" style="width:150px" />&nbsp;&nbsp;验证码&nbsp;&nbsp;<input name="c_validate" type="text" id="c_validate" style="width:50px" />&nbsp;<img src="$sitepath$Validate.aspx" alt="看不清？点击更换" onclick="this.src='$sitepath$Validate.aspx?random=' + Math.random()" style="cursor:pointer;border:1px solid #391107; position:absolute" /></td>
</tr>
<tfoot>
<tr>
	<td colspan="2" align="center"><input type="submit" name="ButtonInsert" value=" 提 交 " id="ButtonInsert" />&nbsp;&nbsp;<input type="reset" value=" 重 置 " /></td>
</tr>
</tfoot>
</table>
</form>
<div class="tip">
	<div></div>
</div>
<br />
<ad:foreach collection="$page("c_guestbook","5","classid=$classid$","inputdate desc, id desc")$" var="it" index="i">
<div class="guestbooktitle"><a name="$i$"></a><strong>姓名：</strong>$htmlencode(it["name"])$　　<strong>提交时间：</strong>$it["inputdate"]$　　<strong>邮箱：</strong>$htmlencode(it["email"])$</div>
<div class="guestbookcontent">$htmlencode(it["content"])$</div>
<div class="guestbookrecontent">回复：$htmlencode(it["recontent"])$</div>
</ad:foreach>
<div class="page"><span>$page["PageNumAll"]$</span>总记录：$Page["RecordCount"]$&nbsp;&nbsp;总分页：$Page["PageCount"]$&nbsp;&nbsp;当前页：$Page["PageNum"]$</div>
<script type="text/javascript">
$$(".tip").hide();
$$("#ButtonInsert").click(function()
{
	$$(".tip").hide();

	if($$("#c_content").val() == "")
	{
		$$(".tip").show();
		$$(".tip div").text('请输入留言内容！');
		$$("#c_content").focus();
		return false;
	}

	if($$("#c_name").val() == "")
	{
		$$(".tip").show();
		$$(".tip div").text('请输入您的姓名！');
		$$("#c_name").focus();
		return false;
	}

	if($$("#c_email").val() == "")
	{
		$$(".tip").show();
		$$(".tip div").text('请输入Email！');
		$$("#c_email").focus();
		return false;
	}

	if($$("#c_validate").val() == "")
	{
		$$(".tip").show();
		$$(".tip div").text('请输入验证码！');
		$$("#c_validate").focus();
		return false;
	}
})
</script>