$(document).ready(function(){function b(){function a(){var a=jQuery("#background_img");var b=jQuery("#background_img").width();var c=jQuery("#background_img").height();var d=c/b;var e=jQuery(window).width();var f=jQuery(window).height();var g=f/e;var h=0;var i=0;var j=0;var k=0;if(g>d){k=f;j=f/d}else{j=e;k=e*d}if(g<d){i=f;h=f/d}else{h=e;i=e*d}jQuery(".bg-fit-inside").find("#background_img").css({width:h,height:i});jQuery(".bg-fit-outside").find("#background_img").css({width:j,height:k});jQuery(".bg-stretch").find("#background_img").css({width:jQuery(window).width(),height:jQuery(window).height()})}if(jQuery("#background_pic").hasClass("fade")){jQuery("#background_img").animate({opacity:"1"},{duration:100,queue:false})}if(jQuery("#background_pic").hasClass("slide")){jQuery("#background_img").animate({top:"0px"},{duration:100,queue:false})}jQuery(window).resize(function(){a()});a()}function a(){var a=new Image;$(a).css("display","none");$(a).attr("src",$("#background_img").attr("src"));if(a.complete||a.readyState===4){b()}else{$(a).load(function(){b()})}}if(jQuery("#background_pic").hasClass("fade")){jQuery("#background_img").css("opacity",0)}if(jQuery("#background_pic").hasClass("slide")){jQuery("#background_img").css({top:100})}a();})