$(function(){jQuery.extend({fullBg:{settings:{src:false,imgFrom:'',fadeTime:2000,hPos:'center',vPos:'middle',iconImg:'media/loading-icon-32x32.gif',iconVpos:'bottom',iconVOffset:'0px',iconHpos:'right',iconHOffset:'0px'},img:new Image(),start:function(s){jQuery.extend(jQuery.fullBg.settings,s);if($("#fullBg").length>0){this.remove()}var a=jQuery.fullBg.settings.src;jQuery.fullBg.img.onload=function(){jQuery.fullBg.resize();$("#fullBgLoad").fadeOut(jQuery.fullBg.settings.fadeTime,function(){$(this).remove()});$("#fullBgImg").fadeIn(jQuery.fullBg.settings.fadeTime,function(){$('body').css({"background-image":"url("+a+")"})})};if(a==false){jQuery.fullBg.settings.imgFrom='background-image';jQuery.fullBg.img.src=$('body').css("background-image").replace(/"/g,'').replace(/url\(|\)$/ig,'')}else{jQuery.fullBg.settings.imgFrom='url';jQuery.fullBg.img.src=a}$("body").append('<div id="fullBgLoad"><img src="'+jQuery.fullBg.settings.iconImg+'" /></div>');$("body").append('<div id="fullBg"><img id="fullBgImg" src="'+jQuery.fullBg.img.src+'" /></div>');$(window).resize(function(){jQuery.fullBg.resize()});$("#fullBg").css({"position":'fixed',"top":'0px',"left":'0px',"z-index":-3,"width":'100%',"height":'100%'});$("#fullBgImg").css({"display":'none',"width":'100%',"height":'100%',"z-index":-2});$("#fullBgLoad").css({"bottom":'0px',"right":'0px',"position":'fixed','background-color':'#FFFFFF','width':'32px','height':'32px'});$("#fullBgLoad").fadeIn()},resize:function(){var a=$(window).width();var b=$(window).height();var c=jQuery.fullBg.img.width;var d=jQuery.fullBg.img.height;var e=a;var f=d*(a/c);var g=0;var h=0;if(f<=b){f=b;e=c*(b/d)}switch(jQuery.fullBg.settings.vPos){case'bottom':g=(b-f);break;case'middle':g=(b-f)/2;break;default:break}switch(jQuery.fullBg.settings.hPos){case'right':h=(a-e);break;case'center':h=(a-e)/2;break;default:break}$("#fullBg").css({"display":"block","width":e+"px","height":f+"px","top":g+"px","left":h+"px"})},remove:function(){if($("#fullBg").length==0){return}$("#fullBg").remove()}}})});
