var FullScreenBG={bg:null,img_src:"",ratio:0,init:function(a){FullScreenBG.img_src=a;window.addEvent("domready",function(){FullScreenBG.createBackground()})},createBackground:function(){if(FullScreenBG.bg!==null){return}var a=new Element("img",{styles:{position:"fixed",top:0,left:0,overflow:"hidden",zIndex:-1,visibility:"hidden"},opacity:0,src:this.img_src,events:{load:function(){var b=a.getSize();FullScreenBG.ratio=b.x.toInt()/b.y.toInt();window.addEvent("resize",FullScreenBG.scale);FullScreenBG.scale();a.fade("in")}}});a.inject(document.body,"bottom");FullScreenBG.bg=a;if(Browser.Engine.trident4){a.setStyles({position:"absolute",top:window.getScrollTop()});window.addEvent("scroll",function(){FullScreenBG.bg.setStyle("top",window.getScrollTop())})}},changeBG:function(a){if(a===FullScreenBG.bg.get("src")){return}FullScreenBG.bg.set({src:a,opacity:0})},scale:function(){var b,f,c=window.getSize(),a=c.x,d=c.y,e=FullScreenBG.ratio;if(a/d>e){b=a;f=Math.round(a/e)}else{b=Math.round(d*e);f=d}FullScreenBG.bg.setStyles({width:b,height:f,marginLeft:Math.round(a/2-b/2),marginTop:Math.round(d/2-f/2)})}};
