  function CLASS_LIANDONG_YAO(array)
  {
   //数组，联动的数据源
   this.array=array;
   this.indexName='';
   this.obj='';
   //设置子SELECT
 // 参数：当前onchange的SELECT ID，要设置的SELECT ID
      this.subSelectChange=function(selectName1,selectName2)
   {
   //try
   //{
    var obj1=document.all[selectName1];
    var obj2=document.all[selectName2];
    var objName=this.toString();
    var me=this;
 
    obj1.onchange=function()
    {
     
     me.optionChange(this.options[this.selectedIndex].value,obj2.id)
    }

   }
   //设置第一个SELECT
 // 参数：indexName指选中项,selectName指select的ID
   this.firstSelectChange=function(indexName,selectName) 
   {
   this.obj=document.all[selectName];
   this.indexName=indexName;
   this.optionChange(this.indexName,this.obj.id)

   }
 
  // indexName指选中项,selectName指select的ID
   this.optionChange=function (indexName,selectName)
   {
    var obj1=document.all[selectName];
  //remove
   for(var r=obj1.options.length-1;r>=0;r--)
	{
	  obj1.options.remove(r);
	}
	
    var me=this;
    obj1.length=0;
    obj1.options[0]=new Option("请选择",'');
  //add
    for(var i=0;i<this.array.length;i++)
    { 
   
     if(this.array[i][1]==indexName)
     {
     //alert(this.array[i][1]+" "+indexName);
      obj1.options[obj1.length]=new Option(this.array[i][2],this.array[i][0])
     }
    }
   }
      //guoyanan要的进入页面初始化选项 ch20090925
   this.showselect=function(countryName, visaName, visaSelect, countrySelect)
   {
      this.setIndex(countryName, countrySelect);
      this.optionChange(countryName, visaSelect);
      this.setIndex(visaName, visaSelect);
   }
   //设置默认值
   this.setIndex=function(dataValue, selectName)
   {
    var obj1=document.all[selectName];
    for(var r=obj1.options.length-1;r>=0;r--)
	{ if(obj1.options[r].value == dataValue)
	  {
             obj1.selectedIndex = r;
             break;
	  }
	}
   }
  }
  
