	function showViewPageDate_success(json){
		//基本信息
		var companyname = formatOutputStr1(isNullString(json.userInfo.companyname));
		var shortcompanyname = formatOutputStr1(isNullString(json.userInfo.shortcompanyname));
		var area = isNullString(json.userInfo.province) + "/" +isNullString(json.userInfo.city);
		var primarybusiness = formatOutputStr1(isNullString(json.userInfo.primarybusiness));
		var telcontact = isNullString(json.userInfo.telcontact);
		var address = formatOutputStr1(isNullString(json.userInfo.address));
		var postcode = isNullString(json.userInfo.postcode);
		var shopaddress = formatOutputStr1(isNullString(json.userInfo.shopaddress));
		var fax = isNullString(json.userInfo.fax);
		//个人信息
		var name = formatOutputStr1(isNullString(json.userInfo.name));
		var telephone = isNullString(json.userInfo.telephone);
		var mobile = isNullString(json.userInfo.mobile);
		var qq = isNullString(json.userInfo.qq);
		var msn = formatOutputStr1(isNullString(json.userInfo.msn));
		var bln = formatOutputStr1(isNullString(json.userInfo.businesslicensenumber));
		var cr = formatOutputStr1(isNullString(json.userInfo.corporaterepresentative));
		var creditvalue = json.userInfo.creditvalue;
		var status = json.userInfo.status;
		//用户状态信息
		var stateInfo =  '';
		if (json.userState!=null)
			stateInfo = isNullString(json.userState.stateinfo); 
		//qq设置
		initQq(qq); 
 
		//填充左侧名片信息//home
		$("#card_companyname").html("<b>"+companyname+"</b>");
		getPicture("ad_","companyAdvertisementPic", json.userInfo.id);//获取公司广告图片
		if (status==3)
			$("#CertificationImg").css("display","block");
		else $("#CertificationImg").css("display","none");
		$("#card_telcontact").html(telcontact);
		$("#card_address").html(address);
		if (creditvalue/100<2)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 2&&creditvalue/100<3)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 3&&creditvalue/100<4)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 4&&creditvalue/100<5)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 5&&creditvalue/100<6)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		//写入状态和姓名信息
		var titleInfo = '<strong><span name="card_name" id="card_name1">'+name+'('+shortcompanyname+')';
			titleInfo = titleInfo + '</span></strong>  '+stateInfo;
		$("#friendIndexTitleInfo").html(titleInfo);
		$("#card_name2").html(name+"("+shortcompanyname+")");
		
		//填充品牌类别列表//view
		var baseInfo,userinfo;
		baseInfo = "公司全称： " + companyname + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;简称： " + shortcompanyname + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;地区： " + area + "<br/>";

		baseInfo += "<p><span style='float:left;padding:0px;margin:0px;'>主营业务：</span> <span style='padding:0px;padding-top:2px;padding-left:5px;margin:0px;clear:none; float:left; line-height:16px; width:460px;word-wrap:break-word;word-break:break-all;'>" + primarybusiness + "</span></p><br/>";
		baseInfo += "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		baseInfo += "<br/>联系电话： " + telcontact + "<br/>";

		baseInfo += "公司地址： " + address + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;邮编： " + postcode + "<br/>";
		baseInfo += "门市地址： " + shopaddress + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;传真： " +  fax;
		$("#baseInfoUlId").html(baseInfo);
		userinfo = "姓名： " + name + "<br/>";
		userinfo += "电话： " + telephone + "<br/>";
		userinfo += "手机： " + mobile + "<br/>";
		userinfo += "&nbsp;&nbsp;QQ： " + qq + "<br/>";
		userinfo += "&nbsp;MSN： " + msn + "<br/>";
		$("#userinfoUlId").html(userinfo);
		
		//填充公司的基本资料//填充edit页面数据
		$("#edit_companyname").val(companyname);
		$("#edit_shortcompanyname").val(shortcompanyname);
		$("#provinceCity").text(area);
		$("#edit_primarybusiness").val(primarybusiness);
		getCountWithHtml();
		$("#edit_telcontact").val(telcontact);
		$("#edit_address").val(address);
		$("#edit_postcode").val(postcode);
		$("#edit_shopaddress").val(shopaddress);
		$("#edit_fax").val(fax);
	
		//填充个人信息资料
		$("#edit_name").val(name);
		$("#edit_telephone").val(telephone);
		$("#edit_mobile").val(mobile);
		$("#edit_qq").val(qq);
		$("#edit_msn").val(msn);
		
		//填充企业认证信息
		$("#edit_bln").val(bln);
		$("#edit_cr").val(cr);
		if(json.userInfo.status == 3){
			$("#provinceCity").css("background-color", "#cccccc");
			$("#provinceCity").css("cursor", "default");
			document.getElementById("provinceCity").onclick = "";
			$("#edit_companyname").attr("disabled", true);
			$("#edit_companyname").attr("readonly", true);
			$("#edit_bln").attr("disabled", true);
			$("#edit_cr").attr("disabled", true);
			$("#edit_updateBlnCr_button").attr("disabled", true);
		} 
	}	

　
	/**
	 * 填充公司简介
	 */
	function fillIntroduction_success(json){
		if(json.description != null){
			descriptionDocument.body.innerHTML = json.description;
			$("#edit_descriptionTipDivId").html(getCountWithoutHtml(descriptionDocument.body.innerHTML)+"/2000");
		}else 
			descriptionDocument.body.innerHTML = "你可以在此输入最新简介。";
	}
	/**
	 * 填充商家公告
	 */
	function fillBulletin_success(json){
		if(json.notice != null){
			noticeDocument.body.innerHTML = json.notice;
			$("#edit_noticeTipDivId").html(getCountWithoutHtml(noticeDocument.body.innerHTML)+"/2000");
		}else
			noticeDocument.body.innerHTML = "你可以在此输入最新公告。";
	}
	/**
	 * 填充已发布报价单
	 */
	function fillBrandCategory_success(json){
		var targetDiv = "<b><a href=\"javascript:void(0);\" onclick=\"friendWebOfferListToggle();return false;\">已发布报价单</a></b><ul id=\"friendWebOfferList\">";
		for(var i=0;i<json.viewUserBrandList.length;i++){
			targetDiv += '<li><span class="left bg priceName" style="overflow: hidden;width: 155px;">'+json.viewUserBrandList[i].bcname+"</span>";
			targetDiv += '<a href="javascript:void(0)" class="right" onclick="offerView('+json.friendid+','+json.viewUserBrandList[i].id+');return false;">查看</a></li>';
		}
		targetDiv += "</ul>";
		$("#brandCategory_listDivId").html(targetDiv);
	}
	/**
	 * 店铺收起已发布的报价单。
	 */
	function friendWebOfferListToggle(){
		$("#brandCategory_listDivId").find("#friendWebOfferList").slideToggle("fast");
	}
	/**
	 * 更新商家资料回调
	 */
	function updateCompanyInfo_success(json){
		var companyname = isNullString(json.userInfo.companyname);
		var shortcompanyname = isNullString(json.userInfo.shortcompanyname);
		var area = isNullString(json.userInfo.province) + "-" +isNullString(json.userInfo.city);
		var primarybusiness = isNullString(json.userInfo.primarybusiness);
		var telcontact = isNullString(json.userInfo.telcontact);
		var address = isNullString(json.userInfo.address);
		var postcode = isNullString(json.userInfo.postcode);
		var shopaddress = isNullString(json.userInfo.shopaddress);
		var fax = isNullString(json.userInfo.fax);
		var creditvalue = json.userInfo.creditvalue;
		if(json.updateSuccess == "true")
			$("#edit_company_update_status").show();
		else
			$("#edit_company_update_status").hide();
		$("#edit_updateCompany_button").attr("disabled",false);
		
		//同时更新左侧的名片信息card_name
		$("#card_companyname").html(companyname);
		$("#card_telcontact").html(telcontact);
		$("#card_address").html(address);
		if (creditvalue/100<2)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 2&&creditvalue/100<3)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 3&&creditvalue/100<4)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 4&&creditvalue/100<5)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		if (creditvalue/100 >= 5&&creditvalue/100<6)
			$("#card_credit").html("<img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/><img src=\"/img/img006.gif\" title=\"信誉值:"+creditvalue+"\"/>");
		//更改预览信息
		var baseInfo;
		baseInfo = "公司全称： " + companyname + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;简称： " + shortcompanyname + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;地区： " + area + "<br/>";
		baseInfo += "<p><span style='float:left;padding:0px;margin:0px'>主营业务：</span> <span style='padding:0px;padding-top:2px;padding-left:5px;margin:0px;clear:none; float:left; line-height:16px; width:460px;word-wrap:break-word;word-break:break-all;'>" + primarybusiness + "</span></p><br/>";
		baseInfo += "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
		baseInfo += "<br/>联系电话： " + telcontact + "<br/>";
		baseInfo += "公司地址： " + address + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;邮编： " + postcode + "<br/>";
		baseInfo += "门市地址： " + shopaddress + "<br/>";
		baseInfo += "&nbsp;&nbsp;&nbsp;&nbsp;传真： " +  fax;
		$("#baseInfoUlId").html(baseInfo);
	}
	function updateDescription_success(json){
		if(json.updateSuccess == "true"){
			$("#edit_description_update_status").show();
		}else
			$("#edit_description_update_status").hide();
		$("#dLoadingDiv").css("display", "none");
		$("#edit_updateDescription_button").attr("disabled",false);
		
		//更新预览信息
		var description = trim(descriptionDocument.body.innerHTML);
		$("#descriptionUlId").html(json.description);
	}
	
/**
 * 设置文本编辑器产生的html字体的行高属性,以便正确的显示在div中
 */
	function setLineHeight(id){
		var pArr = document.getElementById(id).getElementsByTagName("p");　　 
		var lineHeights = {1:"20px",2:"23px",3:"27px",4:"30px",5:"35px",6:"40px",7:"47px"};
		for(var i=0;i<pArr.length;i++){ 
			var maxFontSize = 1;
			var fontArr = pArr[i].children;
			for(var j=0;j<fontArr.length;j++){ 
				if(fontArr[j].size != null && parseInt(fontArr[j].size) > maxFontSize){
					maxFontSize = parseInt(fontArr[j].size);
				}
			}
			pArr[i].style.lineHeight = lineHeights[maxFontSize];  
			pArr[i].style.zoom = 1;
		}
		$("#"+id).attr("isSetLineHeight", "true");
	}	

	
	function updateNotice_success(json) {
		var notice = isNullString(json.notice);
		//标准格式化文本内容 
		if(json.updateSuccess == "true"){
			$("#edit_notice_update_status").show();
		}else
			$("#edit_notice_update_status").hide();
		$("#nLoadingDiv").css("display", "none");	
		$("#edit_updateNotice_button").attr("disabled",false);
		//更新预览信息
		$("#noticeUlId1").html(notice);
		//让预览div的公告重新设置line-height 
		setLineHeight("noticeUlId1");
		//更新店铺首页公告
		$("#noticeUlId").html("<div id='noticeConDivId' style='overflow:hidden;'>"+notice+"</div>");
 		//让首页div的公告重新设置line-height 
 		setLineHeight("noticeConDivId");		
 		$("#noticeUlId").height("40px");
 		$("#noticeConDivId").height("40px");
		
		
/*				//重新设置div高度
			var lineHeights = {1:"20px",2:"23px",3:"27px",4:"30px",5:"35px",6:"40px",7:"47px"};
			var divHeight = 0;
			var ps = $("#noticeUlId").children();
			for(var i=0;i<ps.length;i++){
				var lineHeight_ = ps[i].style.lineHeight;
				var zihuCount = {"20px":49,"23px":49, "27px":39, "30px":32, "35px":24, "40px":18, "47px":12}; 
				var maxlinezishunum = zihuCount[lineHeight_];
				var linezishunum= document.all ? ps[i].innerText.length : ps[i].textContent.length;
				var linenum = linezishunum < maxlinezishunum ? 1 : linezishunum % maxlinezishunum == 0 ? linezishunum/maxlinezishunum : linezishunum/maxlinezishunum+1;
 
				divHeight += linenum * parseInt(lineHeight_.substring(0,2)); 
			}  
			if(divHeight >= 40)  
				divHeight += 40;  
			else{
				divHeight = 40;	 	
			}
			$("#noticeUlId").height("40px");*/
			$("#noticeUlId").slideDown(0); 
			//$("#noticeUlId").height(divHeight+"px");
				
			// $("#noticeUlId").css("zoom","1");
			//确定是否有下拉按钮
			reSetOpenFloderButton();
		
	}
	function updateUserInfo_success(json){
		var name = isNullString(json.userInfo.name);
		var shortcompanyname = isNullString(json.userInfo.shortcompanyname);
		var telephone = isNullString(json.userInfo.telephone);
		var mobile = isNullString(json.userInfo.mobile);
		var qq = isNullString(json.userInfo.qq);
		var msn = isNullString(json.userInfo.msn);	
	
		if(json.updateSuccess == "true"){
			$("#edit_userinfo_update_status").show();
		}else
			$("#edit_userinfo_update_status").hide();
		$("#edit_updateUserInfo_button").attr("disabled",false);
		
		//同时名片信息  
		$("#card_name1").html(name+"("+shortcompanyname+")");
		$("#card_name2").html(name+"("+shortcompanyname+")");
		
		//更改预览信息
		var userinfo;
		userinfo = "姓名： " + name + "<br/>";
		userinfo += "电话： " + telephone + "<br/>";
		userinfo += "手机： " + mobile + "<br/>";
		userinfo += "&nbsp;&nbsp;QQ： " + qq + "<br/>";
		userinfo += "&nbsp;MSN： " + msn + "<br/>";
		$("#userinfoUlId").html(userinfo);				
		initQq(qq);
	}
	function updateBlnCr_success(json){
		if(json.updateSuccess == "true"){
			$("#edit_blncr_update_status").show();
		}else
			$("#edit_blncr_update_status").hide();
		$("#edit_updateBlnCr_button").attr("disabled",false);

	}
	function updatePass_success(json) { 
		if(json.updateSuccess == "true"){
			$("#edit_password_update_status").show(); 
		}else{
			$("#edit_oldPassIdTipDivId").html("<font color='red'>旧密码错误!</font>");
			$("#edit_oldPassIdTipDivId").show();
			$("#edit_password_update_status").hide(); 
		}
		$("#edit_updatePass_button").attr("disabled",false);
	}



function userLogin_success(json) {
	self.location.href = "/friend/friendAdminIndex.jsp";
}

function getUserByUserID_success(json) {
	var targetSrc ;
	var name = json.userInfo.name == null ? "" : json.userInfo.name;
	var telephone = json.userInfo.telephone == null ? "" : json.userInfo.telephone;
	var mobile = json.userInfo.mobile == null ? "" : json.userInfo.mobile;
	var qq = json.userInfo.qq == null ? "" : json.userInfo.qq;
	var msn = json.userInfo.msn == null ? "" : json.userInfo.msn;
	//编辑商家页面
	if(json.targetType == "checkInfo"){
		targetSrc = 
		'			<h2><b><b>个人信息</b></b></h2>											'+
		'			<p><b>姓名</b>'+(name == '' ? '&nbsp;' : name)+'</p>											'+
		'			<p><b>电话</b>'+(telephone == '' ? '&nbsp;' : telephone)+'</p>								'+
		'			<p><b>手机</b>'+(mobile == '' ? '&nbsp;' : mobile)+'</p>								'+
		'			<p><b>QQ</b>'+(qq == '' ? '&nbsp;' : qq)+'</p>									'+
		'			<p><b>MSN</b><a href="#">'+msn+'</a></p>				';
		$("#"+json.targetDiv).html(targetSrc);
		document.getElementById("informationBoxTittle").style.display = "block";
		return true;
	}


	if (json.targetType=='default')
	{
		$("#nameValue").val(name);
		$("#telephoneValue").val(telephone);
		$("#cellphoneValue").val(mobile);
		$("#qqValue").val(qq);
		$("#msnValue").val(msn);
	}else//其它可能。 
	{		
		$("#"+json.targetDiv).html(targetSrc);
	}
	return false;
}


function registerUser_success(json) {
	var recv = json.username;
	//当前页面跳转的方向
	var reg = new RegExp(/@[A-Za-z0-9]*\./);
	var emailPageFrag = new String(reg.exec(json.username));
	emailPageFrag = emailPageFrag.substring(1,emailPageFrag.length - 1);
	self.location.href = "/user/activation.jsp?username="+recv+"&mailPage="+emailPageFrag;
}





function updatePassword_success(json) {
	var targetSrc;
	var updateSuccess = cTrim(json.updateSuccess,0);
	if(updateSuccess == "false"){
		$("#"+json.targetDiv).text("您输入的密码不正确,请重新输入!!");
	}else
		$("#"+json.targetDiv).text("密码设置成功。");
	$("#"+json.targetDiv).css("display","block");
	if(json.targetType == "accessFromEmail"){
		document.getElementById("oldPassId").readOnly = false;
		document.getElementById("oldPassId").value = "";
		//document.getElementById("fromEmailButtonDivId").style.display = "none";
		//document.getElementById("defaultButtonDivId").style.display = "block";
	}
}


function updateUserBasicInfo_success(json){
	if (json.targetType=='default')
	{
		var updateSuccess = cTrim(json.updateSuccess,0);
		if(updateSuccess == "false"){
			$("#"+json.targetDiv).text("个人信息修改失败。!");
		}else
			$("#"+json.targetDiv).text("个人信息修改成功。");
		$("#"+json.targetDiv).css("display","block");
		document.getElementById("button_a").disabled = true;
	}else//其它可能。 
	{	
		
	}
}
