<%template _header%>
<!--header end-->
<script type="text/javascript">
function changeAvatarOption(currentOption)
{
	if ($('enterurl'))
	{
		$('enterurl').style.display='none';
	}
	if ($('uploadfile'))
	{
		$('uploadfile').style.display='none';
	}
	switch (currentOption)
	{
		case "0":
			$('templateid').style.display='none';
			break;
		case "1":
			$('uploadfile').style.display='block';
			break;
		case "2":
			$('enterurl').style.display='block';
			break;
	}
	$('avatarchanged').value=1;
}
</script>

<div id="foruminfo">
	<div id="nav">
		<a href="{config.forumurl}" class="home">{config.forumtitle}</a>  &raquo; <a href="usercp.aspx">用户中心</a>  &raquo; <strong>个性设置</strong>
	</div>
	<div id="headsearch">
		<div id="search">
			<%template _quicksearch%>
		</div>
	</div>
</div>

<!--主体-->
<div class="controlpannel">
   <%template _menu%>
	<div class="pannelcontent">
		<div class="pcontent">
			<div class="panneldetail">
				<%template _permenu%>	
				<div class="pannelbody">
					<div class="pannellist managebox">
					<%if {page_err}==0%>
						<%if {ispost}%>
							<%template _msgbox%>
						<%else%>
						<form action="" method="post" ID="Form1" enctype="multipart/form-data">
						<input name="avatarchanged" type="hidden" value="0" id="avatarchanged" />
						<table width="100%" cellspacing="0" cellpadding="0" border="0" id="Table1">
							<tbody>
							<tr>
							<td>风格:</td>
							<td>
								<select name="templateid" id="templateid" >
								<option value="0" <%if {user.templateid}==0%>selected<%/if%>>默认</option>
								<%loop template templatelist%>
								<option value="{template[templateid]}" 
								<%if {user.templateid}=={strtoint({template[templateid]})}%>selected<%/if%>
								>{template[name]}</option>
								<%/loop%>
								</select>
							</tr>
							</tbody>
							<tbody>
							<tr>
							<td colspan="2" class="userofvatar">
								<img src="{user.avatar}" <%if {user.avatarwidth}>0%>width="{user.avatarwidth}" height="{user.avatarheight}"<%/if%> id="usingavatarimg" alt="形象图"/>
							<%if {usergroupinfo.allowavatar}>0%>
								<ul id="avatarbox">
								<%if {usergroupinfo.allowavatar}>1%>
									<li>
										<input type="radio" id="avatartype1" name="avatartype" value="2" onclick="changeAvatarOption(this.value);"
										<%if {avatartype}==2%>
											checked="checked"
										<%/if%>/><label for="avatartype1">使用外部图片</label>
										<div id="enterurl" style="display: none;">
											URL地址: <input name="avatarurl" type="text" id="avatarurl" value="{avatarurl}" size="40" />
											宽度:
											<input name="avatarwidth" type="text" id="avatarwidth" value="{avatarwidth}" size="3" maxlength="3" style="width: 30px;" /> &nbsp; &nbsp; 
											高度:
											<input name="avatarheight" type="text" id="avatarheight" value="{avatarheight}" size="3" maxlength="3" style="width: 30px;" />	
										</div>
									</li>
								<%/if%>
								<%if {usergroupinfo.allowavatar}>2%>
									<li>
										<input type="radio" id="avatartype2" name="avatartype" value="1" onclick="changeAvatarOption(this.value);"
										<%if {avatartype}==1%>
											checked="checked"
										<%/if%>/><label for="avatartype2">上传头像图片</label>
										<div id="uploadfile" style="display: none;">
										选择本地图片文件: <input name="file" id="file" type="file" size="40"/>
										</div>
									</li>
								<%/if%>
									<li>
										<input type="radio" id="avatartype3" name="avatartype" value="0" onclick="changeAvatarOption(this.value);BOX_show('fromsystem');" 
										<%if {avatartype}==0%>
											checked="checked"
										<%/if%>
										/><label for="avatartype3">使用系统头像 (点击选择...)</label>
										<input type="hidden" name="usingavatar" id="usingavatar" value="{avatar}" />
									</li>
								</ul>
							<%else%>
								<ul style="margin-top: 40px;"><li>您所在的用户组 "{usergroupinfo.grouptitle}" 没有更改头像的权限</li></ul>
							<%/if%>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>每页主题数:</td>
								<td>
									<input type="radio" value="0" name="tpp"
									<%if {user.tpp}==0%>
									  checked="checked"
									<%/if%>/>默认&nbsp;&nbsp;&nbsp;
									<input type="radio" value="15" name="tpp"
									<%if {user.tpp}==15%>
									  checked="checked"
									<%/if%>/>15&nbsp;&nbsp;&nbsp;
									<input type="radio" value="20" name="tpp"
									<%if {user.tpp}==20%>
									  checked="checked"
									<%/if%>/>20&nbsp;&nbsp;&nbsp;
									<input type="radio" value="25" name="tpp"
									<%if {user.tpp}==25%>
									  checked="checked"
									<%/if%>/>25&nbsp;&nbsp;&nbsp;
								</td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>每页帖子数:</td>
								<td>
								<input type="radio" value="0" name="ppp"
								  <%if {user.ppp}==0%>
								  checked="checked"
								  <%/if%>/>默认&nbsp;&nbsp;&nbsp;
								<input type="radio" value="10" name="ppp"
								  <%if {user.ppp}==10%>
								  checked="checked"
								  <%/if%>/>10&nbsp;&nbsp;&nbsp;
								<input type="radio" value="15" name="ppp"
								  <%if {user.ppp}==15%>
								  checked="checked"
								  <%/if%>/>15&nbsp;&nbsp;&nbsp;
								<input type="radio" value="20" name="ppp"
								  <%if {user.ppp}==20%>
								  checked="checked"
								  <%/if%>/>20&nbsp;&nbsp;&nbsp;</td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>是否隐身:</td>
								<td>
								<input type="radio" name="invisible" value="1" class="radioinput" 
								<%if {user.invisible}==1%>
								checked="checked"
								<%/if%>
								 ID="Radio3"/>是
								<input name="invisible" type="radio" value="0" class="radioinput"  
								<%if {user.invisible}==0%>
								checked="checked"
								<%/if%>
								 ID="Radio4"/>否
								 </td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>签名:</td>
								<td>
								<textarea name="signature" cols="60" rows="8" id="signature">{user.signature}</textarea>
								 </td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>&nbsp;</td>
								<td>
								<input name="sigstatus" type="checkbox" id="sigstatus" value="1" 
								<%if {user.sigstatus}==1%>						
									checked="checked"
								<%/if%>							
								/>使用签名
								 </td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>&nbsp;</td>
								<td>
								UBB代码: <strong>
									<%if {usergroupinfo.allowsigbbcode}==1%>
										可用
									<%else%>
										禁用
									<%/if%>
									</strong>&nbsp;&nbsp;
									[img]代码: <strong>
									<%if {usergroupinfo.allowsigimgcode}==1%>
										可用
									<%else%>
										禁用
									<%/if%>
									</strong>
								 </td>
							</tr>
							</tbody>
							<tbody>
							<tr>
								<td>&nbsp;</td>
								<td>
								<input id="sendmsg" type="submit" value="确定" name="sendmsg"/>
								</td>
							</tr>
							</tbody>
						</table>
						</form>
						<%/if%>
						</div>
					<%else%>
					<%template _usercperrmsgbox%>
					<%/if%>
			  </div>
			</div>
		</div>
	</div>
</div>
<!--主体-->
</div>
<%template _copyright%>
<%if {page_err}==0 && !{ispost}%>
	<div id="BOX_overlay" style="background: #000; position: absolute; z-index:100; filter:alpha(opacity=50);-moz-opacity: 0.6;opacity: 0.6;"></div>
	<script type="text/javascript" src="javascript/template_album.js"></script>
	<script type="text/javascript">
		function usethisavatar(e)
		{
			$('usingavatar').value = e.src;
			
			var avatars = $('fromsystem').getElementsByTagName('div');
			for (var i=0; i < avatars.length;i++)
			{
				avatars[i].style.border = "2px dashed white";
			}
			e.parentNode.style.border = "2px dashed black";
		}
		function selectionborder(e)
		{
			if (e.style.border != "2px dashed black" && e.style.border != "black 2px dashed")
			{				
				if (e.style.border == "2px dashed red" || e.style.border == "red 2px dashed" )
				{
					e.style.border = "2px dashed white";
				}
				else
				{
					e.style.border = "2px dashed red";
				}
			}
		}
	</script>

	<div id="fromsystem" class="avatarbackground" style="display: none; position: relative;">
			<div class="avatarlist">
				<ul>
					<%loop avatarfile avatarfilelist%>
						<li>
							<div onmouseover="selectionborder(this)" onmouseout="selectionborder(this)" style="<%if {avatarfile[filename]}=={avatar}%>border: 2px dashed black;<%else%>border: 2px dashed white;<%/if%>cursor: pointer; overflow:hidden; zoom:1;" ><img src="{avatarfile[filename]}" onclick="usethisavatar(this);" alt="形象图名称"/></div>
						</li>
					<%/loop%>
				</ul>
			</div>
			<span class="avatarbutton">
				<input type="button" name="userthisavatar" id="userthisavatar" value="确定" onclick="$('templateid').style.display='';$('usingavatarimg').src=$('usingavatar').value;BOX_remove('fromsystem');" />
				<input type="button" name="canceluserthisavatar" id="canceluserthisavatar" value="取消" onclick="$('templateid').style.display='';BOX_remove('fromsystem');" />
			</span>
	</div>
<%/if%>
<%template _footer%>