function Document()
{
}

Document.prototype.initialize = function()
{
    this.printYear();
    this.setBackground();
}

Document.prototype.printYear = function()
{
    var text = document.createTextNode(new Date().getFullYear());
    document.getElementById('year').appendChild(text);
}

Document.prototype.setBackground = function()
{
    var image = null;
    
    if (screen.width <= 800)
    {
        image = this.getPath() + 'pics/background_400_400.jpg';
    }
    if (screen.width <= 1024)
    {
        image = this.getPath() + 'pics/background_500_500.jpg';
    }
    else if (screen.width <= 1280)
    {
        image = this.getPath() + 'pics/background_600_600.jpg';
    }
    else if (screen.width <= 1440)
    {
        image = this.getPath() + 'pics/background_700_700.jpg';
    }
    else if (screen.width <= 1600)
    {
        image = this.getPath() + 'pics/background_800_800.jpg';
    }
    else if (screen.width <= 1920)
    {
        image = this.getPath() + 'pics/background_900_900.jpg';
    }
    else if (screen.width <= 2048)
    {
        image = this.getPath() + 'pics/background_1000_1000.jpg';
    }
    else if (screen.width <= 2560)
    {
        image = this.getPath() + 'pics/background_1200_1200.jpg';
    }
    else if (screen.width <= 2800)
    {
        image = this.getPath() + 'pics/background_1400_1400.jpg';
    }
    else if (screen.width <= 3200)
    {
        image = this.getPath() + 'pics/background_1600_1600.jpg';
    }
    
    if (image != null)
    {
        document.getElementsByTagName('body')[0].setAttribute('style', 'background-image:url("' + image + '")');
    }
}

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;
}