<!--#include file="_header.html"-->
<script type="text/javascript" language="javascript">
<!--
function checkface()
{
    var f=document.forms['chgfaceform'];
	if (f.face.value != '' && f.face.value.substr(0,9).toLowerCase() != 'userface/' && f.face.value.toLowerCase() != 'http://')
	{
		fileExt=f.face.value.substr(f.face.value.lastIndexOf('.')+1).toLowerCase();
		if (fileExt != 'jpg' && fileExt != 'gif' && fileExt != 'png' && fileExt != 'jpeg' && fileExt != 'jpe')
		{
			alert('自定义头像地址只能是GIF,JPG,PNG格式');
			f.face.focus();
			return false;
		}
		if (isNaN(f.facewidth.value) || isNaN(f.faceheight.value))
		{
			alert('头像宽，高只能是数字');
			f.facewidth.focus();
			return false;
		}
		if (parseInt(f.facewidth.value,10)<20 || parseInt(f.facewidth.value,10)>140 || parseInt(f.faceheight.value,10)<20 || parseInt(f.faceheight.value,10)>160)
		{
			alert('你填写的头像宽或高超过限制');
			f.facewidth.focus();
			return false;
		}
	}
return true;
}

var bV=parseInt(navigator.appVersion); 
var IE4=((document.all)&&(bV>=4))?true:false;                      
var IsFireFox = ($ && !document.all)?true:false
var NS4=(document.layers)?true:false; 
var z=0; 

function LayerV(LayerName,V){ 
	
   E=eval('document.'+LayerName); 
   if(IE4){E=eval('document.all.'+LayerName);}
   if(IsFireFox){ E=$(LayerName);}
   E.style.visibility=(V?'visible':'hidden'); 
} 
////////////////////////////////////////////////////////// 
//下面这个函数实现了当点击图片时，把图片选上 
function select(image1){ 
var html,url1
url1=image1.src 
$("face").value = "userface"+url1.substring(url1.lastIndexOf('/'));
html="<img src="+url1+" width=70 height=70 onclick='javascript:select(this)'>" 
html=html+"<a href=javascript:LayerV('Zhong',z=1-z)><font style='font-family: Webdings;'>6</font></a>" 
$("pic").innerHTML=html 
LayerV('Zhong',z=1-z) 
} 
//-->
</script>
<form name="chgfaceform" enctype="multipart/form-data" method="post" action="user_chgface.aspx" id="chgfaceform">
<table>
<tr id="choosepic">
<td class="tdcolor">个人头像</td>
<td>
	<div id="pic">
						<IMG onclick="javascript:LayerV('Zhong',z=1-z)" height=70 src="<%=((null != face && face.Length > 0) ? Dvbbs.Utils.Config.uploadfaces + face : Dvbbs.Utils.Config.uploadfaces + "userface/1.gif")%>" width=70><A href="javascript:LayerV('Zhong',z=1-z)">
							<FONT style="FONT-FAMILY: Webdings">6</FONT></A>
					</div>
					<div id="Zhong" style="FILTER: Alpha(opacity=100); VISIBILITY: hidden; OVERFLOW: scroll; WIDTH: 90px; POSITION: absolute; HEIGHT: 150px; BACKGROUND-COLOR: #ffffff">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/1.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/2.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/3.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/4.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/5.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/6.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/7.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/8.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/9.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/10.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/11.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/12.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/13.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/14.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/15.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/16.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/17.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/18.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/19.gif" width="70">
						<IMG onclick="javascript:select(this)" height="70" src="<%=Dvbbs.Utils.Config.uploadfaces%>userface/20.gif" width="70">
					</div>
  </td>
</tr>
<tr id="chooseup">
<td class="tdcolor"></td>
<td><br/>
 <a href="javascript:void(0);" onclick="javascript:document.getElementById('size').style.display='none';document.getElementById('canupface').value='1';document.getElementById('upface').style.display='block';document.getElementById('chooseup').style.display='none';document.getElementById('facebtn').style.display='';document.getElementById('choosepic').style.display='none';">上传头像</a>
 </td>
</tr>
<tr id="size">
<td class="tdcolor" height="31">头像设置</td>
<td>
<!--隐藏字段判断是否是上传头像-->
<input type="hidden" name="canupface" id="canupface" value="0"/>
<input type="text" onpropertychange="javascript:parent.$('userface').src='<%= Dvbbs.Utils.Config.uploadfaces%>'+this.value;" id="face" name="face" maxlength="90" style="width:280;ime-mode:disabled" value="<%=face%>" /><br/>
<input type="text" id="facewidth" onchange="javascript:parent.document.getElementById('userface').width=this.value;if(document.getElementById('preview')){document.getElementById('preview').width=this.value;}" name="facewidth" maxlength="3" style="width:60;ime-mode:disabled" value="<%=facewidth%>" />
宽:20-140  &nbsp;<br/>
<input type="text" id="faceheight" onchange="javascript:parent.document.getElementById('userface').height=this.value;if(document.getElementById('preview')){document.getElementById('preview').height=this.value;}" name="faceheight" maxlength="3" style="width:60;ime-mode:disabled" value="<%=faceheight%>" />
高:20-160</td> 
</tr>
<tr id="upface" style="display:none">
<td colspan=2>
       <table>
         <tr id="user_nav">
				<td width="250">上传说明</td>
				<td class="row_no">头像图片只能是<span class="t2">.GIF</span>或<span class="t2">.JPG</span>格式，大小在<span class="t2">25KB</span>以内，上传后的图片将取代原来的头像</td>
			</tr>
			<tr id="user_nav">
				<td>选择本地图片</td>
				<td class="row_no"><input id="file" name="file" type="file" style="WIDTH:250px" onpropertychange="javascript:document.getElementById('preview').src=this.value"></td>
			</tr>
			<tr id="user_nav">
				<td valign="top">预览头像(仅IE有效,预览大小与前台一致)</td>
				<td class="row_no"><img id="preview" src="templates/<%=Dvbbs.Utils.TemplateInfo.CurrentTemplateName%>/images/none.gif" onload="if(this.width>120)this.width=120; if(this.height>160)this.height=160" alt="preview" ></td>			
		</table>	
</td>
</tr>
</table>		
	
<table>
<tr>
<td>
<input type="submit" class="button" name="chgface" id="chgface'" onmouseover="this.className='button_on'" onmouseout="this.className='button'" value="提交"/>
<input type="button" id="facebtn" style="display:none" class="button_on" onclick="javascript:document.getElementById('size').style.display='';document.getElementById('canupface').value='0';document.getElementById('upface').style.display='none';document.getElementById('facebtn').style.display='none';document.getElementById('choosepic').style.display='block';document.getElementById('chooseup').style.display='block';" value="选择头像"/>
</td>
</tr>
</table>
</form>
<!--#include file="_footer.html"-->