var xmlArea = new ActiveXObject("Microsoft.XMLDOM")
var windowName = window.name;
function loadXML(path)
{
xmlArea.async="false"
xmlArea.load(path+"/common/area.xml")
var province =  document.getElementById( "province" ).options;
var length =  province.length;
var ele = xmlArea.getElementsByTagName("province").length
for (i=0;i<ele;i++){
name = xmlArea.getElementsByTagName("province").item(i).attributes[0].value;
value = xmlArea.getElementsByTagName("province").item(i).attributes[1].value;
province[length]=new Option(name,value);
   length++;
}
window.name = windowName;
}

function changeProvince(){
var city = document.getElementById( "city" ).options;
var province = document.getElementById( "province" );
var ele = xmlArea.selectNodes("/country//province[@name='"+province.value+"']/*");
//var ele = xmlArea.selectNodes("/province/city[@name='"+province.value+"']/*");
var length = city.length = 1;
for (i=0;i<ele.length;i++){
name =ele[i].attributes[0].value
value =ele[i].attributes[1].value
city[length]=new Option(name,value);
   length++;
   window.name=windowName;
}
//changeCity();
}
function changeCity()
{
var county = document.getElementById( "county" ).options;
var city = document.getElementById( "city" );
var ele = xmlArea.selectNodes("/country//province/city[@name='"+city.value+"']/*");
var length = county.length = 1;
for (i=0;i<ele.length;i++){
name =ele[i].attributes[0].value
value =ele[i].attributes[1].value
county[length]=new Option(name,value);
length++;
}
window.name=windowName;
}
