$(document).ready(function() {

  $('.why div').hide();
  $('body').click(function() { $('.why div').fadeOut('slow'); });
  $('.why li a').click(function() {
    $('.why div').fadeOut('slow');
      $( $(this).attr('href') ).fadeIn('slow');
     return false;
  });

});

function stfSendAnother(){
	$('.panel-send-to-friend .message a').click(function(){
		$('.panel-send-to-friend .message').css('display', 'none');
		return false;
	});
}


/* namespace, predevsim pro praci s google maps */
GM = {
  createGoogleMap: function(id) {
    GM.map = new google.maps.Map(document.getElementById(id), {
      zoom: 12,    
      center: new google.maps.LatLng(49.96974,17.864394),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    GM.infowindow = new google.maps.InfoWindow();
  },

  // prida ikonku do mapy, vyzaduje Shadowbox v pripade ze se v html nachazi obrazky!
  createMarker: function(coords, html, title){
    coords = coords.split(',');

    var marker = new google.maps.Marker({
      position: new google.maps.LatLng(parseFloat(coords[0]), parseFloat(coords[1])),
      map: GM.map,
      flat: true,
      title: title
    });
    
    google.maps.event.addListener(marker, 'click', function() {
        GM.infowindow.setContent(html);
        GM.infowindow.open(GM.map, marker);
    });
  }
};
