// $Id: photo_layover.js,v 1.1 2009/09/10 00:44:31 hadsie Exp $

/**
* A simple behaviour to show/hide the captions
*/
Drupal.behaviors.photo_layover = function (context) {
   var myDuration = 150; //time in miliseconds
   var endHeight = '20px';
   var imgHeight = $('#slide-0').height();
   var outHeight = (imgHeight - 20);
   var inHeight = (imgHeight + endHeight);

   $(".photo-layover-wrapper", context).hover(
      function () {
         var descHeight = $(this).find('.photo-layover-field.description-field').height();

         // alert(descHeight);

         // $(this).find('.photo-layover-info-box:not(.nohide)').slideDown("fast");
         $(this).find('.photo-layover-info-box:not(.nohide)').animate({
              // top : '-=' + 20,
               // bottom : 10  + 'px',
             // height: '40px'
             height: descHeight + 21 + 'px' 
             }, myDuration);
      },
      function () {
         // $(this).find('.photo-layover-info-box:not(.nohide)').slideUp("fast");
         $(this).find('.photo-layover-info-box:not(.nohide)').animate({ 
             // top : outHeight + 'px',
             // bottom: "0px",
             height: '13px'
              }, myDuration);
      }
   );
}

