var fesco_upload = function ()
{
	this.validate = function (_this)
	{
		var _value = _this.photo.value;
		if(_value == '')
		{
			alert("请选择您要上传的附件");
			return false;
		}
		var suffix;
		suffix = _value.substr((_value.length-3));
		if(suffix.toUpperCase() != 'JPG' && suffix.toUpperCase() !="GIF")
		{
			alert('附件格式只能为jpg或gif');
			return false;
		}
	}
	this.error = function (t)
	{
		var msg;
		switch (t)
		{
			case 1 :
			msg = "上传文件失败";
			case 2 :
			msg = "请您登陆后再执行上传操作";
			case 3 :
			msg = "更新用户资料失败";
			case 4 :
			msg = "上传文件失败";
			case 5 :
			msg = "不允许的文件格式或图片大小超过限制(200k以内)";
		}
		alert(msg);
		return false;
	}
	this.success = function ()
	{
		alert('更新成功');
		window.location = location.href;
	}
}

var __fesco_upload = new fesco_upload();