(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	if(ah < 1){ 
		ah = $(this).css('max-height');
		ah = ah.replace('px','');
	}
	var ph = $(this).parent().height();	 
	if(ph < 1){ 
		ph = $(this).css('max-height');
		ph = ph.replace('px','');
	} 
	var mh = Math.ceil((ph-ah) / 2);	
	$(this).css('margin-top', mh - 2);
	});
};
 
})(jQuery);
