<div id="maincontent">
<script type="text/javascript" language="Javascript" >
function	ChangImg()
{	
	var checkcode = $("#imgcode").get(0);
	var dt = new Date();
	checkcode.src = "<{$baseUrl}>/admin/auth/imgcode/t=" + dt;	
}
function reviewMess(id,title)
{	$("#messageid").val("");
	var	messageid=$("#messageid").val(id);
	var	title=$("#title").val('回复:'+title);
	
	//alert(id);
}
function ChangePhoto()
{
		var headimg=$("#headimg").val();
		//alert(headimg);
		var checkcode = $("#headimgs").get(0);
		
		checkcode.src = "<{$baseUrl}>/public/images/headimg/"+headimg+".png";
}
function	submitmess()
{	
	var headimg=$("#headimg").val();
	var username=$("#username").val();
	var	email=$("#email").val();
	var	content=$("#comcontent").val();
	var	imgcode=$("#code").val();
	var	title=$("#title").val();
	var	messageid=$("#messageid").val();
	if(title==''){
		alert("留言标题不能为空!");
	}else if(username==''){
		alert("您的大名不能为空!");
	}else if(email==''){
		alert("电子邮箱不能为空!");
	}else if(imgcode==''){
		alert("验证码不能为空!");
	}else if(content==''){
		alert("请发表点您的留言吧!");
	}else{
	
	$.post("<{$baseUrl}>/message/message/",{username:username,headimg:headimg,messageid:messageid,title:title,content:content,imgcode:imgcode,email:email},
			function(data){
				//alert(data);
				var   strArray=new   Array();   
				strArray=data.split("||||");
				if(strArray[0]==0){
					$("#email").val('');
					$("#comcontent").val('');
					$("#code").val('');
					$("#nameflag").empty();
					
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					var checkcode = $("#imgcode").get(0);
					var dt = new Date();
					checkcode.src = "<{$baseUrl}>/admin/auth/imgcode/t=" + dt;	
					$("#commentflag").empty();
					$("#messageid").val('0');
					$("#title").val('');
					$("#successflag").html(strArray[1]); 
					$("#commentflag").html(strArray[2]);
				}else if(strArray[0]==1){
					$("#nameflag").empty();
					$("#successflag").empty();
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					$("#nameflag").html(strArray[1]); 
				}else if(strArray[0]==2){
					$("#nameflag").empty();
					$("#successflag").empty();
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					$("#successflag").html(strArray[1]); 
				}else if(strArray[0]==3){
					$("#nameflag").empty();
					$("#successflag").empty();
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					$("#contentflag").html(strArray[1]); 
				}else if(strArray[0]==4){
					$("#nameflag").empty();
					$("#successflag").empty();
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					$("#codeflag").html(strArray[1]); 
				}else if(strArray[0]==5){
					$("#nameflag").empty();
					$("#successflag").empty();
					$("#contentflag").empty();
					$("#codeflag").empty();
					$("#emailflag").empty();
					$("#emailflag").html(strArray[1]); 
				}
				
			});
	}
}
</script>

<div id="content">


<div class="sidebox" style="width:870px">
<div class="commentInner" style="width:860px">
	
		<div id="commentflag">
<{section name=MessageList  loop=$arrMessages }>
			 <div class="messcontent"> 
			 <h2 style="width:860px;font-size:15px;color:green;font-weight:bold;"><span style="font-size:18px;color:#555555;">标题:</span><{$arrMessages[MessageList].title|truncateex:50:'..':true}></h2>
			 <p style="width:860px;text-align:right;color:green;font-size:20px;font-weight:bold;"><{$smarty.section.MessageList.index+1+$offsetnums}>#&nbsp;</p>
	
				 <div class="messleft"><a href="#">
				 <img style="text-align:center;margin-bottom:10px;" src="<{$baseUrl}>/public/images/headimg/<{if $arrMessages[MessageList].headimg==''}>default.gif<{else if}><{$arrMessages[MessageList].headimg}>.png<{/if}>"  alt="留言者的头像"></a>
				 <p style="text-align:center;margin-top:10px;"><a href="#"><{$arrMessages[MessageList].author|truncateex:10:'..':true}></a></p>
				 </div>
				 <div class="messright">
	 				<div class="clear"></div>
		     		<div class="messtop"></div>
		     		<div class="messtext"><div class="messment" style="color:green;"><p><{$arrMessages[MessageList].content}></p></div></div>
		     		<div class="messbot"></div>
					<div class="clear"></div>
				</div>
				
			
<div style="float:right;width:700px;">
<{section name=ReviewList  loop=$arrReview }>
<{if $arrReview[ReviewList].pid==$arrMessages[MessageList].id }>
	<div style="width:592px;" class="box">				
    <div class="rtr"><div class="a4"></div><div class="a3"></div><div class="a2"></div><div class="a1"></div><div class="a0"></div></div>
		<div class="inner">
			<div style="padding:5px;"><{$arrReview[ReviewList].content}></div>
			<div style="float:left;margin:10px 0px 0px 0px;">
				<img src="<{$baseUrl}>/public/images/author.png" alt="author">
				回复者:<{$arrReview[ReviewList].author|truncateex:10:'..':true}>
				<img src="<{$baseUrl}>/public/images/date.png" alt="date">回复时间:<{$arrReview[ReviewList].addtime}>| 
				<img src="<{$baseUrl}>/public/images/filed.png" alt="filed">回复者地址:<{$arrReview[ReviewList].address}>
				 </div>
				 <div class="clear"></div>
		</div>
	<div class="rtr"><div class="a0"></div><div class="a1"></div><div class="a2"></div><div class="a3"></div><div class="a4"></div></div>
   <div class="clear"></div> 
</div>
<{/if}>
<{/section}>
</div>
				<div class="clear"></div>
				<div class="date" style="margin:30px 0px 10px 0px;width:855px;border-bottom: 1px dashed #999; " >
				<div style="float:left;">
				<img src="<{$baseUrl}>/public/images/author.png" alt="author">
				留言者:<{$arrMessages[MessageList].author|truncateex:10:'..':true}>
				<img src="<{$baseUrl}>/public/images/date.png" alt="date">留言时间:<{$arrMessages[MessageList].addtime}>| 
				<img src="<{$baseUrl}>/public/images/filed.png" alt="filed">留言者地址:<{$arrMessages[MessageList].address}>
				 </div><div style="float:right;"> 回复留言&nbsp;&nbsp;
				<a href="#reviewtext"><img border="0" src="<{$baseUrl}>/public/images/review.png" style="cursor:pointer;" onclick="reviewMess('<{$arrMessages[MessageList].id}>','<{$arrMessages[MessageList].title}>')" alt="回复留言"></a></div>
				 <div class="clear"></div>
			</div>
				<div class="clear"></div>
    		</div>

    		<{/section}>
    		
    		
 			<div class="postmetadata">
			<div id="pages"><{$pageInfo}>
			</div>	
		</div>
		<div class="clear"></div>
	 
	
 </div>
	 	
			
			
		</div>
		
		</div>
		
</div>
<div class="sidebox" style="width:870px">
<div class="sideboxInner" style="width:840px">
	<h2 id="reviewtext">发表留言区</h2>

		<div class="cover" style="width:800px">
			<div class="entry" style="width:760px;position:relative;">
			<p class="posttop"><a name="comment">发表留言:</a></p>
	<form id="frmSumbit" target="_self" method="post" action="#" >

	<input type="hidden" name="messageid" id="messageid" value="0" />
	<p><label for="headimg">阁下相片</label>&nbsp;&nbsp;&nbsp;<select id="headimg" name="headimg"  onchange="ChangePhoto();" >
		<option  value="3" selected="selected">默认相片</option>
		<option  value="2">相片一</option>
		<option  value="1">相片二</option>
		<option  value="4">相片三</option>
		<option  value="5">相片四</option>
		<option  value="6">相片五</option>
		<option  value="7">相片六</option>
		<option  value="8">相片七</option>
		<option  value="9">相片八</option>
		</select><img id="headimgs" style="text-align:center;z-index:30;position:absolute;border:1px green solid; left:720px; top:0px;" src="<{$baseUrl}>/public/images/headimg/3.png"  alt="游客的头像"></p>
	
	<p><label for="title">留言标题</label>&nbsp;&nbsp;&nbsp;<input type="text" name="title" id="title" class="text"  size="40"  /><span id="titleflag" style="color:red;"></span></p>
	<p><label for="username">阁下大名</label>&nbsp;&nbsp;&nbsp;<input type="text" name="username" id="username" class="text" value="游客" size="40" tabindex="1" /><span id="nameflag" style="color:red;"></span></p>
	<p><label for="email">电子邮件</label>&nbsp;&nbsp;&nbsp;<input type="text" name="email" id="email" class="text"  size="40" tabindex="2" /><span id="emailflag" style="color:red;"></span></p>
	<p><label for="imgcode">验&nbsp;证&nbsp;码</label>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="imgcode" id="code" class="text"  size="15" tabindex="3"   />&nbsp;&nbsp;<img id="imgcode" style="margin-bottom:-5px;cursor:pointer;" onclick="javascript:ChangImg()"   src="<{$baseUrl}>/admin/auth/imgcode/">&nbsp;点击图,换图片&nbsp;&nbsp;<span id="codeflag" style="color:red;"></span></p>
	<p><label for="content">留言内容(留言的最长字数:<font color="red">500</font>字)</label><span id="successflag" style="color:red;"></span></p>
	<p><textarea name="comcontent" id="comcontent" wrap="hard"  class="text" cols="50" style="width:620px;" rows="4" tabindex="5" ></textarea><span id="contentflag"></span></p>
	<p><input name="butSumbit" type="button" tabindex="6" value="发表留言" onclick="javascript:submitmess()" class="button" /></p>
	</form>
	<p class="postbottom">◎欢迎参与讨论，请在这里发表您的看法、交流您的观点。</p>

			</div>
			
		</div>
		
		</div>
		
</div>




</div>


<div class="clear"></div>
</div>



</div>


