// constructor
function CityData(initCity, initState, initZip, initCounty, initPopulation,
initLandKm, initLandMi, initPopDensityKm, initPopDensityMi, initColor, initLocalColor, initLatLng) {
    this.city = initCity;
    this.state = initState;
    this.zip = initZip;
    this.county = initCounty;
    this.population = initPopulation;
    this.landKm = initLandKm;
    this.landMi = initLandMi;
    this.popDensityKm = initPopDensityKm;
    this.popDensityMi = initPopDensityMi;
    this.color = initColor;
    this.localColor = initLocalColor;
    this.latLng = initLatLng;
    this.getColor = getColor;
    this.getInfo = getInfo;
    this.getLand = getLand;
    this.getPopDensity = getPopDensity;
    this.getCounty = getCounty;
    this.getCity = getCity;
    this.getState = getState;
    this.getZip = getZip;
    this.getPopulation = getPopulation;
    this.getLatLng = getLatLng;
}

// methods
function getInfo(units) {
    var stuff = "<div class=\"infoWindow\"><table width=\"100%\">" +
    "<tr><td align=\"left\"><b>" + this.city + ", " + this.state + " " +
    this.zip + " &nbsp; <\/b><br \/><sup>" + this.county +
    " County<\/sup><br \/>Population: " +   
    this.population + " People<sup>&nbsp;<\/sup><br \/>Area: ";
    if (units.getAbbrev() === "mi") {
        stuff += this.landMi;
    }
    else {
        stuff += this.landKm;
    }
    stuff += " " + units.getFull() + "<sup>2<\/sup><br \/>" + "Density: ";
    if (units.getAbbrev() === "mi") {
        stuff += this.popDensityMi;
    }
    else {
        stuff += this.popDensityKm;
    }
    return stuff + " P\/" + units.getAbbrev() + "<sup>2<\/sup></td></tr></table></div>";
}

function getLand(units) {
    if (units.getAbbrev() === "mi") {
        return this.landMi;
    }
    else {
        return this.landKm;
    }
}

function getPopDensity(units) {
    if (units.getAbbrev() === "mi") {
        return this.popDensityMi;
    }
    else {
        return this.popDensityKm;
    }
}

function getColor(currScale) {
    if (currScale === 0) {
        return this.localColor;
    }
    else
        return this.color;
}

function getCity() { return this.city; }
function getState() { return this.state; }
function getZip() { return this.zip; }
function getCounty() { return this.county; }
function getPopulation() { return this.population; }
function getLatLng() { return this.latLng; }
