/*
config.js is a configuration file to store the settings for the Google Map instance
*/

//Default ArcGIS Server Settings

//The Below variables are now in the Web.Config and are added to the Head of the Maps web page
//in the Map.aspx.cs GetHead Mehtod
//_serverName
//_instanceName
//_serviceName
//_layerID
//_featuredLocationsLayerIndex

//GDB Column names
var _dateColumn = "COLLECTION_DATE";//the name of the column in the map service specifying image acquisition date.
var _imageNameColumn = "ORDERING_ID"; //the name of the column in the map service specifying image name (used to be IMAGE_ID)
var _imageURL = "IMAGE_FILE_URL"; //the url to the image
var _imageLL_Lat = "LL_LAT"; //Lower Left Latitude
var _imageLL_Lon = "LL_LON"; //Lower left Longitude
var _imageUR_Lat = "UR_LAT"; //Upper Right Lat
var _imageUR_Lon = "UR_LON"; //Upper Right Long
var _spacecraftColumn = "COLLECTION_VEHICLE_LONG"; //name of the spacecraft
var _dataOwnerColumn = "DATA_OWNER";//name of the data owner
var _tiltAngleColumn = "COLLECTION_ANGLE_ELEV"; //Tilt angle?
var _cloudCoverColumn = "CLOUD_COVER_PERCENT";//the name of the column in the map service specifying cloud cover.
var _resolutionColumn = "GSD"; //? What's the name of the column holding resolution?
var _fullProductURL = "PRODUCT_INFO_URL"; //URL to full image info
var _fullMetadataURL = "FULL_METADATA_URL"; //URL to full metadata
var _featuredLocationDescription = "FL_DESCRIPTION"; //Featured location description
var _featuredName = "FL_NAME"; //Name of the featured location
var _featuredLocationZoolLevel = "ZOOM_LEVEL"; //Column Name
var _defaultFeaturedLocationsZoom = 10;  //Default Zoom level - if REST Services don't respond


//In case REST Services Fail
var _defaultDateOnRESTError = "01/01/1900";

//Map Settings
var _zoomThreshold = 25000; //The threshold at which footprints are displayed or not.  Units are square km
//var _footprintCountThreshold = 100; //The threshold at which results are displayed or not.  Units are number of features.
var _maxReturnedFootprintCount = 1000; // The max number of footprints returned by the AGS Map Service

//Footprint Styling
var _footprintFillColor = "#385675"; //The fill color of footprint polygons
var _footprintFillOpacity = 0; //The opacity level from 0 (clear) to 1 (opaque)

var _footprintOutlineColor = "#707A84"; //The outline color of footprint polygons
var _footprintOutlineWeight = 3; //The width of the outline
var _footprintOutlineOpacity = .75; //The opacity level from 0 (clear) to 1 (opaque)

var _footprintSelectedFillColor = "#B1D766"; //Selected footprint fill color
var _footprintSelectedFillOpacity = 0; //Selected footprint opacity
var _footprintSelectedOutlineColor = "#00FFFF"; //selected footprint outline color
var _footprintSelectedOutlineWeight = 3; //selected footprint weight
var _footprintSelectedOutlineOpacity = .75; //Selected outline opacity

var _defaultMapCenter = new GLatLng(0, 0); //Where to center the map onload

var _defaultMapZoom = 2; //default zoom level onload

//Dates - used for display in maps app
var _monthArray = new Array("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC");

//Control Names
//var _sunnyButton = "uxSunny"; //Name of the radio button for Sunny Option
//var _partlyCloudyButton = "uxPartlyCloudy"; //Name of the radio button for partly cloudy option
//var _cloudyButton = "uxCloudy"; //Name of the radio button for cloudy option
//var _anyResButton = "uxAnyResolution"; //name of radio button for 'any resolution' option
//var _oneMeterButton = "uxOneMeter"; //name of radio button for 'one meter' option
//var _halfMeterButton = "uxHalfMeter"; //name of radio button for 'half meter option
var _toDateTxt = "uxToDate"; //name of textbox containing To Date
var _fromDateTxt = "uxFromDate"; //name of textbox continaing From Date
var _spatialRanking = "uxUseSpatialRanking";
var _maxCloudCover = "uxMaxCloudCover";
//var _allSourcesButton = "uxSourceAll";
//var _GE1SourcesButton = "uxSourceGE1";
//var _IK2SourcesButton = "uxSourceIK2";
//var _OV3SourcesButton = "uxSourceOV3";

var _maxCloudCoverSliderIndex = 0;
//Icons
var _waitingIcon = "images/busy-anim-icon.gif";

//REST Querystrings
//var _cloudArr = new Array(_cloudCoverColumn + " <= 20 ", _cloudCoverColumn + " <=50 ", _cloudCoverColumn + " <=100 ");
//var _cloudDescription = new Array("Sunny", "Partly Cloudy", "Cloudy");
var _resolutionArr = new Array(" AND " + _resolutionColumn + " > 0 ", " AND " + _resolutionColumn + " < 1 ", " AND " + _resolutionColumn + " < .5 ");
var _resolutionDescription = new Array("Any Resolution", "1 Meter", "1/2 Meter");
// Collection Vehicle Long Items: Any, GEOEYE-1, IKONOS-2, ORBVIEW-3
var _imgSourceArr = new Array("", " AND " + _spacecraftColumn + "='GEOEYE-1'", " AND " + _spacecraftColumn + "='IKONOS-2'", " AND " + _spacecraftColumn + "='ORBVIEW-3'");
var _imgSourceDescription = new Array("All Sources", "Only GeoEye-1", "Only IKONOS-2", "Only OrbView-3");
var _imgSourceListing = new Array("", "GEOEYE-1", "IKONOS-2", "ORBVIEW-3");


/// <summary>
/// Builds ArcGIS Server REST URL based on above parameters.
/// </summary>
/// <returns>null</returns>
function GetArcGISServerRESTURL(layerID) {
    //Overwrite global if passed in.  Default is 0
    if(layerID == undefined || layerID == null)
    {
        layerID = _layerID;
    }
    return "http://" + _serverName + "/" + _instanceName + "/rest/services/" + _serviceName + "/MapServer/" + layerID + "/";
}

function GetCloudQueryValue( ){
    return _cloudCoverColumn + " <= "+ $(_maxCloudCover).value;
}

function GetSpatialRankQueryValue()
{
    /*if($(_spatialRanking).checked)
        return "true";
    else
        return "false";*/
    return false;
}