//Polyline utility: http://www.google.com/apis/maps/documentation/polylineutility.html

    function load() {
      if (GBrowserIsCompatible()) {

//Docuart.
        var map2 = new GMap2(document.getElementById("map2"));
        map2.addControl(new GLargeMapControl());
        map2.addControl(new GMapTypeControl());
        map2.addControl(new GOverviewMapControl());
        map2.setCenter(new GLatLng(47.48848, 19.0636), 16);

        //Add marker
        map2.addOverlay(new GMarker(new GLatLng(47.48708, 19.0637)));

//Vorosmarty.
        var map3 = new GMap2(document.getElementById("map3"));
        map3.addControl(new GLargeMapControl());
        map3.addControl(new GMapTypeControl());
        map3.addControl(new GOverviewMapControl());
        map3.setCenter(new GLatLng(47.4896, 19.0619), 17);

        //Add marker
        map3.addOverlay(new GMarker(new GLatLng(47.48935, 19.06247)));


//Örökmozgó. ROSSZ
        var map4 = new GMap2(document.getElementById("map4"));
        map4.addControl(new GLargeMapControl());
        map4.addControl(new GMapTypeControl());
        map4.addControl(new GOverviewMapControl());
        map4.setCenter(new GLatLng(47.503345,19.064552), 17);

        //Add marker
        map4.addOverlay(new GMarker(new GLatLng(47.503345,19.064552)));


//Marczibanyi ter
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GOverviewMapControl());
        map.setCenter(new GLatLng(47.511, 19.02626), 15);

        // Create our "Dialektus" marker icon
        var icon = new GIcon();
        icon.image = "http://www.dialektusfesztival.hu/img/map/marker.png";
        icon.shadow = "http://www.dialektusfesztival.hu/img/map/shadow.png";
        icon.iconSize = new GSize(67, 52);
        icon.shadowSize = new GSize(80, 52);
        icon.iconAnchor = new GPoint(10, 52);
        icon.infoWindowAnchor = new GPoint(10, 52);

        // Create our "Millenaris" marker icon
        var icon2 = new GIcon();
        icon2.image = "http://www.dialektusfesztival.hu/img/map/millenaris.png";
        icon2.shadow = "http://www.dialektusfesztival.hu/img/map/shadow.png";
        icon2.iconSize = new GSize(67, 35);
        icon2.shadowSize = new GSize(67, 35);
        icon2.iconAnchor = new GPoint(10, 35);

        var icon3 = new GIcon();
        icon3.image = "http://www.dialektusfesztival.hu/img/map/mammut.png";
        icon3.shadow = "http://www.dialektusfesztival.hu/img/map/shadow.png";
        icon3.iconSize = new GSize(67, 35);
        icon3.shadowSize = new GSize(67, 35);
        icon3.iconAnchor = new GPoint(10, 35);

        var icon5 = new GIcon();
        icon5.image = "http://www.dialektusfesztival.hu/img/map/moszkva2.png";
        icon5.shadow = "http://www.dialektusfesztival.hu/img/map/shadow.png";
        icon5.iconSize = new GSize(67,52);
        icon5.shadowSize = new GSize(80, 52);
        icon5.iconAnchor = new GPoint(10, 52);

     function orderOfCreation(marker,b) {
        return 1;
      }

        //Add other markers
        map.addOverlay(new GMarker(new GLatLng(47.5114323, 19.02459), {icon: icon2, zIndexProcess:orderOfCreation}));
        map.addOverlay(new GMarker(new GLatLng(47.509577, 19.026569), {icon: icon3, zIndexProcess:orderOfCreation}));
//mammut1        map.addOverlay(new GMarker(new GLatLng(47.509577, 19.026569), icon3));
//mammut2        map.addOverlay(new GMarker(new GLatLng(47.50848, 19.02570), icon4));
        map.addOverlay(new GMarker(new GLatLng(47.507000, 19.024758), {icon: icon5, zIndexProcess:orderOfCreation}));

        //Add Dialektus marker

        var point = new GLatLng(47.513505,19.021132);
//        var marker = new GMarker(point, {zIndexProcess:orderOfCreation});
        var marker = new GMarker(point, {icon: icon, zIndexProcess:orderOfCreation});
        map.addOverlay(marker);
/*        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml("Marker <b>" + "K" + "</b>");
        });*/

        //Add Millenaris polyline
        var encodedPolyline = new GPolyline.fromEncoded({
            color: "#00ff00",
            weight: 3,
            points: "gr~`HqlbsBuCoDlFaNhDjDcGdN",
            levels: "BBBBB",
            zoomFactor: 32,
            numLevels: 4
        });
        map.addOverlay(encodedPolyline);

        //Add Mammut polyline
        var encodedPolyline = new GPolyline.fromEncoded({
            color: "#ff0000",
            weight: 3,
            points: "k_~`HuubsBkJaM|BkFtFlGEzK",
            levels: "BBBBB",
            zoomFactor: 32,
            numLevels: 4
        });
        map.addOverlay(encodedPolyline);



    }
      // display a warning if the browser was not compatible
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
  }
