function backgroundScale(){var windowWidth=0;var windowHeight=0;if((document.documentElement)&&(document.documentElement.clientWidth))windowWidth=document.documentElement.clientWidth;else if((document.body)&&(document.body.clientWidth))windowWidth=document.body.clientWidth;else if((document.body)&&(document.body.offsetWidth))windowWidth=document.body.offsetWidth;else if(window.innerWidth)windowWidth=window.innerWidth-18;if((document.documentElement)&&(document.documentElement.clientHeight))windowHeight=document.documentElement.clientHeight;else if((document.body)&&(document.body.clientHeight))windowHeight=document.body.clientHeight;else if((document.body)&&(document.body.offsetHeight))windowHeight=document.body.offsetHeight;else if(window.innerHeight)windowHeight=window.innerHeight-18;var imageRatio=1.31;var windowScale=windowWidth/windowHeight;var targetWidth=windowHeight*imageRatio;var leftPos=-(targetWidth-windowWidth)/2;if(windowScale<=imageRatio){$('background').getElements('img').setStyle("width",targetWidth+"px");$('background').setStyle("left",leftPos)}else{$('background').getElements('img').setStyle("width",windowWidth+"px");$('background').setStyle("left",0)}}window.addEvent('domready',function(){backgroundScale()});window.addEvent('resize',function(){backgroundScale()});
