﻿//Global JS Variables
var panSpeed = 70;
var compass_click = false;
var navcontrolId = "navcontrol";
var navHidden = false;
var mapManager = null;
var browserManager = null;
var printManager = null;

//GeoIP
var geoIpLocation = null;
var geoIpCity = null;
var geoIpProvince = null;

//Map controls
var closeMiniDisplay = null;
var openMiniDisplay = null;
var closePanelDisplay = null;
var onPanEnd = false;

//Clustering
var clusterManager = null;
var minZoomLimit = 15;
var gridSize = 70;
var maxZoomLimit = 9;

//Traffic tile overlay globals
var trafficEnabled = false;
var trafficTimer = null;
var trafficRefresh = 60000;

//Used for routing in VE.js
var fromPlaceArray = null;
var fromDisambiguationFlag = false;
var toDisambiguationFlag = false;
var waypointsDisambiguationFlag = false;
var waypointsSingleResultFlag = false;
var waypointsArray = new Array();
var iconArray = [null,'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
var drivingDirectionPaneNumber=-1;
var drivingDirectionResultDiv;
var drivingDirectionTo;
var drivingDirectionFrom;

//pane number to display the results on, -1 means new pane will be created
var findMapResultsPaneNumber=-1;
var findBusinessResultsPaneNumber=-1;

//Browser-dependent values
var resources = new Array();

//Maintaining state of QueryString for FAB
var qStringCache = null;

//Find Business (only):
// Triggers whether or not to turn on simple search on cases that do not contain numbers
// [triggerSimpleSearchInAllCases = true] - If txt location, no numbers in text, conduct a simple search on the keyword/location. If there are numbers in text, then revert to false case
// [triggerSimpleSearchInAllCases = false, default]- Check location, and use VE latlong, confidence <= 1, to do proximity search. If confidence > 1, do simple search
var triggerSimpleSearchInAllCases = false;

var currentWeRecommend = 0;

//For maintaining height for accordion
var windowHeight = 0;

//List used for simple searching
var SimpleSearchCityList = "toronto, vancouver, calgary, edmonton, ottawa, montreal, winnipeg, regina, saskatoon, victoria, burnaby, scarborough, north york, markham, richmond hill, mississauga, brampton, hamilton, laval";

//Used for storing listing name/address/phone to restore state on What's Nearby searches
function tempListing()
{
    this.name = null;
    this.address = null;
    this.phone = null;
}

var GlobalListing = new tempListing();