<?php
error_reporting(0);
session_start();
include_once '../comm/config.php';
include_once '../comm/class_db.php';
include_once 'check.php';
$avatar_result=file_get_contents('http://'.URL.'/user/up_avatar.php?uid='.$_SESSION['dduserid'].'&returnhtml=2');
$tag="center";
?>
<!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" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>用户管理中心</title>
<link href="../template/<?=MOBAN?>/css/usercss.css" rel="stylesheet" type="text/css">
<link href="../template/<?=MOBAN?>/css/common.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../template/<?=MOBAN?>/js/jquery.js"></script>
<script type="text/javascript">
var BROWSER = {};
var USERAGENT = navigator.userAgent.toLowerCase();
browserVersion({'ie':'msie','firefox':'','chrome':'','opera':'','safari':'','mozilla':'','webkit':'','maxthon':'','qq':'qqbrowser'});
if(BROWSER.safari) {
	BROWSER.firefox = true;
}
BROWSER.opera = BROWSER.opera ? opera.version() : 0;

HTMLNODE = document.getElementsByTagName('head')[0].parentNode;
if(BROWSER.ie) {
	BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie);
	HTMLNODE.className = 'ie_all ie' + BROWSER.iemode;
}
function browserVersion(types) {
	var other = 1;
	for(i in types) {
		var v = types[i] ? types[i] : i;
		if(USERAGENT.indexOf(v) != -1) {
			var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig');
			var matches = re.exec(USERAGENT);
			var ver = matches != null ? matches[2] : 0;
			other = ver !== 0 && v != 'mozilla' ? 0 : other;
		}else {
			var ver = 0;
		}
		eval('BROWSER.' + i + '= ver');
	}
	BROWSER.other = other;
}
function AC_FL_RunContent() {
	var str = '';
	var ret = AC_GetArgs(arguments, "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash");
	if(BROWSER.ie && !BROWSER.opera) {
		str += '<object ';
		for (var i in ret.objAttrs) {
			str += i + '="' + ret.objAttrs[i] + '" ';
		}
		str += '>';
		for (var i in ret.params) {
			str += '<param name="' + i + '" value="' + ret.params[i] + '" /> ';
		}
		str += '</object>';
	} else {
		str += '<embed ';
		for (var i in ret.embedAttrs) {
			str += i + '="' + ret.embedAttrs[i] + '" ';
		}
		str += '></embed>';
	}
	return str;
}

function AC_GetArgs(args, classid, mimeType) {
	var ret = new Object();
	ret.embedAttrs = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();
	for (var i = 0; i < args.length; i = i + 2){
		var currArg = args[i].toLowerCase();
		switch (currArg){
			case "classid":break;
			case "pluginspage":ret.embedAttrs[args[i]] = 'http://www.macromedia.com/go/getflashplayer';break;
			case "src":ret.embedAttrs[args[i]] = args[i+1];ret.params["movie"] = args[i+1];break;
			case "codebase":ret.objAttrs[args[i]] = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0';break;
			case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblclick":case "ondrag":case "ondragend":
			case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":
			case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":
			case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":
			case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":
			case "id":ret.objAttrs[args[i]] = args[i+1];break;
			case "width":case "height":case "align":case "vspace": case "hspace":case "class":case "title":case "accesskey":case "name":
			case "tabindex":ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];break;
			default:ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
		}
	}
	ret.objAttrs["classid"] = classid;
	if(mimeType) {
		ret.embedAttrs["type"] = mimeType;
	}
	return ret;
}
</script>
</head>

<body id="usercenter">
<?php
include("../template/".MOBAN."/header.tpl.php");
?>
<?php
include("../template/".MOBAN."/nav.tpl.php");
?><DIV style="MARGIN-TOP: 25px"></DIV>
<div id="main">
<DIV class=white_top>
<DIV class=white_top_left></DIV>
<DIV class=white_top_middle></DIV>
<DIV class=white_top_right></DIV></DIV>
<DIV class=white_bg_rl>
<?php
include("left.php");
?>
<DIV class=contain>
<H2 class=left_nav1>头像修改</H2>
<br/>
<div style="width:450px; float:left">
<p>请选择一个新照片进行上传编辑。</p>
<p>头像保存后，您可能需要刷新一下本页面(按F5键)，才能查看最新的头像效果</p> 
<script type="text/javascript">document.write(AC_FL_RunContent(<?=$avatar_result?>));</script>
</div>
<div style=" width:250px; float:left">
<img style="margin-top:68px; margin-left:10px" onerror="this.src='../images/noavatar_big.gif'" src="../upload/avatar/<?=get_avatar_filepath($_SESSION['dduserid'], $size = 'big')?>" />
</div>
</DIV>
<DIV class=clear></DIV>
</DIV>
</div>
<DIV class=white_bottomm>
<DIV class=white_bottom_left></DIV>
<DIV class=white_bottom_middle></DIV>
<DIV class=white_bottom_right></DIV></DIV></div>
<?php
include("../template/".MOBAN."/footer.tpl.php");
?>
</body>
</html>