/**
 * @author Alexandre Magno
 * @desc Center a element with jQuery
 * @version 1.0
 * @example
 * $("element").center({
 *
 * 		vertical: true,
 *      horizontal: true
 *
 * });
 * @obs With no arguments, the default is above
 * @license free
 * @param bool vertical, bool horizontal
 * @contribution Paulo Radichi
 *
 */
jQuery.fn.center = function(params) {

		var options = {

			vertical: true,
			horizontal: true

		}
		op = jQuery.extend(options, params);

   return this.each(function(){

		//initializing variables
		var self = jQuery(this);
		self.css({"position":"absolute", "top":Math.floor($(window).scrollTop()+($(window).height()-self.height())/2)+"px", "left":Math.floor($(window).scrollLeft()+($(window).width()-self.width())/2)+"px"});


   });

};