// jQuery Captify Plugin
// Copyright (C) 2009 Brian Reavis
// Licenced under the MIT license
// $Date: 2009-11-30 [Mon, 30 Nov 2009] $
jQuery.fn.extend({
	captify: function() {
	
	   $(this).each(function(){
	     var e = $(this);
	     var i = e.children("img");
	     e.append("<span>"+i.attr("alt")+"</span>");
       var s = e.children("span");
       var sH = s.height() + parseInt(s.css("paddingTop")) + parseInt(s.css("paddingBottom")) + parseInt(s.css("marginTop")) + parseInt(s.css("marginBottom"));
       s.css("bottom", sH*-1);
       
      e.hover(function(){      
        s.stop().animate({ 
            bottom: 0
        }, 300 );        
      }, function(){      
        s.stop().animate({ 
            bottom: sH*-1
        }, 300 );
      });
     });
	 
	}
});
