var flg=true;

function submitEventForm(){
	
	if(checkInfo()){
		
		$.ajax({
			type:"POST", 
			url:"checkRepeat.do",
			 data:$('#claimEventForm').serialize(),
			error :function(){
				alert("系统错误，请稍后再试。");
				$("#saveInfo").attr("onclick","saveReceiptPage()");
			},
			success :function(data){
				if(data=="00"){
					$('#claimEventForm').submit();
				}else if(data=="01"){
					alert("数据录入事件信息重复。");
					$("#saveInfo").attr("onclick","saveReceiptPage()");
				}else{
					alert(data+"手术已超过次数限制");
				}
			}
		});
		
	}
}

function checkInfo(){
	var accsby_ = $("#accTypesBy_").val();
	var isBpo = $("#isBpo").val();
	if(accsby_==""||accsby_==undefined){
		alert("请选择索赔事故性质。");
		return false;
	}
	if($("#pregnancyMemo").val().length>200){
		alert("怀孕信息情况字数超限，应为200字。");
		return;
	}  
	if($("#hospitalizedDays").val().length!=0){
		var regpc = /^[0-9]*$/;
		if(!regpc.test($("#hospitalizedDays").val())){
			alert("住院天数格式不正确，请重新录入。");
			return;
		}
	}
	if(isBpo=='N'){
		if($("#bedsandmealstopayDays").val().length!=0){
			var regpc = /^\+?[1-9]\d*$/;
			if(!regpc.test($("#bedsandmealstopayDays").val())){
				alert("床位费和膳食费赔付天数格式不正确，请重新录入。");
				return;
			}
		}
		if($("#extrabedDays").val().length!=0){
			var regpc = /^\+?[1-9]\d*$/;
			if(!regpc.test($("#extrabedDays").val())){
				alert("加床天数格式不正确，请重新录入。");
				return;
			}
		}
		if($("#mentalandpsychologicaDays").val().length!=0){
			var regpc = /^\+?[1-9]\d*$/;
			if(!regpc.test($("#mentalandpsychologicaDays").val())){
				alert("精神和心理障碍治疗天数格式不正确，请重新录入。");
				return;
			}
		}
		if($("#homecareDays").val().length!=0){
			var regpc = /^\+?[1-9]\d*$/;
			if(!regpc.test($("#homecareDays").val())){
				alert("家庭护理天数格式不正确，请重新录入。");
				return;
			}
		}
		if($("#hospicecareDays").val().length!=0){
			var regpc = /^\+?[1-9]\d*$/;
			if(!regpc.test($("#hospicecareDays").val())){
				alert("临终关怀天数格式不正确，请重新录入。");
				return;
			}
		}
	}
	var admissionDateTxt = $("#admissionDate").val();
	var dischargeDateTxt = $("#dischargeDate").val();
	var admsDate = parseInt(admissionDateTxt.replace("-","").replace("-",""));
	var dscgDate = parseInt(dischargeDateTxt.replace("-","").replace("-",""));
//	var day = DateDiff(admissionDateTxt,dischargeDateTxt)+1;
	var day = calcDay(admissionDateTxt,dischargeDateTxt);
	
	var accs = accsby_.split("_");
	for ( var i = 0; i < accs.length; i++) {
			if($("#claimIllsBy_").val()==""){
				alert("请选择疾病诊断信息。");
				return false;
			}
		if(accs[i]=="01"){
			if($("#deadDate").val()==""){
				alert("请选择身故日期。");
				return false;
			}
		}else if(accs[i]=="02"){
				if($("#visitDate").val()==""){
					alert("请选择就诊日期。");
					return false;
				}
			if($("#maimDate").val()==""){
				alert("请选择伤残鉴定日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
		}else if(accs[i]=="03"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
			if($("#illnessCode").val()==""){
				alert("请选择重疾代码。");
				return false;
			}
		}else if(accs[i]=="04"||accs[i]=="15"||accs[i]=="16"||accs[i]=="17"||accs[i]=="18"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
		}else if(accs[i]=="05"||accs[i]=="06"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
			if($("#admissionDate").val()==""){
				alert("请选择入院日期。");
				return false;
			}
			if($("#dischargeDate").val()==""){
				alert("请选择出院日期。");
				return false;
			}						
			if(dscgDate<admsDate){
				alert("出院日期不能早于入院日期。");
				return;
			}
			if($("#hospitalizedDays").val()==""){
				alert("请选择住院天数。");
				return false;
			}			
		}else if(accs[i]=="07"||accs[i]=="10"||accs[i]=="11"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if(flg){
				if($("#hospitalCode").val()==""){
					alert("请选择就诊医院。");
					return false;
				}
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
			if(dscgDate<admsDate){
				alert("出院日期不能早于入院日期。");
				return;
			}
		}else if(accs[i]=="09"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
			if(dscgDate<admsDate){
				alert("出院日期不能早于入院日期。");
				return;
			}
		}else if(accs[i]=="08"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#isBpo").val()!='N'){
				if($("#socialMedicalType").val()==""){
					alert("请选择医保类型。");
					return false;
				}
			}
			if(dscgDate<admsDate){
				alert("出院日期不能早于入院日期。");
				return;
			}
		}else if(accs[i]=="19"){
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
			if($("#surgeryType").val().trim()==""){
				alert("请选择手术类型。");
				return false;
			}
		}else if(accs[i]=="20"){
			if($("#clmIll").val()==""){
				alert("请选择疾病诊断。");
				return false;
			}
			if($("#visitDate").val()==""){
				alert("请选择就诊日期。");
				return false;
			}
			if($("#hospitalCode").val()==""){
				alert("请选择就诊医院。");
				return false;
			}
		}
	}
	if(day<parseInt($("#hospitalizedDays").val())){
		alert("住院天数不能大于出院日期-入院日期");
		return false;
	}
	return true;
}
function selectSurgeryType(val){
	$("#surgeryType_span").val(val);
	$("#surgeryType").val(val);
}
function calcDay(admissionDateTxt,dischargeDateTxt){
	var d=0;
//	var admissionDateTxt = admissionDateTxt;
//	var dischargeDateTxt = dischargeDateTxt;
	if(admissionDateTxt==""||dischargeDateTxt==""){
		return;
	}
	$.ajax({
        cache: true,
        type: "POST",
        url:"calcDays.do",
        data:{"admissionDate":admissionDateTxt,"dischargeDate":dischargeDateTxt},
        async: false,
        error: function(request) {
            alert("操作失败！");
        },
        success: function(data) {
        	if(data!="" && data>0){
        		d=data-1;
        	}else{
        		d=data;
        	}
        	
        	
        }
    });
	return d;
}
function dispatchClaimPage(){
	 $("#claimEventForm").attr("action","dispatcherClmInfoByMyTask.do");
	 $("#claimEventForm").submit();
}
function afterClaimPage(){
	$("#skipFlag").val("Y");
	 $("#claimEventForm").attr("action","dispatcherClmInfoByMyTask.do");
	 $("#claimEventForm").submit();
}

function dispatcherReceiptPage(receiptNo){
	$("#receiptNo").val(receiptNo);
	$("#claimEventForm").attr("action","dispatcherReceiptPage.do");
	$("#claimEventForm").submit();
}
/** 时间组件初始化 */
function dateCompInit(){
//	var date = new Date();
//	date.setDate(date.getDate()-1);
	$('#accidentDate').datepicker({
	 	yearRange:"-10:+10",
		duration:'fast',
		constrainInput:true,
		changeMonth:true,
		dateFormat:'yy-mm-dd',
		showButtonPanel:true,
		changeYear:true,
		maxDate:null,
		showAnim: ''
	    //onSelect:function(dateText,inst){}
	});	
	$('#firstDiagnoseDate').datepicker({
	 	yearRange:"-10:+10",
		duration:'fast',
		constrainInput:true,
		changeMonth:true,
		dateFormat:'yy-mm-dd',
		showButtonPanel:true,
		changeYear:true,
		maxDate:null,
		showAnim: ''
	    //onSelect:function(dateText,inst){}
	});	
}
//身故
function shenggu(a){
	if($('#shenggu').attr('class')=="re_icon1"){
		$('#shenggu').attr('class','re_icon1 re_icon1_cur');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5');
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#deadDatered").html("*");
		saveClaimAcc('add','01');
	}else{
		$('#shenggu').attr('class','re_icon1');
		saveClaimAcc('del','01');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//伤残
function shangchang(a){
	if($('#shangchang').attr('class')=="re_icon2"){
		$('#shenggu').attr('class','re_icon1'); 
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5');
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#shangchang').attr('class','re_icon2 re_icon2_cur');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','02');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#maimDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
	}else{
		$('#shangchang').attr('class','re_icon2');
		saveClaimAcc('del','02');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//重大疾病
function zhongda(a){
	if($('#zhongda').attr('class')=="re_icon3"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2'); 
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5');
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#zhongda').attr('class','re_icon3 re_icon3_cur');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','03');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("*");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#illnessCode").html("*");
		$("#zjClmIllred").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
	}else{
		saveClaimAcc('del','03');
		$('#zhongda').attr('class','re_icon3');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//门争论医疗
function menzhen(a){
	if($('#menzhen').attr('class')=="re_icon4"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3'); 
		$('#zhuyuanyiliao').attr('class','re_icon5');
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#menzhen').attr('class','re_icon4 re_icon4_cur');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','04');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
	}else{
		$('#menzhen').attr('class','re_icon4');
		saveClaimAcc('del','04');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
	
}
//住院医疗
function zhuyuanyiliao(a){
	if($('#zhuyuanyiliao').attr('class')=="re_icon5"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#zhuyuanyiliao').attr('class','re_icon5 re_icon5_cur');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','05');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("*");
		$("#dischargeDatered").html("*");
		$("#hospitalizedDaysred").html("*");
	}else{
		$('#zhuyuanyiliao').attr('class','re_icon5');
		saveClaimAcc('del','05');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}

function nvxingshengyu(a){
	if($('#nvxingshengyu').attr('class')=="re_icon7"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4'); 
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7 re_icon7_cur');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','07');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#nvxingshengyu').attr('class','re_icon7');
		saveClaimAcc('del','07');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}

//住院补贴
function zhuyuanbutie(a){
	if($('#zhuyuanbutie').attr('class')=="re_icon6"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6 re_icon6_cur');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','06');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("*");
		$("#dischargeDatered").html("*");
		$("#hospitalizedDaysred").html("*");
	}else{
		$('#zhuyuanbutie').attr('class','re_icon6');
		saveClaimAcc('del','06');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
function dentisty(a){
	if($('#dentisty').attr('class')=="re_icon8"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8 re_icon8_cur');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','08');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#dentisty').attr('class','re_icon8');
		saveClaimAcc('del','08');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
function onculist(a){
	if($('#onculist').attr('class')=="re_icon9"){
		flg=false;
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9 re_icon9_cur');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','09');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
//		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		flg=true;
		$('#onculist').attr('class','re_icon9');
		saveClaimAcc('del','09');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
function menzhendabing(a){
	if($('#menzhendabing').attr('class')=="re_icon11"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11 re_icon11_cur');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','10');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
	//	$("#haveSocialMedicalred").html("*");
	}else{
		$('#menzhendabing').attr('class','re_icon11');
		saveClaimAcc('del','10');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
function jinjiyake(a){
	if($('#jinjiyake').attr('class')=="re_icon10"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10 re_icon10_cur');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','11');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		if($("#isBpo").val()=='N'){
			$("#haveSocialMedicalred").html("");
		}else{
			$("#haveSocialMedicalred").html("*");
		}
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#jinjiyake').attr('class','re_icon10');
		saveClaimAcc('del','11');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//药房买药
function buymedicine(a){
	if($('#buymedicine').attr('class')=="re_icon12"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12 re_icon12_cur');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		saveClaimAcc('add','12');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#buymedicine').attr('class','re_icon12');
		saveClaimAcc('del','12');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//体检
function medical(a){
	if($('#medical').attr('class')=="re_icon13"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13 re_icon13_cur');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		saveClaimAcc('add','13');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#medical').attr('class','re_icon13');
		saveClaimAcc('del','13');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}
}
//女性疾病
function girlDisease(a){

	if($('#girlDisease').attr('class')=="re_icon14"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14 re_icon14_cur');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		saveClaimAcc('add','14');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}else{
		$('#girlDisease').attr('class','re_icon14');
		saveClaimAcc('del','14');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}


//艾滋病
function aids(a){

	if($('#aids').attr('class')=="re_icon15"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15 re_icon15_cur');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		saveClaimAcc('add','15');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
		
	
	}else{
		$('#aids').attr('class','re_icon15');
		saveClaimAcc('del','15');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}

//紧急医疗
function emergencymedical(a){

	if($('#emergencymedical').attr('class')=="re_icon16"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16 re_icon16_cur');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','16');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
	
	}else{
		$('#emergencymedical').attr('class','re_icon16');
		saveClaimAcc('del','16');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}
//体检疫苗
function medicalvaccine(a){

	if($('#medicalvaccine').attr('class')=="re_icon17"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17 re_icon17_cur');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','17');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
	
	}else{
		$('#medicalvaccine').attr('class','re_icon17');
		saveClaimAcc('del','17');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}

//先天性疾病
function congenitaldisease(a){

	if($('#congenitaldisease').attr('class')=="re_icon18"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18 re_icon18_cur');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','18');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
	
	}else{
		$('#congenitaldisease').attr('class','re_icon18');
		saveClaimAcc('del','18');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}
//心血管
function xinxueguan(a){

	if($('#xinxueguan').attr('class')=="re_icon19"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19 re_icon19_cur');
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('add','19');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#surgeryTypered").html("");
		$("#surgeryTypered").html("*");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
	
	}else{
		$('#xinxueguan').attr('class','re_icon19');
		saveClaimAcc('del','19');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#surgeryTypered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}

//骨折
function guzhe(a){

	if($('#guzhe').attr('class')=="re_icon20"){
		$('#shenggu').attr('class','re_icon1');
		$('#shangchang').attr('class','re_icon2');
		$('#zhongda').attr('class','re_icon3');
		$('#menzhen').attr('class','re_icon4');
		$('#zhuyuanyiliao').attr('class','re_icon5'); 
		$('#zhuyuanbutie').attr('class','re_icon6');
		$('#nvxingshengyu').attr('class','re_icon7');
		$('#dentisty').attr('class','re_icon8');
		$('#onculist').attr('class','re_icon9');
		$('#menzhendabing').attr('class','re_icon11');
		$('#jinjiyake').attr('class','re_icon10');
		$('#buymedicine').attr('class','re_icon12');
		$('#medical').attr('class','re_icon13');
		$('#girlDisease').attr('class','re_icon14');
		$('#aids').attr('class','re_icon15');
		$('#emergencymedical').attr('class','re_icon16');
		$('#medicalvaccine').attr('class','re_icon17');
		$('#congenitaldisease').attr('class','re_icon18');
		$('#xinxueguan').attr('class','re_icon19');
		$('#guzhe').attr('class','re_icon20 re_icon20_cur');
		saveClaimAcc('add','20');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#surgeryTypered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#clmIllred").html("*");
		$("#visitDatered").html("*");
		$("#hospitalNamered").html("*");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
		$("#bedsandmealstopayDays").html("");
		$("#extrabedDays").html("");
		$("#mentalandpsychologicaDays").html("");
		$("#homecareDays").html("");
		$("#hospicecareDays").html("");
	
	}else{
		$('#guzhe').attr('class','re_icon20');
		saveClaimAcc('del','20');
		$("#clmIllred").html("");
		$("#deadDatered").html("");
		$("#visitDatered").html("");
		$("#surgeryTypered").html("");
		$("#zjClmIllred").html("");
		$("#maimDatered").html("");
		$("#hospitalNamered").html("");
		$("#haveSocialMedicalred").html("");
		$("#admissionDatered").html("");
		$("#dischargeDatered").html("");
		$("#hospitalizedDaysred").html("");
	}

}

function checksp(id){
	if($("#"+id).is(".check_no")){
		$("#"+id).attr("class","check_yes");
	}else{
		$("#"+id).attr("class","check_no");
	}
}

	/**疾病诊断保存*/
	function saveDiv(id) {
		var jibing = 0;
		var jbname="";
//		$("#jbresultData").html("");
//		$("#claimIllsBy_").val("");
		$("#jbzd").find("span").each(function() {
			if ($(this).is(".check_yes")){
				if(jibing==0){
					jbname = $(this).attr("title")+$(this).attr("name");
					if($("#claimIllsBy_").val().length!=0){
						if($("#claimIllsBy_").val().indexOf($(this).attr("title"))<0){
							$("#claimIllsBy_").val($("#claimIllsBy_").val()+'_'+$(this).attr("title"));
							$("#jbresultData").append("<tr>" +
									"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
									"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
									"<td width=\"21%\"><a  style=\"cursor: pointer;\" class=\"icon_del\" onclick=\"deljbresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
									"</tr>");
						}
					}else{
						$("#claimIllsBy_").val($(this).attr("title"));
						$("#jbresultData").append("<tr>" +
								"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
								"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
								"<td width=\"21%\"><a  style=\"cursor: pointer;\" class=\"icon_del\" onclick=\"deljbresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
								"</tr>");
					}
				}else{
					if($("#claimIllsBy_").val().indexOf($(this).attr("title"))<0){
						$("#claimIllsBy_").val($("#claimIllsBy_").val()+'_'+$(this).attr("title"));
						$("#jbresultData").append("<tr>" +
								"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
								"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
								"<td width=\"21%\"><a  style=\"cursor: pointer;\" class=\"icon_del\" onclick=\"deljbresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
								"</tr>");
					}
					
				}
				jibing = jibing+1;
				
			}
		});

		$("#clmIll").val(jbname);
		if(jibing>1)
			$("#clmIll").val(jbname+"....");
		$.closePopupLayer(id);
	}
	
	/**重疾代码保存*/
	function saveZJDiv(id) {
		var jibing = 0;
		var jbname="";
//		$("#zjresultData").html("");
		//重疾代码以“_”分隔
//		$("#illnessCode").val("");
		$("#zjdm").find("span").each(function() {
			if ($(this).is(".check_yes")){
				if(jibing==0){
					jbname = $(this).attr("title")+$(this).attr("name");
					if($("#illnessCode").val().length!=0){
						if($("#illnessCode").val().indexOf($(this).attr("title"))<0){
							$("#illnessCode").val($("#illnessCode").val()+'_'+$(this).attr("title"));
							$("#zjresultData").append("<tr>" +
									"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
									"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
									"<td width=\"21%\"><a href=\"#\" class=\"icon_del\" onclick=\"delzjresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
									"</tr>");
						}
					}else{
						$("#illnessCode").val($(this).attr("title"));
						$("#zjresultData").append("<tr>" +
								"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
								"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
								"<td width=\"21%\"><a href=\"#\" class=\"icon_del\" onclick=\"delzjresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
								"</tr>");
					}
				}else{
					if($("#illnessCode").val().indexOf($(this).attr("title"))<0){
						$("#illnessCode").val($("#illnessCode").val()+'_'+$(this).attr("title"));
						$("#zjresultData").append("<tr>" +
								"<td width=\"23%\">"+$(this).attr("title")+"</td>" +
								"<td width=\"45%\">"+$(this).attr("name")+"</td>" +
								"<td width=\"21%\"><a href=\"#\" class=\"icon_del\" onclick=\"delzjresultData(this,'"+$(this).attr("title")+"')\"></a></td>" +
								"</tr>");
					}
					
				}
				jibing = jibing+1;
				
			}
		});

		$("#zjClmIll").val(jbname);
		if(jibing>1)
			$("#zjClmIll").val(jbname+"....");
		$.closePopupLayer(id);
	}
	
	
	function saveHospital(id) {
		var hospital = 0;
		var hospitalName="";
		var hospitalCode="";
		$("#hospitalInfoList").find("span").each(function() {
			if ($(this).is(".check_yes")){
				if(hospital==0){
					hospitalName = $(this).attr("name");
					hospitalCode = $(this).attr("title");
					$("#hospitalCode").val(hospitalCode);
					$("#hospitalName").val(hospitalName);
					hospital=1;
				}
				else {
					alert("只允许选择一个医院");
					$(this).attr("class","check_no");
				}
			}
		});

		$.closePopupLayer(id);
	}
	
	function saveSurgery(id) {
		var surgery = 0;
		var surgeryCode="";
		$("#surgeryInfoList").find("span").each(function() {
			if ($(this).is(".check_yes")){
				if(surgery==0){
					surgeryCode = $(this).attr("title");
					surgeryName = $(this).attr("name");
					$("#surgeryCode").val(surgeryCode); 
					$("#surgeryName").val(surgeryName); 
					surgery=1;
				}
				else {
					alert("只允许选择一个手术");
					$(this).attr("class","check_no");
				}
			}
		});

		$.closePopupLayer(id);
	}
	
	
	function deljbresultData(data,title){
		if(confirm("是否删除当前行！")){
			var trcurrent = $(data).parent().parent();
			trcurrent.remove();
			
			var jb = 0;
			var jbname="";
			$("#claimIllsBy_").val("");
			/*$("#jbzd").find("span").each(function() {
				if ($(this).is(".check_yes")){
					if(title==$(this).attr("title")){
						$(this).attr("class","check_no");
					}else{
						if(jb==0){
							jbname = $(this).attr("title")+$(this).attr("name");
							$("#claimIllsBy_").val($(this).attr("title"));
						}else{
							$("#claimIllsBy_").val($("#claimIllsBy_").val()+'_'+$(this).attr("title"));
						}
						jb = jb+1;
					}
				}
			});*/
			var tr = $("#jbresultData").find("tr");
			var code = "";
			for ( var int = 0; int < tr.length; int++) {
				code = code + $(tr[int]).find("td:eq(0)").html()+"_";
			}
			$("#claimIllsBy_").val(code.substring(0,code.length-1));
			if(tr.length>1){
				var code = $(tr[0]).find("td:eq(0)");
				var name = $(tr[0]).find("td:eq(1)");
				$("#clmIll").val(code.text()+" "+name.text()+"....");
			}else if(tr.length==1){
				var code = $(tr[0]).find("td:eq(0)");
				var name = $(tr[0]).find("td:eq(1)");
				$("#clmIll").val(code.text()+" "+name.text());
			}else{
				$("#clmIll").val("");
			}
			
		}
	}
	
	//重疾代码删除
	function delzjresultData(data,title){
		if(confirm("是否删除当前行！")){
			var trcurrent = $(data).parent().parent();
			trcurrent.remove();
			
			var jb = 0; 
			$("#illnessCode").val("");
			$("#zjdm").find("span").each(function() {
				if ($(this).is(".check_yes")){
					if(title==$(this).attr("title")){
						$(this).attr("class","check_no");
					}else{
						if(jb==0){
							$("#illnessCode").val($(this).attr("title"));
						}else{
							$("#illnessCode").val($("#illnessCode").val()+'_'+$(this).attr("title"));
						}
						jb = jb+1;
					}
				}
			});
			
			var tr = $("#zjresultData").find("tr");
			var code = "";
			for ( var int = 0; int < tr.length; int++) {
				code = code + $(tr[int]).find("td:eq(0)").html()+"_";
			}
			$("#illnessCode").val(code.substring(0,code.length-1));
			if(tr.length>1){
				var code = $(tr[0]).find("td:eq(0)");
				var name = $(tr[0]).find("td:eq(1)");
				$("#zjClmIll").val(code.text()+" "+name.text()+"....");
			}else if(tr.length==1){
				var code = $(tr[0]).find("td:eq(0)");
				var name = $(tr[0]).find("td:eq(1)");
				$("#zjClmIll").val(code.text()+" "+name.text());
			}else{
				$("#zjClmIll").val("");
			}
		}
	}
	
	/**数据判断是否存在值如果存在则删除掉
	 * @param arr
	 * @param val
	 * @returns {Boolean}
	 */
	function isCon(arr, val){
		for(var i=0; i<arr.length; i++){
			if(arr[i] == val){
				arr.splice(i,1); 
				return true;
			}
				
		}
		return false;
	}
	
	function checkDeadDateNotNull(){
		if($("#deadDate").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkVisitDateNotNull(){
		if($("#visitDate").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkMaimDateNotNull(){
		if($("#maimDate").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkHospitalNameNotNull(){
		if($("#hospitalName").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkSocialMedicalTypeNotNull(){
		if($("#socialMedicalType").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkIllnessCodeNotNull(){
		if($("#illnessCode").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkAdmissionDateNotNull(){
		if($("#admissionDate").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkDischargeDateNotNull(){
		if($("#dischargeDate").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkHospitalizedDaysNotNull(){
		if($("#hospitalizedDays").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	function checkClmIllNotNull(){
		if($("#clmIll").val()==''){
			return false;
		}else{
			return true;
		}
		
	}
	
	
	function claimEventCheckBox(dataId){
		if($("#"+dataId).is(".radio_no")){
			//医保类型
			if(dataId=="haveSocialMedical"){
				$("#notHaveSocialMedical").removeClass().addClass("radio_no");
				$("#haveSocialMedical").removeClass().addClass("radio_yes");
				$("#socialMedicalType").val("1");
			}
			if(dataId=="notHaveSocialMedical"){
				$("#haveSocialMedical").removeClass().addClass("radio_no");
				$("#notHaveSocialMedical").removeClass().addClass("radio_yes");
				$("#socialMedicalType").val("2");
			} 
			//是否转诊
			if(dataId=="changeHospital"){
				$("#notChangeHospital").removeClass().addClass("radio_no");
				$("#changeHospital").removeClass().addClass("radio_yes");
				$("#isChangeHospital").val("Y");
				$("#fromHospitalDoctorName").attr("readonly",false);
				$("#fromHospitalDeptName").attr("readonly",false);
				$("#fromHospitalName").attr("readonly",false);
			}
			if(dataId=="notChangeHospital"){
				$("#changeHospital").removeClass().addClass("radio_no");
				$("#notChangeHospital").removeClass().addClass("radio_yes");
				$("#isChangeHospital").val("N");
				$("#fromHospitalDoctorName").val("");
				$("#fromHospitalDeptName").val("");
				$("#fromHospitalName").val("");
				$("#fromHospitalDoctorName").attr("readonly","readonly");
				$("#fromHospitalDeptName").attr("readonly","readonly");
				$("#fromHospitalName").attr("readonly","readonly");
			}
			//预期是否单胎
			if(dataId=="singleEmbryo"){
				$("#notSingleEmbryo").removeClass().addClass("radio_no");
				$("#singleEmbryo").removeClass().addClass("radio_yes");
				$("#isSingleEmbryo").val("Y");
			}
			if(dataId=="notSingleEmbryo"){
				$("#singleEmbryo").removeClass().addClass("radio_no");
				$("#notSingleEmbryo").removeClass().addClass("radio_yes");
				$("#isSingleEmbryo").val("N");
			}
			//是否使用妊娠辅助医疗或人工授精 
			if(dataId=="useAssistMedical"){
				$("#notUseAssistMedical").removeClass().addClass("radio_no");
				$("#useAssistMedical").removeClass().addClass("radio_yes");
				$("#isUseAssistMedical").val("Y");
			}
			if(dataId=="notUseAssistMedical"){
				$("#useAssistMedical").removeClass().addClass("radio_no");
				$("#notUseAssistMedical").removeClass().addClass("radio_yes");
				$("#isUseAssistMedical").val("N");
			}
		}
	}
	function initclaimacc(){
		//accTypesBy_
		var accTypesStr = $("#accTypesBy_").val();
		var accTypes = accTypesStr.split("_");
		var i = 0 ;
		for(; accTypes != '' && i < accTypes.length ; i++ ){
			if(accTypes[i]=="01"){
    			$('#shenggu').attr('class','re_icon1 re_icon1_cur');
    			$("#clmIllred").html("*");
    			$("#deadDatered").html("*");
    		}
			if(accTypes[i]=="02"){
    			$('#shangchang').attr('class','re_icon2 re_icon2_cur'); 
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#maimDatered").html("*");
    			$("#hospitalNamered").html("*");
    		}
    		if(accTypes[i]=="03"){
    			$('#zhongda').attr('class','re_icon3 re_icon3_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#hospitalNamered").html("*");
    			$("#zjClmIllred").html("*");
    		}
    		if(accTypes[i]=="04"){
    			$('#menzhen').attr('class','re_icon4 re_icon4_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    		}
    		if(accTypes[i]=="05"){
    			$('#zhuyuanyiliao').attr('class','re_icon5 re_icon5_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("*");
    			$("#dischargeDatered").html("*");
    			$("#hospitalizedDaysred").html("*");
    		}
    		if(accTypes[i]=="06"){
    			$('#zhuyuanbutie').attr('class','re_icon6 re_icon6_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("*");
    			$("#dischargeDatered").html("*");
    			$("#hospitalizedDaysred").html("*");
    		}
    		if(accTypes[i]=="07"){
    			$('#nvxingshengyu').attr('class','re_icon7 re_icon7_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="08"){
    			$('#dentisty').attr('class','re_icon8 re_icon8_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="09"){
    			$('#onculist').attr('class','re_icon9 re_icon9_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			if($("#isBpo").val()=='N'){
//    				$("#hospitalNamered").html("");
    				$("#haveSocialMedicalred").html("");
    			}else{
//    				$("#hospitalNamered").html("*");
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="10"){
    			$('#menzhendabing').attr('class','re_icon11 re_icon11_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    		}
    		if(accTypes[i]=="11"){
    			$('#jinjiyake').attr('class','re_icon10 re_icon10_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			if($("#isBpo").val()=='N'){
    				$("#haveSocialMedicalred").html("");
    			}else{
    				$("#haveSocialMedicalred").html("*");
    			}
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="12"){
    			$('#buymedicine').attr('class','re_icon12 re_icon12_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("");
    			$("#hospitalNamered").html("");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="13"){
    			$('#medical').attr('class','re_icon13 re_icon13_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("");
    			$("#hospitalNamered").html("");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="14"){
    			$('#girlDisease').attr('class','re_icon14 re_icon14_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("");
    			$("#hospitalNamered").html("");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="15"){
    			$('#aids').attr('class','re_icon15 re_icon15_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("");
    			$("#hospitalNamered").html("");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="16"){
    			$('#emergencymedical').attr('class','re_icon16 re_icon16_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		
    		}
    		if(accTypes[i]=="17"){
    			$('#medicalvaccine').attr('class','re_icon17 re_icon17_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="18"){
    			$('#congenitaldisease').attr('class','re_icon18 re_icon18_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="19"){
    			$('#xinxueguan').attr('class','re_icon19 re_icon19_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		if(accTypes[i]=="20"){
    			$('#guzhe').attr('class','re_icon20 re_icon20_cur');
    			$("#clmIllred").html("*");
    			$("#visitDatered").html("*");
    			$("#hospitalNamered").html("*");
    			$("#haveSocialMedicalred").html("");
    			$("#admissionDatered").html("");
    			$("#dischargeDatered").html("");
    			$("#hospitalizedDaysred").html("");
    		}
    		
    		
		}
		
	}
	
	function saveClaimAcc(method,value){
		if(method=='add'){
			/*var accTypesStr = $("#accTypesBy_").val();
			var accTypes = accTypesStr.split("_");
			var i = 0 ;
			//判断是否已经保存了这个 索赔事故性质
			var flag = 0;
			for(; accTypes != '' && i < accTypes.length ; i++ ){
				if(accTypes[i]==value){
					flag = 1;
					break;
				}
			}
			if(flag==0){
				if($("#accTypesBy_").val()==''){
					$("#accTypesBy_").val(value);
				}else{
					$("#accTypesBy_").val($("#accTypesBy_").val()+"_"+value);
				}
			}*/
			$("#accTypesBy_").val(value);
		}
		
		if(method=='del'){
			/*var accTypesStr = $("#accTypesBy_").val();
			var accTypes = accTypesStr.split("_");
			var i = 0 ;
			//判断是否已经保存了这个 索赔事故性质
			var flag = 0;
			for(; accTypes != '' && i < accTypes.length ; i++ ){
				if(accTypes[i]==value){
					accTypes[i] = '00';
					flag = 1;
					break;
				}
			}
			if(flag==1){
				var accTypesNew = '';
				i = 0;
				var position = 0;
				for(; accTypes != '' && i < accTypes.length ; i++ ){
					if(accTypes[i]!='00'){
						if(position==0){
							accTypesNew = accTypes[i];
						}else{
							accTypesNew = accTypesNew + '_' + accTypes[i];
						}
						position++; 
					}
				}
				
				$("#accTypesBy_").val(accTypesNew);
			}*/
			$("#accTypesBy_").val("");
		}
		
	}

	
	//事件删除
	var index=0;
	function delTr(){ 
		var tr = $("#rcptBillTBL tr:eq("+index+")");
		var trId=tr.attr("id");
		if(trId!=""&&trId!=undefined){
			if(confirm("是否删除此收据信息？")){
				$.ajax({
					type:"POST",
					url:"delRcptBillInfo.do",
					data:'rcptNo='+trId,
					error :function(){
					},
					success :function(data){
						if(data.operFlag=="00"){
							alert("删除收据信息成功！");
							if(index!=0){
								$("#rcptBillTBL tr:eq("+index+")").remove();
								index=0;
							}
							$("#receiptCount").val(data.rcptCount);
						}else{
							alert("系统异常，删除收据信息失败。");
						}
					}
				});
			}
			
		}
	}
	function choosEd(flag){
		 
		$(flag).css("background-color", "#e5e5e5").siblings().css("background-color", "#FFFFFF");
		index=$(flag).index();
	}
	
	function calcDays(){
		var admissionDateTxt = $("#admissionDate").val();
		var dischargeDateTxt = $("#dischargeDate").val();
		if(admissionDateTxt==""||dischargeDateTxt==""){
			return;
		}
		$.ajax({
	        cache: true,
	        type: "POST",
	        url:"calcDays.do",
	        data:{"admissionDate":$("#admissionDate").val(),"dischargeDate":$("#dischargeDate").val()},
	        async: false,
	        error: function(request) {
	            alert("操作失败！");
	        },
	        success: function(data) {
	        	if(data!="" && data>0){
	        		$("#hospitalizedDays").val(data-1);
	        	}else{
	        		$("#hospitalizedDays").val(data);
	        	}
	        	
	        	
	        }
	    });
//		var day = DateDiff(admissionDateTxt,dischargeDateTxt)+1;
//		$("#hospitalizedDays").val(day);
	}
	
	//计算天数差的函数，通用  
	function DateDiff(date1,date2){
     var arr1=date1.split('-');
	 var arr2=date2.split('-');
	 var d1=new Date(arr1[0],arr1[1],arr1[2]);
	 var d2=new Date(arr2[0],arr2[1],arr2[2]);
	 var iDays=(d2.getTime()-d1.getTime())/(1000*3600*24);
	 return  iDays;
	}
	/**继续添加事件信息 **/
	
//	function goonAddEventInfo(){
//		$("#claimEventForm").attr("action","dispatcherEventPage.do");
//		$("#claimEventForm").submit();
//		
//	}
	  function showjbDiv(){
		  $("#jbzd").html("");
		  $("#jbcontent").val("");
		  
		  showDiv('open1');
	  }
	  function showzjDiv(){
		  $("#zjdm").html("");
		  $("#zjcontent").val("");
		  
		  showDiv('open4');
	  }
	  
	  function checkMoney(moneyInput){
			if($(moneyInput).val()!=""){
//				var mny = /(^\d+$)|(^\d+.\d+$)/g;
				var mny = /^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/;
				if(!mny.test($(moneyInput).val())){
					$(moneyInput).val("");
				}
			}
		}	