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.width <= 800): return 'pics/background_400_400.jpg';
        case (screen.width <= 1024): return 'pics/background_500_500.jpg';
        case (screen.width <= 1280): return 'pics/background_600_600.jpg';
        case (screen.width <= 1440): return 'pics/background_700_700.jpg';
        case (screen.width <= 1600): return 'pics/background_800_800.jpg';
        case (screen.width <= 1920): return 'pics/background_900_900.jpg';
        case (screen.width <= 2048): return 'pics/background_1000_1000.jpg';
        case (screen.width <= 2560): return 'pics/background_1200_1200.jpg';
        case (screen.width <= 2800): return 'pics/background_1400_1400.jpg';
        case (screen.width <= 3200): return 'pics/background_1600_1600.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;
}

