var padding = -5;
$(document).ready(function(){
  // Vyhledávání
  $("#div_image_home").hover(
  function () {      
    showHint($(this), "Moje snímky", -5);
  }, 
  function () {
    hideHint();
  });  

  $("#div_image_all").hover(
  function () {      
    showHint($(this), "Všechny snímky", -5);
  }, 
  function () {
    hideHint();
  });  
  
  $("#div_search_small_all").hover(
  function () {      
    showHint($(this), "Všechny snímky", -10);
  }, 
  function () {
    hideHint();
  });  
  
  $("#div_image_catalogue_sm").hover(
  function () {      
    showHint($(this), "Dokončené a ověřené", -5);
  }, 
  function () {
    hideHint();
  });    

  $("#div_image_waiting_sm").hover(
  function () {      
    showHint($(this), "Dokončené", -5);
  }, 
  function () {
    hideHint();
  });    

  $("#div_image_catalogue").hover(
  function () {      
    showHint($(this), "Dokončené a ověřené", -5);
  }, 
  function () {
    hideHint();
  });    

  $("#div_image_waiting").hover(
  function () {      
    showHint($(this), "Dokončené", -5);
  }, 
  function () {
    hideHint();
  });    

  $("#div_image_working").hover(
  function () {      
    showHint($(this), "Rozpracované", -5);
  }, 
  function () {
    hideHint();
  });    
  

  $("#div_search_button").hover(
  function () {      
    showHint($(this), "Vyhledat snímky", -10);
  }, 
  function () {
    hideHint();
  });    
    
  // END Vyhledávání

    
});

function showHint(element, text, mar){
  $("#div_hint_middle").html(text);
  var pos = element.offset();
  var height = element.height()+mar;
  var hintWidht = parseInt($("#div_hint_container").width());
  var width = element.width()/2 - hintWidht/2;
  $("#div_hint_container").css("top", (pos.top-height));
  $("#div_hint_container").css("left", pos.left+width);  
  $("#div_hint_container").css("display", "block");
}

function hideHint(text, position){
  $("#div_hint_container").css("display", "none");
}



