(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vCenter = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(this).parent().height();
    var pw = $(this).parent().width();
    var aw = $(this).width();
	var mh = Math.ceil((ph-ah) / 2);
    var mw =  Math.ceil((pw-aw) / 2);
    if(mh > 0)
    {
	    $(this).css('position', 'absolute');
	    $(this).css('left', mw);
	    $(this).css('top', mh);
    }

	});
};
})(jQuery);
