var $bgimage="";var $loadBgImage=function(){$w8x.ajax({type:"GET",url:"./XML/bg.xml?rnd="+Math.random(),dataType:"xml",success:function(a){var b=Math.floor(Math.random()*Math.abs($w8x(a).find("img").length));var c=$w8x(a).find("img:nth-child("+(b+1)+")").text();$w8x("#bgImage").load(function(){}).attr("src",c);$w8x("#screen1").append($w8x("#bgImage"));$bgimage=$w8x("#bgImage");showBGImage()}})};showBGImage=function(){return $w8x.Deferred(function(a){adjustImageSize($bgimage);$bgimage.fadeIn(1000,a.resolve)}).promise()};$loadBgImage();$w8x(window).resize(function(){if($bgimage!=""){showBGImage()}});var adjustImageSize=function(a){var j=$w8x(window).width(),e=$w8x(window).height(),h=e/j,i=a.width(),d=a.height(),c=d/i,k,f,g,b;if(h>c){f=e;k=e/c}else{f=j*c;k=j}a.css({position:" fixed",width:k+"px",height:f+"px",left:(j-k)/2+"px",top:(e-f)/2+"px"})};var $replaceAll=function(c,b,a){if(c!=undefined){c=c.split(b).join(a)}return c};function sendReq(b,a){b.open("GET",a,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");b.send()}function newXMLHttpRequest(){var c=false;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{if(window.ActiveXObject){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{c=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){c=false}}}}return c}function getReadyStateHandler(c,b,a){return function(){if(c.readyState==4){if(c.status==200){b(c.responseText)}else{}}}};
