function loadMap()
{
  if (GBrowserIsCompatible())
  {
    var map = new GMap2(document.getElementById("map"));
    
    var mapTypes = map.getMapTypes();
    for(var i = 0; i < mapTypes.length; i++)
    {
      if (mapTypes[i].getName() == 'Map')
        mapTypes[i].getName = function() { return 'Mapa'; };
        
      if (mapTypes[i].getName() == 'Satellite')
        mapTypes[i].getName = function() { return 'Satelitarna'; };
        
      if (mapTypes[i].getName() == 'Hybrid')
        mapTypes[i].getName = function() { return 'Hybrydowa'; };
    }
    
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.addControl(new GScaleControl());
    map.addControl(new GOverviewMapControl());
    
    
    map.setCenter(new GLatLng(50.04802, 19.9753), 12);
    
    
    
    
    var manager = new GMarkerManager(map);
    
    for (var i = 0; i < firmy.length; i++)
      setupMarker(map, manager, firmy[i]);
    
    manager.refresh();
  }
}

/**
 * Funkcja dodaje market i chmurke dla markera dla firmy
 */
function setupMarker(map, manager, firma)
{
  var isSmall = true;
  if (isSmall == true && firma[7] == 0)
    return;
  var point = new GLatLng(firma[5], firma[6]);
  
  if (firma[7] == 1)
  {
    var icon = new GIcon(G_DEFAULT_ICON, "images/mapy/iconr.png");
    icon.iconSize = new GSize(20, 34);
    icon.shadowSize = new GSize(37, 34);
    icon.shadow = "images/mapy/marker_shadow.png";
  } else
    {
      var icon = new GIcon(G_DEFAULT_ICON, "images/mapy/marker_small.png");
      icon.iconSize = new GSize(39, 34);
      icon.shadowSize = new GSize(39, 34);
      icon.shadow = "images/mapy/marker_small_shadow.png";
    }
  var marker = new GMarker(point, icon);

  /*@cc_on @if (@_jscript)
    var infoDiv = document.createElement("<div class='chmurka_nazwa'></div>");
    var firmaNazwa = document.createElement("<div></div>");
    var frimaAnchor = document.createElement("<a></a>");
    var firmaAhref = document.createElement("<a></a>");
  @else */
    var infoDiv = document.createElement('div');
    var firmaNazwa = document.createElement('div');
    var frimaAnchor = document.createElement('a');
    var firmaAhref = document.createElement('a');
    infoDiv.setAttribute('class', 'chmurka_nazwa');
  /* @end @*/
  
  frimaAnchor.href = "http://dobryfryzjer.com/produkt.php?id="+firma[0];
  frimaAnchor.innerHTML = firma[1];
  firmaAhref.href = 'http://'+firma[4];
  firmaAhref.innerHTML = firma[4];
  firmaNazwa.appendChild(frimaAnchor);
  var firmaAdres = document.createElement('div');
  firmaAdres.appendChild(firmaAhref);
  var firmaMiasto = document.createElement('div');
  firmaMiasto.innerHTML = firma[2]+'<br />'+firma[3];
  
  infoDiv.appendChild(firmaNazwa);
  infoDiv.appendChild(firmaMiasto);
  infoDiv.appendChild(firmaAdres);
  
  GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(infoDiv) });
  manager.addMarker(marker, 11);
  //map.addOverlay(marker);
}