/**
 * jQuery reallyVisible extension. 0.0.1a
 *
 * Author: Matthew Kingston <matthew@clickcreative.com.au>
 *         Copyright: 2011 © Click Creative Pty Ltd
 *
 * Package: jQuery
 * Category: Selectors
 * 
 * When using the following code
 * <code>
 *     <div id="example1" style="">Example 1</div>
 *     <div id="example2" style="display: none;">Example 2</div>
 * </code>
 *
 * And performing the both of following jQuery checks, they will return true
 *    $('#example1').is(':visible');
 *    $('#example2').is(':hidden');
 *
 * However we run into a problem when using the following code
 * <code>
 *     <div style="display: none;">
 *         <div id="example1" style="">Example 1</div>
 *         <div id="example2" style="display: none;">Example 2</div>
 *     </div>
 * </code>
 *
 * And performing the both of following jQuery checks, they will STILL return true
 *    $('#example1').is(':visible');
 *    $('#example2').is(':hidden');
 *
 * Because jQuery only looks at the element in question to determine it's visibility.
 * But as you can see with the above code, we've hidden a parent element which makes
 * the nested elements both invisible.
 *
 * To overcome this we need to check if 1. The element in question isn't hidden and
 * any parent element (all the way back up to the body) isn't hidden either.
 */
(function($){$.extend($.expr[":"],{reallyvisible:"(jQuery(a).is(':visible') && jQuery(a).parents(':hidden').length == 0)"});})(jQuery);
