 

{
            function setBackgroundImageSize() {
                var h = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
                var w = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
                bg.style.height = h + 'px';
                bg.style.width = w + 'px';
                bgImg.style.height = h + 'px';
                bgImg.style.width = w + 'px';
            }

            window.onload = function() {

                // Create the background image
                bgImg = document.createElement('IMG');
                bgImg.setAttribute('src', 'images/satin1.jpg');
                bgImg.style.left = '0px';
                bgImg.style.position = 'fixed';
                bgImg.style.top = '0px';
                bgImg.style.width = '3000px';
                bgImg.style.zIndex = '-1';

                // Create the background wrapper
                bg = document.createElement('DIV');
                bg.style.height = '2000px';
                bg.style.left = '0px';
                bg.style.position = 'absolute';
                bg.style.top = '0px';
                bg.style.width = '3000px';
                bg.style.zIndex = '-1';

                // Append elements
                bg.appendChild(bgImg);
                document.body.appendChild(bg);
                
                // Set the image size based on window size
                setBackgroundImageSize();

                // Prevent page scrolling on touch devices
                document.body.ontouchmove = function(e) {
                    e.preventDefault();
                }

            }
            window.onresize = function() {
                setBackgroundImageSize();
            }
            window.onorientationchange = function() {
                setBackgroundImageSize();
            }
}

