function initialize() {
  window.map = new GMap2(document.getElementById("mapa"));

  map.setCenter(new GLatLng(0,0), 2);  
  map.enableScrollWheelZoom();
  map.addControl(new GLargeMapControl3D());

  var topRight = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(135,480))
  map.addControl(new GMapTypeControl(), topRight);

  vlozZnacky();
  
  GEvent.addDomListener(map, 'extinfowindowupdate',function(){
    var windowContent = document.getElementById("custom_info_window_red_contents");
    var tabs = new Array(document.getElementById("tab0"),document.getElementById("tab1"));
    if( tabs.length > 0 ){
      var tabContentsArray = new Array(tabs.length);
      for( i=0; i < tabs.length; i++){
        tabContentsArray[i] = document.getElementById("tab"+i+"_content");
        if( i > 0){
          hide(tabContentsArray[i]);
        }
        tabs[i].setAttribute("name", i.toString());
      
        GEvent.addDomListener(tabs[i],"click",function(){
          var tabIndex = this.getAttribute("name");
        
          for(tabContentIndex=0; tabContentIndex < tabs.length; tabContentIndex++){
            if( tabContentIndex == tabIndex ){
              show(tabContentsArray[tabContentIndex]);
            }else{
              hide(tabContentsArray[tabContentIndex]);
            }
          }
          map.getExtInfoWindow().resize();
        });
      }
    }
  });
}

function hide(element){
    element.style.display = "none";
    element.style.position = "absolute";
}

function show(element){
    element.style.display = "block";
    element.style.position = "relative";
}
