﻿var _map;
var _autosuggest;

var _toolbar;

var _mapServiceURL = "http://tkn_52E223866ED9BA980C5B4D16595969FF530E0C1A.api.location-world.com/ArcGIS/rest/services/GlobalMapService2011/MapServer";
var _mapServiceURL3G = "http://maps.location-world.com/ArcGIS/rest/services/Ciudades3G_EscalasGlobal/MapServer";
var _mapServicePicoYPlaca = "http://tkn_52e223866ed9ba980c5b4d16595969ff530e0c1a.api.location-world.com/ArcGIS/rest/services/QuitoPicoPlacaMapService/MapServer";

var _ecuadorMapService;
var _ecuadorMapService3G;
var _picoYPlacaService;

var _weatherLayer;
var _addressLayer;
var _tweetsLayer;
var _lastPoiLayer;

var _latLngMarkLayer;

var _furl = "http://feedback.location-world.com";

var _searchTypes = { ByServices: 0, ByCategories: 1, Intersection: 2, PlaceNearTo: 3, FreeSearch: 4 };

var _searchType;
var _EVCZpointsColl;
var _actualPage = 1;
var _freeSearchHasBothResults = false;
var _searchResultsHeight = 0;

var PUSHPING_SYMBOL = new esri.symbol.PictureMarkerSymbol("images/marker.png", 68, 68);
var ADDRESS_PUSHPING_SYMBOL = new esri.symbol.PictureMarkerSymbol("images/marker_address.png", 68, 68);
var TWEET_SYMBOL = new esri.symbol.PictureMarkerSymbol("images/geotweet.png", 28, 30);
var BASE_POINT_LEVEL = 15;

var hosturl = "";

var testconnect;

function Guiame() {
    
    
    _map = new lw.Map("map", { displayGraphicsOnPan: !dojo.isIE });

    _ecuadorMapService = new esri.layers.ArcGISTiledMapServiceLayer(_mapServiceURL);
    _ecuadorMapService3G = new esri.layers.ArcGISTiledMapServiceLayer(_mapServiceURL3G);
    _picoYPlacaService = new esri.layers.ArcGISTiledMapServiceLayer(_mapServicePicoYPlaca);

    _map.addLayer(_ecuadorMapService);
    
    _ecuadorMapService3G.setOpacity(0.0);
    _map.addLayer(_ecuadorMapService3G);
    
    _picoYPlacaService.setOpacity(0.0);
    _map.addLayer(_picoYPlacaService);

    //InitiAnalythics();

    if (!_map.loaded)
        testconnect = dojo.connect(_map, "onLoad", LoadMapVars);
    else
        LoadMapVars(_map);

}

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27065674-7']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
