	//编辑领款人信息（通过ID先查询）
	function editClmPayeeQuery(dataFrom,url,id,current,payStatus){
		var divId=null;
		$("#geren").attr('class',"check_no txt_blue");
		$("#danwei").attr('class',"check_no txt_blue");
		//当前从不选中到选中时直接跳回不进入编辑框
		$.ajax({
	        type: "POST",
	        url:url,
	        data:{"id":id,"dataFrom":dataFrom},
	       // data:{"id":id,"claimNo":claimNo},// 你的formid
	       // async: false,
	        dataType:'json',
	        success: function(data) {
	        	 //$("#pid").val(data.objId);
    			 //单位领款人
	        	 //领款人类型 1个人\2单位
	        	 $("#dataFrom").val(data.dataFrom);
	        	 if(data.claimPayeeType=="1"){
	        		 divId="divformPerson";
	        		 $("#claimPayeeId").val(data.claimPayeeId);         //证件号码：             
		        	 $("#claimPayeeName").val(data.claimPayeeName);      //姓名：            
		        	 $("#payeePhone").val(data.payeePhone);          //移动电话：        
		        	 $("#payeeTel").val(data.payeeTel);            //固定电话：        
		        	 $("#payeeContractAddr").val(data.payeeContractAddr);   //联系地址：        
		        	 $("#payeePostCode").val(data.payeePostCode);       //邮政编码：        
		        	 $("#payeeProvince").val(data.payeeProvince);       //所在省   
		        	 $("#payeeCityCode").val(data.payeeCityCode);       //所在市     
		        	 $("#payeeEmail").val(data.payeeEmail);          //邮箱地址 
		        	 $("#bankName").val(data.bankName);            //银行名称
		        	 $("#bankType").val(data.bankType);            //银行code
//		        	 $("#bankSubName").val(data.bankSubName);         //开户行     
//		        	 $("#personbankCode").val(data.bankCode);         //开户行code     
		        	 $("#bankAccountNo").val(data.bankAccountNo);       //银行帐号：
		        	 $("#payeerelationship").val(data.payeeInsRelationship);
	    			 $("#payeesex").val(data.claimPayeeGenderCode);
	    			 $("#payeeidcard").val(data.claimPayeeIdType);
	    			 $("#paymodetype").val(data.payMode);
	    			 $("#claimPayeeType").val(data.claimPayeeType);
	    			 if(payStatus != '01'){
		    			 $("#spanpayeeInsRelationshipRead").html(data.payeeInsRelationshipName);
		    			 $("#spanpersonidtypeRead").html(data.claimPayeeIdName);
		    			 $("#spanpersonsexRead").html(data.claimPayeeGenderName);
		    			 $("#spanpaymodeRead").html(data.payModeName);
		    			 $("#spanBankNameRead").html(data.bankName);
	    			 }else{
		    			 $("#spanpayeeInsRelationship").html(data.payeeInsRelationshipName);//与被保险人关系
		    			 $("#spanpersonidtype").html(data.claimPayeeIdName);//证件类型
		    			 $("#spanpersonsex").html(data.claimPayeeGenderName);//性别
		    			 $("#spanpaymode").html(data.payModeName);
		    			 $("#spanBankName").html(data.bankName);
	    			 }
	    			 /*$("#spanpayeeInsRelationship").html(data.payeeInsRelationshipName);//与被保险人关系
	    			 $("#spanpersonidtype").html(data.claimPayeeIdName);//证件类型
	    			 $("#spanpersonsex").html(data.claimPayeeGenderName);//性别
	    			 $("#spanpaymode").html(data.payModeName);
	    			 $("#spanBankName").html(data.bankName);*/
	        		 
	    			 //银行、开户行
	    			 $("#propertyBankName").val(data.bankName);
	    			 
//	    			 if(data.bankType!=null && data.bankType!=""){
//			        	 bankNamechange(data.bankType, data.bankName);//重新去接口取数据
//		    			 $("#spanbankSubName").html(data.bankSubName);
//			        	
//			         }
	    			 $("#objId").val(data.objId);
	     			 $("#divformPerson").css("display","block");
					 $("#divformCenter").css("display","none");
					 $("#hospitalInfo").css("display","none");
					 if(data.payMode=="3"){
						$("#span4").html("*");
//						$("#span5").html("*");
						$("#span6").html("*");
					 }else{
						$("#span4").html("");
//						$("#span5").html("");
						$("#span6").html("");
					 }
	        	 }else if(data.claimPayeeType=="2"){
	        		 divId="divformCenter";
		    		$("#centerCompanyName").val(data.claimPayeeName);
		    		$("#bankAccountName").val(data.bankName);
		        	$("#divbankType").val(data.bankType);            //银行code
//		        	$("#centerbankCode").val(data.bankCode);         //开户行code   
		        	$("#centerbankAccountNo").val(data.bankAccountNo);       //银行帐号：
	    			$("#centerpayeerelationship").val(data.payeeInsRelationship);
	    			$("#centerpaymodetype").val(data.payMode);
	    			$("#objId").val(data.objId);
	    			$("#centerProvince").val(data.payeeProvince);       //所在省   
		        	 $("#centerCityCode").val(data.payeeCityCode);       //所在市   
//	    			 if(data.bankType!=null && data.bankType!=""){
//	    				 centerbankNamechange(data.bankType, data.bankName);//重新去接口取数据
//		    			 $("#spancenterbankSubName").html(data.bankSubName);
//			        	 $("#centerbankSubName").val(data.bankSubName);  //开户行
//			        	
//			         }
	    			 $("#propertyCenterBankName").val(data.bankName);
	    			 if(payStatus != '01'){
	 	        		$("#spancenterrelationshipRead").html(data.payeeInsRelationshipName);//与被保险人关系
		    			$("#spancenterpaymodeRead").html(data.payModeName);
		    			//银行、开户行
		    			 $("#spancenterbankNameListRead").html(data.bankName);
	    			 }else{
	 	        		$("#spancenterrelationship").html(data.payeeInsRelationshipName);//与被保险人关系
		    			$("#spancenterpaymode").html(data.payModeName);
		    			//银行、开户行
		    			 $("#spancenterbankNameList").html(data.bankName);
	    			 }
	 	        		/*$("#spancenterrelationship").html(data.payeeInsRelationshipName);//与被保险人关系
		    			$("#spancenterpaymode").html(data.payModeName);
		    			//银行、开户行
		    			 $("#spancenterbankNameList").html(data.bankName);*/
	    			 
	     			$("#divformPerson").css("display","none");
					$("#divformCenter").css("display","block");
					$("#hospitalInfo").css("display","none");
	    			 if(data.payMode=="3"){
							$("#span4").html("*");
//							$("#span5").html("*");
							$("#span6").html("*");
					}else{
							 $("#span4").html("");
//							 $("#span5").html("");
							 $("#span6").html("");
					}
	        	 }
        		var showDivArr=["divformPerson","divformCenter","hospitalInfo","TPAInfo"];
        		for ( var i = 0; i < showDivArr.length; i++) {
        			if(divId==showDivArr[i]){
        				$("#"+divId+"").css("display","block");
        			}else{
        				$("#"+showDivArr[i]+"").css("display","none");
        			}
        		}
	        	 //alert(data.bankAccountNo);
	        	//$("#payTbbody tr[id='"+id+"']").remove();
	        	//$(current).parent().parent().remove();
	        	
	        },
	        error: function(request) { 
	        	alert("获取信息失败。");
	        }
	    });
	}
	
	function changeCheckBox(objFlag,divId) {
		var showDivArr=["divformPerson","divformCenter","hospitalInfo","TPAInfo"];
		var showDivArr2=["divformHospital","divformTpa"];
		var checkedButArr=["geren","danwei","dpaHospital","tpaHospital"];
		for ( var i = 0; i < checkedButArr.length; i++) {
			if(objFlag.id!=checkedButArr[i]){
				$("#"+checkedButArr[i]).attr('class','check_no txt_blue');
			}else{
				$("#claimPayeeType").val((i+1));
			}
		}
		for ( var i = 0; i < showDivArr.length; i++) {
			if(divId==showDivArr[i]){
				$("#"+divId+"").css("display","block");
			}else{
				$("#"+showDivArr[i]+"").css("display","none");
			}
		}
		for ( var i = 0; i < showDivArr2.length; i++) {
			if(divId==showDivArr2[i] && $("#"+objFlag.id).is(".check_no")){
				showDiv(divId);
			}
		}
		clearPerson();
		clearCenter();
		$("#Tpa").val("");
		$("#yiyuan").val("");
		$("#partnerHospital").html('');
		$("#partnerTpa").html('');
		indexLine=null;
	}
	
	
	
	function addClmPayee(url,caseSource){
		if(!checkPaymodeType("payTbbody","spanPaymethodForObjId","spanpaymode")){
			alert("同一赔案下领款人支付方式请保持一致。");
			return;
		}
			if($("#spanpayeeInsRelationship").html()=="请选择类型"){
				alert("请选择领款人与被保人关系。");
				return ;
			}
			if($("#spanpersonidtype").html()=="请选择类型"){
				alert("请选择领款人证件类型。");
				return ;
			}
			if($("#spanpersonsex").html()=="请选择类型"){
				alert("请选择领款人性别。");
				return ;
			}
			if($("#spanpaymode").html()=="请选择类型"){
				alert("请选择领款人支付方式。");
				return ;
			}
			var payeerelationship = $("#divpayeerelationship_code").val();
			if(payeerelationship!=undefined){
				$("#payeerelationship").val(payeerelationship);
			}
			var divpayeeidcard = $("#divpayeeidcard_code").val();
			if(divpayeeidcard!=undefined){
				$("#payeeidcard").val(divpayeeidcard);
			}
			var divpayeesex = $("#divpayeesex_code").val(); 
			if(divpayeesex!=undefined){
				$("#payeesex").val(divpayeesex);
			}
			var divpaymodetype = $("#divpaymodetype_code").val();
			if(divpaymodetype!=undefined){
				$("#paymodetype").val(divpaymodetype);
			}
			if($.trim($("#payeerelationship").val()).length==0){
				alert("请选择领款人与被保人关系。");
				return ;
			}
			if($.trim($("#payeeidcard").val()).length==0){
				alert("请选择领款人证件类型。");
				return ;
			}
			if($.trim($("#payeesex").val()).length==0){
				alert("请选择领款人性别。");
				return ;
			}
			if($.trim($("#paymodetype").val()).length==0){
				alert("请选择领款人支付方式。");
				return ;
			}
			if($.trim($("#claimPayeeId").val()).length==0){
				alert("请填写领款人证件号码。");
				return ;
			}
			if($("#payeeidcard").val()=="a"){
				if(!checkIdentityCardTrueOrFalse($("#claimPayeeId").val())){
					alert("领款人身份证号码格式有误，请重新录入。");
					return;
				}
			}
			
			if($.trim($("#claimPayeeName").val()).length==0){
				alert("请填写领款人姓名。");
				return ;
			}
			if($("#payeePhone").val().length==0&&$("#payeeTel").val().length==0){
				alert("请填写领款人固话/移动电话。");
				return ;
			}
			var reg = /^1[358][0-9]{9}$/;
			if($.trim($("#payeePhone").val()).length!=0&&$.trim($("#payeePhone").val()).length!=11){
				alert("手机号码长度必须为11位。");
				return;
			}
			if($.trim($("#payeePhone").val()).length!=0){
				if(!reg.test($.trim($("#payeePhone").val()))){
					alert("手机号码 填写格式不正确，请重新填写。");
					return;
				}
			}
//			if($.trim($("#payeeProvince").val()).length==0){
//				alert("请填写领款人所在省");
//				return;
//			}
//			if($.trim($("#payeeCityCode").val()).length==0){
//				alert("请填写领款人所在市");
//				return;
//			}
			if($.trim($("#payeeContractAddr").val()).length==0){
				alert("请填写领款人联系地址。");
				return ;
			}
//			if($.trim($("#payeePostCode").val()).length==0){
//				alert("请填写领款人邮政编码。");
//				return ;
//			}
//			if($("#payeePostCode").val().length!=6){
//				alert("领款人邮编需为6位数字。");
//				return;
//			}else{
//				var regpc = /^[0-9]*$/;
//				if(!regpc.test($("#payeePostCode").val())){
//					alert("领款人邮编录入格式不正确，请重新录入。");
//					return;
//				}
//			}
//			if($.trim($("#payeeEmail").val()).length==0){
//				alert("请填写领款人邮箱。");
//				return ;
//			}
			if($("#payeeEmail").val().length!=0){
				if(!emailCheck($("#payeeEmail").val())){
					alert("领款人邮箱格式不正确，请重新录入。");
					return;
				}
			}
			debugger;
		if($("#paymodetype").val()=="3"){
			if(caseSource=='1'){
				$("#bankType").val($("#propertyBankType").val());
				$("#bankName").val($("#propertyBankName").val());
				if($.trim($("#bankType").val()).length==0){
					alert("请填写领款人银行名称。");
					return ;
				}
			}else{
				if($("#divbankName_code").val()!=undefined&&$("#divbankName_code").val()!=""){
					$("#bankType").val($("#divbankName_code").val());
				}
				if($("#spanBankName").html()!="请选择类型"){
					$("#bankName").val($("#spanBankName").html());
					if($.trim($("#bankType").val()).length==0){
						alert("请填写领款人银行名称。");
						return ;
					}
				}
					
			}
				
				
				
//				if($.trim($("#bankSubName").val()).length==0){
//					alert("请填写领款人开户行。");
//					return ;
//				}
				if($.trim($("#bankAccountNo").val()).length==0){
					alert("请填写领款人银行账号。");
					return ;
				}
		}else{
			$("#bankName").val("");
//			$("#bankSubName").val("");
			$("#bankAccountNo").val("");
		}
		$.ajax({
	        cache: true,
	        type: "POST",
	        url:url,
	        data:$('#formPerson').serialize(),// 你的formid
	        async: false,
	        error: function()
            {
	        	alert("领款人保存失败");
            },
	        success: function(data) {
	        	if(data.flag == "02"){
	        		alert(data.mesg);
	        		return;
	        	}
	        	if(data.flag == "00"){
	        		alert("保存成功！");
	        		SkipByPost("showall.do");
	        	}else{
	        		alert(data.mesg);
	        	}
	        	
        		if($("#objId").val()!=""&&$("#objId").val()!=undefined){
	        		var tr =$("#payTbbody").find("tr[id='"+$("#objId").val()+"']");
	        		tr.find("span[id='spanPayNameForObjId']").html(data.clmPayee.claimPayeeName);
	        		tr.find("span[id='spanRelationshipForObjId']").html(data.clmPayee.payeeInsRelationshipName);
	        		tr.find("span[id='spanPaymethodForObjId']").html(data.clmPayee.payModeName);
	        	}else{
	        		$("#payTbbody").append("<tr id="+data.clmPayee.objId+"><th width=\"6%\"><span id=\"payTbNumber\">"+(parseInt($("#payTbbody").find("tr").length)+1)+"</span></th>"+
	    			"<td width=\"9%\">"+data.clmPayee.claimPayeeName+"</td>"+
	                "<td width=\"17%\">同被保险人关系："+data.clmPayee.payeeInsRelationshipName+"</td>"+
                "<td width=\"12%\">支付方式：<span id=\"spanPaymethodForObjId\">"+data.clmPayee.payModeName+"</span></td>"+
	               "</tr>");
	        	}
	        	
	        	//如果保存成功需要去掉编辑的链接
				$("#geren").attr("class",'check_no txt_blue');
				$("#danwei").attr('class','check_no txt_blue');
	        	$("#divformPerson").css("display","none");
	        	$("#divformCenter").css("display","none");
	    		clearPerson();
	    		clearCenter();
	        }
	    });
	}
	
	
	function addClmPayeeForCom(url){
		if(!checkPaymodeType("payTbbody","spanPaymethodForObjId","spancenterpaymode")){
			alert("同一赔案下领款人支付方式请保持一致。");
			return;
		}
		if($("#spancenterrelationship").html()=="请选择类型"){
			alert("请选择领款人与被保人关系。");
			return ;
		}
		if($("#spancenterpaymode").html()=="请选择类型"){
			alert("请选择领款人支付方式。");
			return ;
		}
		var divcenterpayeerelationship = $("#divcenterpayeerelationship_code").val();
		if(divcenterpayeerelationship!=undefined){
			$("#centerpayeerelationship").val(divcenterpayeerelationship);
		}
		var divcenterpaymodetype = $("#divcenterpaymodetype_code").val();
		if(divcenterpaymodetype!=undefined){
			$("#centerpaymodetype").val(divcenterpaymodetype);
		}
		if($.trim($("#centerpayeerelationship").val()).length==0){
			alert("请选择领款人与被保人关系。");
			return ;
		}
		if($.trim($("#centerpaymodetype").val()).length==0){
			alert("请选择领款人支付方式。");
			return ;
		}
		if($.trim($("#centerCompanyName").val()).length==0){
			alert("请填写领款人公司名称。");
			return ;
		}
		if($("#centerpaymodetype").val()=="3"){
			if($("#divcenterbankNameList_code").val()!=undefined&&$("#divcenterbankNameList_code").val()!=""){
				$("#divbankType").val($("#divcenterbankNameList_code").val());
			}
			if($("#spancenterbankNameList").html()!="请选择类型")
			$("#bankAccountName").val($("#spancenterbankNameList").html());
			if($.trim($("#divbankType").val()).length==0){
				alert("请填写领款人银行名称。");
				return ;
			}
//			if($.trim($("#centerbankSubName").val()).length==0){
//				alert("请填写领款人开户行。");
//				return ;
//			}
			if($.trim($("#centerbankAccountNo").val()).length==0){
				alert("请填写领款人银行帐号。");
				return ;
			}
		}else{
			$("#bankAccountName").val("");
//			$("#centerbankSubName").val("");
			$("#centerbankAccountNo").val("");
		}
		$.ajax({
	        cache: true,
	        type: "POST",
	        url:url,
	        data:$('#formPerson').serialize(),// 你的formid
	        async: false,
	        error: function(request) {
	            alert("保存失败！");
	        },
	        success: function(data) {
	        	if(data.flag == "02"){
	        		alert(data.mesg);
	        		return;
	        	}
	        	if(data.flag == "00"){
	        		alert("保存成功！");
	        		SkipByPost("showall.do");
	        	}else{
	        		alert(data.mesg);
	        	}
	        	
		        	if($("#objId").val()!=""&&$("#objId").val()!=undefined){
		        		var tr =$("#payTbbody").find("tr[id='"+$("#objId").val()+"']");
		        		tr.find("span[id='spanPayNameForObjId']").html(data.claimPayeeName);
		        		tr.find("span[id='spanRelationshipForObjId']").html(data.payeeInsRelationshipName);
		        		tr.find("span[id='spanPaymethodForObjId']").html(data.payModeName);
		        	}else{
		        		$("#payTbbody").append("<tr id="+data.objId+"><th width=\"6%\" ><span id=\"payTbNumber\">"+(parseInt($("#payTbbody").find("tr").length)+1)+"</span></th>"+
	                        "<td width=\"9%\">"+data.claimPayeeName+"</td>"+
		                        "<td width=\"17%\">同被保险人关系："+data.payeeInsRelationshipName+"</td>"+
	                        "<td width=\"12%\">支付方式：<span id=\"spanPaymethodForObjId\">"+data.payModeName+"</span></td>"+
		                        "<td width=\"5%\"><a style=\"cursor: pointer;\" class=\"txt_blue\"  onclick=\"editClmPayeeQuery('"+data.objId+"',this)\">编辑</a></td>"+
	       	               "</tr>");
	        	}
	        	alert("保存成功！");
				$("#geren").attr("class",'check_no txt_blue');
				$("#danwei").attr('class','check_no txt_blue');
	        	$("#divformPerson").css("display","none");
	        	$("#divformCenter").css("display","none");
	        	clearPerson();
	        	clearCenter();
	            //onclick="editClmPayee(${a.objId },this)"
	        }
	    });
	}
	
	function addCXClmPayeeForCom(url,casesource){
		if(!checkPaymodeType("payTbbody","spanPaymethodForObjId","spancenterpaymode")){
			alert("同一赔案下领款人支付方式请保持一致。");
			return;
		}
		if($("#spancenterrelationship").html()=="请选择类型"){
			alert("请选择领款人与被保人关系。");
			return ;
		}
		if($("#spancenterpaymode").html()=="请选择类型"){
			alert("请选择领款人支付方式。");
			return ;
		}
		var divcenterpayeerelationship = $("#divcenterpayeerelationship_code").val();
		if(divcenterpayeerelationship!=undefined){
			$("#centerpayeerelationship").val(divcenterpayeerelationship);
		}
		var divcenterpaymodetype = $("#divcenterpaymodetype_code").val();
		if(divcenterpaymodetype!=undefined){
			$("#centerpaymodetype").val(divcenterpaymodetype);
		}
		if($.trim($("#centerpayeerelationship").val()).length==0){
			alert("请选择领款人与被保人关系。");
			return ;
		}
		if($.trim($("#centerpaymodetype").val()).length==0){
			alert("请选择领款人支付方式。");
			return ;
		}
		if($.trim($("#centerCompanyName").val()).length==0){
			alert("请填写领款人公司名称。");
			return ;
		}
		if($("#centerpaymodetype").val()=="3"){
			$("#divbankType").val($("#propertyCenterBankType").val());
			$("#bankAccountName").val($("#propertyCenterBankName").val());
			if($.trim($("#divbankType").val()).length==0){
				alert("请填写领款人银行名称。");
				return ;
			}
//			if($.trim($("#centerbankSubName").val()).length==0){
//				alert("请填写领款人开户行。");
//				return ;
//			}
			if($.trim($("#centerbankAccountNo").val()).length==0){
				alert("请填写领款人银行帐号。");
				return ;
			}
		}else{
			$("#bankAccountName").val("");
//			$("#centerbankSubName").val("");
			$("#centerbankAccountNo").val("");
		}
		$.ajax({
	        cache: true,
	        type: "POST",
	        url:url,
	        data:$('#formPerson').serialize(),// 你的formid
	        async: false,
	        error: function(request) {
	            alert("保存失败！");
	        },
	        success: function(data) {
		        	if($("#objId").val()!=""&&$("#objId").val()!=undefined){
		        		var tr =$("#payTbbody").find("tr[id='"+$("#objId").val()+"']");
		        		tr.find("span[id='spanPayNameForObjId']").html(data.claimPayeeName);
		        		tr.find("span[id='spanRelationshipForObjId']").html(data.payeeInsRelationshipName);
		        		tr.find("span[id='spanPaymethodForObjId']").html(data.payModeName);
		        	}else{
		        		$("#payTbbody").append("<tr id="+data.objId+"><th width=\"6%\" ><span id=\"payTbNumber\">"+(parseInt($("#payTbbody").find("tr").length)+1)+"</span></th>"+
	                        "<td width=\"9%\">"+data.claimPayeeName+"</td>"+
		                        "<td width=\"17%\">同被保险人关系："+data.payeeInsRelationshipName+"</td>"+
	                        "<td width=\"12%\">支付方式：<span id=\"spanPaymethodForObjId\">"+data.payModeName+"</span></td>"+
		                        "<td width=\"5%\"><a style=\"cursor: pointer;\" class=\"txt_blue\"  onclick=\"editClmPayeeQuery('"+data.objId+"',this)\">编辑</a></td>"+
	       	               "</tr>");
	        	}
	        	alert("保存成功！");
	        	SkipByPost("showall.do");
				$("#geren").attr("class",'check_no txt_blue');
				$("#danwei").attr('class','check_no txt_blue');
	        	$("#divformPerson").css("display","none");
	        	$("#divformCenter").css("display","none");
	        	clearPerson();
	        	clearCenter();
	            //onclick="editClmPayee(${a.objId },this)"
	        }
	    });
	}
	
	
	
	
	
	//个人领款人被保险人关系选择个人或被保人、投保人
	function relationshipChange(url,key,flag){
		if(key=="401" || key=="406"){//本人
			$.ajax({
		        cache: true,
		        type: "POST",
		        url:url,
		        data:{"cliamNo":$("#claimNo").val(),"flag" : flag},
		       // data:{"id":id,"claimNo":claimNo},// 你的formid
		        async: false,
		        error: function(request) {
		            alert("操作失败！");
		        },
		        success: function(data) {
		        	$("#spanpersonidtype").html(data.customerInfo.idtypeName);
		        	$("#payeeidcard").val(data.customerInfo.idtype);
		        	$("#claimPayeeId").val(data.customerInfo.pid);
					$("#claimPayeeName").val(data.customerInfo.name);
					$("#payeePhone").val(data.customerInfo.phone);
					$("#payeeTel").val(data.customerInfo.ftele);
					$("#payeeContractAddr").val(data.customerInfo.faddr);
					/*$("#personidtype").val("a");*/
					$("#payeePostCode").val(data.customerInfo.fzip);
					$("#payeesex").val(data.customerInfo.sex);
//					$("#repInsRelationship").val("401");
//					$("#spanrepInsRelationship").html("本人");
					$("#payeeEmail").val(data.customerInfo.email);
					if(data.customerInfo.sex=="1"){
						$("#spanpersonsex").html("男");
					}else{
						$("#spanpersonsex").html("女");
					}
					
		        }
		    });
		}else if(key=="407"){//投保人
			
		}
	}
	
	function checkPaymodeType(tblName,spanName,chooseName){
		var paymodeList = $("#"+tblName).find("tr");
		for (var i = 0; i < paymodeList.length; i++) {
	
			var paymodeSpan = $(paymodeList[i]).find("SPAN[id='"+spanName+"']").html();
			if($("#objId").val()!=null&&$("#objId").val()!=undefined){
				if($("#objId").val() == $(paymodeList[i]).attr("id")){
					continue;
				}
			}
			if(paymodeSpan!=$("#"+chooseName).html()){
				return false;
			}
		}
		return true;
		
		
	}
	
	
	
	
	function tipSearch(flag){
		var bankname = null;
		if(flag=='1'){
			bankname = $("#propertyBankName").val();
		}else if(flag=='2'){
			bankname = $("#propertyCenterBankName").val();
		}
		
		$.ajax({
			type:"POST",
			url:"queryPropertyBank.do",
			data:{"bankname":bankname},
			error:function(){
			},
			success:function(data){
				if(flag=='1'){
					var ul=$("<ul id=\"tip\"></ul>");
					if(data.length>0){
						for ( var i = 0; i < data.length; i++) {
							$(ul).append("<li style=\"background-color:#FFFFFF\" onmouseover=\"changbackclrFn(this)\" onblur=\"displayNone('1')\" onclick=\"selectedCompanyInfoFn('"+data[i].bankName+"','"+data[i].bankGroupCode+"','1')\">"+data[i].bankName+"</li>");
						}
						$("#tip-div").html(ul);
						$("#tip-div").css("display","");
					}else{
						$("#tip-div").css("display","none");
					}
				}else if(flag=='2'){
					var ul=$("<ul id=\"top\"></ul>");
					if(data.length>0){
						for ( var i = 0; i < data.length; i++) {
							$(ul).append("<li style=\"background-color:#FFFFFF\" onmouseover=\"changbackclrFn(this)\" onblur=\"displayNone('2')\" onclick=\"selectedCompanyInfoFn('"+data[i].bankName+"','"+data[i].bankGroupCode+"','2')\">"+data[i].bankName+"</li>");
						}
						$("#top-div").html(ul);
						$("#top-div").css("display","");
					}else{
						$("#top-div").css("display","none");
					}
				}
				
			}
		});
	}
	
	
	function selectedCompanyInfoFn(bankName,bankGroupCode,flag){
		if(flag=='1'){
			$("#propertyBankName").val(bankName);
			$("#propertyBankType").val(bankGroupCode);
			$("#tip-div").css("display","none");
		}else if(flag=='2'){
			$("#propertyCenterBankName").val(bankName);
			$("#propertyCenterBankType").val(bankGroupCode);
			$("#top-div").css("display","none");
		}
		
	}
	
	function changbackclrFn(flag){
		$(flag).css("background-color", "#e5e5e5").siblings().css("background-color", "#FFFFFF");
	}
	function displayNone(flag){
		if(flag=='1'){
			$("#tip").css("display","none");
		}else if(flag=='2'){
			$("#top").css("display","none");
		}
		
	}
	
	
	
	//邮箱校验
	function emailCheck(str){
	//  var pattern =/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/;
		var pattern =/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	   return pattern.test(str);  
	}