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){FullScreenBG.bg=new Element("img",{id:"FullScreenBGImg",styles:{position:"fixed",top:0,left:0,overflow:"hidden",zIndex:-1,visibility:"hidden"},src:this.img_src,events:{load:function(){var a=parseInt(FullScreenBG.bg.getStyle("width"),10);var b=parseInt(FullScreenBG.bg.getStyle("height"),10);FullScreenBG.ratio=a/b;window.addEvent("resize",FullScreenBG.scale);FullScreenBG.scale();new Fx.Style(FullScreenBG.bg,"opacity").start(0,1)}}});FullScreenBG.bg.injectInside(document.body);if(window.ie6){FullScreenBG.bg.setStyles({position:"absolute",top:window.getScrollTop()});window.addEvent("scroll",function(){FullScreenBG.bg.setStyle("top",window.getScrollTop())})}}},changeBG:function(a){if(a===FullScreenBG.bg.getProperty("src")){return}FullScreenBG.bg.setOpacity(0);FullScreenBG.bg.setProperty("src",a)},scale:function(){var a,c,b,e,d;a=window.getWidth();c=window.getHeight();d=FullScreenBG.ratio;if(a/c>d){b=a;e=Math.round(a/d)}else{b=Math.round(c*d);e=c}FullScreenBG.bg.setStyles({width:b,height:e,marginLeft:Math.round(a/2-b/2),marginTop:Math.round(c/2-e/2)})}};