<!--
  function gettax( pretax ){
    var taxrate;
    var deduct;
    if(pretax<500){
      taxrate=0.05;
      deduct=0;}
    if (pretax>=500 && pretax<2000){
      taxrate=0.1;
      deduct=25;}
    if (pretax>=2000 && pretax<5000){
      taxrate=0.15;
      deduct=125;}
    if (pretax>=5000 && pretax<20000){
      taxrate=0.2;
      deduct=375;}
    if (pretax>=20000 && pretax<40000){
      taxrate=0.25;
      deduct=1375;}
    if (pretax>=40000 && pretax<60000){
      taxrate=0.3;
      deduct=3375;}
    if (pretax>=60000 && pretax<80000){
      taxrate=0.35;
      deduct=6375;}
    if (pretax>=80000 && pretax<100000){
      taxrate=0.4;
      deduct=10375;}
    if (pretax>=100000){
      taxrate=0.45;
      deduct=15375;}
    return (pretax*taxrate-deduct);
  }

  function gottax( aftertax ){
    var taxrate;
    var deduct;
    if (aftertax<475){
      taxrate=0.05;
      deduct=0;}
    if (aftertax>=475 && aftertax<1825){
      taxrate=0.1;
      deduct=25;}
    if (aftertax>=1825 && aftertax<4375){
      taxrate=0.15;
      deduct=125;}
    if (aftertax>=4375 && aftertax<16375){
      taxrate=0.2;
      deduct=375;}
    if (aftertax>=16375 && aftertax<31375){
      taxrate=0.25;
      deduct=1375;}
    if (aftertax>=31375 && aftertax<45375){
      taxrate=0.3;
      deduct=3375;}
    if (aftertax>=45375 && aftertax<58375){
      taxrate=0.35;
      deduct=6375;}
    if (aftertax>=58375 && aftertax<70375){
      taxrate=0.4;
      deduct=10375;}
    if (aftertax>=70375){
      taxrate=0.45;
      deduct=15375;}
    return ((aftertax-deduct)/(1-taxrate));
  }

  function getrewardtax(prereward){
    var taxrate;
    var deduct;
    if(prereward<20000){
      taxrate=0.2;
      deduct=0;}
    if (prereward>=20000 && prereward<50000){
      taxrate=0.3;
      deduct=2000;}
    if (prereward>=50000){
      taxrate=0.4;
      deduct=7000;}
    return (prereward*taxrate-deduct);
  }

  function gotrewardtax(afterreward){
    var taxrate;
    var deduct;
    if (afterreward<16000){
      taxrate=0.2;
      deduct=0;}
    if (afterreward>=16000 && afterreward<37000){
      taxrate=0.3;
      deduct=2000;}
    if(afterreward>=37000){
      taxrate=0.4;
      deduct=7000;}
    if(afterreward<3360){
      taxreward = (afterreward-800)/(1-taxrate);
    }else{
      taxreward = (afterreward-deduct)*(1-0.2)/(1-taxrate*(1-0.2));
    }
    return (taxreward);
  }
  
  
  function accountznjtax(date2,date1,time1,sum, mony){	
	Endday = new Date(date2.value);          
	StartDay = new Date(date1.value);            
	timeold = (Endday.getTime() - StartDay.getTime());    
	sectimeold = timeold/1000 ;         
	secondsold = Math.floor(sectimeold);         
	msPerDay = 24 * 60 * 60 * 1000  ;         
	timeold = (Endday.getTime() - StartDay.getTime());         
	e_daysold = timeold / msPerDay;         
	daysold = Math.floor(e_daysold);  
	if (daysold >= 0){
		time1.value = daysold;	
		var tempS_loop = date1.value.split("/");
		var tempE_loop = date2.value.split("/");
		var tempdatestart="";
		var tempdateend="";
		for (i = 0; i < tempS_loop.length; i++){
		  if (tempS_loop[i].length < 2)
		     tempS_loop[i] = 0 + tempS_loop[i];
		  if (tempE_loop[i].length < 2)
		     tempE_loop[i] = 0 + tempE_loop[i];
		  tempdatestart = tempdatestart + tempS_loop[i];
		  tempdateend = tempdateend + tempE_loop[i];
		}     
		if (tempdatestart < 20010501 && tempdateend < 20010501)
		{
		   sum.value = mony.value*0.002*daysold;
		}
		else if (tempdatestart >= 20010501 && tempdateend >= 20010501)
		{
		   sum.value = mony.value*0.0005*daysold;
		}
		else if (tempdatestart < 20010501 && tempdateend >= 20010501)
		{
			MidDay = new Date("2001/5/1");
			timeold = (MidDay.getTime() - StartDay.getTime());
			e_daysold = timeold / msPerDay;            
			secondsold = Math.floor(e_daysold);         
            zsbTime1 = mony.value*0.002*secondsold;
            
            timeold = (Endday.getTime() - MidDay.getTime());            
			e_daysold = timeold / msPerDay;            
			secondsold = Math.floor(e_daysold);               
            zsbTime2 = mony.value*0.0005*secondsold;
            
            sum.value = zsbTime1 + zsbTime2;
		}
		   
    }
	else{
	
	time1.value = '数据有误，请核实。'
	sum.value = '数据有误，请核实。'
        }

}
//-->