function BizinsCount() {
	this.cp = null;
	this.detail = null;
	this.canselectsc = null;
	this.spControl = new hashtable();
	this.inscontrol = new hashtable();
	this.premiumtrial_ = new Array();// 计算多家保险公司保费计算结果
	this.result = null;
	this.dispose = function() {
		if (this.createForm != null) {
			this.createForm.module.dispose();
			this.createForm.module = null;
			this.createForm = null;
		}
		this.inscontrol = this.premiumtrial_ = this.canselectsc = this.spControl = this.cp = null;
	}
	this.createForm = null;
	
	this.PremiumtrialOn = function() {
		this.premiumtrial_.clear();
		if(!this.validata ()){// 验证
			return;
		}
		this.getcarpar();
		this.getdetail();
		if(this.getValue(getspSelectControl('displacement',"displacement", this))!=null){//排量
		this.detail.emission = '1000';
		}else{
		this.detail.emission = '2000';
		}
		this.cp.cardetail = this.detail;
		var inszone =null;
		var companyno_ =null;
		if (getspSelectControl('inszone', "inszone", this) != null) {
			 inszone = this.getValue(getspSelectControl('inszone',"inszone", this));// 投保区域
		}
		if (getspSelectControl('companyno', "companyselect", this) != null) {
			 companyno_ = this.getValue(getspSelectControl('companyno',"companyselect", this));// 投保公司
		}
		var checkItem=LEAP.checkbox.getCheckedItem(getspSelectControl('companyselect', "companyselect", this));
		
		
		var companylist = new Array();//选择保险公司
		var inslist = new Array();//选择的选种
		var _code = new Array("C101", "C102", "C103", "C104", "C105", "C201",
				"C202", "C203", "C204", "C205", "C207", "C208", 
				 "C211", "C901", "C902");
		for (var i = 0; i < _code.length; i++) {
			if (this.inscontrol.contains(_code[i])) 
			{
				var _con = this.inscontrol.getvalue(_code[i]);
				var _val = _con.getEasyValue();
				if(_val!=null){
				if(_val.split(',')[0]=='C206_C207')
				{
				inslist.add('C206,1');
				inslist.add('C207,1');
				}
				else if(_val.split(',')[0]=='C208_C209_C210'){
				inslist.add('C208,1');
				inslist.add('C209,1');
				inslist.add('C210,1');
   			    }
				else
				{
					inslist.add(_val);
				}
			  }
			}
		}
		for (var k = 0; k < LEAP.checkbox.getCheckedCount(getspSelectControl('companyselect', "companyselect", this)); k++) 
			{
				var comp= null;
				if(companyno_.startWith(',')){
				comp= companyno_.split(',')[k+1];
				}
				else{
				comp= companyno_.split(',')[k];
				}
				companylist.add(inszone+comp);
			}
		var getEasyCal = LEAP.request('getEasyCal', {companylist : companylist,inslist : inslist,cp : this.cp}); 
		if(getEasyCal!=null&&getEasyCal.length>0){
		for (var r = 0; r < getEasyCal.length; r++) {
			if (getEasyCal[r] != null) {
				var checkItemcompany=null;
				if(companyno_.startWith(',')){
				checkItemcompany=checkItem.getvalue(companyno_.split(',')[r+1]);
				}
				else{
				checkItemcompany=checkItem.getvalue(companyno_.split(',')[r]);
				}
				getEasyCal[r].requiredpic=checkItemcompany;
				var dis=0;
				var Fxian=0;
				var Cxian=0;
				var etEasy=getEasyCal[r].insurcode.length;
				for(var f=0;f<etEasy;f++){
					if(getEasyCal[r].insurcode[f].premium!=null&&getEasyCal[r].insurcode[f].discountrate){
					dis +=getEasyCal[r].insurcode[f].premium*getEasyCal[r].insurcode[f].discountrate;//合计
					}
//					if (getEasyCal[r].insurcode[f].generacode == 'C201') {debugger
//						if (getEasyCal[r].insurcode[f].suminsured == '-1') {
//							getEasyCal[r].insurcode[f].suminsured = '国产';
//						} else {
//							getEasyCal[r].insurcode[f].suminsured = '进口';
//						}
//					}
//					if(getEasyCal[r].insurcode[f].suminsured =='1'){
//							getEasyCal[r].insurcode[f].suminsured='按折旧价';
//					}
					if(getEasyCal[r].insurcode[f].generacode=='C206'||getEasyCal[r].insurcode[f].generacode=='C207'){//车上人员附加险额
					Cxian +=getEasyCal[r].insurcode[f].premium*getEasyCal[r].insurcode[f].discountrate;
					getEasyCal[r].insurcode.removeindex(f);//删除车上人险不计免赔
					etEasy--;
					f--;
					}
					else if(getEasyCal[r].insurcode[f].generacode=='C208'||getEasyCal[r].insurcode[f].generacode=='C209'||getEasyCal[r].insurcode[f].generacode=='C210')
					{
					Fxian +=getEasyCal[r].insurcode[f].premium*getEasyCal[r].insurcode[f].discountrate;
					getEasyCal[r].insurcode.removeindex(f);//删除附加险不计免赔
					etEasy--;
					f--;
					}
				}
				getEasyCal[r].disall=dis;
				getEasyCal[r].sumconstraintpreiumrate=Fxian;//附加险
				getEasyCal[r].discountconstraintpreiumrate=Cxian;//车上人员不计
				getEasyCal[r].payment=this.cp.regisdate;//登記日期
				this.premiumtrial_.add(getEasyCal[r]);// 计算多家保险公司
			}
		}
		this.popWindow ('popwin5');
		this.setDiv(this.premiumtrial_);
	}
	else{
	alert('计算结果为空');
	}
//		 if (this.createForm == null) {
//		 this.createForm = LEAP.form.create('BizinsZZ', "保费试算");
//		 LEAP.form.setSize(this.createForm.form, 740, 400);
//		 } else
//		 this.createForm.module.clearPageData();
//		 LEAP.form.show(this.createForm.form);
//
//		//传送数据
//		 this.createForm.module.setDiv(this.premiumtrial_);
		 
		checkItemcompany=inslist =companylist =getEasyCal =checkIem=this.result =companyno_ =this.canselectsc = null;
	}
	this.fnzonevalueChange = function()// 选择投保地区事件
	{
		var inszone = this.getUT("inszone");// 投保地区
		var zoneno = LEAP.select.getValue(inszone);// 得到投保地区选择值
		this.innerradio(zoneno);
		zoneno = inszone = null;
	}
	this.innerradio = function(zoneno) {// 显示投保公司
		var companyselect = this.getUT("companyselect");// 投保公司
		var company=Scar.getPar("company");
		var result = LEAP.request('getinscompanyfromzoneno', {
			par : zoneno
		});
		companyselect.innerHTML = "";
		if(result!=null&&result.length>0){
		for (var i = 0; i < result.length; i++) {
			companyselect.innerHTML += "<div class='checkbox_div' ctf='checkbox_item' style='height:20px;'><label ctf='checkbox_label' class='checkbox_unchecked' value='"
					+ result[i].companyno
					+ "'>"
					+ result[i].fullname
					+ "</label></div>";
//			LEAP.checkbox.addItem(companyselect, result[i].fullname, result[i].companyno,false);
		}
		if(company!=null&&company!=''){
				LEAP.checkbox.setValue(companyselect,company);
			}
			
		}
		result =companyselect =null;
	}
	this.changecartype = function() {
		var cartype = this.getUT("cartype");
		var select_C902 = this.getUT("select_C902");
		var deadweight = this.getUT("deadweight");
		var displacement = this.getUT("displacement");
		if (LEAP.select.getValue(cartype) == 'BE4820DE-058E-4F91-9F28-838F4FD680F2') {
			deadweight.readOnly = true;
			LEAP.radio.setDisabled(displacement, false, null, '01');
		} else {
			deadweight.readOnly = false;
			LEAP.radio.setDisabled(displacement, true, null, '01');
		}
	displacement =deadweight = deadweight =select_C902 =cartype =null;
	}
	this.intit = function() {
		var item_C102 = this.getUT("item_C102");// 机动车第三者责任险
		var item_C104 = this.getUT("item_C104");// 车上人员司机位
		var item_C105 = this.getUT("item_C105");// 车上人员乘客位
		var item_C201 = this.getUT("item_C201");// 玻璃单独破碎损失险
		var item_C202 = this.getUT("item_C202");// 车身划痕损失险
		var select_C204 = this.getUT("select_C204");// 车辆
		var select_C205 = this.getUT("select_C205");// 三者
		var select_C206_C207 = this.getUT("select_C206_C207");// 车上人员
		var select_C211 = this.getUT("select_C211");// 盗抢
		var deadweight = this.getUT("deadweight");// 自重

		item_C102.readOnly = true;
		item_C104.readOnly = true;
		item_C105.readOnly = true;
		item_C201.readOnly = true;
		item_C202.readOnly = true;
		 LEAP.radio.setDisabled(select_C204, true, null, '01');
		 LEAP.radio.setDisabled(select_C205, true, null, '01');
		 LEAP.radio.setDisabled(select_C206_C207, true, null, '01');
		 LEAP.radio.setDisabled(select_C211, true, null, '01');
		deadweight.readOnly = true;
		deadweight =select_C211 =select_C206_C207 =select_C205 =select_C204 =item_C202 =item_C201 =item_C105 =item_C104 =item_C102 =null;
	}
	this.oclickradio = function(arg) {
		if(arg.arg!=null){
		var select_C204 = this.getUT("select_C204");
		var select_C205 = this.getUT("select_C205");
		var select_C211 = this.getUT("select_C211");
		var select_C206_C207 = this.getUT("select_C206_C207");
		var select_C104 = this.getUT("select_C104");
		var select_C105 = this.getUT("select_C105");
		if (arg.arg2.newvalue != null) {
			arg.arg.readOnly = false;
			if(arg.arg2.radio.id=='001'){
				this.setValue(arg.arg, this.getValue('[ut=newcarprice]'));
				LEAP.radio.setDisabled(select_C204, false, null, '01');
			}else if(arg.arg2.radio.id=='002'){
			LEAP.select.setValue(arg.arg, '200000');
			LEAP.radio.setDisabled(select_C205, false, null, '01');
			}else if(arg.arg2.radio.id=='003'){
			this.setValue(arg.arg, this.getValue('[ut=newcarprice]'));
			LEAP.radio.setDisabled(select_C211, false, null, '01');
			}else if(arg.arg2.radio.id=='004'){
			LEAP.select.setValue(arg.arg, '50000');	
			LEAP.radio.setDisabled(select_C206_C207, false, null, '01');
			}else if(arg.arg2.radio.id=='005'){
			LEAP.select.setValue(arg.arg, '50000');
			LEAP.radio.setDisabled(select_C206_C207, false, null, '01');
			}else if(arg.arg2.radio.id=='006'){
			LEAP.select.setValue(arg.arg, '-1');
			}else if(arg.arg2.radio.id=='007'){
			LEAP.select.setValue(arg.arg, '2000');
			}else if(arg.arg2.radio.id=='008'){
			this.setValue(arg.arg, this.getValue('[ut=newcarprice]'));
			}
		} else {
			this.setValue(arg.arg, '');
			arg.arg.readOnly = true;
			if(arg.arg2.radio.id=='001'){
			LEAP.radio.setDisabled(select_C204, true, null, '01');
			}else if(arg.arg2.radio.id=='002'){
			LEAP.select.setValue(arg.arg, '');
			LEAP.radio.setDisabled(select_C205, true, null, '01');
			}else if(arg.arg2.radio.id=='003'){
			LEAP.radio.setDisabled(select_C211, true, null, '01');
			}else if(arg.arg2.radio.id=='004'||arg.arg2.radio.id=='005'){
				if(LEAP.radio.getValue(select_C104)==null&&LEAP.radio.getValue(select_C105)==null){
					LEAP.select.setValue(arg.arg, '');
					LEAP.select.setValue(arg.arg, '');
				   LEAP.radio.setDisabled(select_C206_C207, true, null, '01');
				}
			}else if(arg.arg2.radio.id=='006'){
			LEAP.select.setValue(arg.arg, '');
			}else if(arg.arg2.radio.id=='007'){
			LEAP.select.setValue(arg.arg, '');
			}else if(arg.arg2.radio.id=='008'){
			this.setValue(arg.arg, '');
			}
		}
		}
		select_C105 =select_C104 =select_C211 =select_C206_C207 =select_C205 =select_C204 =arg=null;
	}
	this.ablur = function() {
		if (LEAP.radio.getValue('[ut=select_C101]') != null) {
			this.setValue('[ut=xz_C101]', this.getValue('[ut=newcarprice]'));
		}
		if (LEAP.radio.getValue('[ut=select_C103]') != null) {
			this.setValue('[ut=input_C103]', this.getValue('[ut=newcarprice]'));
		}
		if (LEAP.radio.getValue('[ut=select_C203]') != null) {
			this.setValue('[ut=xz_C203]', this.getValue('[ut=newcarprice]'));
		}

	}
	this.pageLoad = function() {
		this.initInsCode_();
		var inszone = this.getUT("inszone");// 投保地区
		var premiumtrial = this.getUT("premiumtrial");// 保费试算按钮
		var cartype = this.getUT("cartype");
		var newcarprice = this.getUT("newcarprice");
	    var item_C102 = this.getUT("item_C102");
	    var item_C104 = this.getUT("item_C104");
	    var item_C105 = this.getUT("item_C105");
	    var item_C201 = this.getUT("item_C201");
	    var item_C202 = this.getUT("item_C202");
		//this.tip();//提示帮助
		this.intit();
		try {
//			setinszonevalue(inszone);
			var city=Scar.getPar("city");
			var ins=Scar.getPar("ins");
			if(city!=null&&city!=''){
				LEAP.select.setValue(inszone,city);
				var zoneno = LEAP.select.getValue(inszone);// 得到投保地区选择值
				this.innerradio(zoneno);
			}
			if(ins!=null&&ins!=''){
				switch (parseInt(ins))
				   {
				   case 1:
				     LEAP.radio.setValue('[ut=select_C101]','01') ;
				     LEAP.radio.setValue('[ut=select_C102]','01') ;
				     LEAP.select.setValue('[ut=item_C102]','100000') ;
				     item_C102.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C901]','01') ;
				     LEAP.radio.setDisabled('[ut=select_C204]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C205]', false, null, '01');
				     LEAP.radio.setValue('[ut=select_C204]','01') ;
				     LEAP.radio.setValue('[ut=select_C205]','01') ;
				     break
				   case 2:
				     LEAP.radio.setValue('[ut=select_C101]','01') ;
				     LEAP.radio.setValue('[ut=select_C102]','01') ;
				     LEAP.select.setValue('[ut=item_C102]','200000') ;
				     item_C102.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C103]','01') ;
				     LEAP.radio.setValue('[ut=select_C901]','01') ;
				     
				     LEAP.radio.setDisabled('[ut=select_C204]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C205]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C211]', false, null, '01');
				     LEAP.radio.setValue('[ut=select_C204]','01') ;
				     LEAP.radio.setValue('[ut=select_C205]','01') ;
				     LEAP.radio.setValue('[ut=select_C211]','01') ;
				     break
			       case 3:
				     LEAP.radio.setValue('[ut=select_C101]','01') ;
				     LEAP.radio.setValue('[ut=select_C102]','01') ;
				     LEAP.select.setValue('[ut=item_C102]','500000') ;
				     item_C102.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C103]','01') ;
				     LEAP.radio.setValue('[ut=select_C104]','01') ;
				     LEAP.select.setValue('[ut=item_C104]','10000') ;
				     item_C104.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C105]','01') ;
				     LEAP.select.setValue('[ut=item_C105]','10000') ;
				     item_C105.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C901]','01') ;
				     
				     LEAP.radio.setDisabled('[ut=select_C204]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C205]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C211]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C206_C207]', false, null, '01');
				     LEAP.radio.setValue('[ut=select_C204]','01') ;
				     LEAP.radio.setValue('[ut=select_C205]','01') ;
				     LEAP.radio.setValue('[ut=select_C211]','01') ;
				     LEAP.radio.setValue('[ut=select_C206_C207]','01') ;
				     break
			       case 4:
				     LEAP.radio.setValue('[ut=select_C101]','01') ;
				     LEAP.radio.setValue('[ut=select_C102]','01') ;
				     LEAP.select.setValue('[ut=item_C102]','1000000') ;
				     item_C102.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C103]','01') ;
				     LEAP.radio.setValue('[ut=select_C104]','01') ;
				     LEAP.select.setValue('[ut=item_C104]','10000') ;
				     item_C104.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C105]','01') ;
				     LEAP.select.setValue('[ut=item_C105]','10000') ;
				     item_C105.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C901]','01') ;
				     LEAP.radio.setValue('[ut=select_C201]','01') ;
				     LEAP.select.setValue('[ut=item_C201]','-1') ;
				     item_C201.readOnly = false;
				     LEAP.radio.setValue('[ut=select_C202]','01') ;
				     LEAP.select.setValue('[ut=item_C202]','2000') ;
				     item_C202.readOnly = false;
				     
				     LEAP.radio.setDisabled('[ut=select_C204]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C205]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C211]', false, null, '01');
				     LEAP.radio.setDisabled('[ut=select_C206_C207]', false, null, '01');
				     LEAP.radio.setValue('[ut=select_C204]','01') ;
				     LEAP.radio.setValue('[ut=select_C205]','01') ;
				     LEAP.radio.setValue('[ut=select_C211]','01') ;
				     LEAP.radio.setValue('[ut=select_C206_C207]','01') ;
				     break
				   case 0:
				     break
				   default:
				}
			}
//			else
//			{
//			this.setValue(inszone, '440300');
//			}
//			LEAP.select.setValue('[ut=cartype]',
//					"BE4820DE-058E-4F91-9F28-838F4FD680F2");
//			LEAP.select.setValue('[ut=belongselect]',
//					"6E58ED12-A376-49BC-BD42-33B16D7FCAE6");
//			LEAP.select.setValue('[ut=usetypeselect]',
//					"3D444E25-1330-430E-80D1-D300A9D262E8");
//			LEAP.date.setValue('[ut=regisdate]',LEAP.formatdate(new Date(), 1)); 
//			this.setValue('[ut=tonnage]', "0");
			this.addEvent(inszone, 'valueChange', this.fnzonevalueChange);
			this.addEvent(premiumtrial, 'click', this.PremiumtrialOn);
			this.addEvent(cartype, 'valueChange', this.changecartype);
			this.addEvent('[ut=select_C101]', 'valueChange', this.oclickradio,
					this.getUT("xz_C101"));
			this.addEvent('[ut=select_C102]', 'valueChange', this.oclickradio,
					this.getUT("item_C102"));
			this.addEvent('[ut=select_C103]', 'valueChange', this.oclickradio,
					this.getUT("input_C103"));
			this.addEvent('[ut=select_C104]', 'valueChange', this.oclickradio,
					this.getUT("item_C104"));
			this.addEvent('[ut=select_C105]', 'valueChange', this.oclickradio,
					this.getUT("item_C105"));
			this.addEvent('[ut=select_C201]', 'valueChange', this.oclickradio,
					this.getUT("item_C201"));
			this.addEvent('[ut=select_C202]', 'valueChange', this.oclickradio,
					this.getUT("item_C202"));
			this.addEvent('[ut=select_C203]', 'valueChange', this.oclickradio,
					this.getUT("xz_C203"));
			this.addEvent('[ut=select_C902]', 'valueChange', this.oclickradio);
			this.addEvent(newcarprice, 'blur', this.ablur);
		} finally {
			item_C102 =item_C104 =item_C105 =item_C201 =item_C202=newcarprice=zoneno = premiumtrial = inszone = null;
		}
	}
	this.tip = function() {
		LEAP.check.setTip('[ut=ssxian]',
						'车辆损失险是指保险车辆在条款约定的责任范围内发生了意外事故，造成了车辆的部分或者全部的损失，以及为减少保险车辆的损失所支付的必要的、合理的施救费用，保险公司将按合同规定进行赔偿。本险种的保险金额可以按以下几种方式确定：（一）按投保时与保险车辆同种车型的新车购置价；（二）按投保时与保险车辆同种车型的新车购置价扣减折旧部分；（三）投保人与保险公司协商确定。为了您在理赔时赔偿能更加充分，此处我们为您选择“方式（一）”');
		LEAP.check.setTip('[ut=sdsxian]',
						'机动车第三者责任险，车辆保险合同中保险公司称为“第一者”，投保车险的车主称为“第二者”，除保险公司和车主之外的称为“第三者”。这里所说的“第三者责任险”，是指被保险人或其允许的合格驾驶员在使用保险车辆过程中，发生意外事故，致使第三者遭 受人身伤亡和财产的直接损毁，依法应当由被保险人支付的赔偿金额，保险公司依照法律法规和保险合同的规定给予赔偿。');
		LEAP.check.setTip('[ut=dqxian]',
						'全车盗抢损失险，是指保险车辆全车被盗窃、被抢劫、被抢夺，经县级以上公安刑侦部门立案核实，满三个月未查明下落的，保险公司负责赔偿；如果车被盗抢后，在三个月内找回了，但是在此期间车辆损坏或零部件丢失，保险公司负责赔偿修复费用。 全车盗抢险的保险金额应在保险车辆的实际价值内确定，如果您的车是二手车，请按购车发票的票面价格和车辆的折旧价格中较低的作为保险金额，以最少的保费获得最大程度的保障。实际价值是指用新车购置价减去折旧金额的价格，按照国家规定：一般情况下，个人家庭自用轿车的使用期限为15年，比如您的车已使用3年整，您车的实际价值=新车购置价×（1-3×12×6‰）。在您投保时，页面上提示您的金额即是系统自动算出的车辆实际价值。');
		LEAP.check.setTip('[ut=cssjxian]',
						'车上人员责任险司机座位是第三者责任险的附加险，负责赔偿保险车辆在使用过程中由于发生意外事故造成的本车驾驶员座位人员的伤亡，可选择投保。');
		LEAP.check.setTip('[ut=csryxian]',
						'车上人员责任险乘客座位是第三者责任险的附加险，负责赔偿保险车辆由于发生意外事故造成的本车指定乘客座位的伤亡，可选择投保。为行驶证核定的载客数减去驾驶员座位的其它全部座位。');
		LEAP.check.setTip('[ut=blpsxian]',
						'玻璃单独破碎损失险，当本车玻璃（不包括灯具和车镜玻璃）发生单独破碎时，保险公司负责按照实际损失赔偿。如果您的车辆为进口车辆，在投保该险别时，可以选择出险后安装国产风挡玻璃还是进口风挡玻璃，这在保费的确定上是有区别的。无论从实用还是节省保费的角度考虑，我们都建议您选择国产玻璃。');
		LEAP.check.setTip('[ut=cshhxian]','车身划痕损失险，保险车辆发生无明显碰撞痕迹的车身表面油漆单独划伤，保险公司按实际损失进入赔偿，赔偿金额累计达到赔偿限额时，本附加险保险责任终止。');
		LEAP.check.setTip('[ut=zrxian]','自燃损失险，如果发生因本车电路、线路、供油系统发生故障及运载货物自身原因起火燃烧，造成保险车辆损失，保险公司将按照保险合同的规定对损失进行赔偿。通常情况下，使用时间在三年以上的车辆应考虑投保此险别，它的保险金额确定的方法与盗抢险相同，须在投保车辆的实际价值之内确定。');
		LEAP.check.setTip('[ut=bjxian]','不计免赔率是指发生保险事故后，按照合同约定，投保人选择投保的车辆损失险、第三者责任险、车上人员责任险（司机/乘客），以及车身划痕等附加险，在事故责任免赔率计算时，应当由被保险人自行承担的免赔金额部分，保险公司负责赔偿。车损不计免赔特约险是车辆损失险的附加险，只有选择了以上险种之一的方可投保，保费为以上险种保费的15%三者不计免赔特约险是商业第三者责任险的附加险，只有选择了商业第三者责任险方可投保，保费为商业第三者责任险保费的15%车上人员不计免赔特约险是车上人员责任险（司机、乘客险）的附加险，只有选择了司机/乘客座位责任险中的一个或者两个的方可投保，保费为车上人员责任险保费的15%附加不计免赔特约险是所有合同中规定了事故责任免赔率或绝对免赔率的附加险种的附加险，只有选择了（自燃损失险、车身划痕险等附加险）其中的一个或者多个的方可投保，保费为所投保设有免赔率附加险保费之和的15%。');
		LEAP.check.setTip('[ut=jqxian]','机动车交通事故责任强制险，影响交强险费率浮动因素及比率如下：上一个年度未发生有责任道路交通事故，浮动比例为-10%；上两个年度未发生有责任道路交通事故，浮动比例为-20%；上三个及以上年度未发生有责任道路交通事故，浮动比例为-30%；上一个年度发生一次有责任不涉及死亡的道路交通事故，浮动比例为0%；上一个年度发生两次及两次以上有责任道路交通事故，浮动比例为10%；上一个年度发生有责任道路交通死亡事故，浮动比例为30%。交强险最终保险费计算方法是：交强险最终保险费＝交强险基础保险费×（1+与道路交通事故相联系的浮动比率）。');
		LEAP.check.setTip('[ut=ccxian]','车船税属于地方税，由地方税务机关负责征收管理。对于机动车，为了方便纳税人缴税，节约纳税人的缴税成本和时间，《条例》规定从事机动车交通事故责任强制保险业务的保险机构为车船税的扣缴义务人，在销售机动车交通事故责任强制保险时,纳税人未能提供完税或免税证明的，应代收代缴车船税，并及时向国库解缴税款。货车自重：货车购买车船税的计税单位，指机动车的整备质量。对于机动车行驶证上未注明整备质量参数的，按总质量减去核定载质量的差额作为计税吨位，或由纳税人提供能确认车辆整备质量的相关资料。根据实施细则第二十九条规定：“车辆自重尾数在0.5吨以下（含0.5吨）的，按照0.5吨计算；超过0.5吨的，按1吨计算。”客车排气量≤1升：此种排气量的客车车船税的纳税额比其它排气量的客车的缴纳额少，为避免多交税，请按实际选择。');
	}
	this.getdetail = function() {
		if (this.detail == null) {
			this.detail = new Object();
			this.detail.javaClass = "com.longrise.LEAP.FISP.BO.carinsdatadetailmodel";
		}
		this.detail.carbrandid = '8587793C-B651-428E-9E6F-D0A3073002F6';
		this.detail.carmodelid = '7257A9D4-3D7D-4E73-B2A7-9F4A8111BC86';
		this.detail.id = 'ACD1005AHA';
		this.detail.cartype = this.getValue(getspSelectControl('cartype',
				"cartype", this));
		this.detail.seating = this.getValue(getspSelectControl('seating',
				"seating", this));
		this.detail.price = this.getValue(getspSelectControl('newcarprice',
				"newcarprice", this));
		this.detail.tonnage = this.getValue(getspSelectControl('tonnage',
				"tonnage", this));

	}
	this.getcarpar = function() {
		if (this.cp == null) {
			this.cp = new Object();
			this.cp.javaClass = "com.longrise.LEAP.FISP.BO.carparameters";
		}

		// if ( getspSelectControl('companyno',"companyselect",this) != null )
		// {
		// this.cp.companyno =
		// this.getValue(getspSelectControl('companyno',"companyselect",this));//投保公司
		// }

		if (getspSelectControl('zoneno', "inszone", this) != null) {
			this.cp.zoneno = LEAP.select.getValue(getspSelectControl('zoneno',
					"inszone", this));// 投保地区
		}

		if (getspSelectControl('isrenewal', "isrenewalselect", this) != null) {
			this.cp.isrenewal = LEAP.select.getValue(getspSelectControl(
					'isrenewal', "isrenewalselect", this));// 是否续保
		}

		if (getspSelectControl('belong', "belongselect", this) != null) {
			this.cp.belong = LEAP.select.getValue(getspSelectControl('belong',
					"belongselect", this));// 车辆所属
		}

		if (getspSelectControl('usetype', "usetypeselect", this) != null) {
			this.cp.usetype = LEAP.select.getValue(getspSelectControl(
					'usetype', "usetypeselect", this));// 使用用途
		}

		// if ( getspSelectControl('carlicensezoneno',"carbelongzone_city",this)
		// != null )
		// {
		// this.cp.carlicensezoneno = cinfo.curData.carbelongzone_city;//车辆所属城市
		// }

		// this.cp.cardetail =carIn ;//carIn this.selectcar
		this.cp.routing = "";

		this.cp.regisdate = this.getValue(getspSelectControl('regisdate',
				"regisdate", this));// 登记日期
		// this.cp.commercebegin = cinfo.curData.commercebegin;//商业险起保日期
		// this.cp.constraintbegin = cinfo.curData.constraintbegin;//交强险起保日期

		if (getspSelectControl('deadweight', "deadweight", this) != null&&this.getValue(getspSelectControl('deadweight',
					"deadweight", this))) {
			this.cp.deadweight = this.getValue(getspSelectControl('deadweight',
					"deadweight", this));// 货车自重(吨)
		}

		if (getspSelectControl('newcarprice', "newcarprice", this) != null&&this.getValue(getspSelectControl(
					'newcarprice', "newcarprice", this))) {
			this.cp.suminsured = this.getValue(getspSelectControl(
					'newcarprice', "newcarprice", this));// 新车购置价
		}

		this.cp.robberysumins = 0;

			// k = null;
	}
	this.initInsCode_ = function() {
		this.inscontrol.clear();
		var _code = new Array("C101", "C102", "C103", "C104", "C105", "C201",
				"C202", "C203", "C204", "C205", "C206", "C207", "C208", "C209",
				"C210", "C211", "C901", "C902");
		for (var i = 0; i < _code.length; i++) {
			var _control = new InsControl();
			_control.initInsControl_(_code[i], this);
			this.inscontrol.add(_code[i], _control);
			_control = null;
		}
		_code = null;
	}
	this.validata = function() {// 验证数据
		if (getspSelectControl('companyselect', "companyselect", this) != null) {
			if (LEAP.checkbox.getCheckedCount(getspSelectControl('companyselect', "companyselect", this))  == 0) {
				alert('请选择保险公司！');
				return false;
			} else if(LEAP.checkbox.getCheckedCount(getspSelectControl('companyselect', "companyselect", this))>3) {
				alert('最多只能选择三家保险公司！');
				return false;
			}
		}
		if (getspSelectControl('regisdate', "regisdate", this) != null) {
			if (this.getValue(getspSelectControl('regisdate', "regisdate", this))== null||this.getValue(getspSelectControl('regisdate', "regisdate", this))=='')
			{
				alert('车辆登记日期必须填写！');
				return false;
			}
		}
		if (getspSelectControl_MD('newcarpric', "newcarprice", this) != null) {
		if (this.getValue(getspSelectControl_MD('newcarpric', "newcarprice", this)).toString().Trim()== '')
		{
			alert('新车购置价必须填写！');
			return false;
		}
		else{
			if(	LEAP.parsenum(this.getValue(getspSelectControl_MD('newcarpric', "newcarprice", this)).toString().Trim())==null ){
				alert('新车购置价必须为数字！');
				return false;
			}
		}
		}
		if (getspSelectControl_MD('seatin', "seating", this) != null) {
		if (this.getValue(getspSelectControl_MD('seatin', "seating", this)).toString().Trim()== '')
		{
			alert('座位数必须填写！');
			return false;
		}
		else{
			if(	LEAP.parsenum(this.getValue(getspSelectControl_MD('seatin', "seating", this)).toString().Trim())==null ){
				alert('座位数必须为数字！');
				return false;
			}
		}
		}
		if (getspSelectControl_MD('tonnag', "tonnage", this) != null) {
		if (this.getValue(getspSelectControl_MD('tonnag', "tonnage", this)).toString().Trim()== '')
		{
			alert('吨位必须填写！');
			return false;
		}
		else{
			if(	LEAP.parsenum(this.getValue(getspSelectControl_MD('tonnag', "tonnage", this)).toString().Trim())==null ){
				alert('吨位必须为数字！');
				return false;
			}
		}
		}
		if(LEAP.radio.getValue('[ut=select_C101]')!=null){
		if (getspSelectControl_MD('xz_C101_', "xz_C101", this) != null) {
		if (this.getValue(getspSelectControl_MD('xz_C101_', "xz_C101", this)).toString().Trim()== '')
		{
			alert('机动车损必须填写！');
			return false;
		}
		else{
			if(	LEAP.parsenum(this.getValue(getspSelectControl_MD('xz_C101_', "xz_C101", this)).toString().Trim())==null ){
				alert('机动车损必须为数字！');
				return false;
			}
		}
		}
		}
		if (getspSelectControl_MD('cartyp', "cartype", this) != null) {
		if (LEAP.select.getValue(getspSelectControl_MD('cartyp', "cartype", this)) == '35021B88-27CC-4E21-AE78-4EA34FF801B2')//货车
		{
			if (getspSelectControl_MD('deadweigh', "deadweight", this) != null) {
			if (this.getValue(getspSelectControl_MD('deadweigh', "deadweight", this)).toString().Trim()== '')
			{
				alert('货车自重必须填写！');
				return false;
			}
			}
		}
		if (this.getValue(getspSelectControl_MD('deadweigh', "deadweight", this)).toString().Trim()!= ''){
			if(	LEAP.parsenum(this.getValue(getspSelectControl_MD('deadweigh', "deadweight", this)).toString().Trim())==null ){
				alert('货车自重必须为数字！');
				return false;
				}
		}
		}
		return true;
	}
this.premiumtresult = new hashtable();// 计算多家保险公司保费计算结果
	var listBizType=new Array("C101", "C102", "C103", "C104", "C105", "C201",
				"C202", "C203", "C204", "C205", "C206", "C207", "C208", "C209",
				"C210", "C211", "C901", "C902");

this.popWindow = function(POPW_N){
 var popn=document.getElementById(POPW_N)
 if(popn.style.display=='none'){
  popn.style.display='';
 }
}

function popWindow_quit(POPW_N){
var popn=document.getElementById(POPW_N)
    popn.style.display='none';
}	
this.setDiv=function(date)
	{
		var tab=this.getUT("div");
		tab.innerHTML="";
		if(date ==null&&date[0]!=null)
			return;
		//折扣提示	
		 var discountrate = this.getUT('discountrate');
		 var asEndDate=DateConvert.DateToString(new Date());
		 var year=DateConvert.DateCompare_year(date[0].payment,asEndDate);
//		 if(date[0].insurcode[0].discountrate!=null||date[0].insurcode[0].discountrate!=''){
		 if(year>=1){
		 discountrate.innerHTML="";
		 discountrate.innerHTML="折扣率：旧车商业险0.7折";
		 }else{
		 discountrate.innerHTML="";
		 discountrate.innerHTML="折扣率：新车商业险0.855折(注：深圳地区为0.95折)";
		 }
//		 }
		
		var tableDiv=null;
		tableDiv=document.createElement("table");
		tableDiv.id="tab";
		tableDiv.width="100%";
		tableDiv.className="noborder";
		
		
		//tableDiv.style="padding:0px;border-collapse:collapse;border:1px solid #666666";
		//tableDiv.style.backgroundColor="red";
		var beginCellNum=3;  //起始列数
		
		//创建表头
		var trHead=tableDiv.insertRow(0);		
		var tdHead0=trHead.insertCell(0);
		tdHead0.className="noborder1";
		tdHead0.width="100px";		
		tdHead0.innerHTML="险种类型";
		
		var tdHead1=trHead.insertCell(1);	
		tdHead1.width="210px";
		tdHead1.className="noborder1";
		tdHead1.innerHTML="险种"
		
		var tdHead2=trHead.insertCell(2);
		tdHead2.width="100px";
		tdHead2.className="noborder1";
		tdHead2.innerHTML="保额";	
		
		
				
		var b1=false;//附加不计
		var b2= false;//车上人员不计
		for(var i=0;i<date.length;i++)
		{
			var tdHead=null;
			tdHead=trHead.insertCell(beginCellNum+i);
			tdHead.width="80";
			tdHead.className="noborder1";
			tdHead.innerHTML=date[i].requiredpic;			
			if(date[i].discountconstraintpreiumrate !=null&&date[i].discountconstraintpreiumrate !=0){
			 	b1=true;
			}
			if(date[i].sumconstraintpreiumrate !=null&&date[i].sumconstraintpreiumrate !=0)
			{
				b2= true;
			}
		}
		
		
		//创建数据行
		var intI=1;
		var premiumbe=null;
		if(date[0]!=null)
		{		
			//var tempItems=this.returnBigItem(date);
			//date[0].insurcode[0].generacode
			var str="";
			var intRowspan=1;
			for(var i=0;i<listBizType.length;i++)
			{
				//获取此险类型是否需要显示
				
				
				
				var temp=this.falg(date,listBizType[i])
				if(temp != null)
				{
					//遍历第一条数据得到行
					var tableRow=null;			
					
					//写入行
					tableRow=tableDiv.insertRow(intI);
					tableRow.className="noborder";

					var	tableCell=tableRow.insertCell(0);

					tableCell.className="noborder";
					tableCell.innerHTML=temp.subclassid;
			
					
					
					tableCell=tableRow.insertCell(1);
					tableCell.className="noborder";
					tableCell.innerHTML=temp.generaname;
					
					tableCell=tableRow.insertCell(2);
					tableCell.className="noborder";
					if(temp.generacode=='C902')//保额
					{
						premiumbe=temp.premium;
					}else if(temp.generacode=='C901')
					{
						premiumbe=temp.premium;
					}else
					{
						premiumbe=temp.suminsured;
					}
					tableCell.innerHTML=this.changeNum(premiumbe,2);
					for(var j=0;j<date.length;j++)
					{					
						tableCell=tableRow.insertCell(beginCellNum+j);
						tableCell.className="noborder";			
						var tempsuminsured=this.returnSuminsured(date[j],listBizType[i]);
						tableCell.innerHTML=this.changeNum(tempsuminsured,2);
					}
					
					intI++;
				}
				if(b2 &&　listBizType[i]=="C211"){
					//附加不计					
					tableRow=tableDiv.insertRow(intI);
					tableRow.className="noborder";
					//写入列
					var tableCell=tableRow.insertCell(0);
					tableCell.className="noborder";
					tableCell.innerHTML="附加险";
					
					tableCell=tableRow.insertCell(1);
					tableCell.className="noborder";
					tableCell.innerHTML="附加险不计免赔";
					
					tableCell=tableRow.insertCell(2);
					tableCell.className="noborder";
					tableCell.innerHTML="　";
					
					for(var j=0;j<date.length;j++)
					{
						tableCell=tableRow.insertCell(beginCellNum+j);
						tableCell.className="noborder";
						tableCell.innerHTML=this.changeNum(date[j].sumconstraintpreiumrate,2);
					}
					intI++;
					}
					if(b1 && listBizType[i]=="C211"){					
					//车上人员不计
					tableRow=tableDiv.insertRow(intI);
					tableRow.className="noborder";
					//写入列
					var tableCell=tableRow.insertCell(0);
					tableCell.className="noborder";
					tableCell.innerHTML="附加险";
					
					tableCell=tableRow.insertCell(1);
					tableCell.className="noborder";
					tableCell.innerHTML="车上人员责任险不计免赔";
					
					tableCell=tableRow.insertCell(2);
					tableCell.className="noborder";
					tableCell.innerHTML="　";
					
					for(var j=0;j<date.length;j++)
					{
						tableCell=tableRow.insertCell(beginCellNum+j);
						tableCell.className="noborder";
						tableCell.innerHTML=this.changeNum(date[j].discountconstraintpreiumrate,2);
					}
					intI++;
					}
				
			}
		}
		//商业险小计
		tableRow=tableDiv.insertRow(intI);
		tableRow.className="noborder";
		//写入列
		var tableCell=tableRow.insertCell(0);
		tableCell.className="noborder";
		tableCell.innerHTML="商业险小计";
		
		tableCell=tableRow.insertCell(1);
		tableCell.className="noborder";
		tableCell.innerHTML="折后保费";
		
		tableCell=tableRow.insertCell(2);
		tableCell.className="noborder";
		tableCell.innerHTML="　";

		for(var j=0;j<date.length;j++)
		{
			var cartaxconstraint=0;
			for(var n=0;n<date[j].insurcode.length;n++){
			if(date[j].insurcode[n].generacode=='C901'||date[j].insurcode[n].generacode=='C902'){
			cartaxconstraint +=date[j].insurcode[n].premium*date[j].insurcode[n].discountrate;
			}
			}
			tableCell=tableRow.insertCell(beginCellNum+j);
			tableCell.className="noborder";
			tableCell.innerHTML=this.changeNum(date[j].disall-cartaxconstraint,2);
		}
		cartaxconstraint=null;
		intI++;
		//合计
		tableRow=tableDiv.insertRow(intI);
		tableRow.className="noborder";
		//写入列
		var tableCell=tableRow.insertCell(0);
		tableCell.className="noborder";
		tableCell.innerHTML="合计";
		
		tableCell=tableRow.insertCell(1);
		tableCell.className="noborder";
		tableCell.innerHTML="　";
		
		tableCell=tableRow.insertCell(2);
		tableCell.className="noborder";
		tableCell.innerHTML="　";

		for(var j=0;j<date.length;j++)
		{
			tableCell=tableRow.insertCell(beginCellNum+j);
			tableCell.className="noborder";
			tableCell.innerHTML=this.changeNum(date[j].disall,2);
		}
		intI++;
		//链接车险
		tableRow=tableDiv.insertRow(intI);
		tableRow.className="noborder";
		//写入列
		var tableCell=tableRow.insertCell(0);
		tableCell.className="noborder";
		tableCell.innerHTML="　";
		
		tableCell=tableRow.insertCell(1);
		tableCell.className="noborder";
		tableCell.innerHTML="　";
		
		tableCell=tableRow.insertCell(2);
		tableCell.className="noborder";
		tableCell.innerHTML="　";

		for(var j=0;j<date.length;j++)
		{
			tableCell=tableRow.insertCell(beginCellNum+j);
			tableCell.className="noborder";
			tableCell.innerHTML="<a  href='../InsyiShopCarInsure' ><img src='/images/Insyi/fisp.gif'  style='margin:0px;border:0px;'></a>";
		}
		tab.appendChild(tableDiv);
		premiumbe=null;

		//合并单元格
		var intR=1;
		var strR="";
		var tempRecored=1;
		for(var i=1;i<tableDiv.rows.length;i++)
		{		
			var tempstr=tableDiv.rows[i].cells[0].innerHTML;
			if(strR.indexOf(tempstr) != -1 )
			{
				tableDiv.rows[i].removeChild(tableDiv.rows[i].cells[0]);
				intR++;
			}
			else
			{
				if(strR.indexOf(tempstr) == -1 && i != 1)
				{
					tableDiv.rows[tempRecored].cells[0].rowSpan=intR;
					intR=1;
					tempRecored=i;
				}
				strR+=tempstr+"|";
			}	
			
		}
		date=discountrate =null;
	}

	this.returnBigItem=function(Date)
	{
		var returnItems=null;		
		for(var i=0;i<Date.length;i++)
		{
			if(returnItems != null)
			{
				returnItems=returnItems.insurcode.length>Date[i].insurcode.length?returnItems:Date[i];
			}
			else
			{
				returnItems=Date[0];
			}
		}
		return returnItems;
	}
	//设置是否显示
	this.falg=function(Date,type)
	{
		var falg=null;
		for(var i=0;i<Date.length;i++)
		{
			for(var j=0;j<Date[i].insurcode.length;j++)
			{
				var temp=Date[i].insurcode[j];
				if(temp.creator !='' && temp.generacode==type)
					falg=temp;
			}
		}
		return falg;
	}
	
	//设置显示险种金额---保费
	this.returnSuminsured = function(item, type) {
		var returnValue = " 0 ";
		for (var i = 0; i < item.insurcode.length; i++) {
			if (item.insurcode[i].generacode == type) {
					returnValue = item.insurcode[i].premium* item.insurcode[i].discountrate;
			}
		}
		return returnValue;
	}
	this.changeNum = function(num,n)  
	{
		var  dd=1;  
		var  tempnum;  
		for(i=0;i<n;i++)  
		{  
			dd*=10;  
		}  
		tempnum=num*dd;  
		tempnum=Math.round(tempnum);  
		return tempnum / dd;
	}
}
