function uploadImage(obj){
	var name = $(obj).attr('name');
	var type = $(obj).attr('imgType');
	$("body").append('<iframe name="hframe" style="display: none;"></iframe>');
	$("#dataForm").attr({"action":"upload_image.htm?imgLabel="+name+"&imgType="+type,"target":"hframe","enctype":"multipart/form-data"}).submit();
	$(obj).after($(obj).clone().val('')).remove();
	flag = false;
}

function callback(result, resultInfo, url,imgLabel) {
	if (result == "false") {
		alert(resultInfo);
	} else {
		$("iframe").remove();
		appendImg(url,imgLabel);
	}
}

function appendImg(url,imgLabel) {
	$("#"+imgLabel+"_id").val(url);
	var box = $("#"+imgLabel+"").parent();
	box.hide();
	box.after('<div class="license-box"><img src='+url+' /><a href="javascript:void(0);" class="del-pic">x</a></div>');
}

function checkMail(str){ 
	var result=str.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/); 
	if(result==null) 
		return false; 
}

function checkPwd(pwd){
	if(!/^[\w-_.]{6,16}$/i.test(pwd)){
		alert("请输入由6-20位的字母、数字和下划线组成的密码。");
		return false;
	}
}