function getDimension(a){img=new Image();img.src=a.src;return{height:img.height,width:img.width}}jQuery.fn.resize=function(a){a=$.extend({height:null,width:null,container:false,center:false,middle:false},a||{});return this.each(function(){var c=1;if(a.container||a.center){a.height=parseInt($(this).parent().height());a.width=parseInt($(this).parent().width())}if((a.height!=null)&&(a.width!=null)){if($(this).height()>a.height){$(this).height(a.height)}if($(this).width()>a.width){c=($(this).width()/a.width);$(this).width(a.width);$(this).height($(this).height()/c)}if(a.center){var e=parseInt($(this).parent().height());var b=$(this).height();var d=(e/2)-(b/2);$(this).css("display","block");$(this).css("margin","auto");$(this).css("padding-top",d)}}})};