
if (typeof hbConfig == "undefined") hbConfig={};
hbConfig.version = hbConfig.version || "current";
hbConfig.arcgisVersion = hbConfig.arcgisVersion || (esri && esri.version) || "1.5";

// CONFIGURATION PROPERTIES

hbConfig.arcgisUrl = 'http://dc1.maps.lt/arcgis_js_api/library/'+hbConfig.arcgisVersion+'/arcgis/';
hbConfig.baseUrl = '//www.maps.lt/maps_js_api/'+hbConfig.version+'/'; // dont use absolute url as this currently breaks widget loading cross domain (especially with IE hrrr....) 
hbConfig.servicesUrl = 'http://www.maps.lt/map/';
hbConfig.servicesAoUrl = 'http://services.maps.lt/maps_services_ao/';
hbConfig.servicesProxyUrl = 'http://www.maps.lt/maps_services/';
hbConfig.adsImagesUrl = 'http://www.maps.lt/map/images/_ads/';
hbConfig.layerDefs = {
    vector: {
        title: {lt:'Žemėlapis', en:'Map'},
        url: 'http://services.maps.lt/mapsk_services/mapslt/MapServer',
        tilesUrls: ['http://dc1.maps.lt/cache/mapslt'],
        group: 'bg',        
        alt: {id:"vector_2_5d", extents:[
            {xmin:565000,ymin:6048700,xmax:596600,ymax:6077900},
            {xmin:483628,ymin:6074279,xmax:516122,ymax:6098642},
            {xmin:315656,ymin:6166407,xmax:334594,ymax:6193467},
            {xmin:513442,ymin:6171825,xmax:529660,ymax:6182621}
        ], minScale:6000},
        visible:true
    },    
	vector_2_5d: {
        title: {lt:'2.5D emlapis (beta)', en:'2.5D map (beta)'},
        url: 'http://www.maps.lt/maps_services/mapslt_25d_vkkp/MapServer',
        tilesUrls: ['http://dc1.maps.lt/cache/mapslt_25d_vkkp'],
        visible:true
    },
    orthophoto: {
        title: { lt: 'Ortofoto', en: 'Orthophoto' },
        url: 'http://www.maps.lt/maps_services/mapslt_ortofoto/MapServer',
        tilesUrls: ['http://dc1.maps.lt/cache/mapslt_ortofoto'],
        alt: { id: 'orthophoto_2010', extents: [{ xmin: 475000, ymin: 6000000, xmax: 550000, ymax: 6225000 }, { xmin: 550000, ymin: 6160000, xmax: 615000, ymax: 6210000}], minScale: 200001 },
        group: 'bg'
    },
    orthophoto_2010: {
        title: { lt: 'Atnaujintas ortofoto', en: 'Updated orthophoto' },
        url: 'http://www.maps.lt/maps_services/mapslt_ortofoto_2010/MapServer',
        tilesUrls: ['http://dc1.maps.lt/cache/mapslt_ortofoto_2010'],
        visible: true
    },
    hybrid: {
        title: { lt: 'Mišrus', en: 'Hybrid' },
        url: 'http://www.maps.lt/maps_services/mapslt_ortofoto/MapServer',
        tilesUrls: [
            'http://dc1.maps.lt/cache/mapslt_ortofoto'
        ],
        alt: { id: 'hybrid_2010', extents: [{ xmin: 475000, ymin: 6000000, xmax: 550000, ymax: 6225000 }, { xmin: 550000, ymin: 6160000, xmax: 615000, ymax: 6210000}], minScale: 200001 },
        group: 'bg',
        children: ['hybrid_overlay']
    },
    hybrid_2010: {
        title: { lt: 'Atnaujintas ortofoto', en: 'Updated orthophoto' },
        url: 'http://www.maps.lt/maps_services/mapslt_ortofoto_2010/MapServer',
        tilesUrls: ['http://dc1.maps.lt/cache/mapslt_ortofoto_2010'],
        visible: true
    },
    hybrid_overlay: {
        url: 'http://www.maps.lt/maps_services/mapslt_ortofoto_overlay/MapServer',
        tilesUrls: [
            'http://dc1.maps.lt/cache/mapslt_ortofoto_overlay'
        ],
        visible: true
    },
    relief: {
        title: {lt:'Reljefas', en:'Relief'},
        url: 'http://www.maps.lt/maps_services/mapslt_relief/MapServer',
		tilesUrls: [
            'http://dc1.maps.lt/cache/mapslt_relief'
        ],
        group: 'bg'
    },
    hotels: {
        title: {lt:'Viešbučiai, kavinės, laisvalaikio objektai', en:'Hotels, cafes, leisure objects'},
        url: 'http://www.maps.lt/maps_services/mapslt_hotels/MapServer',
        tilesUrls: ['http://www.maps.lt/cache/mapslt_hotels']
    },
    other: {
        title: {lt:'Kiti objektai', en:'Other objects'},
        url: 'http://www.maps.lt/maps_services/mapslt_other/MapServer',
        tilesUrls: ['http://www.maps.lt/cache/mapslt_other']
    },
    parks: {
        title: { lt: "Saugomos teritorijos", en: "Protected areas" },
        url: "http://www.maps.lt/maps_services/mapslt_parks/MapServer",
        opacity: 0.4
    },
    topo: {
        title: {lt:'Toponimika', en:'Toponymics'},
        url: 'http://services.maps.lt/mapsk_services/mapslt_topo/MapServer',
        type: 'dynamic'
    },
    overview: {
        title: "",
        url: 'http://www.maps.lt/maps_services/mapslt_overview/MapServer',
        tilesUrls: ['http://www.maps.lt/cache/mapslt_overview']
    },
    ikartelv_vector: {
        title:"",
        url: "http://www.maps.lt/maps_services/ikartelv/MapServer",
        tilesUrls: ['http://www.maps.lt/cache/ikartelv'],
        visible: true
    }
};
hbConfig.copyrights = {
    author: "© UAB Hnit-Baltic, " + (new Date()).getFullYear(),
    link: "http://www.maps.lt/apie/autorines",
    providers: [
        "© Anykščių rajono savivaldybė, 2001",
        "© SĮ Panevėžio planas, 2000",
        "© SĮ Vilniaus planas, 2001",
        "LTDBK50000-V © Nacionalinė žemės tarnyba prie ŽŪM, 1996-2005",
        "ORT10LT © Nacionalinė žemės tarnyba prie ŽŪM, 2005-2006",
        "Adresų ir gatvių duomenys &copy; VĮ Registrų Centras, 2009",
        "Lietuvos Respublikos saugomų teritorijų valstybės kadastro duomenys <br />&copy; Valstybinė saugomų teritorijų tarnyba prie Aplinkos ministerijos, 2008"
    ]
};

hbConfig.configScriptLocations = ['http://localhost', 'http://www.maps.lt'];


// CONFIGURATION ACTIONS

// Update dojo config
if (typeof dojo == 'undefined'){
    if (typeof djConfig == 'undefined') djConfig = {};
    if (!djConfig.baseUrl) djConfig.baseUrl = hbConfig.arcgisUrl + 'dojo/';
    if (typeof djConfig.modulePaths == 'undefined') djConfig.modulePaths = {};
    djConfig.modulePaths.hb = hbConfig.baseUrl + 'js/hb';
    djConfig.locale = 'lt';
} else {
	if (!dojo.baseUrl) dojo.baseUrl = hbConfig.arcgisUrl + 'dojo/';
    dojo.registerModulePath('hb', hbConfig.baseUrl + 'js/hb');
}
