// config settings for the TaxParcelViewer application
// change the service urls and other properties to work with your GIS server.

function setConfigProperties(){
  
  var server = checkVal("http://gis.traversecitymi.gov/ArcGIS/rest/services/");           // url for server rest services directory, ends with "/"
  var folder = ("");                                      // url for server subFolder, normally "TaxParcel/", ends with "/"

  industryMapServiceStr = server +  "tcaerialbase/MapServer";   // service for industry map
  consumerMapServiceStr = server +  "tcparcelbase/MapServer";// service for consumer map
  queryLayerStr         = server +  "tcquery/MapServer/2";   // service for query layer (popup)
  searchLayerStr        = server +  "tcquery/MapServer";     // service for find task (search box)
  parcelLayerNum = 2;                                                       // layer number for find task (search box)

  spRef =  new esri.SpatialReference({
    "wkid" : 2252
  });

  startExtent = new esri.geometry.Extent(19348468.1432425, 518934.478063315, 19377640.2303798, 537339.580358095,spRef);

  fields = {
  SiteAddress: "P_ADDR_COMBINED", 
    LowParcelID : "LOW_PIN", 
    ParcelID : "LONG_PIN", 
    PropertyClass : "PROP_CLASS",  
    LiberPage : "LIBERPAGE",
    OwnerName: "OWNERNAME1", 
    Assess_Value: "ASSESS_VALUE",
    Tax_Value: "TAX_VALUE", 
	MBOR_Value: "MBOR_VALUE",
    LastSaleAmt : "LASTSALEAMT", 
    LastSaleDate : "LASTSALEDATE", 
        // URL : "URL"
    PercentExempt : "PERC_HOMESTEAD",
    Zoning : "ZONING", 
    ResSqFt : "RES_FLOORAREA", 	
    CISqFt : "CI_FLOORAREA",
    ResTCV : "RES_EST_TCV",
    CITCV : "CI_EST_TCV",
    Legal : "LEGAL"
  };
  // this is the primary key field for the tax parcel layer
  // these 2 fields are shown in the search results window on the left hand side of the app
  keyField = fields.ParcelID;
  addressField = fields.SiteAddress;
} 

function setLayoutProperties(){
  // should not need to change these properties unless you make changes to the popup
  infoWindowWidth = 342;
  infoWindowHeight = 262
  ;
  // the app will zoom to the feature extent + and - the addExtent in map units
  addExtent = 600;
}
function checkVal(strUrl){
  // check that the server URL paths end with a "/", add it if not present
  var strLen = strUrl.length;
  if( strUrl.substring(strLen-1,strLen) != "/"){
    alert(strUrl + " in config.js is missing '/' at the end of the string, automatically added");
    strUrl = strUrl + "/";
  }
  return(strUrl);
}