$(document).ready(function() {
    
    $('#zoo').mouseover(function() {
      $('p.box').remove();
    });
    
    $('.menu').mouseover(function() {
      $('p.box').remove();
    });
    
    $('.menu ul li a span').mouseover(function() {
      $('p.box').remove();
    });
    
    $('.box3').mouseover(function() {
      $('p.box').remove();
    });
    $('.box4').mouseover(function() {
      $('p.box').remove();
    });
    $('#navigation').mouseover(function() {
      $('p.box').remove();
    });
    
    $('#zoo a.point').mouseover(function() {
        var point = this;
        var id = $(this).attr('rel');
        
        var position = $(this).position();
        var posun = 0;
        var posun2= 0;
        if (position.left>850) {
          var posun = 1;
        }
        if (position.top>50) {
          var posun2 = 1;
        }
        
        
        $.ajax({
            type: "GET",
            url: '_data.php?id='+id,
            dataType: "html",
            success: function(data) {      
              $(point).append('<p class="box">'+data+'</p>');
              if (posun==1) {
                $('p.box').css('left','-230px');
              }
              
              if (posun2==1) {
                $('p.box').css('top','-60px');
              } else {
                $('p.box').css('top','0px');
              }
              
              //$('p.box').css('z-index','10100');
            }
        });
        
    }).mouseout(function() {
        $(this).find('p.box').remove();   
    });
   
});

