//产生被联动的下拉框
//其中arr为数组名,selectName为下拉框名,locationid为被选择的下拉框的值,selectNameAll为所有下拉框名
//firstName为取得的第一个下拉框名
//otherName为其他下拉框名字符串 如:"cun,zu"
function changelocation1(selectNameAll,locationid,arr){
index=selectNameAll.indexOf(",");
if(index==-1){
firstName=selectNameAll;
otherName="";
}else{
firstName=selectNameAll.substring(0,selectNameAll.indexOf(","));
otherName=selectNameAll.substring (selectNameAll.indexOf(",")+1)
}
selectName=eval("document.all['"+firstName+"']");
    clearList(selectNameAll);
var i;  
    for (i=0;i < eval(arr).length; i++){
   if (eval(arr)[i][1] == locationid  ){ 
    selectName.options[selectName.length] = new Option(eval(arr)[i][2], eval(arr)[i][0]);
   } 
}

 
//clear subselect optionfunction clearList(ctrl1){
var index=ctrl1.indexOf(",");
if(index>0){
firstName=ctrl1.substring(0,index);
otherName=ctrl1.substring (index+1);
}else{
firstName=ctrl1;otherName="";
}
//alert(firstName);
ctrl=eval("document.all['"+firstName+"']");
//alert(ctrl);
 if (document.all) {
   for(;ctrl.options.length>1;)
ctrl.options.remove(ctrl.options.length-1);
}else{   for(;ctrl.options.length>1;)
 ctrl.options[ctrl.options.length-1] = null;
 }
 if(otherName!="")clearList(otherName);
}
function xzld(xzname,xxz){//修改页面中的选择 xzname你要自动选中的SELECT名称,xxz传入自动选中条件即当option的value=xxz的时候,自动选中
for (i=0;i < eval("document.all."+xzname).options.length-1; i++){
if (eval("document.all."+xzname).options[i].value==xxz){
eval("document.all."+xzname).options[i].selected=true;
break;
}
}