<?
if ( isset( $this -> _adress ) )
{
  ?>
  <script type='text/javascript'>
    $(document).ready(function() {
      map_<?=$this -> _id;?> = new GMap2(document.getElementById('mapa_<?=$this -> _id;?>'));
      var geo_<?=$this -> _id;?> = new GClientGeocoder();
      var adres_<?=$this -> _id;?> = '<?=$this -> _adress;?>';
      geo_<?=$this -> _id;?>.getLatLng(adres_<?=$this -> _id;?>,function(punkt_<?=$this -> _id;?>){
        map_<?=$this -> _id;?>.setCenter(punkt_<?=$this -> _id;?>, <?=$this -> _zoom;?> );
        map_<?=$this -> _id;?>.addOverlay(new GMarker(punkt_<?=$this -> _id;?>));
        map_<?=$this -> _id;?>.panTo(punkt_<?=$this -> _id;?>);
        map_<?=$this -> _id;?>.setUIToDefault();
      });
    });
  </script>
  <div id='mapa_<?=$this -> _id;?>' style='width:<?=$this -> _width;?>px; height:<?=$this -> _height;?>px; border:1px solid black;'></div>
  <?
}
else
{
  ?>    
  <script type='text/javascript'>
    $(document).ready(function() {
      map_<?=$this -> _id;?> = new GMap2(document.getElementById('mapa_<?=$this -> _id;?>'));
      var point_<?=$this -> _id;?> = new GLatLng(<?=$this -> _x_coord;?>,<?=$this -> _y_coord;?>);
      map_<?=$this -> _id;?>.setCenter(point_<?=$this -> _id;?> , <?=$this -> _zoom;?> );
      map_<?=$this -> _id;?>.addOverlay(new GMarker(point_<?=$this -> _id;?>));
      map_<?=$this -> _id;?>.setUIToDefault();
    });
  </script>
  <div id='mapa_<?=$this -> _id;?>' style='width:<?=$this -> _width;?>px; height:<?=$this -> _height;?>px; border:1px solid black;'></div>
  <?
}