<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{echo: lp{m_u_center};/}</title>
<link rel="stylesheet" type="text/css" href="skin/{echo: $SYSINFO['templates'];/}/css/modules.css">
<link rel="stylesheet" type="text/css" href="skin/{echo: $SYSINFO['templates'];/}/css/layout.css">
<link rel="stylesheet" type="text/css" href="skin/{echo: $SYSINFO['templates'];/}/css/style.css">
<script type="text/javascript" src="skin/{echo: $SYSINFO['templates'];/}/js/userchangeStyle.js"></script>

<style type="text/css">
#picspan {width:82px; height:82px; padding:1px; border:1px solid #efefef; line-height:80px; text-align:center; display:inline-block; overflow:hidden; float:right;}
</style>
</head>
<body>
{inc: require("shop/index_header.php");/}
	<div class="site_map">
	  {echo:lp{m_current_position};/}<A href="index.php">{echo:$SYSINFO['sys_name'];/}</A>/<a href="modules.php">{echo:lp{m_u_center};/}</a>/&nbsp;&nbsp;{echo: lp{m_ico_set};/}
	</div>
    <div class="clear"></div>
    {inc: require("modules/left_menu.php");/}
    <div class="main_right">
		<div class="right_top"></div>
		<div class="cont">
			<div class="title_uc"><h3>{echo: lp{m_ico_set};/}</h3><hr /></div>
				<form action="do.php?act=user_ico" method="post" name="form_profile" enctype="multipart/form-data">
				<table width="100%" class="form_table">
					<tr><td class="textright"><span id="picspan">{sta:if($user_info['user_ico'])[exc]}<img src="{echo:$user_info['user_ico'];/}" width="80" height="80" onerror="this.src='skin/default/images/nopic.gif'"/>{sta: }else[exc]}{echo:lp{m_user_ico};/}{end:if/}</span></td><td class="textleft"><input type="file" name="attach[]" onchange="showimg(this)" /><br />{echo:lp{m_img_limit};/}</td></tr>
					<tr><td colspan="2" align="center"><input type="hidden" name="user_id" value="{echo: $user_id;/}" /><input type="submit" name="submit" value="{echo:lp{m_ico_set};/}" /></td></tr>
				</table>
				</form>
	        </div>
    	</div>
    </div>
<div class="clear"></div>
{inc: require("shop/index_footer.php");/}
<script language="JavaScript">
<!--
function showimg(obj) {
	var picspan = document.getElementById("picspan");
	picspan.innerHTML = '';
	var Img = new Image();
	Img.id = "goods_pic";

	if(navigator.userAgent.indexOf("MSIE")>0) {
		Img.src = obj.value;
	} else {
		Img.src = obj['files'][0].getAsDataURL();
	}
	picspan.appendChild(Img);
	//imgwh();
	setTimeout("imgwh()",100);
}

function imgwh() {
	var Img = document.getElementById("goods_pic");
	var w = Img.width;
	var h = Img.height
	if(w>h) {
		Img.height = h*80/w;
		Img.width = '80';
		Img.style.marginTop = (80-Img.height)/2+'px';
	} else {
		Img.width = w*80/h;
		Img.height = '80';
	}
}
//-->
</script>
</body>
</html>