function setAdd(id){
    clearform();
    document.getElementById("hidden_id").value=id;
    document.getElementById("txt_address").value=document.getElementById("ar_"+id).value;
    document.getElementById("txt_name").value=document.getElementById("name_"+id).value;
    document.getElementById("txt_postalcode").value=document.getElementById("scode_"+id).value;
    var phone=document.getElementById("phone_"+id).value;
    if(phone!=""){
        var p_list=phone.split('-');
        document.getElementById("txt_qu").value=p_list[0];
        document.getElementById("txt_code").value=p_list[1];
        if((p_list[2]!="")&&(p_list[2]!=undefined)){
            document.getElementById("txt_fen").value=p_list[2];
        }
    }
    var phone2=document.getElementById("phone2_"+id).value;
    document.getElementById("txt_phone").value=phone2;
    document.getElementById("title_c").innerHTML="修改";
}
function clearform(){
    document.getElementById("txt_address").value="";
    document.getElementById("txt_name").value="";
    document.getElementById("txt_postalcode").value="";
    document.getElementById("txt_qu").value="";
    document.getElementById("txt_code").value="";
    document.getElementById("txt_fen").value="";
    document.getElementById("txt_phone").value="";
}
function del(aid){
    document.getElementById("del_id").value=aid;
    document.getElementById("delform").submit();
}

