/******************************************************
    * jQuery plug-in
    * Easy Background Image Resizer
    * Developed by J.P. Given (http://johnpatrickgiven.com)
    * Useage: anyone so long as credit is left alone
******************************************************/

(function(a){function b(){var b=a("#jq_ez_bg"),d=b.children("img"),e=a(window).width(),f=a(window).height();b.css({position:"fixed",top:"0px",left:"0px","z-index":"-1",overflow:"hidden",width:e+"px",height:f+"px",opacity:c.opacity});d.css("position","relative");var g=d.width();var h=d.height();if(e>f){if(g>h){var i=g/h;d.css("width",e+"px");d.css("height",Math.round(e*(1/i)));var j=Math.round(e*(1/i));if(j<f){var i=h/g;d.css("height",f);d.css("width",Math.round(f*(1/i)))}}else{var i=h/g;d.css("height",f);d.css("width",Math.round(f*(1/i)))}}else{var i=h/g;d.css("height",f);d.css("width",Math.round(f*(1/i)))}if(typeof c.center=="undefined"||c.center){if(d.width()>e){var k=(d.width()-e)/2;d.css({top:0,left:-k})}if(d.height()>f){var l=(d.height()-f)/2;d.css({left:0,top:-l})}}a("#jq_ez_bg img").fadeIn(400);a("body").css({overflow:"auto"})}var c={};a.fn.ezBgResize=function(d){c=d;if(!a.isArray(c.img)){var e=c.img;c.img=[e]}a("<img/>").attr("src",c.img).load(function(){c.width=this.width;c.height=this.height;a("body").append('<div id="jq_ez_bg"></div>');a("#jq_ez_bg").html('<img src="'+c.img[0]+'" width="'+c.width+'" height="'+c.height+'" border="0">');a("#jq_ez_bg img").css("display","none");a("body").css({overflow:"hidden"});b()})};a(window).bind("resize",function(){b()})})(jQuery)
