(function(a){a.fn.dpg_resize_object=function(c){var d=[];var b=Math.floor(Math.random()*99999);d[b]=a.extend({inherit_width_from:null,inherit_height_from:null,aspect_based_on:"height",aspect_ratio:null,width_deduction:0,height_deduction:0},c);this.each(function(){a(this).css({position:"absolute"});object=a(this);e(object);object.show();a(window).bind("resize",function(){e(object);});});function e(h){var f;var g;if(d[b].aspect_ratio!==null){multiplier=d[b].aspect_ratio.split(":")[1]/d[b].aspect_ratio.split(":")[0];if(d[b].aspect_based_on=="width"){f=Math.round(d[b].inherit_height_from.height()*multiplier);g=Math.round(d[b].inherit_height_from.height());}else{multiplier=2-multiplier;f=Math.round(d[b].inherit_height_from.height()*multiplier);g=Math.round(d[b].inherit_height_from.height());if(f>a(window).width()){multiplier=d[b].aspect_ratio.split(":")[1]/d[b].aspect_ratio.split(":")[0];f=Math.round(a(window).width());g=Math.round(a(window).width()*multiplier);}}}else{if(d[b].width!==null){f=d[b].inherit_width_from.width();}if(d[b].height!==null){g=d[b].inherit_height_from.height();}}object.width(f);object.height(g);}};})(jQuery);