function MyMap() {

    this.zoom = 17;
    this.map = new GMap2(document.getElementById("gmap"));
    this.map.setCenter(new GLatLng(50.083, 14.45724), this.zoom);
    this.map.setMapType(G_NORMAL_MAP);

    this.map.addControl(new GSmallMapControl());
    this.map.addControl(new GMapTypeControl());

    this.map.enableContinuousZoom();
    this.map.enableScrollWheelZoom();

    this.bigIcon = new GIcon(G_DEFAULT_ICON);
    this.bigIcon.image = "/images/logo_google.png";
    this.bigIcon.iconSize = new GSize(44, 44);
    this.bigIcon.shadow = "/images/logo_google_shadow.png";
    this.bigIcon.shadowSize = new GSize(44, 44);

    this.mediumIcon = new GIcon(G_DEFAULT_ICON);
    this.mediumIcon.image = "/images/logo_google.png";
    this.mediumIcon.iconSize = new GSize(26, 26);
    this.mediumIcon.shadow = "/images/logo_google_shadow.png";
    this.mediumIcon.shadowSize = new GSize(26, 26);

    this.smallIcon = new GIcon(G_DEFAULT_ICON);
    this.smallIcon.image = "/images/logo_google.png";
    this.smallIcon.iconSize = new GSize(20, 20);
    this.smallIcon.shadow = "/images/logo_google_shadow.png";
    this.smallIcon.shadowSize = new GSize(20, 20);

    // pruchod vsemi typy map a nastaveni minimalniho a maximalniho zoomu
    this.mt = this.map.getMapTypes();

    for (var i=0; i < this.mt.length; i++) {

        this.mt[i].getMinimumResolution = function() {
            return 5;
        }

    }

    GEvent.bind(this.map, "zoomend", this, this.setZoom);

    this.map.clearOverlays();
}

MyMap.prototype.addpoint = function(point) {

    if (this.zoom >= 17) {
        options = {icon: this.bigIcon};
    } else if (this.zoom < 17 && this.zoom >= 12 ) {
        options = {icon: this.mediumIcon};
    } else {
        options = {icon: this.smallIcon};
    }

    this.marker = new GMarker(point, options);

    this.map.addOverlay(this.marker);
}

MyMap.prototype.setZoom = function() {
    this.map.clearOverlays();
    this.zoom = this.map.getZoom();

    if (this.zoom >= 17) {
        point = new GLatLng(50.083, 14.45724);
    } else if (this.zoom < 17 && this.zoom >= 12 ) {
        point = new GLatLng(50.0828 - ((16 - this.zoom) * 0.0001), 14.45724);
    } else if(this.zoom < 12 && this.zoom >= 8) {
        point = new GLatLng(50.082 - ((11 - this.zoom) * 0.01), 14.45724);
    } else if(this.zoom < 8) {
        point = new GLatLng(50.082 - ((8 - this.zoom) * 0.1), 14.45724);
    }

    this.addpoint(point);
}

$(document).ready(function() {

    var gmap = new MyMap();
    point = new GLatLng(50.083, 14.45724);
    gmap.addpoint(point);

});

$(window).unload( function () {
    GUnload();
});