var DataContainer = Class.create();

DataContainer.prototype = {

initialize : function (JSONObject) {

	var myJSONObject = JSONObject;	
	var countryJSONArray = myJSONObject.countryList;
	var airportJSONArray = myJSONObject.airportList;
	var portJSONArray = myJSONObject.portList;

	this.countries = [];
	for (var i = 0; i<countryJSONArray.length; i++){
		this.countries[i] = new Country(countryJSONArray[i].countryCode, countryJSONArray[i].country);
	}
	
	this.ports = [];
	for (var k = 0; k<portJSONArray.length; k++) {
		this.ports[k] = new Port(portJSONArray[k].portCode, portJSONArray[k].port);
	}
	
	this.airports =[];
	for (var j = 0; j<airportJSONArray.length; j++){
		this.airports[j] = new Airport(airportJSONArray[j].airportCode, airportJSONArray[j].airport, airportJSONArray[j].countryCode, this.countries, airportJSONArray[j].portCode, this.ports); 
	}
	
	this.myJSONObject = myJSONObject;
	//this.toAirports = [];
},
getAirports : function () {
return this.airports;
},
getCountries : function () {
return this.countries;
},
getToAirports : function () {
return this.toAirports;
}
/*getFromAirports : function () {
return this.fromAirports;
},*/
/*getPopularFromAirports : function () {
return this.popularFromAirports;
},*/
}

