
var root;
function init(){
	XML_Data_Cfg.async = false;
	if(!XML_Data_Cfg.load("courtfee.xml")){
		alert("配置文件读取错误！");window.close();
		return;
	}
	root=XML_Data_Cfg.documentElement;
	bt1.checked=true;
	checkType();
}
window.onload=init;
var ns=null;
function checkType(){
	if(bt1.checked){
		ns=root.selectNodes("susong").item(0).childNodes;
	}
	else{
		ns=root.selectNodes("feisong").item(0).childNodes;
	}
	for(var i=0;i<ns.length;i++){
		szl.options[i]=new Option(ns.item(i).getAttribute("name"),ns.item(i).getAttribute("value"));
	}
	szl.length=ns.length;
	szl.selectedIndex=0;
	setZl();
}
function setZl(){
	var idx=szl.selectedIndex;
	var ts=ns.item(idx).childNodes;
	for(var i=0;i<ts.length;i++){
		slx.options[i]=new Option(ts.item(i).getAttribute("t"),ts.item(i).getAttribute("c"));
	}
	slx.length=ts.length;
	slx.selectedIndex=0;
}
function setlX(){
	nowcase.innerText=slx.options[slx.selectedIndex].text;
}

function startcount(){
	if(slx.selectedIndex==-1||slx.value==""){alert("请选择案件类型！");return;}
	if(biaodi.value==""){alert("请输入案件标的值！");return;}
	var r=runcount(parseInt(slx.value,10),parseInt(biaodi.value,10));
	result.value=r;
}

function runcount(i,t){
switch (i){
	//a11
	case 0:
 riefs="财产案件 > 一般案件";
if (t<=1000){
x=50;
}
else {
  if (t<=50000) {
   x=(t-1000)*0.04+50;
   }
   else {
   	if (t<=100000) {
   	x=(t-50000)*0.03+2010;
   	}                       
   	else {
   	      if (t<=200000) {
   	      x=(t-100000)*0.02+3510;
   	      }
   	      else {
   	          if (t<=500000) {
   	          x=(t-200000)*0.015+5510;
   	          }
	          else {                  
                       if (t<=1000000) { 
                       x=(t-500000)*0.01+10010;
                       }
                       else {
                       x=(t-1000000)*0.005+15010;
                       }
                       }                    
    }
    }
    }
    }
	break;
	//a12

	case 1:
	 riefs="财产案件 > 破产案件";
if (t<=1000){
x=50;
}
else {
  if (t<=50000) {
   x=(t-1000)*0.04+50;
   }
   else {
   	if (t<=100000) {
   	x=(t-50000)*0.03+2010;
   	}                       
   	else {
   	      if (t<=200000) {
   	      x=(t-100000)*0.02+3510;
   	      }
   	      else {
   	          if (t<=500000) {
   	          x=(t-200000)*0.015+5510;
   	          }
	          else {                  
                       if (t<=1000000) { 
                       x=(t-500000)*0.01+10010;
                       }
                       else {
                       x=(t-1000000)*0.005+15010;
                       }
                       }                    
    }
    }
    }
}
x=x/2;
if (x>100000) {x=100000;}
	break;
	//a21
	case 2:
		 riefs="离婚案件";
	if (t>10000){
		x=(t-10000)*0.01+50;
	}
	else
	{x=50;}
	break;
	//a22
	
	case 3:
		 riefs="知识产权案件";
if (t==0) {
	x=0;
}
else {
	if ((t<=1000)&&(t>0)){
	x=50;
	}
	else {
	 if (t<=50000) {
   x=(t-1000)*0.04+50;
   }
   else {
   	if (t<=100000) {
   	x=(t-50000)*0.03+2010;
   	}                       
   	else {
   	      if (t<=200000) {
   	      x=(t-100000)*0.02+3510;
   	      }
   	      else {
   	          if (t<=500000) {
   	          x=(t-200000)*0.015+5510;
   	          }
	          else {                  
                       if (t<=1000000) { 
                       x=(t-500000)*0.01+10010;
                       }
                       else {
                       x=(t-1000000)*0.005+15010;
                       }
                       }                    
    }
    }
    }
}
}
x=x+1000;
	break;
	//a23
	case 4:
		 riefs="侵害姓名权、名称权、肖像权、名誉权、荣誉权的案件";
	x=100;
	break;
	//a24
	case 5:
		 riefs="行政案件";
if (t==0) {
	x=0;
}
else {
	if ((t<=1000)&&(t>0)){
	x=50;
	}
	else {
	 if (t<=50000) {
   x=(t-1000)*0.04+50;
   }
   else {
   	if (t<=100000) {
   	x=(t-50000)*0.03+2010;
   	}                       
   	else {
   	      if (t<=200000) {
   	      x=(t-100000)*0.02+3510;
   	      }
   	      else {
   	          if (t<=500000) {
   	          x=(t-200000)*0.015+5510;
   	          }
	          else {                  
                       if (t<=1000000) { 
                       x=(t-500000)*0.01+10010;
                       }
                       else {
                       x=(t-1000000)*0.005+15010;
                       }
                       }                    
    }
    }
    }
}
}
x=x+100;	
	break;
	//a25
	case 6:
		 riefs="劳动争议案件";
	x=50;
	break;
	//a31
	case 7:
		 riefs="申请诉讼保全措施案件";
	if (t<=1000){
	x=30;
	}
	else {
  	if (t<=100000) {
   	x=t*0.01+20;
   	}
   	else {
   	if (t>100000) {
   	x=t*0.005+520;
   	}                       
   	
    }
    }
	break;
	//a41
	case 8:
		 riefs="执行案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }
	break;
	//a51
	case 9:
		 riefs="支付令、公示催告案件";
	x=100;
	break;
	//b11
	case 10:
		 riefs="申请执行仲裁裁决（涉外）";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }
	break;
	//b12
	case 11:
		 riefs="申请撤销仲裁裁决的案件";
	x=100;
	break;
	//b13
	case 12:
		 riefs="申请确认仲裁协议效力的案件";
	x=100;
	break;
	//b14
	case 13:
		 riefs="申请承认外国仲裁裁决的案件";
	x=500;
	break;
	//b15
	case 14:
		 riefs="申请执行外国仲裁裁决的案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }	
	break;
	//b16
	case 15:
		 riefs="同时申请承认和执行外国仲裁裁决的案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }	
	break;
	//b17
	case 16:
		 riefs="申请执行香港特区作出的仲裁裁决的案件";
	if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }
	break;
	//b18
	case 17:
		 riefs="申请涉外仲裁财产保全的案件";
	if (t<=1000){
	x=30;
	}
	else {
  	if (t<=100000) {
   	x=t*0.01+20;
   	}
   	else {
   	if (t>100000) {
   	x=t*0.005+520;
   	}                       
   	
    }
    }	
	break;
	//b21
	case 18:
		 riefs="申请承认外国法院民事判决、裁定案件";
	x=100;
	break;
	//b31
	case 19:
		 riefs="申请认可台湾地区法院民事判决、裁定、调解书案件";
	x=100;
	break;
	//b41
	case 20:
		 riefs="行政执行案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }	
	break;
	//b51
	case 21:
		 riefs="公证执行案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=t*0.005;
   	}
   	else {
   	if (t>500000) {
   	x=t*0.001+2000;
   	}                       
   	
    }
    }	
	break;
//a11
	default:
		 riefs="财产案件 > 一般案件";
// ????????? 	var riefs=1; 
if (t<=1000){
x=50;
}
else {
  if (t<=50000) {
   x=(t-1000)*0.04+50;
   }
   else {
   	if (t<=100000) {
   	x=(t-50000)*0.03+2010;
   	}                       
   	else {
   	      if (t<=200000) {
   	      x=(t-100000)*0.02+3510;
   	      }
   	      else {
   	          if (t<=500000) {
   	          x=(t-200000)*0.015+5510;
   	          }
	          else {                  
                       if (t<=1000000) { 
                       x=(t-500000)*0.01+10010;
                       }
                       else {
                       x=(t-1000000)*0.005+15010;
                       }
                       }                    
    }
    }
    }
    }
	}
	
return x;
}
