/**
* Centers an element
*
* @param element Element to center
*/
;(function($){
$.fn.centered = function(){
return this.each(function(){
var element = $(this),
parent = element.parent();
element.css({
position: 'absolute',
left: (parent.width() - element.width()) / 2,
top: (parent.height() - element.height()) / 2
});
return element;
});
}
})(jQuery);