/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 1.1
 */
(function(c){c.fn.overlaps=function(f){if(arguments.length===0){return this.pushStack(d(this))}else{return e(this,c(f))}};c.expr[":"].overlaps=function(h,g,f,j){return e([h],j)};c.expr[":"].overlapping=c.expr[":"].overlaps;function d(j){var i=b(j),f=[],k=0,h=0,g=i.length;for(;k<g;k++){for(h=0;h<g;h++){if(k===h){continue}if(a(i[k],i[h])){f.push(j[h])}}}return c.unique(f)}function e(h,f){var i=b(h),g=b(f),m=0,k=0,l=i.length,j=g.length;for(;m<l;m++){for(k=0;k<j;k++){if(h[m]===f[k]){continue}if(a(i[m],g[k])){return true}}}return false}function b(f){var k=[],g=0,j,h;while((h=f[g++])){j=c(h).offset();k.push([j.top,j.left,h.offsetWidth,h.offsetHeight])}return k}function a(j,i){var g=j[1],o=j[0],k=j[2],m=j[3],f=i[1],n=i[0],h=i[2],l=i[3];return !(n+l<o||o+m<n||f+h<g||g+k<f)}})(jQuery);
