﻿$(window).load(function () {
    var a1Max = 0;
    var a1Min = -276;

    var a2Max = 46;
    var a2Min = -230;

    var a3Max = 92;
    var a3Min = -184;

    window.setTimeout(function () {
        jQuery(document.getElementById("a3")).animate({ left: a3Max + "px" }, { queue: false, duration: 500 });
    }
            , 1500);

    window.setTimeout(function () {

        jQuery(document.getElementById("a2")).animate({ left: a2Max + "px" }, { queue: false, duration: 500 });
    }
            , 2000);

    window.setTimeout(function () {

        jQuery(document.getElementById("a1")).animate({ left: a1Max + "px" }, { queue: false, duration: 500 });
    }
         , 2500);

    $("ul li span").hover(
            function () {


                if (this.id == "a3") {
                    $('#a1').animate({ left: a1Min + "px" }, { queue: false, duration: 400 });
                    $('#a2').animate({ left: a2Min + "px" }, { queue: false, duration: 400 });
                    $('#a3').animate({ left: a3Max + "px" }, { queue: false, duration: 400 });
                }


                if (this.id == "a2") {
                    $('#a1').animate({ left: a1Min + "px" }, { queue: false, duration: 400 });
                    $('#a2').animate({ left: a2Max + "px" }, { queue: false, duration: 400 });
                    $('#a3').animate({ left: a3Max + "px" }, { queue: false, duration: 400 });
                }

                if (this.id == "a1") {
                    $('#a1').animate({ left: a1Max + "px" }, { queue: false, duration: 400 });
                    $('#a2').animate({ left: a2Max + "px" }, { queue: false, duration: 400 });
                    $('#a3').animate({ left: a3Max + "px" }, { queue: false, duration: 400 });
                }

            }
    );
});
//$(document).ready(function () {
//    lastBlock = $("#a1");
//    maxWidth = 322;
//    minWidth = 46;

//    window.setTimeout(function () {
//        jQuery(document.getElementById("a3")).animate({ width: maxWidth + "px" }, { queue: false, duration: 500 });
//    }
//            , 1500);

//    jQuery(document.getElementById('VIT')).hide();
//    //

//    window.setTimeout(function () {
//        jQuery(document.getElementById("a3")).animate({ width: minWidth + "px" }, { queue: false, duration: 500 });
//        jQuery(document.getElementById("a2")).animate({ width: maxWidth + "px" }, { queue: false, duration: 500 });
//    }
//            , 2000);

//    window.setTimeout(function () {
//        jQuery(document.getElementById("a2")).animate({ width: minWidth + "px" }, { queue: false, duration: 500 });
//        jQuery(document.getElementById("a1")).animate({ width: maxWidth + "px" }, { queue: false, duration: 500 });
//    }
//         , 2500);

//    $("ul li a").hover(
//            function () {

//                $(lastBlock).stop(true, false).animate({ width: minWidth + "px" }, { queue: false, duration: 400 });
//                $(this).animate({ width: maxWidth + "px" }, { queue: false, duration: 400 });
//                lastBlock = this;
//            }
//            );
//            jQuery(document.getElementById('VIT')).fadeIn('slow', function() {
//        // Animation complete
//      });

//});

