﻿
function showareacity(id,obj)
{
   ajaxCheck("/hzyx/temp.aspx","form=areacity&rid="+id,function(responseText){
        o("area").options.length = 1;
        if(obj!="province"){
          if(o(obj).options.length > 1){
              o(obj).options.length = 1;
          }
        }
        if(responseText!=""){
         var strValue = responseText.split(",");
         for(var i=0;i<strValue.length;i++){
           var strArea = strValue[i].split("|");
           var objOption=document.createElement("OPTION");
           objOption.value = strArea[0];
           //objOption.value = strArea[1];
           objOption.text = strArea[1];
           o(obj).add(objOption);
        }
      }
   }); 
}

function selectArea(id,hid,pid,cid,aid,obj){
     ajaxCheck("/hzyx/temp.aspx","form=areacity&rid="+id,function(responseText){
        o("province").options.length = 1;
        o("city").options.length = 1;
        o("area").options.length = 1;
        if(obj!="country"){
          if(o(obj).options.length > 1){
              o(obj).options.length = 1;
          }
        }
        if(responseText!=""){
         var strValue = responseText.split(",");
         for(var i=0;i<strValue.length;i++){
           var strArea = strValue[i].split("|");
           var objOption=document.createElement("OPTION");
           objOption.value = strArea[0];
           //objOption.value = strArea[1];
           objOption.text = strArea[1];
           o(obj).add(objOption);
        }
      }
//      if(pid!=""){
//          var selectLength = o(obj).options.length;
//          for(var i=0;i<selectLength;i++){
//            if(o(obj).options[i].value == pid){
//               o(obj).options[i].selected = true;
//           }
//           showareacity(pid,"city");
//       }
//       if(cid != ""){
//          var cityselectLength = o("city").options.length;
//          for(var i=0;i<cityselectLength;i++){
//            if(o("city").options[i].value == pid){
//               o("city").options[i].selected = true;
//           }
//           showareacity(cid,"area");
//       }
//       if(aid != ""){
//          var selectLength = o("area").options.length;
//          for(var i=0;i<selectLength;i++){
//            if(o("area").options[i].value == pid){
//               o("area").options[i].selected = true;
//           }
//       } 
     }
   );
}