$(function() {

    // menu initialization
    var $menu = $('#menu');
    var $menuEntries = $menu.children('div');
    $(window).on('hashchange load', function() {
        $menuEntries.hide();
        var clickedMenuEntry =
            $menuEntries.filter(window.location.hash).size() ?
            window.location.hash :
            '#index';
        $(clickedMenuEntry).show();
    });

    var curBackground = 1;
    var backgroundsCount = 10;
    var backgroundsExt = '.jpg';
    var backgroundsUrlPrefix = 'css/img/backgrounds/';

    // simple images preloading
    for (var i = curBackground; i <= backgroundsCount; i++) {
        $('<img src="' + backgroundsUrlPrefix + i + backgroundsExt + '">');
    }

    var $backgroundContainer = $('#background');

    setInterval(function() {
        $backgroundContainer.fadeOut('slow', function() {
            $backgroundContainer.css(
                'background-image',
                'url(' + backgroundsUrlPrefix + curBackground + backgroundsExt + ')'
            ).fadeIn('slow');
        });
        curBackground = (curBackground === backgroundsCount) ? 1 : ++curBackground;
    }, 5000);

});

@@ -142,13 +142,8 @@
 ange
- load
 ', f
@@ -376,18 +376,84 @@
 ;%0A    %7D)
-;%0A
+.trigger('hashchange'); // initial%0A%0A%7D);%0A%0A$(window).load(function() %7B
 %0A    var
@@ -819,16 +819,49 @@
 und');%0A%0A
+    // background images cycling%0A
     setI
@@ -1238,13 +1238,12 @@
  5000);%0A
-%0A
 %7D);%0A

Move images preloading and background cycling start to the "window.load"