/*
 * FullScreenBG 1.0.1 
 * for MooTools 1.2
 *
 * Copyright (c) 2008 Ryan Quigley (exhibit-E.com)
 * Licensed under the MIT (MIT-LICENSE.txt)
 *
 */
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",overflow:"hidden",zIndex:0,visibility:"hidden"},src:this.img_src,events:{load:function(){var B=FullScreenBG.bg.getSize();var A=parseInt(B.x,10);var C=parseInt(B.y,10);FullScreenBG.ratio=A/C;window.addEvent("resize",FullScreenBG.scale);FullScreenBG.scale();FullScreenBG.bg.set("opacity",0).fade("in")}}});FullScreenBG.bg.inject(document.body,"bottom");if(Browser.Engine.trident4){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.get("src")){return }FullScreenBG.bg.set("opacity",0);FullScreenBG.bg.set("src",A)},scale:function(){var A,D,B,F,E;var 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)})}};