// jQuery centerXY 1.0 Plugin by John Terenzio (http://terenz.io)
(function($){$.fn.centerXY=function(offsetX,offsetY){offsetX=offsetX||0;offsetY=offsetY||0;return this.each(function(){var elem=$(this);var parent=(elem.parent()[0].tagName.toLowerCase()==('body'||'html'))?$(window):elem.parent();var left=Math.floor((parent.width()-elem.width())/2+offsetX);var top=Math.floor((parent.height()-elem.height())/2+offsetY);elem.css('position','absolute');elem.css('top',(top>0)?top+'px':'0px');elem.css('left',(left>0)?left+'px':'0px');$(window).one('resize',function(){elem.centerXY(offsetX,offsetY);});});};})(jQuery);