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.29;var windowScale = windowWidth / windowHeight;var targetWidth = windowHeight * imageRatio;var targetWidthFull = windowWidth;var leftPos = - (targetWidth - windowWidth) / 2;var leftPosFull = 0;if (windowScale <= imageRatio){$('sclbg').getElements('img').setStyle("width", targetWidth + "px");$('sclbg').setStyle("left", leftPos);}else{$('sclbg').getElements('img').setStyle("width", targetWidthFull + "px");$('sclbg').setStyle("left", leftPosFull);}}window.addEvent('domready', function(){backgroundScale();});window.addEvent('resize', function(){backgroundScale();});