var backgrounds = new Array();
backgrounds.push('defend.png');
backgrounds.push('gift.png');
backgrounds.push('heliod.png');
backgrounds.push('masterofwaves.png');
backgrounds.push('willing.png');
backgrounds.push('lotus.png');

var win = $(window);

var pathImages = '../img/backgrounds/';
var image = '';

var backgroundsInterval = setInterval(function(){

    var image = backgrounds[Math.floor(Math.random() * backgrounds.length)];
    $('html').css('background-image', 'url(../img/backgrounds/' + image + ')');

}, 10000);

$(function() {
    $('html').css('background-size', win.width());
});

win.resize(function() {

    $('html').css('background-size', win.width());

});