/*
xml+ajax无刷新联动省市区功能
create by tongwh
2008.12.18
*/
function MajorNameResult(parent_id,objDropDownList){
    document.getElementById("DropDownList_MajorType_SelectText").value = parent_id.text;//首页标签赋值
                    //alert(parent_id.text);
                  //alert(document.getElementById("DropDownList_MajorType_SelectText").value);
    document.getElementById("DropDownList_MajorType_SelectId").value = parent_id.value;//首页标签赋值
    _Default.BindMajorName(parent_id.value,objDropDownList,get_MajorName_Result_CallBack);
}
function get_MajorName_Result_CallBack(response)
{
    if (response.value != null)
    {                   　           
　　　　var ds = response.value;
　　　　var first_city;
　　　　var first_city_id;
　　　　//绑定城市
        if(ds != null && typeof(ds) == "object" && ds.Tables != null){               
			document.getElementById("DropDownList_MajorName").length = 0;
            for(var i=0; i<ds.Tables[0].Rows.length; i++){
　　　　        var name=ds.Tables[0].Rows[i].Text;
　　　　　　    var id=ds.Tables[0].Rows[i].Value;
　　　　　　    if(i==0){first_city = name;first_city_id = id};
　　　　　　    document.getElementById("DropDownList_MajorName").options.add(new Option(name,id));
　　　　    }
　　　　    //每次省选择以后，赋省下第一个城市值
　　　　   document.getElementById("DropDownList_MajorName_SelectText").innerText = first_city; //首页标签赋值
			//绑定地区
			if(first_city_id&&typeof(first_city_id)!='undefined')
　　　　		_Default.Bindvocation(first_city_id,'DropDownList_vocation',get_vocation_Result_CallBack);
　　　　	else{
　　　　		document.getElementById("DropDownList_vocation").length = 0;
　　　　	}
        }
       
    }           
}

function vocationResult(parent_id,objDropDownList){
    document.getElementById("DropDownList_MajorName_SelectText").innerText = parent_id.text;//首页标签赋值
    _Default.Bindvocation(parent_id.value,objDropDownList,get_vocation_Result_CallBack);
}
function get_vocation_Result_CallBack(response)
{
    if (response.value != null){                   
　　　　var ds = response.value;
　　　　var first_area;
　　　　var first_area_id;
        if(ds != null && typeof(ds) == "object" && ds.Tables != null){                   
			document.getElementById("DropDownList_vocation").length = 0;
            for(var i=0; i<ds.Tables[0].Rows.length; i++){
　　　　        var name=ds.Tables[0].Rows[i].Text;
　　　　　　    var id=ds.Tables[0].Rows[i].Value;
　　　　　　    if(i==0){first_area = name;first_area_id = id};
　　　　　　    document.all("DropDownList_vocation").options.add(new Option(name,id));
　　　　    }
　　　　    //每次城市后 赋第一个地区值
　　　　     document.getElementById("DropDownList_vocation_SelectText").innerText = first_area;//首页标签赋值
        }
    }
}
function vocationResultV(parent_id,objDropDownList){
   document.getElementById("DropDownList_vocation_SelectText").innerText = parent_id.text; //首页标签赋值
    //dropdownlist_ajaxpro_Default.Bindvocation(parent_id.value,objDropDownList,get_Area_Result_CallBack);
}
            
