function Document() {
}

Document.prototype.setBackground = function() {
    var image = this.getImage();

    if (image != null) {
        image = this.getPath() + image;
        document.getElementsByTagName('body')[0].setAttribute('style', 'background-image:url("' + image + '")');
    }
}

Document.prototype.getImage = function() {
    switch(true) {
        case (screen.height <= 600): return 'pics/background_480_600.jpg';
        case (screen.height <= 720): return 'pics/background_576_720.jpg';
        case (screen.height <= 768): return 'pics/background_614_768.jpg';
        case (screen.height <= 800): return 'pics/background_640_800.jpg';
        case (screen.height <= 864): return 'pics/background_691_864.jpg';
        case (screen.height <= 900): return 'pics/background_720_900.jpg';
        case (screen.height <= 960): return 'pics/background_768_960.jpg';
        case (screen.height <= 1080): return 'pics/background_864_1080.jpg';
        case (screen.height <= 1152): return 'pics/background_921_1152.jpg';
        case (screen.height <= 1200): return 'pics/background_960_1200.jpg';
        case (screen.height <= 1440): return 'pics/background_1152_1440.jpg';
        case (screen.height <= 1536): return 'pics/background_1229_1536.jpg';
        case (screen.height <= 1600): return 'pics/background_1280_1600.jpg';
        case (screen.height <= 1920): return 'pics/background_1536_1920.jpg';
        case (screen.height <= 2048): return 'pics/background_1638_2048.jpg';
        case (screen.height <= 2100): return 'pics/background_1680_2100.jpg';
        case (screen.height <= 2400): return 'pics/background_1920_2400.jpg';
    }
}

Document.prototype.getPath = function() {
    return document.getElementById('path').content;
}

Document.prototype.loadXMLDocument = function(filename) {
    var xhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
    xhttp.open('GET', this.getPath() + 'xml/' + filename, false);
    xhttp.send('');
    return xhttp.responseXML;
}

