function RouteListRoute() {
	this.listCount = 0;
	this.id = null;
	this.division = null;
	this.kana = null;
	this.name = null;
	this.init = function(xml) {
		this.listCount = xml.getElementsByTagName('datainfo').length;
		this.id = new Array();
		this.division = new Array();
		this.kana = new Array();
		this.name = new Array();

		var dataList = xml.getElementsByTagName('datainfo');
		for (i = 0; i < this.listCount; i++) {
			this.id[i] = dataList[i].getAttribute('id');
			this.division[i] = dataList[i].getAttribute('division');
			this.kana[i] = "";
			this.name[i] = "";
			for (j = 0; j < dataList[i].childNodes.length; j++) {
				var child = dataList[i].childNodes[j];
				if (child.tagName == 'name') {
					if(child.firstChild) {
						this.name[i] = child.firstChild.nodeValue;
						this.kana[i] = child.getAttribute('kana');
					}
				}
			}
		}

	}
	
	this.getListCount = function() {
		return this.listCount;
	}
	this.getId = function() {
		return this.id;
	}
	this.getDivision = function() {
		return this.division;
	}
	this.getKana = function() {
		return this.kana;
	}
	this.getName = function() {
		return this.name;
	}
}

function RouteListStationStop() {
	this.listCount = 0;
	this.stationStopCount = 0;
	this.id = null;
	this.division = null;
	this.kana = null;
	this.name = null;
	this.stopParentRouteId = null;
	this.stopParentDivision = null;
	this.stopParentKana = null;
	this.stopParentName = null;
	this.stopChildRouteId = null;
	this.stopChildKana = null;
	this.stopChildName = null;
	this.stopNumber = null;
	this.stopId = null;
	this.stopName = null;
	this.stopKana = null;
	this.stopPointX = null;
	this.stopPointY = null;
	this.init = function(xml) {
		this.listCount = xml.getElementsByTagName('datainfo').length;

		this.stopParentRouteId = new Array();
		this.stopParentDivision = new Array();
		this.stopParentKana = new Array();
		this.stopParentName = new Array();
		this.stopChildRouteId = new Array();
		this.stopChildKana = new Array();
		this.stopChildName = new Array();
		this.stopNumber = new Array();
		this.stopId = new Array();
		this.stopName = new Array();
		this.stopKana = new Array();
		this.stopPointX = new Array();
		this.stopPointY = new Array();


		var dataList = xml.getElementsByTagName('datainfo');
		for (i = 0; i < this.listCount; i++) {
			var parentId = this.id = dataList[i].getAttribute('id');
			var parentDivision = this.division = dataList[i].getAttribute('division');
			var child = dataList[i].childNodes;
			var childLen = dataList[i].childNodes.length;
			for (j = 0; j < childLen; j++){
				if(child[j].tagName == "name"){
					var parentKana = this.kana = child[j].getAttribute('kana');
					var parentName = this.name = child[j].firstChild.nodeValue;
//console.log(">>>>>>>>>>>>> parentId:"+parentId+", parentKana:"+parentKana+ ", parentName:"+parentName);

				}
				if(child[j].tagName == "routelineinfo"){
					var childId = child[j].getAttribute('id');
//console.log(">>>>>>>>>>>>> childId:"+childId);

					var childChildLen = child[j].childNodes.length;
					for (k = 0; k < childChildLen; k++){
						var childChild = child[j].childNodes[k];
						if(childChild.tagName == "name"){
							if(childChild.firstChild) {
								var childKana = childChild.getAttribute('kana');
								var childName = childChild.firstChild.nodeValue;
//console.log(">>>>>>>>>>>>> childKana:"+childKana+ ", childName:"+childName);
							}
						}
						if(childChild.tagName == "stationstop"){
							if(childChild.firstChild) {
								var childChildChildLen = childChild.childNodes.length;
								for (m = 0; m < childChildChildLen; m++){
									var childChildChild = childChild.childNodes[m];
									if(childChildChild.tagName == "name"){
										if(childChildChild.firstChild) {
											var sName = childChildChild.firstChild.nodeValue;
											var sKana = childChildChild.getAttribute('kana');
											var sNo = childChild.getAttribute('no');
											var sId = childChild.getAttribute('id');
										}
									}
									if(childChildChild.tagName == "point"){
										if(childChildChild.firstChild) {
											sX = childChildChild.getAttribute('x');
											sY = childChildChild.getAttribute('y');
//console.log(">>>>>>>>>>>>> sName:"+sName);
											var nameLen = this.stopName.length;
//console.log(">>>>>>>>>>>>> nameLen:"+nameLen);
											//重複バス停名は省く
											var flag="";
											for(var nn = 0; nn < nameLen; nn++){
												if(this.stopName[nn] == sName){
//console.log(">>>>>>>>>>>>> break");
													var flag = "break";
												}
											}
											if(!flag){
												//初期化
												this.stopName[this.stationStopCount]          = "";
												this.stopKana[this.stationStopCount]          = "";
												this.stopNumber[this.stationStopCount]        = "";
												this.stopId[this.stationStopCount]            = "";
												this.stopPointX[this.stationStopCount]        = "";
												this.stopPointY[this.stationStopCount]        = "";
												this.stopParentRouteId[this.stationStopCount] = "";
												this.stopParentDivision[this.stationStopCount]= "";
												this.stopParentKana[this.stationStopCount]    = "";
												this.stopParentName[this.stationStopCount]    = "";
												this.stopChildRouteId[this.stationStopCount]  = "";
												this.stopChildKana[this.stationStopCount]     = "";
												this.stopChildName[this.stationStopCount]     = "";
												//値
												this.stopName[this.stationStopCount]          = sName;
												this.stopKana[this.stationStopCount]          = sKana;
												this.stopNumber[this.stationStopCount]        = sNo;
												this.stopId[this.stationStopCount]            = sId;
												this.stopPointX[this.stationStopCount]        = sX;
												this.stopPointY[this.stationStopCount]        = sY;
												this.stopParentRouteId[this.stationStopCount] = parentId;
												this.stopParentDivision[this.stationStopCount]= parentDivision;
												this.stopParentKana[this.stationStopCount]    = parentKana;
												this.stopParentName[this.stationStopCount]    = parentName;
												this.stopChildRouteId[this.stationStopCount]  = childId;
												this.stopChildKana[this.stationStopCount]     = childKana;
												this.stopChildName[this.stationStopCount]     = childName;
												//++
												this.stationStopCount++;
											}
										}
									}
/*
console.log(">>>>>>>>>>>>> k:" + k + ", Cnt:" + this.stationStopCount + ",\n"
			+ "stopNumber:" + this.stopNumber[this.stationStopCount] + ", stopId:" + this.stopId[this.stationStopCount]
			+ ", stopKana:" + this.stopKana[this.stationStopCount] + ", stopName:" + this.stopName[this.stationStopCount]
			+ ",\n"
			+ "parentId:" + this.stopParentRouteId[this.stationStopCount] + ", parentKana:" + this.stopParentKana[this.stationStopCount]
			+ ", parentName:" + this.stopParentName[this.stationStopCount] + ", childId:" + this.stopChildRouteId[this.stationStopCount]
			+ ", childKana:" + this.stopChildKana[this.stationStopCount] + ", childName:" + this.stopChildName[this.stationStopCount]
			);
*/
								}
							}
						}
					}
				}
			}
		}
	}
	
	this.getListCount = function() {
		return this.listCount;
	}
	this.getStationStopCount = function() {
		return this.stationStopCount;
	}
	this.getId = function() {
		return this.id;
	}
	this.getDivision = function() {
		return this.division;
	}
	this.getKana = function() {
		return this.kana;
	}
	this.getName = function() {
		return this.name;
	}
	this.getStopParentRouteId = function() {
		return this.stopParentRouteId;
	}
	this.getStopParentDivision = function() {
		return this.stopParentDivision;
	}
	this.getStopParentKana = function() {
		return this.stopParentKana;
	}
	this.getStopParentName = function() {
		return this.stopParentName;
	}
	this.getStopChildRouteId = function() {
		return this.stopChildRouteId;
	}
	this.getStopChildKana = function() {
		return this.stopChildKana;
	}
	this.getStopChildName = function() {
		return this.stopChildName;
	}
	this.getStopNumber = function() {
		return this.stopNumber;
	}
	this.getStopId = function() {
		return this.stopId;
	}
	this.getStopName = function() {
		return this.stopName;
	}
	this.getStopKana = function() {
		return this.stopKana;
	}
	this.getStopPointX = function() {
		return this.stopPointX;
	}
	this.getStopPointY = function() {
		return this.stopPointY;
	}
}

