		

var Page = {
    load: function() {        
        var map = new AMap("map", {
            showAtlasLogo : false 
        });                                          
        map.addMapPart(new AMapControl());
        map.addMapPart(new AMapTypeControl());  
        map.addMapPart(new AScaleOfMap());        
        map.addMapPart(new AMapLayerControl([map_over]));
        map.registerLayers(map_over)  

        map.loadMaps(new AGeoPoint("49°9\'33.62\"N; 16°37\'26.33\"E"), 8, 'Letecká');
        
   }
} 

window.addEvent('domready', Page.load.bind(Page));    

// pro posunutí mapy
		moveX = -601595; // více záporné číslo = posun doprava
		moveY = -1168945; //větší číslo = posun dolů

map_over = {
    "centerX" :- 661856,
    "centerY" :- 1083840,
    "coordinateSystem": 1,
    "copyright": "ceskedalnice.cz",
    "displayName": "Brno, rozšíření D1",
    "scaleInfos": [ {
        "coordinateSystem": 1,
        "scale": 1000000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 128,
        "coefficientY": 128,
        "tileNumX": 1,
        "tileNumY": 1,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res-mini/res8",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 500000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 64,
        "coefficientY": 64,
        "tileNumX": 1,
        "tileNumY": 1,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res-mini/res7",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 250000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 32,
        "coefficientY": 32,
        "tileNumX": 1,
        "tileNumY": 1,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res-mini/res6",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 125000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 16,
        "coefficientY": 16,
        "tileNumX": 2,
        "tileNumY": 2,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res5/{column}_{row}",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 64000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 8,
        "coefficientY": 8,
        "tileNumX": 4,
        "tileNumY": 4,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res4/{column}_{row}",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 32000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 4,
        "coefficientY": 4,
        "tileNumX": 8,
        "tileNumY": 8,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res3/{column}_{row}",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 16000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 2,
        "coefficientY": 2,
        "tileNumX": 16,
        "tileNumY": 16,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res2/{column}_{row}",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 8000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 1,
        "coefficientY": 1,
        "tileNumX": 32,
        "tileNumY": 32,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res1/{column}_{row}",
        "mapID": "over"
    }, {
        "coordinateSystem": 1,
        "scale": 4000,
        "minX" : moveX,
        "minY" : moveY,
        "maxX" : 8192 - moveX,
        "maxY" : 8192 - moveY,
        "tileFormat": "Png",
        "tileWidthPx": 256,
        "tileHeightPx": 256,
        "coefficientX": 0.5,
        "coefficientY": 0.5,
        "tileNumX": 64,
        "tileNumY": 64,
        "tileUrlFormat": "http://mapy.ceskedalnice.cz/interaktivni-mapy/d1-brno-rozsireni/res0/{column}_{row}",
        "mapID": "over"
    }],
    "scaleIdx": 0,
    "id": 3
};


// resizovani okna - zmena velikosti mapy

function MyResize() {
	var ppw = 0, pph = 0;
	if( self.innerHeight ) {
		ppw = self.innerWidth;
		pph = self.innerHeight;
	} else if( document.documentElement && document.documentElement.clientHeight ) {
		ppw = document.documentElement.clientWidth;
		pph = document.documentElement.clientHeight;
	} else if( document.body ) {
		ppw = document.body.clientWidth;
		pph = document.body.clientHeight;
	};
	if (pph<100) { pph=100 };
	if (ppw<300) { ppw=300 };
	document.getElementById("map").style.height = (pph - 42) + "px";
	document.getElementById("map").style.width = (ppw - 201) + "px";
	document.getElementById("sidebar").style.height = (pph - 41) + "px";
	document.getElementById("sidebar").style.left = (ppw - 200) + "px";
}
window.onresize = MyResize;

// odstraneni scroolbaru v IE
if( document.documentElement && document.documentElement.clientHeight ) {
	document.getElementsByTagName("html")[0].style.overflow = "hidden";
}

