function getStationOption(category,comp_id){
	objF = document.getElementById('address');//父分类,地址名
	objC = document.getElementById('station');//子分类,车站名
	if(objF && objC){
		if(objF.value != ''){
			objC.disabled = false;
			getStationXml(objF.value,category,comp_id);			
		} else {
			objC.disabled = true;
		}
	}
}

function getStationXml(address_id,category,comp_id){
	var Url = "/ajax_address.php?t=" + (new Date).getTime() + "&address_id=" + address_id + "&category=" + category + "&comp_id=" + comp_id;
	creatXMLHttpRequest();
	xmlHttp.open("GET",Url,"true");
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200){			
			clearModelsList();
			var results = xmlHttp.responseXML.getElementsByTagName("station");
			var objC = document.getElementById("station");
			var option = null;

			option = document.createElement("option");
			objC.options.add(option);
			option.text = '選択してください';
			option.value = '';

			for(var i = 0; i < results.length; ++i) {
				option = document.createElement("option");
				objC.options.add(option);
				option.text = results[i].getAttribute('name');
				option.value = results[i].getAttribute('id');
			}
		}		
	}
	xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
	xmlHttp.send(null);
}

function clearModelsList() {
    var objC = document.getElementById("station");
    while(objC.childNodes.length > 0 && objC) {
        objC.removeChild(objC.childNodes[0]);
    }
}