<!--
//window.resizeTo (500,380);  //对窗口定义(宽\高)
//window.defaultStatus="欢迎使用案件计费工具";  //定义状态栏文字
var root;
function init(){
	XML_Data_Cfg.async = false;
	if(!XML_Data_Cfg.load("./images/costs.xml")){
		alert("配置文件读取错误！^-^");window.close();
		return;
	}
	root=XML_Data_Cfg.documentElement;
	bt1.checked=true;
	checkType();
	showcasemode(0);  //显示诉讼类型
}
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 check_qty(str_qty)
{
   var pattern = /^[1-9][0-9]{0,20}$/; 
   var result = str_qty.match(pattern);
   return (result != null);  
};
function startcount(){
	if(slx.selectedIndex==-1||slx.value==""){alert("请选择案件类型!");return;}
	if(biaodi.value==""){alert("案件标的不能为空,请重新输入!");return;}
        if (!check_qty(biaodi.value))  { alert ("案件标的只能填写数字,请重新输入!");biaodi.focus(); return false; }
	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<=10000){
x=50;
}
else {
  if (t<=100000) {
   x=(t-10000)*0.025+50;
   }
   else {
   	if (t<=200000) {
   	x=(t-100000)*0.02+2300;
   	}                       
   	else {
   	      if (t<=500000) {
   	      x=(t-200000)*0.015+4300;
   	      }
   	      else {
   	          if (t<=1000000) {
   	          x=(t-500000)*0.01+8800;
   	          }
	          else {                  
                       if (t<=2000000) { 
                       x=(t-1000000)*0.009+13800;
                       }
	          else {
                       if (t<=5000000) { 
                       x=(t-2000000)*0.008+22800;
                       }
	          else {
                       if (t<=10000000) { 
                       x=(t-5000000)*0.007+46800;
                       }
	          else {
                       if (t<=20000000) { 
                       x=(t-10000000)*0.006+81800;
                       }
                       else {
                       x=(t-20000000)*0.005+141800;
                       }
                       }                    
    }
    }
    }
    }
    }
    }
    }
	break;
	//a12

	case 1:
	 riefs="财产案件 > 破产案件";
if (t<=10000){
x=50;
}

else {
  if (t<=100000) {
   x=(t-10000)*0.025+50;
   }
   else {
   	if (t<=200000) {
   	x=(t-100000)*0.02+2300;
   	}                       
   	else {
   	      if (t<=500000) {
   	      x=(t-200000)*0.015+4300;
   	      }
   	      else {
   	          if (t<=1000000) {
   	          x=(t-500000)*0.01+8800;
   	          }
	          else {                  
                       if (t<=2000000) { 
                       x=(t-1000000)*0.009+13800;
                       }
	          else {
                       if (t<=5000000) { 
                       x=(t-2000000)*0.008+22800;
                       }
	          else {
                       if (t<=10000000) { 
                       x=(t-5000000)*0.007+46800;
                       }
	          else {
                       if (t<=20000000) { 
                       x=(t-10000000)*0.006+81800;
                       }
                       else {
                       x=(t-20000000)*0.005+141800;
                       }
                       }                    
    }
    }
    }
    }
    }
    }
    }
x=x/2;
if (x>300000) {x=300000;}
	break;
	//a21

	case 2:
		 riefs="离婚案件";
	if (t>200000){
		x=(t-200000)*0.005+50;
	}
	else
	{x=50;}
	break;
	//a22
	
	case 3:
		 riefs="知识产权案件";
//if (t==0) {
	//x=0;
//}

if (t<=10000){
x=50;
}

else {
  if (t<=100000) {
   x=(t-10000)*0.025+50;
   }
   else {
   	if (t<=200000) {
   	x=(t-100000)*0.02+2300;
   	}                       
   	else {
   	      if (t<=500000) {
   	      x=(t-200000)*0.015+4300;
   	      }
   	      else {
   	          if (t<=1000000) {
   	          x=(t-500000)*0.01+8800;
   	          }
	          else {                  
                       if (t<=2000000) { 
                       x=(t-1000000)*0.009+13800;
                       }
	          else {
                       if (t<=5000000) { 
                       x=(t-2000000)*0.008+22800;
                       }
	          else {
                       if (t<=10000000) { 
                       x=(t-5000000)*0.007+46800;
                       }
	          else {
                       if (t<=20000000) { 
                       x=(t-10000000)*0.006+81800;
                       }
                       else {
                       x=(t-20000000)*0.005+141800;
                       }
                       }                    
    }
    }
    }
    }
    }
    }
    }
x=x+1000;
	break;
	//a23
	case 4:
		 riefs="侵害姓名权、名称权、肖像权、名誉权、荣誉权的案件";
if (t==0) {
	x=0;
}
else {
	if ((t<=50000)&&(t>0)){
	x=0;
	}
else {
	 if (t<=100000) {
   x=(t-50000)*0.01;
   }
else {
   x=(t-100000)*0.005+500;
    }
}
}
x=x+100;
	break;
	//a24
	case 5:
		 riefs="一般行政案件";
x=50;	
	break;

	case 23:
		 riefs="商标、专利、海事行政案件";
x=100;	
	break;

	//a25
	case 6:
		 riefs="劳动争议案件";
	x=10;
	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;
   	}                       
   	
    }
    }
if (x>5000) {x=5000;}
	break;
	//a41

	case 8:
		 riefs="执行案件";
		if (t<=10000){
	x=50;
	}
	else {
  	if (t<=500000) {
   	x=(t-10000)*0.015+50;
   	}
	else {
  	if (t<=5000000) {
   	x=(t-500000)*0.01+7400;
   	}
	else {
  	if (t<=10000000) {
   	x=(t-5000000)*0.005+52400;
   	}
   	else {
   	if (t>10000000) {
   	x=t*0.001+77400;
   	}                       
    }
    }
    }
    }
	break;
	//a51
	case 9:
		 riefs="支付令案件";
	if (t<=10000){
x=50;
}
else {
  if (t<=100000) {
   x=(t-1000)*0.025+50;
   }
   else {
   	if (t<=200000) {
   	x=(t-100000)*0.02+2300;
   	}                       
   	else {
   	      if (t<=500000) {
   	      x=(t-200000)*0.015+4300;
   	      }
   	      else {
   	          if (t<=1000000) {
   	          x=(t-500000)*0.01+8800;
   	          }
	          else {                  
                       if (t<=2000000) { 
                       x=(t-1000000)*0.009+13800;
                       }
	          else {
                       if (t<=5000000) { 
                       x=(t-2000000)*0.008+22800;
                       }
	          else {
                       if (t<=10000000) { 
                       x=(t-5000000)*0.007+46800;
                       }
	          else {
                       if (t<=20000000) { 
                       x=(t-10000000)*0.006+81800;
                       }
                       else {
                       x=(t-20000000)*0.005+141800;
                       }
                       }                    
    }
    }
    }
    }
    }
    }
    }
    x=x/3;
	break;
	//b11
	case 22:
		 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;
}



//诉讼说明与计算切换
function showcasemode(mode) //--显示诉讼类计算说明
{
	susreadme.style.display="none";
	suscounte.style.display="none";
	
	switch (mode) {

		case 0: //--诉讼计费算程序
			suscounte.style.display="block";
			break;
		case 1: //--诉讼费收费说明
			susreadme.style.display="block";
			break;
	}
}


//对表单弹出窗口进行定义
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
